From d9ba53fc73922d67e6bff37271fa4e00f65b99f7 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Apr 2025 17:54:08 -0700 Subject: [PATCH 01/53] Add initial support for PM Apps --- .../Http/Controllers/Api/UserController.php | 14 + ProcessMaker/Http/Kernel.php | 3 +- config/cors.php | 6 +- routes/api.php | 2 + storage/api-docs/api-docs.json | 8089 ++++++++++------- 5 files changed, 5069 insertions(+), 3045 deletions(-) diff --git a/ProcessMaker/Http/Controllers/Api/UserController.php b/ProcessMaker/Http/Controllers/Api/UserController.php index 0ecbf49fe0..b26e26b2a1 100644 --- a/ProcessMaker/Http/Controllers/Api/UserController.php +++ b/ProcessMaker/Http/Controllers/Api/UserController.php @@ -946,4 +946,18 @@ public function updateLanguage(Request $request) return response([], 204); } + + public function current() + { + return response([ + 'data' => Auth::user(), + ], 200); + } + + public function logout(Request $request) + { + $request->user()->token()->revoke(); + + return response()->json(['message' => 'OK']); + } } diff --git a/ProcessMaker/Http/Kernel.php b/ProcessMaker/Http/Kernel.php index 97ffae0d6c..c083dbee34 100644 --- a/ProcessMaker/Http/Kernel.php +++ b/ProcessMaker/Http/Kernel.php @@ -24,6 +24,7 @@ class Kernel extends HttpKernel Middleware\BrowserCache::class, ServerTimingMiddleware::class, Middleware\FileSizeCheck::class, + \Illuminate\Http\Middleware\HandleCors::class, ]; /** @@ -89,7 +90,7 @@ class Kernel extends HttpKernel 'no-cache' => Middleware\NoCache::class, 'admin' => Middleware\IsAdmin::class, 'etag' => Middleware\Etag\HandleEtag::class, - 'file_size_check' => Middleware\FileSizeCheck::class + 'file_size_check' => Middleware\FileSizeCheck::class, ]; /** diff --git a/config/cors.php b/config/cors.php index 8a39e6daa6..979cc947db 100644 --- a/config/cors.php +++ b/config/cors.php @@ -15,11 +15,13 @@ | */ - 'paths' => ['api/*', 'sanctum/csrf-cookie'], + 'paths' => ['api/*', 'sanctum/csrf-cookie', 'oauth/*'], 'allowed_methods' => ['*'], - 'allowed_origins' => ['*'], + 'allowed_origins' => [ + 'http://localhost:4200', + ], 'allowed_origins_patterns' => [], diff --git a/routes/api.php b/routes/api.php index 1d48e244e3..35d4c6ceb0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -60,6 +60,8 @@ Route::put('users/update_language', [UserController::class, 'updateLanguage'])->name('users.updateLanguage'); Route::get('users_task_count', [UserController::class, 'getUsersTaskCount'])->name('users.users_task_count') ->middleware('can:view-users'); + Route::get('users/current', [UserController::class, 'current'])->name('users.current'); + Route::post('users/logout', [UserController::class, 'logout'])->name('users.logout'); // User Groups Route::put('users/{user}/groups', [UserController::class, 'updateGroups'])->name('users.groups.update')->middleware('can:edit-users'); diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 3755004f8f..ebcc60c8ac 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,6 +18,177 @@ } ], "paths": { + "/analytics-reporting": { + "get": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Returns all analytics reporting that the user has access to", + "description": "Get a list of Analytics Reporting.", + "operationId": "getAnalyticsReporting", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of analytics reporting", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/analyticsReporting" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Save a new Analytics Reporting", + "description": "Create a new Analytics Reporting.", + "operationId": "createAnalyticsReporting", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReportingEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } + } + } + } + }, + "/analytics-reporting/{analytic_reporting_id}": { + "get": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Get single analytic reporting by ID", + "description": "Get a single Analytic Reporting.", + "operationId": "getAnalyticReportingById", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the analytics reporting", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } + } + } + }, + "put": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Update a analytic reporting", + "description": "Update a Analytics Reporting.", + "operationId": "updateAnalyticReporting", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReportingEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Delete an analytic reporting", + "description": "Delete a Analytics Reporting.", + "operationId": "deleteAnalyticReporting", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, "/collections": { "get": { "tags": [ @@ -554,48 +725,84 @@ } } }, - "/saved-searches/{saved_search_id}/charts": { + "/comments/tasks": { "get": { "tags": [ - "SavedSearchCharts" + "Comments" ], - "summary": "Returns all saved search charts that the user has access to", - "description": "Get a list of SavedSearchCharts.", - "operationId": "getSavedSearchCharts", + "summary": "Returns all the tasks that are active.", + "description": "Display a listing of the resource.", + "operationId": "getCommentTasks", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", + "name": "process_request_id", "in": "query", - "description": "Only return saved searches by type", + "description": "Process request id", "required": false, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "integer" } }, + { + "$ref": "#/components/parameters/filter" + }, { "$ref": "#/components/parameters/order_by" }, { "$ref": "#/components/parameters/order_direction" + } + ], + "responses": { + "200": { + "description": "list all tasks taht are active", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequestToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/data_source_categories": { + "get": { + "tags": [ + "DataSourcesCategories" + ], + "summary": "Returns all Data Connectors categories that the user has access to", + "description": "Display a listing of the Data Connector Categories.", + "operationId": "getDataSourceCategories", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/order_by" }, { - "$ref": "#/components/parameters/include" + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of saved search charts", + "description": "list of Data Connectors categories", "content": { "application/json": { "schema": { @@ -603,7 +810,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } }, "meta": { @@ -622,111 +829,63 @@ } } }, - "put": { + "post": { "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" - } - } + "DataSourcesCategories" ], + "summary": "Save a new Data Connector Category", + "description": "Store a newly created Data Connector Category in storage", + "operationId": "createDataSourceCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchChart" - } + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } }, "responses": { - "204": { - "description": "success" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceCategory" + } + } + } } } - }, - "post": { + } + }, + "/data_source_categories/{data_source_category_id}": { + "get": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Save a new saved search chart", - "description": "Create a new SavedSearchChart.", - "operationId": "createSavedSearchChart", + "summary": "Get single Data Connector category by ID", + "description": "Display the specified data Source category.", + "operationId": "getDatasourceCategoryById", "parameters": [ { - "name": "saved_search_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of saved search to which this chart will be saved", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" - } - } - } - }, "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } - } - } - } - }, - "/saved-searches/charts/{chart_id}": { - "get": { - "tags": [ - "SavedSearchCharts" - ], - "summary": "Get single saved search chart by ID", - "description": "Get a single SavedSearchChart.", - "operationId": "getSavedSearchChartById", - "parameters": [ - { - "name": "chart_id", - "in": "path", - "description": "ID of chart to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the saved search chart", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -735,16 +894,16 @@ }, "put": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Update a saved search chart", - "description": "Update a SavedSearchChart.", - "operationId": "updateSavedSearchChart", + "summary": "Update a Data Connector Category", + "description": "Updates the current element", + "operationId": "updateDatasourceCategory", "parameters": [ { - "name": "chart_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -756,7 +915,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -767,7 +926,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -776,16 +935,16 @@ }, "delete": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Delete a saved search chart", - "description": "Delete a SavedSearchChart.", - "operationId": "deleteSavedSearchChart", + "summary": "Delete a Data Connector category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDataSourceCategory", "parameters": [ { - "name": "chart_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -799,52 +958,73 @@ } } }, - "/saved-searches/charts/{chart_id}/fields": { + "/data_sources": { "get": { "tags": [ - "SavedSearchCharts" + "DataSources" ], - "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 Data Connectors that the user has access to", + "description": "Get the list of records of a Data Connector", + "operationId": "getDataSources", "parameters": [ { - "name": "chart_id", - "in": "path", - "description": "ID of Saved Search 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" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the saved search", + "description": "list of Data Connectors", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataSource" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } } } - } - }, - "/saved-searches/reports": { + }, "post": { "tags": [ - "Reports" + "DataSources" ], - "summary": "Save a new report", - "operationId": "createReport", + "summary": "Save a new Data Connector", + "description": "Create a new Data Connector.", + "operationId": "createDataSource", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } @@ -855,7 +1035,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "$ref": "#/components/schemas/dataSource" } } } @@ -863,174 +1043,91 @@ } } }, - "/saved-searches/reports/{reportId}": { - "put": { + "/data_sources/{data_source_id}": { + "get": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Update a saved search", - "description": "Update a Report", - "operationId": "updateReport", + "summary": "Get single Data Connector by ID", + "description": "Get a single Data Connector.", + "operationId": "getDataSourceById", "parameters": [ { - "name": "reportId", + "name": "data_source_id", "in": "path", - "description": "ID of report", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/saved-searches": { - "get": { + }, + "put": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Returns all saved searches that the user has access to", - "description": "Get a list of SavedSearches.", - "operationId": "getSavedSearches", + "summary": "Update a Data Connector", + "description": "Update a Data Connector.", + "operationId": "updateDataSource", "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, + "name": "data_source_id", + "in": "path", + "description": "ID of Data Connector to return", + "required": true, "schema": { - "type": "string", - "enum": [ - "mine", - "shared" - ] - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "list of saved searches", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearch" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" - } - } + "type": "string" } } - } - }, - "post": { - "tags": [ - "SavedSearches" ], - "summary": "Save a new saved search", - "description": "Create a new SavedSearch.", - "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "201": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/saved-searches/{savedSearchId}": { - "get": { + }, + "delete": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Get single saved searches by ID", - "description": "Get a single SavedSearch.", - "operationId": "getSavedSearchById", + "summary": "Delete a Data Connector", + "description": "Delete a Data Connector.", + "operationId": "deleteDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1038,30 +1135,32 @@ } ], "responses": { - "200": { - "description": "Successfully found the saved search", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - }, - "put": { + } + }, + "/data_sources/{data_source_id}/test": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Update a saved search", - "description": "Update a SavedSearch.", - "operationId": "updateSavedSearch", + "summary": "Send a Data Connector request", + "description": "Send a Data Connector request.", + "operationId": "sendDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1073,18 +1172,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } @@ -1092,76 +1191,56 @@ } } }, - "/saved-searches/{savedSearchId}/columns": { - "get": { + "/requests/{request_id}/data_sources/{data_source_id}": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Returns all columns associated with a Saved Search", - "description": "Display a listing of columns.", - "operationId": "getSavedSearchColumns", + "summary": "execute Data Source", + "description": "Execute a data Source endpoint", + "operationId": "executeDataSourceForRequest", "parameters": [ { - "name": "savedSearchId", + "name": "request_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of the request in whose context the datasource will be executed", "required": true, "schema": { "type": "string" } }, { - "name": "include", - "in": "query", - "description": "Include specific categories. Comma separated list.", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "current", - "default", - "available", - "data" - ] - }, - "uniqueItems": false + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "Categorized list of columns", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "current": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "default": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "available": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1169,110 +1248,49 @@ } } }, - "/saved-searches/{savedSearchId}/users": { - "get": { + "/requests/data_sources/{data_source_id}": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchUsers", + "summary": "execute Data Source", + "operationId": "executeDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of DataSource to be run", "required": true, "schema": { "type": "string" } - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], - "responses": { - "200": { - "description": "list of users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" }, - "type": "object" - } + "data": { + "type": "object" + } + }, + "type": "object" } } } - } - } - }, - "/saved-searches/{savedSearchId}/groups": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchGroups", - "parameters": [ - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - } - ], + }, "responses": { "200": { - "description": "list of groups", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1280,68 +1298,40 @@ } } }, - "/saved-searches/{saved_search_id}": { - "delete": { + "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Delete a saved search", - "description": "Delete a SavedSearch.", - "operationId": "deleteSavedSearch", + "summary": "Get Data from Data Source", + "operationId": "getDataFromDataSource", "parameters": [ { - "name": "saved_search_id", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of DataSource to be run", "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" + "name": "endpoint", + "in": "path", + "description": "Endpoint of the data source", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of icons for saved searches", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchIcon" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1349,14 +1339,14 @@ } } }, - "/version_histories": { + "/decision_table_categories": { "get": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Return all version History according to the model", - "description": "Get the list of records of Version History", - "operationId": "getVersionHistories", + "summary": "Returns all Decision Tables categories that the user has access to", + "description": "Display a listing of the Decision Tables Categories.", + "operationId": "getDecisionTableCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1369,14 +1359,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Version History", + "description": "list of Decision Tables categories", "content": { "application/json": { "schema": { @@ -1384,7 +1371,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } }, "meta": { @@ -1405,17 +1392,17 @@ }, "post": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Save a new Version History", - "description": "Create a new Version History.", - "operationId": "createVersion", + "summary": "Save a new Decision Table Category", + "description": "Store a newly created Decision Tables Category in storage", + "operationId": "createDecisionTableCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -1426,7 +1413,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1434,19 +1421,19 @@ } } }, - "/version_histories/{version_history_id}": { + "/decision_table_categories/{decision_table_categories_id}": { "get": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Get single Version History by ID", - "description": "Get a single Version History.", - "operationId": "getVersionHistoryById", + "summary": "Get single Decision Table category by ID", + "description": "Display the specified decision Tables category.", + "operationId": "getDecisionTableCategoryById", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1455,11 +1442,11 @@ ], "responses": { "200": { - "description": "Successfully found the Version History", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1468,16 +1455,16 @@ }, "put": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Update a Version History", - "description": "Update a Version History.", - "operationId": "updateVersion", + "summary": "Update a Decision Table Category", + "description": "Updates the current element", + "operationId": "updateDecisionTableCategory", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1489,18 +1476,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1509,16 +1496,16 @@ }, "delete": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Delete a Version History", - "description": "Delete a Version History.", - "operationId": "deleteVersion", + "summary": "Delete a Decision Table category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDecisionTableCategory", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1527,98 +1514,19 @@ ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } - } - } - } - }, - "/version_histories/clone": { - "post": { - "tags": [ - "Version History" - ], - "summary": "Clone a new Version History", - "description": "Clone a new Version History.", - "operationId": "cloneVersion", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } - } - } - } - }, - "/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" - } - } - } + "description": "success" } } } }, - "/environment_variables": { + "/decision_tables": { "get": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", - "description": "Fetch a collection of variables based on paged request and filter if provided", - "operationId": "getEnvironmentVariables", + "summary": "Returns all Decision tables that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getDecisionTables", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1638,7 +1546,7 @@ ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of Decision Tables", "content": { "application/json": { "schema": { @@ -1646,11 +1554,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -1662,17 +1575,17 @@ }, "post": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Create a new environment variable", - "description": "Creates a new global Environment Variable in the system", - "operationId": "createEnvironmentVariable", + "summary": "Save a new Decision Table", + "description": "Store a newly created resource in storage.", + "operationId": "createDecisionTable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -1683,7 +1596,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1691,32 +1604,32 @@ } } }, - "/environment_variables/{environment_variable_id}": { + "/decision_tables/{decision_table_id}": { "get": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "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 Decision Table by ID", + "description": "Display the specified resource.", + "operationId": "getDecisionTableById", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1725,19 +1638,19 @@ }, "put": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", + "summary": "Update a Decision Table", + "description": "Update a Decision table", + "operationId": "updateDecisionTable", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment variables to update", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -1746,18 +1659,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1766,117 +1679,96 @@ }, "delete": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", + "summary": "Delete a Decision Table", + "description": "Delete a Decision tables", + "operationId": "deleteDecisionTable", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "description": "success" + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } } }, - "/files": { - "get": { + "/decision_tables/{decision_table_id}/duplicate": { + "put": { "tags": [ - "Files" + "DecisionTables" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "duplicate a Decision Table", + "description": "duplicate a Decision table.", + "operationId": "duplicateDecisionTable", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "decision_table_id", + "in": "path", + "description": "ID of Decision Table to return", + "required": true, + "schema": { + "type": "string" + } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTableEditable" + } + } + } + }, "responses": { - "200": { - "description": "list of files", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/decisionTable" } } } } } - }, + } + }, + "/decision_tables/{decision_table_id}/excel-import": { "post": { "tags": [ - "Files" + "DecisionTables" ], - "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", + "summary": "Import a new decision table", + "description": "Import a Decision table from excel", + "operationId": "importExcel", "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", + "name": "decision_table_id", + "in": "path", + "description": "ID of Decision Table to return", "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": { @@ -1886,7 +1778,7 @@ "schema": { "properties": { "file": { - "description": "save a new media file", + "description": "file to import", "type": "string", "format": "binary" } @@ -1897,23 +1789,14 @@ } }, "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" + "status": { + "type": "object" } }, "type": "object" @@ -1924,120 +1807,139 @@ } } }, - "/files/{file_id}": { - "get": { + "/decision_tables/{decision_table_id}/export": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "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": "Export a single Decision Table by ID", + "description": "Export the specified screen.", + "operationId": "exportDecisionTable", "parameters": [ { - "name": "file_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the file", + "description": "Successfully exported the decision table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/DecisionTableExported" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/decision_tables/import": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "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" + "summary": "Import a new Decision Table", + "description": "Import the specified Decision Table.", + "operationId": "importDecisionTable", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } + } } } } }, - "/files/{file_id}/contents": { - "get": { + "/decision_tables/{decision_table_id}/execute": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", + "summary": "Execute a Decision Table definition", + "description": "Execute a Decision Table definition", + "operationId": "previewDecisionTable", "parameters": [ { - "name": "file_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the file to return", + "description": "Decision Table unique Identifier", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "File stream", + "description": "Successfully executed", "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "application/json": { + "schema": {} } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups": { + "/saved-searches/{saved_search_id}/charts": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getGroups", + "summary": "Returns all saved search charts that the user has access to", + "description": "Get a list of SavedSearchCharts.", + "operationId": "getSavedSearchCharts", "parameters": [ { - "$ref": "#/components/parameters/status" + "$ref": "#/components/parameters/filter" }, { - "$ref": "#/components/parameters/filter" + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] + } }, { "$ref": "#/components/parameters/order_by" @@ -2054,7 +1956,7 @@ ], "responses": { "200": { - "description": "list of groups", + "description": "list of saved search charts", "content": { "application/json": { "schema": { @@ -2062,11 +1964,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2076,19 +1983,67 @@ } } }, + "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": [ - "Groups" + "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" + } + } ], - "summary": "Save a new group", - "description": "Store a newly created resource in storage.", - "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } @@ -2099,67 +2054,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/groups/{group_id}": { + "/saved-searches/charts/{chart_id}": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Get single group by ID", - "description": "Display the specified resource.", - "operationId": "getGroupById", + "summary": "Get single saved search chart by ID", + "description": "Get a single SavedSearchChart.", + "operationId": "getSavedSearchChartById", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the group", + "description": "Successfully found the saved search chart", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", + "summary": "Update a saved search chart", + "description": "Update a SavedSearchChart.", + "operationId": "updateSavedSearchChart", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -2168,94 +2117,75 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } }, "delete": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", + "summary": "Delete a saved search chart", + "description": "Delete a SavedSearchChart.", + "operationId": "deleteSavedSearchChart", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups/{group_id}/users": { + "/saved-searches/charts/{chart_id}/fields": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", + "summary": "Get available chart fields for a Saved Search by ID", + "description": "Get available chart fields for a Saved Search.", + "operationId": "getSavedSearchFieldsById", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group", + "description": "ID of Saved Search to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of members of a group", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2263,52 +2193,73 @@ } } }, - "/groups/{group_id}/groups": { - "get": { + "/saved-searches/reports": { + "post": { "tags": [ - "Groups" + "Reports" ], - "summary": "Returns all users of a group", - "description": "Display the list of groups in a group", - "operationId": "getGroupGroupss", + "summary": "Save a new report", + "operationId": "createReport", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Report" + } + } + } + } + } + } + }, + "/saved-searches/reports/{reportId}": { + "put": { + "tags": [ + "SavedSearches" + ], + "summary": "Update a saved search", + "description": "Update a Report", + "operationId": "updateReport", "parameters": [ { - "name": "group_id", + "name": "reportId", "in": "path", - "description": "ID of group", + "description": "ID of report", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$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": "list of members of a group", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2316,17 +2267,44 @@ } } }, - "/group_members": { + "/saved-searches": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Returns all groups for a given member", - "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", + "summary": "Returns all saved searches that the user has access to", + "description": "Get a list of SavedSearches.", + "operationId": "getSavedSearches", "parameters": [ { - "$ref": "#/components/parameters/member_id" + "$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/order_by" @@ -2336,11 +2314,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of group_members", + "description": "list of saved searches", "content": { "application/json": { "schema": { @@ -2348,11 +2329,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groupMembers" + "$ref": "#/components/schemas/SavedSearch" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2364,17 +2350,17 @@ }, "post": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Save a new group member", - "description": "Store a newly created resource in storage.", - "operationId": "createGroupMember", + "summary": "Save a new saved search", + "description": "Create a new SavedSearch.", + "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupMembersEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -2385,7 +2371,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/createGroupMembers" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2393,19 +2379,19 @@ } } }, - "/group_members/{group_member_id}": { + "/saved-searches/{savedSearchId}": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Get single group member by ID", - "description": "Display the specified resource.", - "operationId": "getGroupMemberById", + "summary": "Get single saved searches by ID", + "description": "Get a single SavedSearch.", + "operationId": "getSavedSearchById", "parameters": [ { - "name": "group_member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group members to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2414,97 +2400,126 @@ ], "responses": { "200": { - "description": "Successfully found the group members", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/getGroupMembersById" + "$ref": "#/components/schemas/SavedSearch" } } } } } }, - "delete": { + "put": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Delete a group member", - "description": "Delete a group membership", - "operationId": "deleteGroupMember", + "summary": "Update a saved search", + "description": "Update a SavedSearch.", + "operationId": "updateSavedSearch", "parameters": [ { - "name": "group_member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group_members to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchEditable" + } + } + } + }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearch" + } + } + } } } } }, - "/group_members_available": { + "/saved-searches/{savedSearchId}/columns": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Returns all groups available for a given member", - "description": "Display a listing of groups available", - "operationId": "getGroupMembersAvailable", + "summary": "Returns all columns associated with a Saved Search", + "description": "Display a listing of columns.", + "operationId": "getSavedSearchColumns", "parameters": [ { - "name": "member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group member to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } }, { - "name": "member_type", - "in": "path", - "description": "type of group member to return", - "required": true, + "name": "include", + "in": "query", + "description": "Include specific categories. Comma separated list.", "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "current", + "default", + "available", + "data" + ] + }, + "uniqueItems": false } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of groups available to be assigned as member", + "description": "Categorized list of columns", "content": { "application/json": { "schema": { "properties": { - "data": { + "current": { "type": "array", "items": { - "$ref": "#/components/schemas/availableGroupMembers" + "$ref": "#/components/schemas/columns" } }, - "meta": { - "$ref": "#/components/schemas/metadata" + "default": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "available": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } } }, "type": "object" @@ -2515,19 +2530,19 @@ } } }, - "/user_members_available": { + "/saved-searches/{savedSearchId}/users": { "get": { "tags": [ - "Group Members" + "Users" ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchUsers", "parameters": [ { - "name": "group_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2536,7 +2551,7 @@ { "name": "filter", "in": "query", - "description": "Filter results by string. Searches Name. Can be a substring.", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", "schema": { "type": "string" } @@ -2549,11 +2564,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users available to be assigned as member", + "description": "list of users", "content": { "application/json": { "schema": { @@ -2576,24 +2594,131 @@ } } }, - "/notifications": { + "/saved-searches/{savedSearchId}/groups": { "get": { "tags": [ - "Notifications" + "Groups" ], - "summary": "Returns all notifications that the user has access to", + "summary": "Returns all groups that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getNotifications", + "operationId": "getSavedSearchGroups", "parameters": [ { - "name": "status", - "in": "query", - "description": "Only return notifications by status (unread, all, etc.)", - "required": false, + "$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" + } + } + } + } + } + } + }, + "/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" }, @@ -2612,7 +2737,7 @@ ], "responses": { "200": { - "description": "list of notifications", + "description": "list of Version History", "content": { "application/json": { "schema": { @@ -2620,10 +2745,17 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } }, - "meta": {} + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } }, "type": "object" } @@ -2634,17 +2766,17 @@ }, "post": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Save a new notifications", - "description": "Store a newly created resource in storage.", - "operationId": "createNotification", + "summary": "Save a new Version History", + "description": "Create a new Version History.", + "operationId": "createVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } @@ -2655,7 +2787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2663,19 +2795,19 @@ } } }, - "/notifications/{notification_id}": { + "/version_histories/{version_history_id}": { "get": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", + "summary": "Get single Version History by ID", + "description": "Get a single Version History.", + "operationId": "getVersionHistoryById", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2684,11 +2816,11 @@ ], "responses": { "200": { - "description": "Successfully found the notification", + "description": "Successfully found the Version History", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2697,16 +2829,16 @@ }, "put": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", + "summary": "Update a Version History", + "description": "Update a Version History.", + "operationId": "updateVersion", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2718,29 +2850,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "204": { - "description": "success" - } - } - }, + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } + } + } + }, "delete": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", + "summary": "Delete a Version History", + "description": "Delete a Version History.", + "operationId": "deleteVersion", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2749,113 +2888,68 @@ ], "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" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } } } } - }, - "responses": { - "201": { - "description": "success" - } } } }, - "/unread_notifications": { - "put": { + "/version_histories/clone": { + "post": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Mark notifications as unread by the user", - "description": "Update notifications as unread", - "operationId": "markNotificationAsUnread", + "summary": "Clone a new Version History", + "description": "Clone a new Version History.", + "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } } } } }, - "/read_all_notifications": { - "put": { + "/customize-ui": { + "post": { "tags": [ - "Notifications" + "CssSettings" ], - "summary": "Mark notifications as read by id and type", - "description": "Update all notification as read.", - "operationId": "markAllAsRead", + "summary": "Create or update a new setting", + "description": "Create a new Settings css-override", + "operationId": "updateCssSetting", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "id": { - "description": "Polymorphic relation id", - "type": "integer" + "variables": { + "type": "string" }, - "type": { - "description": "Polymorphic relation type", + "sansSerifFont": { "type": "string" } }, @@ -2866,73 +2960,29 @@ }, "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" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/settings" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/process_categories": { + "/environment_variables": { "get": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", + "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", + "description": "Fetch a collection of variables based on paged request and filter if provided", + "operationId": "getEnvironmentVariables", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -2942,11 +2992,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes categories", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -2954,7 +3007,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { @@ -2970,17 +3023,17 @@ }, "post": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Save a new process Category", - "description": "Store a newly created Process Category in storage", - "operationId": "createProcessCategory", + "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/ProcessCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -2991,7 +3044,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -2999,19 +3052,19 @@ } } }, - "/process_categories/{process_category_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "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": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { "type": "integer" @@ -3019,12 +3072,12 @@ } ], "responses": { - "200": { - "description": "Successfully found the process", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3033,16 +3086,16 @@ }, "put": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Update a process Category", - "description": "Updates the current element", - "operationId": "updateProcessCategory", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment variables to update", "required": true, "schema": { "type": "integer" @@ -3054,7 +3107,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -3065,7 +3118,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3074,16 +3127,15 @@ }, "delete": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Delete a process category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { "type": "integer" @@ -3091,27 +3143,20 @@ } ], "responses": { - "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "200": { + "description": "success" } } } }, - "/processes": { + "/files": { "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "summary": "Returns the list of files", + "description": "Display a listing of the resource.", + "operationId": "getFiles", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -3124,26 +3169,11 @@ }, { "$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 processes", + "description": "list of files", "content": { "application/json": { "schema": { @@ -3151,7 +3181,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/media" } }, "meta": { @@ -3167,28 +3197,87 @@ }, "post": { "tags": [ - "Processes" + "Files" ], - "summary": "Save a new process", + "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": "createProcess", + "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" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "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/Process" + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" } } } @@ -3196,94 +3285,82 @@ } } }, - "/processes/{processId}": { + "/files/{file_id}": { "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Get single process by ID", - "description": "Display the specified resource.", - "operationId": "getProcessById", + "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": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file to return", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/media" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, - "put": { + "delete": { "tags": [ - "Processes" + "Files" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessEditable" - } - } - } - }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/files/{file_id}/contents": { + "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file to return", "required": true, "schema": { "type": "integer" @@ -3291,29 +3368,46 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/processes/{processId}/start_events": { + "/groups": { "get": { "tags": [ - "Processes" + "Groups" ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } + "$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" @@ -3321,7 +3415,7 @@ ], "responses": { "200": { - "description": "Successfully found the start events process", + "description": "list of groups", "content": { "application/json": { "schema": { @@ -3329,7 +3423,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessStartEvents" + "$ref": "#/components/schemas/groups" } }, "meta": { @@ -3342,21 +3436,88 @@ } } } - } - }, - "/processes/{processId}/draft": { - "put": { + }, + "post": { "tags": [ - "Processes" + "Groups" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "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": "processId", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "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" @@ -3368,62 +3529,79 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } + "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" + } } } }, - "/start_processes": { + "/groups/{group_id}/users": { "get": { "tags": [ - "Processes" + "Groups" ], - "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": "Returns all users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, + "schema": { + "type": "integer" + } }, { - "$ref": "#/components/parameters/order_by" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "without_event_definitions", - "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, - "schema": { - "type": "boolean" - } } ], "responses": { "200": { - "description": "list of processes that the user can start", + "description": "list of members of a group", "content": { "application/json": { "schema": { @@ -3431,7 +3609,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" + "$ref": "#/components/schemas/users" } }, "meta": { @@ -3446,32 +3624,52 @@ } } }, - "/processes/{processId}/restore": { - "put": { + "/groups/{group_id}/groups": { + "get": { "tags": [ - "Processes" + "Groups" ], - "summary": "Restore an inactive process", - "description": "Reverses the soft delete of the element.", - "operationId": "restoreProcess", + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", "parameters": [ { - "name": "processId", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "description": "ID of group", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "success", + "description": "list of members of a group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -3479,34 +3677,43 @@ } } }, - "/processes/{processId}/export": { - "post": { + "/group_members": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process to export", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/member_id" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "list of group_members", "content": { "application/json": { "schema": { "properties": { - "url": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3515,40 +3722,31 @@ } } } - } - }, - "/processes/import/validation": { + }, "post": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Validate a import", - "description": "Validate the specified process before importing.", - "operationId": "validateImport", + "summary": "Save a new group member", + "description": "Store a newly created resource in storage.", + "operationId": "createGroupMember", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/groupMembersEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "$ref": "#/components/schemas/createGroupMembers" } } } @@ -3556,111 +3754,118 @@ } } }, - "/processes/import": { - "post": { + "/group_members/{group_member_id}": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "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 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": "success", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "$ref": "#/components/schemas/getGroupMembersById" } } } } } - } - }, - "/processes/{processId}/bpmn": { - "get": { + }, + "delete": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", "parameters": [ { - "name": "processId", + "name": "group_member_id", "in": "path", - "description": "ID of process", + "description": "ID of group_members to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "description": "Successfully built the process for export", - "content": { - "application/json": { - "schema": { - "properties": { - "url": { - "type": "string" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/group_members_available": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Returns all groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ { - "name": "code", + "name": "member_id", "in": "path", - "description": "Import code", + "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": "check is import is ready", + "description": "list of groups available to be assigned as member", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableGroupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3671,88 +3876,60 @@ } } }, - "/processes/{process_id}/import/assignments": { - "post": { - "tags": [ - "Processes" - ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", - "parameters": [ - { - "name": "process_id", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessAssignments" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/process_events/{process_id}": { - "post": { + "/user_members_available": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Returns all users available for a given group", + "description": "Display a listing of users available", + "operationId": "getUserMembersAvailable", "parameters": [ { - "name": "process_id", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { - "name": "event", + "name": "filter", "in": "query", - "description": "Node ID of the start event", - "required": true, + "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" } ], - "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": "list of users available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -3760,28 +3937,22 @@ } } }, - "/requests": { + "/notifications": { "get": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Returns all process Requests that the user has access to", + "summary": "Returns all notifications that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getProcessesRequests", + "operationId": "getNotifications", "parameters": [ { - "name": "type", + "name": "status", "in": "query", - "description": "Only return requests by type (all|in_progress|completed)", + "description": "Only return notifications by status (unread, all, etc.)", "required": false, "schema": { - "type": "string", - "enum": [ - "all", - "in_progress", - "completed", - "started_me" - ] + "type": "string" } }, { @@ -3802,7 +3973,7 @@ ], "responses": { "200": { - "description": "list of processes", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -3810,12 +3981,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/Notification" } }, - "meta": { - "$ref": "#/components/schemas/metadata" - } + "meta": {} }, "type": "object" } @@ -3823,61 +3992,85 @@ } } } - } + }, + "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" + } + } + } + } + } + } }, - "/requests/{process_request_id}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Get single process request by ID", + "summary": "Get single notification by ID", "description": "Display the specified resource.", - "operationId": "getProcessRequestById", + "operationId": "getNotificationById", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/Notification" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Update a process request", - "description": "Update a request", - "operationId": "updateProcessRequest", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -3886,7 +4079,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -3894,179 +4087,137 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Delete a process request", - "description": "Delete a request", - "operationId": "deleteProcessRequest", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" + "description": "success" } } } }, - "/requests/{process_request_id}/events/{event_id}": { - "post": { + "/read_notifications": { + "put": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Update a process request event", - "description": "Trigger a intermediate catch event", - "operationId": "updateProcessRequestEvent", - "parameters": [ - { - "name": "process_request_id", - "in": "path", - "description": "ID of process request to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event_id", - "in": "path", - "description": "ID of process event to return", - "required": true, - "schema": { - "type": "string" + "summary": "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": { - "204": { + "201": { "description": "success" } } } }, - "/requests/{request_id}/files": { - "get": { + "/unread_notifications": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Returns the list of files associated with a request", - "description": "Display a listing of the resource.", - "operationId": "getRequestFiles", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - } + "Notifications" ], - "responses": { - "200": { - "description": "list of files", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "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" } }, - "type": "object" - } + "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" + } } - }, - "post": { + } + }, + "/read_all_notifications": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Save a new media file to a request", - "description": "Store a newly created resource in storage.", - "operationId": "createRequestFile", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Variable name in the request data to use for the file name", - "required": false, - "schema": { - "type": "string" - } - } + "Notifications" ], + "summary": "Mark notifications as read by id and type", + "description": "Update all notification as read.", + "operationId": "markAllAsRead", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" + "id": { + "description": "Polymorphic relation id", + "type": "integer" + }, + "type": { + "description": "Polymorphic relation type", + "type": "string" } }, "type": "object" @@ -4075,122 +4226,71 @@ } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - }, - "fileUploadId": { - "type": "integer" - } - }, - "type": "object" - } - } - } + "201": { + "description": "success" } } } }, - "/requests/{request_id}/files/{file_id}": { - "get": { + "/permissions": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Get a file uploaded to a request", - "description": "Display the specified resource.", - "operationId": "getRequestFilesById", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "file_id", - "in": "path", - "description": "ID of the file to return", - "required": true, - "schema": { - "type": "integer" - } - } + "Permissions" ], - "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "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" } } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "delete": { - "tags": [ - "Request Files" - ], - "summary": "Delete all media associated with a request", - "description": "Remove the specified resource from storage.", - "operationId": "deleteRequestFile", - "parameters": [ - { - "name": "file_id", - "in": "path", - "description": "ID of the file", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "string" - } } - ], + }, "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/screen_categories": { + "/process_categories": { "get": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Returns all screens categories that the user has access to", - "description": "Display a listing of the Screen Categories.", - "operationId": "getScreenCategories", + "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, Description, and Status. All fields must match exactly.", + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", "schema": { "type": "string" } @@ -4207,7 +4307,7 @@ ], "responses": { "200": { - "description": "list of screens categories", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -4215,7 +4315,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { @@ -4231,17 +4331,17 @@ }, "post": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Save a new Screen Category", - "description": "Store a newly created Screen Category in storage", - "operationId": "createScreenCategory", + "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/ScreenCategoryEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -4252,7 +4352,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4260,32 +4360,32 @@ } } }, - "/screen_categories/{screen_category_id}": { + "/process_categories/{process_category_id}": { "get": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Get single screen category by ID", - "description": "Display the specified screen category.", - "operationId": "getScreenCategoryById", + "summary": "Get single process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4294,19 +4394,19 @@ }, "put": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Update a screen Category", + "summary": "Update a process Category", "description": "Updates the current element", - "operationId": "updateScreenCategory", + "operationId": "updateProcessCategory", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4315,7 +4415,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -4326,7 +4426,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4335,37 +4435,44 @@ }, "delete": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Delete a screen category", + "summary": "Delete a process category", "description": "Remove the specified resource from storage.", - "operationId": "deleteScreenCategory", + "operationId": "deleteProcessCategory", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } } }, - "/screens": { + "/processes": { "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Returns all screens that the user has access to", - "description": "Get a list of Screens.", - "operationId": "getScreens", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4379,13 +4486,16 @@ { "$ref": "#/components/parameters/per_page" }, + { + "$ref": "#/components/parameters/status" + }, { "$ref": "#/components/parameters/include" }, { - "name": "exclude", + "name": "simplified_data_for_selector", "in": "query", - "description": "Comma separated list of fields to exclude from the response", + "description": "Comma separated list of fields to include in the response", "schema": { "type": "string", "default": "" @@ -4394,7 +4504,7 @@ ], "responses": { "200": { - "description": "list of screens", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -4402,11 +4512,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -4418,17 +4528,17 @@ }, "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Save a new screens", - "description": "Create a new Screen.", - "operationId": "createScreen", + "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/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } @@ -4439,7 +4549,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } } } @@ -4447,32 +4557,51 @@ } } }, - "/screens/{screens_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Get single screens by ID", - "description": "Get a single Screen.", - "operationId": "getScreensById", + "summary": "Get single process by ID", + "description": "Display the specified resource.", + "operationId": "getProcessById", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screens to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" + } + } + } + }, + "204": { + "description": "Process not found", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + "example": "The requested process was not found" + } + }, + "type": "object" } } } @@ -4481,19 +4610,19 @@ }, "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "Update a screen", - "description": "Update a Screen.", - "operationId": "updateScreen", + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4502,32 +4631,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } }, "delete": { "tags": [ - "Screens" + "Processes" ], - "summary": "Delete a screen", - "description": "Delete a Screen.", - "operationId": "deleteScreen", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4538,58 +4674,69 @@ } } }, - "/screens/{screens_id}/draft": { - "put": { + "/processes/{processId}/start_events": { + "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Update a draft screen", - "description": "Update a draft Screen.", - "operationId": "updateDraftScreen", + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screensEditable" + "responses": { + "200": { + "description": "Successfully found the start events process", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/screens/{screens_id}/duplicate": { + "/processes/{processId}/draft": { "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "duplicate a screen", - "description": "duplicate a Screen.", - "operationId": "duplicateScreen", + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4598,18 +4745,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } } } @@ -4617,32 +4764,58 @@ } } }, - "/screens/{screensId}/export": { - "post": { + "/start_processes": { + "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Export a single screen by ID", - "description": "Export the specified screen.", - "operationId": "exportScreen", + "summary": "Returns the list of processes that the user can start", + "description": "Returns the list of processes that the user can start.", + "operationId": "startProcesses", "parameters": [ { - "name": "screensId", + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "without_event_definitions", "in": "path", - "description": "ID of screen to return", - "required": true, + "description": "If true return only processes that haven't start event definitions", + "required": false, "schema": { - "type": "string" + "type": "boolean" } } ], "responses": { "200": { - "description": "Successfully exported the screen", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screenExported" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessWithStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -4650,40 +4823,67 @@ } } }, - "/screens/import": { - "post": { + "/processes/{processId}/restore": { + "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "Import a new screen", - "description": "Import the specified screen.", - "operationId": "importScreen", - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } + "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": { "schema": { - "properties": { - "status": { - "type": "object" + "$ref": "#/components/schemas/Process" + } + } + } + } + } + } + }, + "/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", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to export", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Successfully built the process for export", + "content": { + "application/json": { + "schema": { + "properties": { + "url": { + "type": "string" } }, "type": "object" @@ -4694,31 +4894,24 @@ } } }, - "/screens/preview": { + "/processes/import/validation": { "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Preview a screen", - "description": "Get preview a screen", - "operationId": "preview", + "summary": "Validate a import", + "description": "Validate the specified process before importing.", + "operationId": "validateImport", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "config": { - "type": "object" - }, - "watchers": { - "type": "object" - }, - "computed": { - "type": "object" - }, - "custom_css": { - "type": "string" + "file": { + "description": "file to import", + "type": "string", + "format": "binary" } }, "type": "object" @@ -4728,11 +4921,11 @@ }, "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/ProcessImport" } } } @@ -4740,41 +4933,38 @@ } } }, - "/screens/{screen_id}/translate/{language}": { - "get": { + "/processes/import": { + "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Translates the screen to the desired language", - "description": "Translates the controls inside a screen", - "operationId": "translateScreen", - "parameters": [ - { - "name": "screen_id", - "in": "path", - "description": "ID of the screen", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "language", - "in": "path", - "description": "Language used for the translation of the string", - "required": true, - "schema": { - "type": "string" + "summary": "Import a new process", + "description": "Import the specified process.", + "operationId": "importProcess", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/ProcessImport" } } } @@ -4782,48 +4972,34 @@ } } }, - "/script_categories": { + "/processes/{processId}/bpmn": { "get": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Returns all scripts categories that the user has access to", - "description": "Display a listing of the Script Categories.", - "operationId": "getScriptCategories", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "name": "processId", + "in": "path", + "description": "ID of process", + "required": true, "schema": { - "type": "string" + "type": "integer" } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of scripts categories", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ScriptCategory" - } - }, - "meta": { - "type": "object" + "url": { + "type": "string" } }, "type": "object" @@ -4832,51 +5008,21 @@ } } } - }, - "post": { - "tags": [ - "Script Categories" - ], - "summary": "Save a new Script Category", - "description": "Store a newly created Script Category in storage", - "operationId": "createScriptCategory", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } - } - } } }, - "/script_categories/{script_category_id}": { - "get": { + "/processes/import/{code}/is_ready": { + "head": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Get single script category by ID", - "description": "Display the specified script category.", - "operationId": "getScriptCategoryById", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "6a131993b7c879ddcd3d3a291dd8380f", "parameters": [ { - "name": "script_category_id", + "name": "code", "in": "path", - "description": "ID of script category to return", + "description": "Import code", "required": true, "schema": { "type": "string" @@ -4885,32 +5031,39 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "check is import is ready", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "properties": { + "ready": { + "type": "boolean" + } + }, + "type": "object" } } } } } - }, - "put": { + } + }, + "/processes/{process_id}/import/assignments": { + "post": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Update a script Category", - "description": "Updates the current element", - "operationId": "updateScriptCategory", + "summary": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", "parameters": [ { - "name": "script_category_id", + "name": "process_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4919,58 +5072,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "$ref": "#/components/schemas/ProcessAssignments" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } + "204": { + "description": "success" } } - }, - "delete": { + } + }, + "/process_events/{process_id}": { + "post": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Delete a script category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScriptCategory", + "summary": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", "parameters": [ { - "name": "script_category_id", + "name": "process_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "event", + "in": "query", + "description": "Node ID of the start event", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } } } } }, - "/scripts": { + "/requests": { "get": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Returns all scripts that the user has access to", - "description": "Get a list of scripts in a process.", - "operationId": "getScripts", + "summary": "Returns all process Requests that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getProcessesRequests", "parameters": [ + { + "name": "type", + "in": "query", + "description": "Only return requests by type (all|in_progress|completed)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "in_progress", + "completed", + "started_me" + ] + } + }, { "$ref": "#/components/parameters/filter" }, @@ -4989,7 +5179,7 @@ ], "responses": { "200": { - "description": "list of scripts", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -4997,11 +5187,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/processRequest" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5010,50 +5200,58 @@ } } } - }, - "post": { + } + }, + "/requests/{process_request_id}": { + "get": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Save a new script", - "description": "Create a new script in a process.", - "operationId": "createScript", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } + "summary": "Get single process request by ID", + "description": "Display the specified resource.", + "operationId": "getProcessRequestById", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } - }, + ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/processRequest" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{script_id}/preview": { - "post": { + }, + "put": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Test script code without saving it", - "description": "Previews executing a script, with sample data/config data", - "operationId": "previewScript", + "summary": "Update a process request", + "description": "Update a request", + "operationId": "updateProcessRequest", "parameters": [ { - "name": "script_id", + "name": "process_request_id", "in": "path", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -5061,108 +5259,81 @@ } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "code": { - "type": "string" - }, - "nonce": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/processRequestEditable" } } } }, "responses": { - "200": { - "description": "success if the script was queued" + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/execute/{script_id}": { - "post": { + }, + "delete": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Execute script", - "description": "Executes a script, with sample data/config data", - "operationId": "executeScript", + "summary": "Delete a process request", + "description": "Delete a request", + "operationId": "deleteProcessRequest", "parameters": [ { - "name": "script_id", + "name": "process_request_id", "in": "path", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "type": "object" - } - } - } - }, "responses": { - "200": { - "description": "success if the script was queued", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsPreview" + "$ref": "#/components/schemas/processRequest" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/scripts/execution/{key}": { - "get": { + "/requests/{process_request_id}/events/{event_id}": { + "post": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Get the response of a script execution by execution key", - "description": "Get the response of a script execution", - "operationId": "getScriptExecutionResponse", + "summary": "Update a process request event", + "description": "Trigger a intermediate catch event", + "operationId": "updateProcessRequestEvent", "parameters": [ { - "name": "key", + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "event_id", "in": "path", + "description": "ID of process event to return", "required": true, "schema": { "type": "string" @@ -5170,62 +5341,94 @@ } ], "responses": { - "200": { - "description": "response of a script execution", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "success" } } } }, - "/scripts/{script_id}": { + "/requests/{request_id}/files": { "get": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Get single script by ID", - "description": "Get a single script in a process.", - "operationId": "getScriptsById", + "summary": "Returns the list of files associated with a request", + "description": "Display a listing of the resource.", + "operationId": "getRequestFiles", "parameters": [ { - "name": "script_id", - "in": "path", - "description": "ID of script 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" + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the script", + "description": "list of files", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/media" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } } } }, - "put": { + "post": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Update a script", - "description": "Update a script in a process.", - "operationId": "updateScript", + "summary": "Save a new media file to a request", + "description": "Store a newly created resource in storage.", + "operationId": "createRequestFile", "parameters": [ { - "name": "script_id", + "name": "request_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the request", "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Variable name in the request data to use for the file name", + "required": false, "schema": { "type": "string" } @@ -5234,134 +5437,140 @@ "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "properties": { + "file": { + "description": "save a new media file", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + }, + "fileUploadId": { + "type": "integer" + } + }, + "type": "object" + } + } + } } } - }, - "delete": { + } + }, + "/requests/{request_id}/files/{file_id}": { + "get": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Delete a script", - "description": "Delete a script in a process.", - "operationId": "deleteScript", + "summary": "Get a file uploaded to a request", + "description": "Display the specified resource.", + "operationId": "getRequestFilesById", "parameters": [ { - "name": "script_id", + "name": "request_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the request", "required": true, "schema": { - "type": "string" + "type": "integer" } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/scripts/{script_id}/draft": { - "put": { - "tags": [ - "Scripts" - ], - "summary": "Update a draft script", - "description": "Update a draft script.", - "operationId": "updateDraftScript", - "parameters": [ + }, { - "name": "script_id", + "name": "file_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "responses": { + "200": { + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } } } - } - }, - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{scripts_id}/duplicate": { - "put": { + }, + "delete": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "duplicate a script", - "description": "Duplicate a Script.", - "operationId": "duplicateScript", + "summary": "Delete all media associated with a request", + "description": "Remove the specified resource from storage.", + "operationId": "deleteRequestFile", "parameters": [ { - "name": "scripts_id", + "name": "file_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the file", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scripts" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/script-executors": { + "/screen_categories": { "get": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Returns all script executors that the user has access to", - "description": "Get a list of script executors.", - "operationId": "getScriptExecutors", + "summary": "Returns all screens categories that the user has access to", + "description": "Display a listing of the Screen Categories.", + "operationId": "getScreenCategories", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5375,7 +5584,7 @@ ], "responses": { "200": { - "description": "list of script executors", + "description": "list of screens categories", "content": { "application/json": { "schema": { @@ -5383,7 +5592,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scriptExecutors" + "$ref": "#/components/schemas/ScreenCategory" } }, "meta": { @@ -5399,36 +5608,28 @@ }, "post": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Create a script executor", - "description": "Create a script executor", - "operationId": "createScriptExecutor", + "summary": "Save a new Screen Category", + "description": "Store a newly created Screen Category in storage", + "operationId": "createScreenCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" + "$ref": "#/components/schemas/ScreenCategoryEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } @@ -5436,109 +5637,62 @@ } } }, - "/script-executors/{script_executor}": { - "put": { + "/screen_categories/{screen_category_id}": { + "get": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Update script executor", - "description": "Update and rebuild the script executor", - "operationId": "updateScriptExecutor", + "summary": "Get single screen category by ID", + "description": "Display the specified screen category.", + "operationId": "getScreenCategoryById", "parameters": [ { - "name": "script_executor", + "name": "screen_category_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } }, - "delete": { + "put": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Delete a script executor", - "description": "Delete a script executor", - "operationId": "deleteScriptExecutor", + "summary": "Update a screen Category", + "description": "Updates the current element", + "operationId": "updateScreenCategory", "parameters": [ { - "name": "script_executor", + "name": "screen_category_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" - } - } - } - } - } - } - }, - "/script-executors/cancel": { - "post": { - "tags": [ - "Rebuild Script Executors" - ], - "summary": "Cancel a script executor", - "description": "Cancel a script executor", - "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "pidFile": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategoryEditable" } } } @@ -5549,30 +5703,46 @@ "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } + }, + "delete": { + "tags": [ + "Screen Categories" + ], + "summary": "Delete a screen category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScreenCategory", + "parameters": [ + { + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } } }, - "/script-executors/available-languages": { + "/screens": { "get": { "tags": [ - "Rebuild Script Executors" + "Screens" ], - "summary": "Returns all available languages", - "description": "Get a list of available languages.", - "operationId": "getAvailableLanguages", + "summary": "Returns all screens that the user has access to", + "description": "Get a list of Screens.", + "operationId": "getScreens", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -5585,11 +5755,23 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude", + "in": "query", + "description": "Comma separated list of fields to exclude from the response", + "schema": { + "type": "string", + "default": "" + } } ], "responses": { "200": { - "description": "list of available languages", + "description": "list of screens", "content": { "application/json": { "schema": { @@ -5597,7 +5779,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/availableLanguages" + "$ref": "#/components/schemas/screens" } }, "meta": { @@ -5610,48 +5792,31 @@ } } } - } - }, - "/security-logs": { - "get": { + }, + "post": { "tags": [ - "Security Logs" + "Screens" ], - "summary": "Returns all security logs", - "description": "Get a list of Security Logs.", - "operationId": "getSecurityLogs", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "summary": "Save a new screens", + "description": "Create a new Screen.", + "operationId": "createScreen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } } - ], + }, "responses": { - "200": { - "description": "list of security logs", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/screens" } } } @@ -5659,19 +5824,19 @@ } } }, - "/security-logs/{securityLog}": { + "/screens/{screens_id}": { "get": { "tags": [ - "Security Logs" + "Screens" ], - "summary": "Get single security log by ID", - "description": "Display the specified resource.", - "operationId": "getSecurityLog", + "summary": "Get single screens by ID", + "description": "Get a single Screen.", + "operationId": "getScreensById", "parameters": [ { - "name": "securityLog", + "name": "screens_id", "in": "path", - "description": "ID of security log to return", + "description": "ID of screens to return", "required": true, "schema": { "type": "string" @@ -5680,92 +5845,92 @@ ], "responses": { "200": { - "description": "Successfully found the security log", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/screens" } } } } } - } - }, - "/settings": { - "get": { + }, + "put": { "tags": [ - "Settings" + "Screens" ], - "summary": "Returns all settings", - "description": "Display a listing of the resource.", - "operationId": "getSettings", + "summary": "Update a screen", + "description": "Update a Screen.", + "operationId": "updateScreen", "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": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } } ], - "responses": { - "200": { - "description": "list of settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/settings" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" } } } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Screens" + ], + "summary": "Delete a screen", + "description": "Delete a Screen.", + "operationId": "deleteScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } } } }, - "/settings/{setting_id}": { + "/screens/{screens_id}/draft": { "put": { "tags": [ - "Settings" + "Screens" ], - "summary": "Update a setting", - "description": "Update a setting", - "operationId": "updateSetting", + "summary": "Update a draft screen", + "description": "Update a draft Screen.", + "operationId": "updateDraftScreen", "parameters": [ { - "name": "setting_id", + "name": "screens_id", "in": "path", - "description": "ID of setting to return", + "description": "ID of screen to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -5774,7 +5939,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/settingsEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -5782,75 +5947,35 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/signals": { - "get": { + "/screens/{screens_id}/duplicate": { + "put": { "tags": [ - "Signals" + "Screens" ], - "summary": "Returns all signals", - "description": "Display a listing of the resource.", - "operationId": "getSignals", + "summary": "duplicate a screen", + "description": "duplicate a Screen.", + "operationId": "duplicateScreen", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of signals", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/signals" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" } } - } - }, - "post": { - "tags": [ - "Signals" ], - "summary": "Creates a new Global Signal", - "description": "Creates a new global signal", - "operationId": "createSignal", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -5861,7 +5986,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screens" } } } @@ -5869,19 +5994,19 @@ } } }, - "/signals/{signal_id}": { - "get": { + "/screens/{screensId}/export": { + "post": { "tags": [ - "Signals" + "Screens" ], - "summary": "Get a single signal by ID", - "description": "Display the specified resource.", - "operationId": "getSignalsById", + "summary": "Export a single screen by ID", + "description": "Export the specified screen.", + "operationId": "exportScreen", "parameters": [ { - "name": "signal_id", + "name": "screensId", "in": "path", - "description": "signal id", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -5890,68 +6015,130 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully exported the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screenExported" } } } } } - }, - "put": { + } + }, + "/screens/import": { + "post": { "tags": [ - "Signals" + "Screens" ], - "summary": "Update a signal", - "operationId": "updateSignal", - "parameters": [ - { - "name": "signal_id", - "in": "path", - "description": "ID of signal to update", - "required": true, - "schema": { - "type": "string" + "summary": "Import a new screen", + "description": "Import the specified screen.", + "operationId": "importScreen", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } } } + } + } + }, + "/screens/preview": { + "post": { + "tags": [ + "Screens" ], + "summary": "Preview a screen", + "description": "Get preview a screen", + "operationId": "preview", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "properties": { + "config": { + "type": "object" + }, + "watchers": { + "type": "object" + }, + "computed": { + "type": "object" + }, + "custom_css": { + "type": "string" + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "success", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screens" } } } } } - }, - "delete": { + } + }, + "/screens/{screen_id}/translate/{language}": { + "get": { "tags": [ - "Signals" + "Screens" ], - "summary": "Delete a signal", - "operationId": "deleteSignal", + "summary": "Translates the screen to the desired language", + "description": "Translates the controls inside a screen", + "operationId": "translateScreen", "parameters": [ { - "name": "signal_id", + "name": "screen_id", "in": "path", - "description": "ID of signal to delete", + "description": "ID of the screen", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "language", + "in": "path", + "description": "Language used for the translation of the string", "required": true, "schema": { "type": "string" @@ -5959,23 +6146,35 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/task_assignments": { + "/script_categories": { "get": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Returns all task assignments", - "description": "Display a listing of the resource.", - "operationId": "getTaskAssignments", + "summary": "Returns all scripts categories that the user has access to", + "description": "Display a listing of the Script Categories.", + "operationId": "getScriptCategories", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5989,7 +6188,7 @@ ], "responses": { "200": { - "description": "list of task assignments", + "description": "list of scripts categories", "content": { "application/json": { "schema": { @@ -5997,7 +6196,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/ScriptCategory" } }, "meta": { @@ -6013,17 +6212,17 @@ }, "post": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Save a new Task Assignment", - "description": "Store a newly created task assignment in storage.", - "operationId": "createTaskAssignments", + "summary": "Save a new Script Category", + "description": "Store a newly created Script Category in storage", + "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -6034,73 +6233,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/ScriptCategory" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/task_assignments/{task_assignment}": { - "put": { + "/script_categories/{script_category_id}": { + "get": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Update a Task Assignment", - "description": "Update a task assignment", - "operationId": "updateTaskAssignments", + "summary": "Get single script category by ID", + "description": "Display the specified script category.", + "operationId": "getScriptCategoryById", "parameters": [ { - "name": "task_assignment", + "name": "script_category_id", "in": "path", - "description": "ID of task assignment to update", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "responses": { + "200": { + "description": "Successfully found the script", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } } } } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } } }, - "delete": { + "put": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Delete a Task Assignment", - "description": "Remove an assignment", - "operationId": "deleteTaskAssignments", + "summary": "Update a script Category", + "description": "Updates the current element", + "operationId": "updateScriptCategory", "parameters": [ { - "name": "task_assignment", + "name": "script_category_id", "in": "path", - "description": "ID of task assignment to delete", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6109,45 +6296,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } }, "responses": { "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Script Categories" + ], + "summary": "Delete a script category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScriptCategory", + "parameters": [ + { + "name": "script_category_id", + "in": "path", + "description": "ID of script category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { "description": "success" } } } }, - "/tasks": { + "/scripts": { "get": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Returns all tasks that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getTasks", + "summary": "Returns all scripts that the user has access to", + "description": "Get a list of scripts in a process.", + "operationId": "getScripts", "parameters": [ - { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "all_tasks", - "in": "query", - "description": "Return all task types. Not just user tasks.", - "required": false, - "schema": { - "type": "boolean" - } - }, { "$ref": "#/components/parameters/filter" }, @@ -6157,13 +6357,16 @@ { "$ref": "#/components/parameters/order_direction" }, + { + "$ref": "#/components/parameters/per_page" + }, { "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of tasks", + "description": "list of scripts", "content": { "application/json": { "schema": { @@ -6171,11 +6374,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/scripts" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -6184,64 +6387,50 @@ } } } - } - }, - "/tasks/{task_id}": { - "get": { + }, + "post": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Get a single task by ID", - "description": "Display the specified resource.", - "operationId": "getTasksById", - "parameters": [ - { - "name": "task_id", - "in": "path", - "description": "task id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "include", - "in": "query", - "description": "include", - "required": false, - "schema": { - "type": "string" + "summary": "Save a new script", + "description": "Create a new script in a process.", + "operationId": "createScript", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } } } - ], + }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "put": { + } + }, + "/scripts/{script_id}/preview": { + "post": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Update a task", - "description": "Updates the current element", - "operationId": "updateTask", + "summary": "Test script code without saving it", + "description": "Previews executing a script, with sample data/config data", + "operationId": "previewScript", "parameters": [ { - "name": "task_id", + "name": "script_id", "in": "path", - "description": "ID of task to update", "required": true, "schema": { "type": "integer" @@ -6249,21 +6438,27 @@ } ], "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "required": [ - "status", - "data" - ], "properties": { - "status": { - "type": "string", - "example": "COMPLETED" - }, "data": { - "type": "object" + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "code": { + "type": "string" + }, + "nonce": { + "type": "string" } }, "type": "object" @@ -6273,226 +6468,146 @@ }, "responses": { "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequestToken" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" + "description": "success if the script was queued" } } } }, - "/users": { - "get": { + "/scripts/execute/{script_id}": { + "post": { "tags": [ - "Users" + "Scripts" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getUsers", + "summary": "Execute script", + "description": "Executes a script, with sample data/config data", + "operationId": "executeScript", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "exclude_ids", - "in": "query", - "description": "Comma separated list of IDs to exclude from the response", + "name": "script_id", + "in": "path", + "required": true, "schema": { - "type": "string", - "default": "" - } - } - ], - "responses": { - "200": { - "description": "list of users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } + "type": "integer" } } - } - }, - "post": { - "tags": [ - "Users" ], - "summary": "Save a new users", - "description": "Store a newly created resource in storage.", - "operationId": "createUser", "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "sync": { + "type": "boolean" + } + }, + "type": "object" } } } }, "responses": { - "201": { - "description": "success", + "200": { + "description": "success if the script was queued", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scriptsPreview" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users_task_count": { + "/scripts/execution/{key}": { "get": { "tags": [ - "Users" + "Scripts" ], - "summary": "Returns all users and their total tasks", - "description": "Display a listing of users and their task counts.", - "operationId": "getUsersTaskCount", + "summary": "Get the response of a script execution by execution key", + "description": "Get the response of a script execution", + "operationId": "getScriptExecutionResponse", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "name": "key", + "in": "path", + "required": true, "schema": { "type": "string" } - }, - { - "name": "include_ids", - "in": "query", - "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", - "schema": { - "type": "string", - "default": "" - } } ], "responses": { "200": { - "description": "List of users with task counts", + "description": "response of a script execution", "content": { "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "schema": {} } } } } } }, - "/users/{user_id}": { + "/scripts/{script_id}": { "get": { "tags": [ - "Users" + "Scripts" ], - "summary": "Get single user by ID", - "description": "Display the specified resource.", - "operationId": "getUserById", + "summary": "Get single script by ID", + "description": "Get a single script in a process.", + "operationId": "getScriptsById", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Update a user", - "description": "Update a user", - "operationId": "updateUser", + "summary": "Update a script", + "description": "Update a script in a process.", + "operationId": "updateScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6501,7 +6616,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -6509,95 +6624,50 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Users" + "Scripts" ], - "summary": "Delete a user", - "description": "Delete a user", - "operationId": "deleteUser", + "summary": "Delete a script", + "description": "Delete a script in a process.", + "operationId": "deleteScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to delete", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/{user_id}/get_pinned_controls": { - "get": { + "/scripts/{script_id}/draft": { + "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Get the pinned BPMN elements of a specific user", - "description": "Return the user's pinned nodes.", - "operationId": "getPinnnedControls", + "summary": "Update a draft script", + "description": "Update a draft script.", + "operationId": "updateDraftScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return the pinned nodes of", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Pinned nodes returned succesfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/update_pinned_controls": { - "put": { - "tags": [ - "Users" - ], - "summary": "Update a user's pinned BPMN elements on Modeler", - "description": "Update a user's pinned BPMN elements on Modeler", - "operationId": "updatePinnedControls", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6606,7 +6676,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -6614,164 +6684,70 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users/{user_id}/groups": { + "/scripts/{scripts_id}/duplicate": { "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Set the groups a users belongs to", - "description": "Update a user's groups", - "operationId": "updateUserGroups", + "summary": "duplicate a script", + "description": "Duplicate a Script.", + "operationId": "duplicateScript", "parameters": [ { - "name": "user_id", + "name": "scripts_id", "in": "path", - "description": "ID of user", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/updateUserGroups" - } + "type": "string" } } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/users/restore": { - "put": { - "tags": [ - "Users" ], - "summary": "Restore a soft deleted user", - "description": "Reverses the soft delete of a user", - "operationId": "restoreUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/restoreUser" + "$ref": "#/components/schemas/scriptsEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/users/get_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get filter configuration by name", - "description": "Get filter configuration.", - "operationId": "getFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/store_filter_configuration/{name}": { + "/script-executors": { "get": { "tags": [ - "Users" + "Rebuild Script Executors" ], - "summary": "Store filter configuration by name", - "description": "Store filter configuration.", - "operationId": "storeFilterConfiguration", + "summary": "Returns all script executors that the user has access to", + "description": "Get a list of script executors.", + "operationId": "getScriptExecutors", "parameters": [ { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } + "$ref": "#/components/parameters/filter" }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/tokens": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Display listing of access tokens for the specified user.", - "description": "Display listing of access tokens for the specified user.", - "operationId": "getTokens", - "parameters": [ { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" @@ -6779,7 +6755,7 @@ ], "responses": { "200": { - "description": "List of tokens.", + "description": "list of script executors", "content": { "application/json": { "schema": { @@ -6787,11 +6763,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/UserToken" + "$ref": "#/components/schemas/scriptExecutors" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -6803,44 +6779,36 @@ }, "post": { "tags": [ - "Personal Tokens" - ], - "summary": "Create new token for a specific user", - "description": "Create a new personal access token for the user.", - "operationId": "createTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - } + "Rebuild Script Executors" ], + "summary": "Create a script executor", + "description": "Create a script executor", + "operationId": "createScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/scriptExecutorsEditable" } } } }, "responses": { - "201": { - "description": "New token instance", + "200": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserToken" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -6848,41 +6816,47 @@ } } }, - "/users/{user_id}/tokens/{token_id}": { - "get": { + "/script-executors/{script_executor}": { + "put": { "tags": [ - "Personal Tokens" + "Rebuild Script Executors" ], - "summary": "Get single token by ID", - "description": "Show a personal access token for the user", - "operationId": "getTokenById", + "summary": "Update script executor", + "description": "Update and rebuild the script executor", + "operationId": "updateScriptExecutor", "parameters": [ { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", + "name": "script_executor", "in": "path", - "description": "ID of token to return", + "description": "ID of script executor to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "Successfully found the token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" } } } @@ -6891,25 +6865,193 @@ }, "delete": { "tags": [ - "Personal Tokens" + "Rebuild Script Executors" ], - "summary": "Delete a token", - "description": "Delete the given token for a user", - "operationId": "deleteToken", + "summary": "Delete a script executor", + "description": "Delete a script executor", + "operationId": "deleteScriptExecutor", "parameters": [ { - "name": "user_id", + "name": "script_executor", "in": "path", - "description": "User ID", + "description": "ID of script executor to return", "required": true, "schema": { - "type": "integer" + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/script-executors/cancel": { + "post": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Cancel a script executor", + "description": "Cancel a script executor", + "operationId": "cancelScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "pidFile": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + } } + } + } + } + }, + "/script-executors/available-languages": { + "get": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Returns all available languages", + "description": "Get a list of available languages.", + "operationId": "getAvailableLanguages", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "name": "token_id", + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of available languages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableLanguages" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Returns all security logs", + "description": "Get a list of Security Logs.", + "operationId": "getSecurityLogs", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of security logs", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs/{securityLog}": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Get single security log by ID", + "description": "Display the specified resource.", + "operationId": "getSecurityLog", + "parameters": [ + { + "name": "securityLog", "in": "path", - "description": "Token ID", + "description": "ID of security log to return", "required": true, "schema": { "type": "string" @@ -6917,68 +7059,1649 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the security log", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + } + }, + "type": "object" + } + } + } } } } - } - }, - "components": { - "schemas": { - "DateTime": { - "properties": { - "date": { - "type": "string" + }, + "/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Returns all settings", + "description": "Display a listing of the resource.", + "operationId": "getSettings", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/settings" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings/{setting_id}": { + "put": { + "tags": [ + "Settings" + ], + "summary": "Update a setting", + "description": "Update a setting", + "operationId": "updateSetting", + "parameters": [ + { + "name": "setting_id", + "in": "path", + "description": "ID of setting to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/settingsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/signals": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Returns all signals", + "description": "Display a listing of the resource.", + "operationId": "getSignals", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of signals", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/signals" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Signals" + ], + "summary": "Creates a new Global Signal", + "description": "Creates a new global signal", + "operationId": "createSignal", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + } + }, + "/signals/{signal_id}": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Get a single signal by ID", + "description": "Display the specified resource.", + "operationId": "getSignalsById", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "signal id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "put": { + "tags": [ + "Signals" + ], + "summary": "Update a signal", + "operationId": "updateSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Signals" + ], + "summary": "Delete a signal", + "operationId": "deleteSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to delete", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/task_assignments": { + "get": { + "tags": [ + "Task Assignments" + ], + "summary": "Returns all task assignments", + "description": "Display a listing of the resource.", + "operationId": "getTaskAssignments", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of task assignments", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/taskAssignments" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Task Assignments" + ], + "summary": "Save a new Task Assignment", + "description": "Store a newly created task assignment in storage.", + "operationId": "createTaskAssignments", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignments" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/task_assignments/{task_assignment}": { + "put": { + "tags": [ + "Task Assignments" + ], + "summary": "Update a Task Assignment", + "description": "Update a task assignment", + "operationId": "updateTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Task Assignments" + ], + "summary": "Delete a Task Assignment", + "description": "Remove an assignment", + "operationId": "deleteTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Returns all tasks that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getTasks", + "parameters": [ + { + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "all_tasks", + "in": "query", + "description": "Return all task types. Not just user tasks.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of tasks", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequestToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/tasks/{task_id}": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Get a single task by ID", + "description": "Display the specified resource.", + "operationId": "getTasksById", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "task id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "include", + "in": "query", + "description": "include", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Tasks" + ], + "summary": "Update a task", + "description": "Updates the current element", + "operationId": "updateTask", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "ID of task to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "required": [ + "status", + "data" + ], + "properties": { + "status": { + "type": "string", + "example": "COMPLETED" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getUsers", + "parameters": [ + { + "$ref": "#/components/parameters/status" + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude_ids", + "in": "query", + "description": "Comma separated list of IDs to exclude from the response", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "list of users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Users" + ], + "summary": "Save a new users", + "description": "Store a newly created resource in storage.", + "operationId": "createUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users_task_count": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users and their total tasks", + "description": "Display a listing of users and their task counts.", + "operationId": "getUsersTaskCount", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "schema": { + "type": "string" + } + }, + { + "name": "include_ids", + "in": "query", + "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "schema": { + "type": "string", + "default": "" + } + } + ], + "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}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get single user by ID", + "description": "Display the specified resource.", + "operationId": "getUserById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user", + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete a user", + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/get_pinned_controls": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get the pinned BPMN elements of a specific user", + "description": "Return the user's pinned nodes.", + "operationId": "getPinnnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return the pinned nodes of", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Pinned nodes returned succesfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/update_pinned_controls": { + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user's pinned BPMN elements on Modeler", + "description": "Update a user's pinned BPMN elements on Modeler", + "operationId": "updatePinnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users/{user_id}/groups": { + "put": { + "tags": [ + "Users" + ], + "summary": "Set the groups a users belongs to", + "description": "Update a user's groups", + "operationId": "updateUserGroups", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/updateUserGroups" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/users/restore": { + "put": { + "tags": [ + "Users" + ], + "summary": "Restore a soft deleted user", + "description": "Reverses the soft delete of a user", + "operationId": "restoreUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/restoreUser" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/users/get_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get filter configuration by name", + "description": "Get filter configuration.", + "operationId": "getFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/store_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Store filter configuration by name", + "description": "Store filter configuration.", + "operationId": "storeFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/tokens": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Display listing of access tokens for the specified user.", + "description": "Display listing of access tokens for the specified user.", + "operationId": "getTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "List of tokens.", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Personal Tokens" + ], + "summary": "Create new token for a specific user", + "description": "Create a new personal access token for the user.", + "operationId": "createTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "New token instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + } + }, + "/users/{user_id}/tokens/{token_id}": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Get single token by ID", + "description": "Show a personal access token for the user", + "operationId": "getTokenById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "ID of token to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Personal Tokens" + ], + "summary": "Delete a token", + "description": "Delete the given token for a user", + "operationId": "deleteToken", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "Token ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/processes/variables": { + "get": { + "tags": [ + "Processes Variables" + ], + "summary": "Get variables for multiple processes with pagination", + "operationId": "660c9459febd17c58400be4b4d49a152", + "parameters": [ + { + "name": "processIds", + "in": "query", + "description": "Comma-separated list of process IDs", + "required": false, + "schema": { + "type": "string", + "example": "1,2,3", + "nullable": true + } + }, + { + "name": "page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "in": "query", + "description": "Items per page", + "required": false, + "schema": { + "type": "integer", + "default": 20 + } + } + ], + "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": [ + { + "url": "https://nolans-laptop.tail0babd.ts.net/api/1.1", + "description": "API v1.1 Server" + } + ] + } + } + }, + "components": { + "schemas": { + "DateTime": { + "properties": { + "date": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReportingEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "link": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReporting": { + "allOf": [ + { + "$ref": "#/components/schemas/analyticsReportingEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "collectionsEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "custom_title": { + "type": "string" + }, + "create_screen_id": { + "type": "string", + "format": "id" + }, + "read_screen_id": { + "type": "string", + "format": "id" + }, + "update_screen_id": { + "type": "string", + "format": "id" + }, + "signal_create": { + "type": "boolean" + }, + "signal_update": { + "type": "boolean" + }, + "signal_delete": { + "type": "boolean" + } + }, + "type": "object" + }, + "collections": { + "allOf": [ + { + "$ref": "#/components/schemas/collectionsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + }, + "columns": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + ] + }, + "recordsEditable": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "records": { + "allOf": [ + { + "$ref": "#/components/schemas/recordsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "collection_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "DataSourceCallParameters": { + "properties": { + "endpoint": { + "type": "string" + }, + "dataMapping": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "outboundConfig": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "DataSourceResponse": { + "properties": { + "status": { + "type": "integer" + }, + "response": { + "type": "object" + } + }, + "type": "object" + }, + "dataSourceEditable": { + "properties": { + "id": { + "description": "Class DataSource", + "type": "string", + "format": "id" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "endpoints": { + "type": "string" + }, + "mappings": { + "type": "string" + }, + "authtype": { + "type": "string" + }, + "credentials": { + "type": "string" + }, + "status": { + "type": "string" + }, + "data_source_category_id": { + "type": "string" + } + }, + "type": "object" + }, + "dataSource": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "dataSourceCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business data Source category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DataSourceCategory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceCategoryEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" } - }, - "type": "object" + ] }, - "collectionsEditable": { + "decisionTableEditable": { "properties": { + "id": { + "description": "Class Screen", + "type": "string", + "format": "id" + }, "name": { "type": "string" }, "description": { "type": "string" }, - "custom_title": { + "definition": { "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" + "decision_table_categories_id": { + "type": "string" } }, "type": "object" }, - "collections": { + "decisionTable": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" }, { "properties": { - "id": { - "type": "integer" - }, "created_at": { "type": "string", "format": "date-time" @@ -6986,47 +8709,55 @@ "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": { + "DecisionTableExported": { "properties": { - "data": { - "type": "object" + "url": { + "type": "string" } }, "type": "object" }, - "records": { + "decisionTableCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business decision Table category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DecisionTableCategory": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/recordsEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" }, { "properties": { "id": { - "type": "integer" - }, - "collection_id": { "type": "string", "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" } }, "type": "object" @@ -7297,6 +9028,132 @@ }, "type": "object" }, + "Variable": { + "properties": { + "id": { + "type": "integer", + "example": 1 + }, + "process_id": { + "type": "integer", + "example": 1 + }, + "uuid": { + "type": "string", + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "field": { + "type": "string", + "enum": [ + "string", + "number", + "boolean", + "array" + ], + "example": "string" + }, + "label": { + "type": "string", + "example": "Variable 1 for Process 1" + }, + "name": { + "type": "string", + "example": "var_1_1" + }, + "asset": { + "properties": { + "id": { + "type": "string", + "example": "asset_1_1" + }, + "type": { + "type": "string", + "enum": [ + "sensor", + "actuator", + "controller", + "device" + ], + "example": "sensor" + }, + "name": { + "type": "string", + "example": "Asset 1 for Process 1" + }, + "uuid": { + "type": "string", + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" + } + }, + "type": "object" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + "PaginationMeta": { + "properties": { + "current_page": { + "type": "integer", + "example": 1 + }, + "from": { + "type": "integer", + "example": 1 + }, + "last_page": { + "type": "integer", + "example": 5 + }, + "path": { + "type": "string", + "example": "http://processmaker.com/processes/variables" + }, + "per_page": { + "type": "integer", + "example": 20 + }, + "to": { + "type": "integer", + "example": 20 + }, + "total": { + "type": "integer", + "example": 100 + }, + "links": { + "properties": { + "first": { + "type": "string", + "example": "http://processmaker.com/processes/variables?page=1" + }, + "last": { + "type": "string", + "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" + } + }, + "type": "object" + }, "metadata": { "properties": { "filter": { @@ -8632,6 +10489,9 @@ }, "key": { "type": "string" + }, + "output": { + "type": "object" } }, "type": "object" @@ -9002,6 +10862,9 @@ }, "force_change_password": { "type": "boolean" + }, + "email_task_notification": { + "type": "boolean" } }, "type": "object" @@ -9194,9 +11057,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": "https://nolans-laptop.tail0babd.ts.net/oauth/authorize", + "tokenUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/token", + "refreshUrl": "https://nolans-laptop.tail0babd.ts.net/token/refresh", "scopes": {} } } @@ -9208,6 +11071,148 @@ } } }, + "tags": [ + { + "name": "AnalyticsReporting", + "description": "AnalyticsReporting" + }, + { + "name": "Collections", + "description": "Collections" + }, + { + "name": "Screens", + "description": "Screens" + }, + { + "name": "Comments", + "description": "Comments" + }, + { + "name": "DataSourcesCategories", + "description": "DataSourcesCategories" + }, + { + "name": "DataSources", + "description": "DataSources" + }, + { + "name": "DecisionTableCategories", + "description": "DecisionTableCategories" + }, + { + "name": "DecisionTables", + "description": "DecisionTables" + }, + { + "name": "SavedSearchCharts", + "description": "SavedSearchCharts" + }, + { + "name": "Reports", + "description": "Reports" + }, + { + "name": "SavedSearches", + "description": "SavedSearches" + }, + { + "name": "Users", + "description": "Users" + }, + { + "name": "Groups", + "description": "Groups" + }, + { + "name": "Version History", + "description": "Version History" + }, + { + "name": "CssSettings", + "description": "CssSettings" + }, + { + "name": "Environment Variables", + "description": "Environment Variables" + }, + { + "name": "Files", + "description": "Files" + }, + { + "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": "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": "Personal Tokens", + "description": "Personal Tokens" + }, + { + "name": "Processes Variables", + "description": "Processes Variables" + } + ], "security": [ { "passport": [], From 36397eace70b11652a912437b8067a3f420714bf Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Apr 2025 17:58:08 -0700 Subject: [PATCH 02/53] Make secrets nullable --- ...9_update_oauth_clients_secret_nullable.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php diff --git a/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php b/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php new file mode 100644 index 0000000000..08e05d6987 --- /dev/null +++ b/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php @@ -0,0 +1,27 @@ +string('secret', 100)->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('oauth_clients', function (Blueprint $table) { + $table->string('secret', 100)->nullable(false)->change(); + }); + } +}; From 77d4c7c8bf6edabdd7d9eecffdc9fbbcbacb005b Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Apr 2025 07:20:48 -0700 Subject: [PATCH 03/53] Update cors.php --- config/cors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cors.php b/config/cors.php index 979cc947db..481af047b7 100644 --- a/config/cors.php +++ b/config/cors.php @@ -31,6 +31,6 @@ 'max_age' => 0, - 'supports_credentials' => false, + 'supports_credentials' => true, ]; From 473a0b7ec1a7d84a24eee9cae96e74c2da1e17b0 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Apr 2025 07:57:23 -0700 Subject: [PATCH 04/53] Update LoginController.php --- ProcessMaker/Http/Controllers/Auth/LoginController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Auth/LoginController.php b/ProcessMaker/Http/Controllers/Auth/LoginController.php index 190475ec1b..a223b6853b 100644 --- a/ProcessMaker/Http/Controllers/Auth/LoginController.php +++ b/ProcessMaker/Http/Controllers/Auth/LoginController.php @@ -288,6 +288,10 @@ private function forgetUserSession() public function loggedOut(Request $request) { + if ($request->has('redirectTo')) { + return redirect($request->get('redirectTo')); + } + $response = redirect(route('login')); if ($request->has('timeout')) { $response->with('timeout', true); From 19cb1648ebceb41e2edb8dba2259cc50d2aa4b47 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 21 Apr 2025 11:48:11 -0400 Subject: [PATCH 05/53] Add Api2TypescriptCommand for generating TypeScript SDK from OpenAPI spec - Implemented a new console command `make:api-typescript` to convert OpenAPI JSON specifications into TypeScript interfaces, API classes, and composables for Vue applications. - Added methods for parsing JSON, generating TypeScript types, API classes, and composables based on OpenAPI tags. - Created necessary stub files for TypeScript generation including API index, response types, and composables. - Updated OpenAPI spec to include new parameters and operation IDs for better integration with the generated SDK. --- .../Commands/Api2TypescriptCommand.php | 704 ++ .../Http/Controllers/Api/OpenApiSpec.php | 7 + .../Controllers/Api/PermissionController.php | 1 + .../Controllers/Api/ProcessController.php | 2 + .../Api/V1_1/ProcessVariableController.php | 1 + .../stubs/api2typescript/api-index.blade.php | 9 + .../api2typescript/api-response.blade.php | 7 + resources/stubs/api2typescript/api.blade.php | 63 + .../stubs/api2typescript/composable.blade.php | 15 + .../composables-index.blade.php | 9 + .../stubs/api2typescript/main-index.blade.php | 4 + .../stubs/api2typescript/readme.blade.php | 45 + .../stubs/api2typescript/types.blade.php | 14 + storage/api-docs/api-docs.json | 8929 +++++++++-------- 14 files changed, 5351 insertions(+), 4459 deletions(-) create mode 100644 ProcessMaker/Console/Commands/Api2TypescriptCommand.php create mode 100644 resources/stubs/api2typescript/api-index.blade.php create mode 100644 resources/stubs/api2typescript/api-response.blade.php create mode 100644 resources/stubs/api2typescript/api.blade.php create mode 100644 resources/stubs/api2typescript/composable.blade.php create mode 100644 resources/stubs/api2typescript/composables-index.blade.php create mode 100644 resources/stubs/api2typescript/main-index.blade.php create mode 100644 resources/stubs/api2typescript/readme.blade.php create mode 100644 resources/stubs/api2typescript/types.blade.php diff --git a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php new file mode 100644 index 0000000000..4d8593ed39 --- /dev/null +++ b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php @@ -0,0 +1,704 @@ +files = $files; + } + + /** + * Execute the console command. + * + * @return int + */ + public function handle() + { + $openapiFile = url('/docs?api-docs.json'); //$this->argument('input'); + $outputDirectory = $this->argument('output'); + + // update the api-docs.json file + Artisan::call('l5-swagger:generate'); + + // Parse JSON file + $openapi = $this->parseJsonFile(); + if (!$openapi) { + $this->error("Failed to parse OpenAPI JSON file."); + return 1; + } + + // Create output directory if it doesn't exist + if (!$this->files->exists($outputDirectory)) { + $this->files->makeDirectory($outputDirectory, 0755, true); + } + + // Create subdirectories + $typesDir = "$outputDirectory/types"; + $apiDir = "$outputDirectory/api"; + $composablesDir = "$outputDirectory/composables"; + + foreach ([$typesDir, $apiDir, $composablesDir] as $dir) { + if (!$this->files->exists($dir)) { + $this->files->makeDirectory($dir, 0755, true); + } + } + + // Extract API info + $apiTitle = $openapi['info']['title'] ?? 'API'; + $apiDescription = $openapi['info']['description'] ?? 'API Description'; + $apiVersion = $openapi['info']['version'] ?? '1.0.0'; + + // Extract tag names + $tags = []; + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + if (isset($details['tags']) && is_array($details['tags'])) { + foreach ($details['tags'] as $tag) { + $tags[$tag] = true; + } + } + } + } + $tags = array_keys($tags); + + $this->generateTypesForTag($openapi, 'types', $typesDir); + // Process each tag as a separate API client + foreach ($tags as $tag) { + $this->generateApiClassForTag($openapi, $tag, $apiDir); + $this->generateComposableForTag($tag, $composablesDir); + } + + // Generate index files + $this->generateIndexFiles($tags, $apiDir, $composablesDir, $typesDir, $outputDirectory); + + $this->info("TypeScript SDK generated successfully in $outputDirectory"); + return 0; + } + + /** + * Parse a JSON file + */ + protected function parseJsonFile() + { + $content = file_get_contents(storage_path('api-docs/api-docs.json')); + $data = json_decode($content, true); + if (json_last_error() !== JSON_ERROR_NONE) { + $this->error("JSON parse error: " . json_last_error_msg()); + return null; + } + + return $data; + } + + /** + * Map OpenAPI type to TypeScript type + */ + protected function mapSwaggerTypeToTypescript($type) + { + switch ($type) { + case 'integer': + return 'number'; + case 'number': + return 'number'; + case 'boolean': + return 'boolean'; + case 'array': + return 'any[]'; + case 'object': + return 'Record'; + default: + return 'string'; + } + } + + /** + * Generate TypeScript interfaces for schemas related to a tag + */ + protected function generateTypesForTag($openapi, $tag, $outputDir) + { + $tagLower = strtolower($tag); + $interfaces = []; + $queryParamInterfaces = []; + + // Get all schemas from components + $schemas = $openapi['components']['schemas'] ?? []; + + // Process paths to find related schemas and generate query param interfaces + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + // Skip if not related to current tag + // if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + // continue; + // } + + // Generate query param interfaces for GET methods + if (isset($details['parameters'])) { + $queryParamInterface = $this->generateQueryParamInterface($details['parameters'], $tagLower, $details['operationId']); + if ($queryParamInterface) { + $queryParamInterfaces[] = $queryParamInterface; + } + } + + // Check request body schema reference + if (isset($details['requestBody']['content']['application/json']['schema']['$ref'])) { + $schemaRef = $details['requestBody']['content']['application/json']['schema']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + + // Generate response type for operationId + $responseSchema = $details['responses']['200']['content']['application/json']['schema'] ?? + $details['responses']['201']['content']['application/json']['schema'] ?? null; + if ($responseSchema && isset($responseSchema['properties'])) { + $queryParamInterfaces[] = $this->generateResponseType($details['operationId'], $responseSchema, $tagLower); + } + + // Check response schema references + foreach ($details['responses'] ?? [] as $response) { + if (isset($response['content']['application/json']['schema']['$ref'])) { + $schemaRef = $response['content']['application/json']['schema']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + + // Check for arrays with items having refs + if (isset($response['content']['application/json']['schema']['properties']['data']['items']['$ref'])) { + $schemaRef = $response['content']['application/json']['schema']['properties']['data']['items']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + } + } + } + + // Generate TypeScript interfaces from schemas + foreach ($schemas as $name => $schema) { + $interfaces[] = $this->generateInterface($name, $schema); + } + + // Write interfaces to file + $data = [ + 'interfaces' => array_filter($interfaces), + 'queryParamInterfaces' => array_filter($queryParamInterfaces), + ]; + + $content = Blade::render($this->getStub('types'), $data); + $this->files->put("$outputDir/types.ts", $content); + } + + /** + * Generate TypeScript API class for a tag + */ + protected function generateApiClassForTag($openapi, $tag, $outputDir) + { + $tagLower = lcfirst(Str::camel($tag)); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + + // Import interfaces + $imports = [ + // ucfirst($tagLower), + // fix the editable name + // "Editable" . ucfirst($tagLower), + // "PaginatedResponse" + ]; + + // Add query param interfaces to imports + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + continue; + } + + $operationId = $details['operationId'] ?? ''; + if ($operationId) { + if (isset($details['parameters'])) { + // Import the query param interface + $interfaceName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + $interfaceCode = $this->generateQueryParamInterface($details['parameters'], $tagLower, $details['operationId']); + if ($interfaceCode) { + $imports[] = $interfaceName; + } + } + + // Import the paginated response type and its type + $reference = $this->getResponseReference($operationId, $details['responses']); + if ($reference) { + $imports[] = $reference; + } + } + } + } + + // Generate methods for each path + $methods = []; + foreach ($openapi['paths'] as $path => $pathMethods) { + foreach ($pathMethods as $method => $details) { + // Skip if not related to current tag + if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + continue; + } + + $operationId = $details['operationId'] ?? ''; + if ($operationId) { + $methods[] = $this->generateMethod($method, $path, $details, $imports); + } + } + } + + $data = [ + 'tagLower' => $tagLower, + 'className' => $className, + 'imports' => array_unique($imports), + 'methods' => $methods + ]; + + $content = Blade::render($this->getStub('api'), $data); + $this->files->put("$outputDir/$tagLower.api.ts", $content); + } + + private function getResponseReference(string $operationId, array $responses) + { + $responseSchema = $responses['200']['content']['application/json']['schema'] ?? + $responses['201']['content']['application/json']['schema'] ?? + $responses['202']['content']['application/json']['schema'] ?? + $responses['203']['content']['application/json']['schema'] ?? + $responses['204']['content']['application/json']['schema'] ?? null; + + if (!$responseSchema) { + return null; + } + if ($responseSchema && isset($responseSchema['properties'])) { + $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; + return $interfaceName; + } elseif ($responseSchema) { + return $this->getSchemaNameFromRef($responseSchema['$ref']); + } + + throw new \Exception("Failed to find response schema for $operationId"); + } + + private function findResponseSchema(string $operationId, array $responseSchema, array $imports) + { + $responseProperties = $responseSchema['properties'] ?? null; + if ($responseProperties) { + $refs = $this->findRefs($responseProperties); + foreach ($refs as $ref) { + $imports[] = $this->getSchemaNameFromRef($ref); + } + } elseif (isset($responseSchema['$ref'])) { + $imports[] = $this->getSchemaNameFromRef($responseSchema['$ref']); + } else { + throw new \Exception("Failed to find response schema for $operationId"); + } + + return $imports; + } + + private function findRefs(array $schema) + { + $refs = []; + foreach ($schema as $key => $value) { + if (isset($value['$ref'])) { + $refs[] = $value['$ref']; + } + if (is_array($value)) { + $refs = array_merge($refs, $this->findRefs($value)); + } + } + + return $refs; + } + + /** + * Generate a TypeScript method for an API endpoint + */ + protected function generateMethod($httpMethod, $path, $details, &$imports) + { + $operationId = $details['operationId']; + $methodName = $this->camelCase($operationId); + $summary = $details['summary'] ?? ''; + $parameters = $details['parameters'] ?? []; + $requestBody = $details['requestBody'] ?? null; + $responses = $details['responses'] ?? []; + + $parameters = $this->filterValidParameters($parameters); + // Determine method signature based on parameters and request body + $paramList = []; + $pathParams = []; + $queryParams = []; + + // Process path parameters + foreach ($parameters as $param) { + if ($param['in'] === 'path') { + $pathParams[] = $param; + $paramType = $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string'); + $paramList[] = $this->camelCase($param['name']) . ": " . $paramType; + } elseif ($param['in'] === 'query') { + $queryParams[] = $param; + } + } + + // Add request body parameter for POST/PUT methods + if (($httpMethod === 'post' || $httpMethod === 'put')/* && $requestBody*/) { + if (isset($requestBody['content']['application/json']['schema']['$ref'])) { + $schemaRef = $requestBody['content']['application/json']['schema']['$ref']; + $schemaName = $this->getSchemaNameFromRef($schemaRef); + // $this->generateInterface($schemaName, $requestBody['content']['application/json']['schema']); + $imports[] = $schemaName; + $paramList[] = "data: " . $schemaName; + } else { + $paramList[] = "data: Record"; + } + } + + // Handle GET methods with query parameters + if (!empty($queryParams)) { + $queryParamTypeName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + $paramList[] = "params?: " . $queryParamTypeName; + } + + // Determine return type + /*$returnType = 'void'; + foreach ($responses as $code => $response) { + if ("$code"[0] === '2') { // 2xx response + if (isset($response['content']['application/json']['schema'])) { + $schema = $response['content']['application/json']['schema']; + + if (isset($schema['$ref'])) { + $returnType = $this->getSchemaNameFromRef($schema['$ref']); + } elseif (isset($schema['type']) && $schema['type'] === 'object' && isset($schema['properties']['data']['type']) && $schema['properties']['data']['type'] === 'array') { + // Handle paginated response + if (isset($schema['properties']['data']['items']['$ref'])) { + $itemType = $this->getSchemaNameFromRef($schema['properties']['data']['items']['$ref']); + $returnType = "PaginatedResponse<" . $itemType . ">"; + } else { + $returnType = "PaginatedResponse"; + } + } else { + $returnType = "any"; + } + } + break; + } + }*/ + + $returnType = $this->getResponseReference($operationId, $responses); + + + // Build path with parameters + $apiPath = $path; + foreach ($pathParams as $param) { + $apiPath = str_replace('{' . $param['name'] . '}', '${' . $this->camelCase($param['name']) . '}', $apiPath); + } + + return [ + 'methodName' => $methodName, + 'summary' => $summary, + 'httpMethod' => $httpMethod, + 'paramList' => $paramList, + 'returnType' => $returnType, + 'apiPath' => $apiPath, + 'queryParams' => $queryParams, + 'pathParams' => $pathParams + ]; + } + + private function filterValidParameters(array $parameters) + { + // add in=query to the parameters if it is not set + foreach ($parameters as $i => $param) { + if (isset($param['ref']) || isset($param['$ref'])) { + $ref = $param['ref'] ?? $param['$ref']; + $refParts = explode('/', $ref); + $refName = end($refParts); + $parameters[$i]['in'] = 'query'; + $parameters[$i]['name'] = $refName; + } elseif (!isset($param['in'])) { + $parameters[$i]['in'] = 'query'; + dd($parameters[$i]); + } + } + return $parameters; + return array_filter($parameters, function ($param) { + return isset($param['in']); + }); + } + + /** + * Generate a TypeScript composable for a tag + */ + protected function generateComposableForTag($tag, $outputDir) + { + $tagLower = Str::camel($tag); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + $hookName = "useProcessMaker" . ucfirst($tagLower); + + $data = [ + 'tagLower' => $tagLower, + 'className' => $className, + 'hookName' => $hookName + ]; + + $content = Blade::render($this->getStub('composable'), $data); + $this->files->put("$outputDir/" . $hookName . ".ts", $content); + } + + /** + * Generate index files for the SDK + */ + protected function generateIndexFiles($tags, $apiDir, $composablesDir, $typesDir, $outputDir) + { + // API index + $apiClasses = []; + foreach ($tags as $tag) { + $tagLower = Str::camel($tag); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + $apiClasses[] = [ + 'className' => $className, + 'tagLower' => $tagLower + ]; + } + + $data = ['apiClasses' => $apiClasses]; + $content = Blade::render($this->getStub('api-index'), $data); + $this->files->put("$apiDir/index.ts", $content); + + // Composables index + $hooks = []; + foreach ($tags as $tag) { + $tagLower = Str::camel($tag); + $hookName = "useProcessMaker" . ucfirst($tagLower); + $hooks[] = $hookName; + } + + $data = ['hooks' => $hooks]; + $content = Blade::render($this->getStub('composables-index'), $data); + $this->files->put("$composablesDir/index.ts", $content); + + // Main SDK index + $data = ['tags' => $tags]; + $content = Blade::render($this->getStub('main-index'), $data); + $this->files->put("$outputDir/index.ts", $content); + + // API Response type + $content = Blade::render($this->getStub('api-response'), []); + $this->files->put("$typesDir/api.ts", $content); + + // README + $data = [ + 'tags' => $tags, + 'firstTag' => !empty($tags) ? $tags[0] : null + ]; + $content = Blade::render($this->getStub('readme'), $data); + $this->files->put("$outputDir/README.md", $content); + } + + /** + * Generate interface from OpenAPI schema + */ + protected function generateInterface($name, $schema) + { + $properties = $schema['properties'] ?? []; + + $interfaceName = $this->formatInterfaceName($name); + + if (empty($properties)) { + return "export interface $interfaceName {\n [key: string]: any;\n}"; + } + + $interface = "export interface $interfaceName {\n"; + + foreach ($properties as $propName => $propDetails) { + $interface .= " " . $propName; + + // Check if property is required + $required = $schema['required'] ?? []; + if (!in_array($propName, $required)) { + $interface .= "?"; + } + + $interface .= ": " . $this->getTypescriptType($propDetails) . ";\n"; + } + + $interface .= "}"; + + return $interface; + } + + /** + * Generate query param interface for GET endpoints + */ + protected function generateQueryParamInterface($parameters, $tagLower, $operationId) + { + $parameters = $this->filterValidParameters($parameters); + + $queryParams = array_filter($parameters, function ($param) { + return $param['in'] === 'query'; + }); + + if (empty($queryParams)) { + return ""; + } + + $interfaceName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + + $interface = "export interface " . $interfaceName . " {\n"; + + foreach ($queryParams as $param) { + $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string') . ";\n"; + } + + $interface .= "}"; + + return $interface; + } + + private function generateResponseType($operationId, $responseSchema, $outputDir) + { + $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; + + $code = "export interface $interfaceName {\n"; + + foreach ($responseSchema['properties'] as $propName => $propDetails) { + $code .= " " . $propName . ": " . $this->getTypescriptType($propDetails) . ";\n"; + } + + $code .= "}"; + + return $code; + } + + /** + * Format interface name to PascalCase + */ + protected function formatInterfaceName($name) + { + $name = str_replace('#/components/schemas/', '', $name); + + // Convert snake_case to PascalCase + return Str::studly($name); + } + + /** + * Convert swagger type to TypeScript type + */ + protected function getTypescriptType($property) + { + if (isset($property['$ref'])) { + return $this->getSchemaNameFromRef($property['$ref']); + } + + $type = $property['type'] ?? 'string'; + + switch ($type) { + case 'integer': + return 'number'; + case 'number': + return 'number'; + case 'boolean': + return 'boolean'; + case 'array': + if (isset($property['items']['$ref'])) { + $itemType = $this->getSchemaNameFromRef($property['items']['$ref']); + return $itemType . '[]'; + } else { + $itemType = $this->getTypescriptType($property['items'] ?? ['type' => 'string']); + return $itemType . '[]'; + } + case 'object': + if (isset($property['additionalProperties'])) { + $valueType = $this->getTypescriptType($property['additionalProperties']); + return "Record"; + } + return 'Record'; + default: + return 'string'; + } + } + + /** + * Get schema name from reference + */ + protected function getSchemaNameFromRef($ref) + { + $parts = explode('/', $ref); + return $this->formatInterfaceName(end($parts)); + } + + /** + * Collect schema from reference for later processing + */ + protected function collectSchemaFromRef($ref, &$schemas) + { + return; + // $schemaName = $this->getSchemaNameFromRef($ref); + // if ($schemaName !== 'UpdateUserGroups') { + // return; + // } + // dump($schemaName, $ref); + } + + /** + * Get parameter value with appropriate conversion for TypeScript + */ + protected function getParamValueConversion($paramName, $param) + { + $type = $param['schema']['type'] ?? 'string'; + + if ($type === 'integer' || $type === 'number') { + return "params.$paramName.toString()"; + } + + return "params.$paramName"; + } + + /** + * Convert string to camelCase + */ + protected function camelCase($str) + { + return Str::camel($str); + } + + /** + * Get stub template content + */ + protected function getStub($type) + { + return $this->files->get(resource_path("stubs/api2typescript/{$type}.blade.php")); + } +} diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index f99e69b916..2dd79a6baa 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -74,6 +74,13 @@ * in="query", * @OA\Schema(type="string", default=""), * ), + * @OA\Parameter( + * parameter="pmql", + * name="pmql", + * in="query", + * description="PMQL query to filter results", + * @OA\Schema(type="string"), + * ), * @OA\Schema( * schema="DateTime", * @OA\Property(property="date", type="string"), diff --git a/ProcessMaker/Http/Controllers/Api/PermissionController.php b/ProcessMaker/Http/Controllers/Api/PermissionController.php index 03b468fa22..f5636d846d 100644 --- a/ProcessMaker/Http/Controllers/Api/PermissionController.php +++ b/ProcessMaker/Http/Controllers/Api/PermissionController.php @@ -48,6 +48,7 @@ public function index(Request $request) * @OA\Put( * path="/permissions", * summary="Update the permissions of a user", + * operationId="updatePermissions", * tags={"Permissions"}, * * @OA\RequestBody( diff --git a/ProcessMaker/Http/Controllers/Api/ProcessController.php b/ProcessMaker/Http/Controllers/Api/ProcessController.php index b782c2cf0b..1b9e6dc39c 100644 --- a/ProcessMaker/Http/Controllers/Api/ProcessController.php +++ b/ProcessMaker/Http/Controllers/Api/ProcessController.php @@ -87,6 +87,7 @@ class ProcessController extends Controller * @OA\Parameter(ref="#/components/parameters/per_page"), * @OA\Parameter(ref="#/components/parameters/status"), * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter(ref="#/components/parameters/pmql"), * @OA\Parameter( * name="simplified_data_for_selector", * in="query", @@ -1310,6 +1311,7 @@ public function downloadBpmn(Request $request, Process $process) * @OA\Head( * path="/processes/import/{code}/is_ready", * summary="Check if the import is ready", + * operationId="importReady", * tags={"Processes"}, * * @OA\Parameter( diff --git a/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php b/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php index d57af422fb..ec45f6fb7d 100644 --- a/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php +++ b/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php @@ -66,6 +66,7 @@ class ProcessVariableController extends Controller * ) * @OA\Get( * path="/processes/variables", + * operationId="getProcessesVariables", * summary="Get variables for multiple processes with pagination", * servers={ * @OA\Server(url=L5_SWAGGER_API_V1_1, description="API v1.1 Server") diff --git a/resources/stubs/api2typescript/api-index.blade.php b/resources/stubs/api2typescript/api-index.blade.php new file mode 100644 index 0000000000..565d644764 --- /dev/null +++ b/resources/stubs/api2typescript/api-index.blade.php @@ -0,0 +1,9 @@ +@foreach ($apiClasses as $class) +import { {{ $class['className'] }} } from './{{ $class['tagLower'] }}.api'; +@endforeach + +export { +@foreach ($apiClasses as $class) + {{ $class['className'] }}, +@endforeach +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/api-response.blade.php b/resources/stubs/api2typescript/api-response.blade.php new file mode 100644 index 0000000000..31951ad37c --- /dev/null +++ b/resources/stubs/api2typescript/api-response.blade.php @@ -0,0 +1,7 @@ +export interface ApiResponse { + data?: T; + status?: number; + statusText?: string; + error?: string; + message?: string; +} \ No newline at end of file diff --git a/resources/stubs/api2typescript/api.blade.php b/resources/stubs/api2typescript/api.blade.php new file mode 100644 index 0000000000..7d2940303d --- /dev/null +++ b/resources/stubs/api2typescript/api.blade.php @@ -0,0 +1,63 @@ +@if (!empty($imports)) +import { +@foreach ($imports as $import) + {{ $import }}, +@endforeach +} from '../types/types'; +@endif + +export class {{ $className }} { + constructor(private apiClient: { + get: (endpoint: string) => Promise; + post: (endpoint: string, data: Record) => Promise; + put: (endpoint: string, data: Record) => Promise; + delete: (endpoint: string) => Promise; + }) {} + +@foreach ($methods as $method) + /** + * {{ $method['summary'] }} + */ + {!! $method['methodName'] !!}({!! implode(', ', $method['paramList']) !!}): Promise<{!! $method['returnType'] ?: 'void' !!}> { +@if (!empty($method['queryParams'])) + const queryParams = new URLSearchParams(); + + if (params) { +@foreach ($method['queryParams'] as $param) +@php +$paramName = Illuminate\Support\Str::camel($param['name']); +$paramType = $param['schema']['type'] ?? 'string'; +$paramValue = ($paramType === 'integer' || $paramType === 'number') ? "params.{$paramName}.toString()" : "params.{$paramName}"; +@endphp + if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {{ $paramValue }}); +@endforeach + } + + const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ''; +@endif + +@if ($method['httpMethod'] === 'get' || $method['httpMethod'] === 'head') +@if (!empty($method['queryParams'])) + return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); +@else + return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); +@endif +@elseif ($method['httpMethod'] === 'post') +@if (!empty($method['queryParams'])) + return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); +@else + return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); +@endif +@elseif ($method['httpMethod'] === 'put') +@if (!empty($method['queryParams'])) + return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); +@else + return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); +@endif +@elseif ($method['httpMethod'] === 'delete') + return this.apiClient.delete<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); +@endif + } + +@endforeach +} \ No newline at end of file diff --git a/resources/stubs/api2typescript/composable.blade.php b/resources/stubs/api2typescript/composable.blade.php new file mode 100644 index 0000000000..2771ec5b04 --- /dev/null +++ b/resources/stubs/api2typescript/composable.blade.php @@ -0,0 +1,15 @@ +import { {{ $className }} } from '../api/{{ $tagLower }}.api'; + +/** + * Hook to access ProcessMaker {{ ucfirst($tagLower) }} API + * @param apiClient - API client with authentication handling + * @returns {{ $className }} instance + */ +export const {{ $hookName }} = (apiClient: { + get: (endpoint: string) => Promise; + post: (endpoint: string, data: Record) => Promise; + put: (endpoint: string, data: Record) => Promise; + delete: (endpoint: string) => Promise; +}) => { + return new {{ $className }}(apiClient); +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/composables-index.blade.php b/resources/stubs/api2typescript/composables-index.blade.php new file mode 100644 index 0000000000..f0297a04c5 --- /dev/null +++ b/resources/stubs/api2typescript/composables-index.blade.php @@ -0,0 +1,9 @@ +@foreach ($hooks as $hook) +import { {{ $hook }} } from './{{ $hook }}'; +@endforeach + +export { +@foreach ($hooks as $hook) + {{ $hook }}, +@endforeach +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/main-index.blade.php b/resources/stubs/api2typescript/main-index.blade.php new file mode 100644 index 0000000000..43a1b8be5e --- /dev/null +++ b/resources/stubs/api2typescript/main-index.blade.php @@ -0,0 +1,4 @@ +// Generated ProcessMaker SDK +export * from './lib/processmaker-sdk' +export * from './composables'; +export * from './engine'; diff --git a/resources/stubs/api2typescript/readme.blade.php b/resources/stubs/api2typescript/readme.blade.php new file mode 100644 index 0000000000..32e8b7a46b --- /dev/null +++ b/resources/stubs/api2typescript/readme.blade.php @@ -0,0 +1,45 @@ +# ProcessMaker SDK + +This SDK provides typed access to the ProcessMaker API. + +## Features + +- Fully typed API interfaces +- Composable hooks for easy integration +@foreach ($tags as $tag) +- Complete implementation of the ProcessMaker {{ ucfirst(strtolower($tag)) }} API +@endforeach + +## Usage + +@if ($firstTag) +### {{ ucfirst(strtolower($firstTag)) }} API + +```typescript +import { useProcessMakerApi } from '~/composables/useProcessMakerApi'; +import { useProcessMaker{{ ucfirst(strtolower($firstTag)) }} } from 'shared'; + +// In your component or service +const api = useProcessMakerApi(); +const {{ strtolower($firstTag) }}Api = useProcessMaker{{ ucfirst(strtolower($firstTag)) }}(api); + +// Example: Get all {{ strtolower($firstTag) }} +const get{{ ucfirst(strtolower($firstTag)) }} = async () => { + try { + const response = await {{ strtolower($firstTag) }}Api.get{{ ucfirst(strtolower($firstTag)) }}(); + return response.data; + } catch (error) { + console.error('Error fetching {{ strtolower($firstTag) }}:', error); + throw error; + } +}; +``` +@endif + +## Available APIs + +Currently, the SDK includes: + +@foreach ($tags as $tag) +- **{{ ucfirst(strtolower($tag)) }} API**: Complete implementation of the ProcessMaker {{ ucfirst(strtolower($tag)) }} API +@endforeach \ No newline at end of file diff --git a/resources/stubs/api2typescript/types.blade.php b/resources/stubs/api2typescript/types.blade.php new file mode 100644 index 0000000000..33ab9b96fa --- /dev/null +++ b/resources/stubs/api2typescript/types.blade.php @@ -0,0 +1,14 @@ +@foreach ($interfaces as $interface) +{!! $interface !!} + +@endforeach + +/*export interface PaginatedResponse { + data: T[]; + meta: Metadata; +}*/ + +@foreach ($queryParamInterfaces as $interface) +{!! $interface !!} + +@endforeach diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index ebcc60c8ac..9373a2878e 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,14 +18,14 @@ } ], "paths": { - "/analytics-reporting": { + "/decision_table_categories": { "get": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Returns all analytics reporting that the user has access to", - "description": "Get a list of Analytics Reporting.", - "operationId": "getAnalyticsReporting", + "summary": "Returns all Decision Tables categories that the user has access to", + "description": "Display a listing of the Decision Tables Categories.", + "operationId": "getDecisionTableCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -38,14 +38,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of analytics reporting", + "description": "list of Decision Tables categories", "content": { "application/json": { "schema": { @@ -53,11 +50,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -69,17 +71,17 @@ }, "post": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Save a new Analytics Reporting", - "description": "Create a new Analytics Reporting.", - "operationId": "createAnalyticsReporting", + "summary": "Save a new Decision Table Category", + "description": "Store a newly created Decision Tables Category in storage", + "operationId": "createDecisionTableCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReportingEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -90,7 +92,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -98,19 +100,19 @@ } } }, - "/analytics-reporting/{analytic_reporting_id}": { + "/decision_table_categories/{decision_table_categories_id}": { "get": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Get single analytic reporting by ID", - "description": "Get a single Analytic Reporting.", - "operationId": "getAnalyticReportingById", + "summary": "Get single Decision Table category by ID", + "description": "Display the specified decision Tables category.", + "operationId": "getDecisionTableCategoryById", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -119,11 +121,11 @@ ], "responses": { "200": { - "description": "Successfully found the analytics reporting", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -132,16 +134,16 @@ }, "put": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Update a analytic reporting", - "description": "Update a Analytics Reporting.", - "operationId": "updateAnalyticReporting", + "summary": "Update a Decision Table Category", + "description": "Updates the current element", + "operationId": "updateDecisionTableCategory", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to update", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -153,29 +155,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReportingEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DecisionTableCategory" + } + } + } } } }, "delete": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Delete an analytic reporting", - "description": "Delete a Analytics Reporting.", - "operationId": "deleteAnalyticReporting", + "summary": "Delete a Decision Table category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDecisionTableCategory", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -189,14 +198,14 @@ } } }, - "/collections": { + "/decision_tables": { "get": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Returns all collections that the user has access to", - "description": "Get a list of Collections.", - "operationId": "getCollections", + "summary": "Returns all Decision tables that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getDecisionTables", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -216,7 +225,7 @@ ], "responses": { "200": { - "description": "list of collections", + "description": "list of Decision Tables", "content": { "application/json": { "schema": { @@ -224,11 +233,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -240,17 +254,17 @@ }, "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Save a new collections", - "description": "Create a new Collection.", - "operationId": "createCollection", + "summary": "Save a new Decision Table", + "description": "Store a newly created resource in storage.", + "operationId": "createDecisionTable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -261,7 +275,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } @@ -269,19 +283,19 @@ } } }, - "/collections/{collection_id}": { + "/decision_tables/{decision_table_id}": { "get": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Get single collections by ID", - "description": "Get a single Collection.", - "operationId": "getCollectionById", + "summary": "Get single Decision Table by ID", + "description": "Display the specified resource.", + "operationId": "getDecisionTableById", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to return", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -290,11 +304,11 @@ ], "responses": { "200": { - "description": "Successfully found the collections", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } @@ -303,16 +317,16 @@ }, "put": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Update a collection", - "description": "Update a Collection.", - "operationId": "updateCollection", + "summary": "Update a Decision Table", + "description": "Update a Decision table", + "operationId": "updateDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to update", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -324,29 +338,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } }, "delete": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Delete a collection", - "description": "Delete a Collection.", - "operationId": "deleteCollection", + "summary": "Delete a Decision Table", + "description": "Delete a Decision tables", + "operationId": "deleteDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to return", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -355,61 +376,43 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } } }, - "/collections/{collection_id}/export": { - "post": { + "/decision_tables/{decision_table_id}/duplicate": { + "put": { "tags": [ - "Screens" + "DecisionTables" ], - "summary": "Trigger export collections job", - "description": "Export the specified collection.", - "operationId": "exportCollection", + "summary": "duplicate a Decision Table", + "description": "duplicate a Decision table.", + "operationId": "duplicateDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection to export", + "description": "ID of Decision Table to return", "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": { + "application/json": { "schema": { - "required": [ - "file" - ], - "properties": { - "file": { - "description": "file to upload", - "type": "file", - "format": "file" - } - }, - "type": "object" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -420,99 +423,59 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } - }, - "200": { - "description": "success" } } } }, - "/collections/{collection_id}/truncate": { - "delete": { + "/decision_tables/{decision_table_id}/excel-import": { + "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Deletes all records in a collection", - "description": "Truncate a Collection.", - "operationId": "truncateCollection", + "summary": "Import a new decision table", + "description": "Import a Decision table from excel", + "operationId": "importExcel", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to truncate", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/collections/{collection_id}/records": { - "get": { - "tags": [ - "Collections" - ], - "summary": "Returns all records", - "description": "Get the list of records of a collection.", - "operationId": "getRecords", - "parameters": [ - { - "name": "collection_id", - "in": "path", - "description": "ID of collection to get records for", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pmql", - "in": "query", - "schema": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/include" } - ], + }, "responses": { - "200": { - "description": "list of records of a collection", + "201": { + "description": "success", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/records" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "status": { + "type": "object" } }, "type": "object" @@ -521,31 +484,62 @@ } } } - }, + } + }, + "/decision_tables/{decision_table_id}/export": { "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Save a new record in a collection", - "description": "Create a new record in a Collection.", - "operationId": "createRecord", + "summary": "Export a single Decision Table by ID", + "description": "Export the specified screen.", + "operationId": "exportDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" } } ], + "responses": { + "200": { + "description": "Successfully exported the decision table", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DecisionTableExported" + } + } + } + } + } + } + }, + "/decision_tables/import": { + "post": { + "tags": [ + "DecisionTables" + ], + "summary": "Import a new Decision Table", + "description": "Import the specified Decision Table.", + "operationId": "importDecisionTable", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/recordsEditable" + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } @@ -556,7 +550,12 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" } } } @@ -564,41 +563,99 @@ } } }, - "/collections/{collection_id}/records/{record_id}": { - "get": { + "/decision_tables/{decision_table_id}/execute": { + "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Get single record of a collection", - "description": "Get a single record of a Collection.", - "operationId": "getRecordById", + "summary": "Execute a Decision Table definition", + "description": "Execute a Decision Table definition", + "operationId": "previewDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection", + "description": "Decision Table unique Identifier", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "Successfully executed", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/saved-searches/{saved_search_id}/charts": { + "get": { + "tags": [ + "SavedSearchCharts" + ], + "summary": "Returns all saved search charts that the user has access to", + "description": "Get a list of SavedSearchCharts.", + "operationId": "getSavedSearchCharts", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "name": "record_id", - "in": "path", - "description": "ID of the record to return", - "required": true, + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the record", + "description": "list of saved search charts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } @@ -607,25 +664,16 @@ }, "put": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Update a record", - "description": "Update a record in a Collection.", - "operationId": "updateRecord", + "summary": "Update several saved search charts at once", + "description": "Batch update several SavedSearchCharts.", + "operationId": "batchUpdateSavedSearchCharts", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "saved_search_id", "in": "path", - "description": "ID of the record ", + "description": "ID of saved search to which these charts will be saved", "required": true, "schema": { "type": "string" @@ -637,7 +685,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/recordsEditable" + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } } } } @@ -648,27 +699,61 @@ } } }, - "delete": { + "post": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Delete a collection record", - "description": "Delete a record of a Collection.", - "operationId": "deleteRecord", + "summary": "Save a new saved search chart", + "description": "Create a new SavedSearchChart.", + "operationId": "createSavedSearchChart", "parameters": [ { - "name": "collection_id", + "name": "saved_search_id", "in": "path", - "description": "ID of collection", + "description": "ID of saved search to which this chart will be saved", "required": true, "schema": { "type": "string" } - }, + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChartEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } + } + } + } + }, + "/saved-searches/charts/{chart_id}": { + "get": { + "tags": [ + "SavedSearchCharts" + ], + "summary": "Get single saved search chart by ID", + "description": "Get a single SavedSearchChart.", + "operationId": "getSavedSearchChartById", + "parameters": [ { - "name": "record_id", + "name": "chart_id", "in": "path", - "description": "ID of record in collection", + "description": "ID of chart to return", "required": true, "schema": { "type": "string" @@ -676,32 +761,30 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the saved search chart", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } }, - "patch": { + "put": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Partial update of a record", - "description": "Implements a partial update of a record in a Collection.", - "operationId": "patchRecord", + "summary": "Update a saved search chart", + "description": "Update a SavedSearchChart.", + "operationId": "updateSavedSearchChart", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection ", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "chart_id", "in": "path", - "description": "ID of the record ", + "description": "ID of chart to return", "required": true, "schema": { "type": "string" @@ -713,135 +796,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } }, "responses": { "200": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } - } - }, - "/comments/tasks": { - "get": { + }, + "delete": { "tags": [ - "Comments" + "SavedSearchCharts" ], - "summary": "Returns all the tasks that are active.", - "description": "Display a listing of the resource.", - "operationId": "getCommentTasks", + "summary": "Delete a saved search chart", + "description": "Delete a SavedSearchChart.", + "operationId": "deleteSavedSearchChart", "parameters": [ { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, + "name": "chart_id", + "in": "path", + "description": "ID of chart to return", + "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" } ], "responses": { - "200": { - "description": "list all tasks taht are active", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/processRequestToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/data_source_categories": { + "/saved-searches/charts/{chart_id}/fields": { "get": { "tags": [ - "DataSourcesCategories" + "SavedSearchCharts" ], - "summary": "Returns all Data Connectors categories that the user has access to", - "description": "Display a listing of the Data Connector Categories.", - "operationId": "getDataSourceCategories", + "summary": "Get available chart fields for a Saved Search by ID", + "description": "Get available chart fields for a Saved Search.", + "operationId": "getSavedSearchFieldsById", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "chart_id", + "in": "path", + "description": "ID of Saved Search to return", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of Data Connectors categories", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataSourceCategory" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, + } + }, + "/saved-searches/reports": { "post": { "tags": [ - "DataSourcesCategories" + "Reports" ], - "summary": "Save a new Data Connector Category", - "description": "Store a newly created Data Connector Category in storage", - "operationId": "createDataSourceCategory", + "summary": "Save a new report", + "operationId": "createReport", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceCategoryEditable" + "$ref": "#/components/schemas/ReportEditable" } } } @@ -852,7 +895,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceCategory" + "$ref": "#/components/schemas/Report" } } } @@ -860,50 +903,19 @@ } } }, - "/data_source_categories/{data_source_category_id}": { - "get": { - "tags": [ - "DataSourcesCategories" - ], - "summary": "Get single Data Connector category by ID", - "description": "Display the specified data Source category.", - "operationId": "getDatasourceCategoryById", - "parameters": [ - { - "name": "data_source_category_id", - "in": "path", - "description": "ID of Data Connector category to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the Data Connector", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataSourceCategory" - } - } - } - } - } - }, + "/saved-searches/reports/{reportId}": { "put": { "tags": [ - "DataSourcesCategories" + "SavedSearches" ], - "summary": "Update a Data Connector Category", - "description": "Updates the current element", - "operationId": "updateDatasourceCategory", + "summary": "Update a saved search", + "description": "Update a Report", + "operationId": "updateReport", "parameters": [ { - "name": "data_source_category_id", + "name": "reportId", "in": "path", - "description": "ID of Data Connector category to return", + "description": "ID of report", "required": true, "schema": { "type": "string" @@ -915,7 +927,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceCategoryEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -926,49 +938,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceCategory" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, - "delete": { + } + }, + "/saved-searches": { + "get": { "tags": [ - "DataSourcesCategories" + "SavedSearches" ], - "summary": "Delete a Data Connector category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteDataSourceCategory", + "summary": "Returns all saved searches that the user has access to", + "description": "Get a list of SavedSearches.", + "operationId": "getSavedSearches", "parameters": [ { - "name": "data_source_category_id", - "in": "path", - "description": "ID of Data Connector category to return", - "required": true, + "$ref": "#/components/parameters/filter" + }, + { + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/data_sources": { - "get": { - "tags": [ - "DataSources" - ], - "summary": "Returns all Data Connectors that the user has access to", - "description": "Get the list of records of a Data Connector", - "operationId": "getDataSources", - "parameters": [ + }, { - "$ref": "#/components/parameters/filter" + "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/order_by" @@ -985,7 +1000,7 @@ ], "responses": { "200": { - "description": "list of Data Connectors", + "description": "list of saved searches", "content": { "application/json": { "schema": { @@ -993,7 +1008,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } }, "meta": { @@ -1014,17 +1029,17 @@ }, "post": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Save a new Data Connector", - "description": "Create a new Data Connector.", - "operationId": "createDataSource", + "summary": "Save a new saved search", + "description": "Create a new SavedSearch.", + "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -1035,7 +1050,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -1043,19 +1058,19 @@ } } }, - "/data_sources/{data_source_id}": { + "/saved-searches/{savedSearchId}": { "get": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Get single Data Connector by ID", - "description": "Get a single Data Connector.", - "operationId": "getDataSourceById", + "summary": "Get single saved searches by ID", + "description": "Get a single SavedSearch.", + "operationId": "getSavedSearchById", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -1064,11 +1079,11 @@ ], "responses": { "200": { - "description": "Successfully found the Data Connector", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -1077,16 +1092,16 @@ }, "put": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Update a Data Connector", - "description": "Update a Data Connector.", - "operationId": "updateDataSource", + "summary": "Update a saved search", + "description": "Update a SavedSearch.", + "operationId": "updateSavedSearch", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -1098,49 +1113,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, - "delete": { + } + }, + "/saved-searches/{savedSearchId}/columns": { + "get": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Delete a Data Connector", - "description": "Delete a Data Connector.", - "operationId": "deleteDataSource", + "summary": "Returns all columns associated with a Saved Search", + "description": "Display a listing of columns.", + "operationId": "getSavedSearchColumns", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } + }, + { + "name": "include", + "in": "query", + "description": "Include specific categories. Comma separated list.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "current", + "default", + "available", + "data" + ] + }, + "uniqueItems": false + } } ], "responses": { - "204": { - "description": "success", + "200": { + "description": "Categorized list of columns", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "properties": { + "current": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "default": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "available": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + } + }, + "type": "object" } } } @@ -1148,42 +1209,63 @@ } } }, - "/data_sources/{data_source_id}/test": { - "post": { + "/saved-searches/{savedSearchId}/users": { + "get": { "tags": [ - "DataSources" + "Users" ], - "summary": "Send a Data Connector request", - "description": "Send a Data Connector request.", - "operationId": "sendDataSource", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchUsers", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dataSourceEditable" - } + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } - }, + ], "responses": { - "204": { - "description": "success", + "200": { + "description": "list of users", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -1191,56 +1273,46 @@ } } }, - "/requests/{request_id}/data_sources/{data_source_id}": { - "post": { + "/saved-searches/{savedSearchId}/groups": { + "get": { "tags": [ - "DataSources" + "Groups" ], - "summary": "execute Data Source", - "description": "Execute a data Source endpoint", - "operationId": "executeDataSourceForRequest", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchGroups", "parameters": [ { - "name": "request_id", - "in": "path", - "description": "ID of the request in whose context the datasource will be executed", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/order_by" }, { - "name": "data_source_id", - "in": "path", - "description": "ID of DataSource to be run", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "config": { - "$ref": "#/components/schemas/DataSourceCallParameters" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "list of groups", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -1248,49 +1320,68 @@ } } }, - "/requests/data_sources/{data_source_id}": { - "post": { + "/saved-searches/{saved_search_id}": { + "delete": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "execute Data Source", - "operationId": "executeDataSource", + "summary": "Delete a saved search", + "description": "Delete a SavedSearch.", + "operationId": "deleteSavedSearch", "parameters": [ { - "name": "data_source_id", + "name": "saved_search_id", "in": "path", - "description": "ID of DataSource to be run", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "config": { - "$ref": "#/components/schemas/DataSourceCallParameters" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } - } + "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": "success", + "description": "list of icons for saved searches", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchIcon" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } @@ -1298,40 +1389,39 @@ } } }, - "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "/customize-ui": { "post": { "tags": [ - "DataSources" + "CssSettings" ], - "summary": "Get Data from Data Source", - "operationId": "getDataFromDataSource", - "parameters": [ - { - "name": "data_source_id", - "in": "path", - "description": "ID of DataSource to be run", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "endpoint", - "in": "path", - "description": "Endpoint of the data source", - "required": true, - "schema": { - "type": "string" + "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": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "$ref": "#/components/schemas/settings" } } } @@ -1339,14 +1429,14 @@ } } }, - "/decision_table_categories": { + "/environment_variables": { "get": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Returns all Decision Tables categories that the user has access to", - "description": "Display a listing of the Decision Tables Categories.", - "operationId": "getDecisionTableCategories", + "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" @@ -1359,11 +1449,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Decision Tables categories", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -1371,16 +1464,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "type": "object" } }, "type": "object" @@ -1392,17 +1480,17 @@ }, "post": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Save a new Decision Table Category", - "description": "Store a newly created Decision Tables Category in storage", - "operationId": "createDecisionTableCategory", + "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/decisionTableCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -1413,7 +1501,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1421,32 +1509,32 @@ } } }, - "/decision_table_categories/{decision_table_categories_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Get single Decision Table category by ID", - "description": "Display the specified decision Tables category.", - "operationId": "getDecisionTableCategoryById", + "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": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully found the Decision Table", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1455,19 +1543,19 @@ }, "put": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Update a Decision Table Category", - "description": "Updates the current element", - "operationId": "updateDecisionTableCategory", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment variables to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -1476,7 +1564,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTableCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -1487,7 +1575,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1496,37 +1584,36 @@ }, "delete": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Delete a Decision Table category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteDecisionTableCategory", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { + "200": { "description": "success" } } } }, - "/decision_tables": { + "/files": { "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Returns all Decision tables that the user has access to", + "summary": "Returns the list of files", "description": "Display a listing of the resource.", - "operationId": "getDecisionTables", + "operationId": "getFiles", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1539,14 +1626,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Decision Tables", + "description": "list of files", "content": { "application/json": { "schema": { @@ -1554,16 +1638,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/media" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -1575,28 +1654,87 @@ }, "post": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Save a new Decision Table", + "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": "createDecisionTable", + "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" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/decisionTableEditable" + "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/decisionTable" + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" } } } @@ -1604,136 +1742,171 @@ } } }, - "/decision_tables/{decision_table_id}": { + "/files/{file_id}": { "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Get single Decision Table by ID", - "description": "Display the specified resource.", - "operationId": "getDecisionTableById", + "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": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the Decision Table", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/media" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, - "put": { + "delete": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Update a Decision Table", - "description": "Update a Decision table", - "operationId": "updateDecisionTable", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/decisionTableEditable" - } - } - } - }, "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/decisionTable" - } - } - } + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/files/{file_id}/contents": { + "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Delete a Decision Table", - "description": "Delete a Decision tables", - "operationId": "deleteDecisionTable", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { - "description": "success", + "200": { + "description": "File stream", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "type": "string", + "format": "binary" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/decision_tables/{decision_table_id}/duplicate": { - "put": { + "/groups": { + "get": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "duplicate a Decision Table", - "description": "duplicate a Decision table.", - "operationId": "duplicateDecisionTable", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "name": "decision_table_id", - "in": "path", - "description": "ID of Decision Table to return", - "required": true, - "schema": { - "type": "string" + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of groups", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } } } + } + }, + "post": { + "tags": [ + "Groups" ], + "summary": "Save a new group", + "description": "Store a newly created resource in storage.", + "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTableEditable" + "$ref": "#/components/schemas/groupsEditable" } } } @@ -1744,219 +1917,148 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/groups" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/decision_tables/{decision_table_id}/excel-import": { - "post": { + "/groups/{group_id}": { + "get": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Import a new decision table", - "description": "Import a Decision table from excel", - "operationId": "importExcel", + "summary": "Get single group by ID", + "description": "Display the specified resource.", + "operationId": "getGroupById", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } - } - } - }, "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the group", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/groups" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/decision_tables/{decision_table_id}/export": { - "post": { + }, + "put": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Export a single Decision Table by ID", - "description": "Export the specified screen.", - "operationId": "exportDecisionTable", + "summary": "Update a group", + "description": "Update a user", + "operationId": "updateGroup", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully exported the decision table", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DecisionTableExported" - } - } + "type": "integer" } } - } - } - }, - "/decision_tables/import": { - "post": { - "tags": [ - "DecisionTables" ], - "summary": "Import a new Decision Table", - "description": "Import the specified Decision Table.", - "operationId": "importDecisionTable", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/decision_tables/{decision_table_id}/execute": { - "post": { + }, + "delete": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Execute a Decision Table definition", - "description": "Execute a Decision Table definition", - "operationId": "previewDecisionTable", + "summary": "Delete a group", + "description": "Delete a user", + "operationId": "deleteGroup", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "Decision Table unique Identifier", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully executed", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/saved-searches/{saved_search_id}/charts": { + "/groups/{group_id}/users": { "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 users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", - "in": "query", - "description": "Only return saved searches by type", - "required": false, + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "integer" } }, { - "$ref": "#/components/parameters/order_by" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of saved search charts", + "description": "list of members of a group", "content": { "application/json": { "schema": { @@ -1964,16 +2066,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -1982,68 +2079,120 @@ } } } - }, - "put": { + } + }, + "/groups/{group_id}/groups": { + "get": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Update several saved search charts at once", - "description": "Batch update several SavedSearchCharts.", - "operationId": "batchUpdateSavedSearchCharts", + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", "parameters": [ { - "name": "saved_search_id", + "name": "group_id", "in": "path", - "description": "ID of saved search to which these charts will be saved", + "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": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "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" } } } } - }, - "responses": { - "204": { - "description": "success" - } } - }, - "post": { + } + }, + "/group_members": { + "get": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Save a new saved search chart", - "description": "Create a new SavedSearchChart.", - "operationId": "createSavedSearchChart", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "name": "saved_search_id", - "in": "path", - "description": "ID of saved search to which this chart will be saved", - "required": true, - "schema": { - "type": "string" + "$ref": "#/components/parameters/member_id" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of group_members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } } } + } + }, + "post": { + "tags": [ + "Group Members" ], + "summary": "Save a new group member", + "description": "Store a newly created resource in storage.", + "operationId": "createGroupMember", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" + "$ref": "#/components/schemas/groupMembersEditable" } } } @@ -2054,7 +2203,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/createGroupMembers" } } } @@ -2062,73 +2211,32 @@ } } }, - "/saved-searches/charts/{chart_id}": { + "/group_members/{group_member_id}": { "get": { "tags": [ - "SavedSearchCharts" - ], - "summary": "Get single saved search chart by ID", - "description": "Get a single SavedSearchChart.", - "operationId": "getSavedSearchChartById", - "parameters": [ - { - "name": "chart_id", - "in": "path", - "description": "ID of chart to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the saved search chart", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } - } - } - }, - "put": { - "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Update a saved search chart", - "description": "Update a SavedSearchChart.", - "operationId": "updateSavedSearchChart", + "summary": "Get single group member by ID", + "description": "Display the specified resource.", + "operationId": "getGroupMemberById", "parameters": [ { - "name": "chart_id", + "name": "group_member_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group members to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/getGroupMembersById" } } } @@ -2137,16 +2245,16 @@ }, "delete": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Delete a saved search chart", - "description": "Delete a SavedSearchChart.", - "operationId": "deleteSavedSearchChart", + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", "parameters": [ { - "name": "chart_id", + "name": "group_member_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group_members to return", "required": true, "schema": { "type": "string" @@ -2160,32 +2268,64 @@ } } }, - "/saved-searches/charts/{chart_id}/fields": { + "/group_members_available": { "get": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "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 groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ { - "name": "chart_id", + "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": "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": "Successfully found the saved search", + "description": "list of groups available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableGroupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2193,30 +2333,60 @@ } } }, - "/saved-searches/reports": { - "post": { + "/user_members_available": { + "get": { "tags": [ - "Reports" + "Group Members" ], - "summary": "Save a new report", - "operationId": "createReport", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportEditable" - } + "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": { - "201": { - "description": "success", + "200": { + "description": "list of users available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2224,87 +2394,26 @@ } } }, - "/saved-searches/reports/{reportId}": { - "put": { + "/notifications": { + "get": { "tags": [ - "SavedSearches" - ], - "summary": "Update a saved search", - "description": "Update a Report", - "operationId": "updateReport", - "parameters": [ - { - "name": "reportId", - "in": "path", - "description": "ID of report", - "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" - } - } - } - } - } - } - }, - "/saved-searches": { - "get": { - "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Returns all saved searches that the user has access to", - "description": "Get a list of SavedSearches.", - "operationId": "getSavedSearches", + "summary": "Returns all notifications that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getNotifications", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", + "name": "status", "in": "query", - "description": "Only return saved searches by type", + "description": "Only return notifications by status (unread, all, etc.)", "required": false, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "string" } }, { - "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/filter" }, { "$ref": "#/components/parameters/order_by" @@ -2321,7 +2430,7 @@ ], "responses": { "200": { - "description": "list of saved searches", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -2329,17 +2438,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } + "meta": {} }, "type": "object" } @@ -2350,17 +2452,17 @@ }, "post": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Save a new saved search", - "description": "Create a new SavedSearch.", - "operationId": "createSavedSearch", + "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/SavedSearchEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -2371,7 +2473,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } } } @@ -2379,19 +2481,19 @@ } } }, - "/saved-searches/{savedSearchId}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Get single saved searches by ID", - "description": "Get a single SavedSearch.", - "operationId": "getSavedSearchById", + "summary": "Get single notification by ID", + "description": "Display the specified resource.", + "operationId": "getNotificationById", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -2400,11 +2502,11 @@ ], "responses": { "200": { - "description": "Successfully found the saved search", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } } } @@ -2413,16 +2515,16 @@ }, "put": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Update a saved search", - "description": "Update a SavedSearch.", - "operationId": "updateSavedSearch", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -2434,124 +2536,218 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearch" - } - } - } + "204": { + "description": "success" } } - } - }, - "/saved-searches/{savedSearchId}/columns": { - "get": { + }, + "delete": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Returns all columns associated with a Saved Search", - "description": "Display a listing of columns.", - "operationId": "getSavedSearchColumns", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" } - }, - { - "name": "include", - "in": "query", - "description": "Include specific categories. Comma separated list.", - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "current", - "default", - "available", - "data" - ] - }, - "uniqueItems": false - } } ], "responses": { - "200": { - "description": "Categorized list of columns", - "content": { - "application/json": { - "schema": { - "properties": { - "current": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "default": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "available": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } + "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" } }, - "type": "object" - } + "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" + } } } }, - "/saved-searches/{savedSearchId}/users": { - "get": { + "/unread_notifications": { + "put": { "tags": [ - "Users" + "Notifications" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchUsers", - "parameters": [ - { - "name": "savedSearchId", - "in": "path", - "description": "ID of saved search to return", - "required": true, - "schema": { - "type": "string" + "summary": "Mark notifications as unread by the user", + "description": "Update notifications as unread", + "operationId": "markNotificationAsUnread", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "message_ids": { + "description": "list of message ids that will be marked as read", + "type": "array", + "items": { + "type": "string" + } + }, + "routes": { + "description": "all messages that has an url that is in this list will be marked as read", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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": "updatePermissions", + "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 First Name, Last Name, Email and Username.", + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", "schema": { "type": "string" } @@ -2564,14 +2760,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -2579,11 +2772,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -2592,48 +2785,31 @@ } } } - } - }, - "/saved-searches/{savedSearchId}/groups": { - "get": { + }, + "post": { "tags": [ - "Groups" + "Process Categories" ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchGroups", - "parameters": [ - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" + "summary": "Save a new process Category", + "description": "Store a newly created Process Category in storage", + "operationId": "createProcessCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategoryEditable" + } + } } - ], + }, "responses": { - "200": { - "description": "list of groups", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -2641,68 +2817,104 @@ } } }, - "/saved-searches/{saved_search_id}": { - "delete": { + "/process_categories/{process_category_id}": { + "get": { "tags": [ - "SavedSearches" + "Process Categories" ], - "summary": "Delete a saved search", - "description": "Delete a SavedSearch.", - "operationId": "deleteSavedSearch", + "summary": "Get single process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "saved_search_id", + "name": "process_category_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategory" + } + } + } } } - } - }, - "/saved-searches/icons": { - "get": { + }, + "put": { "tags": [ - "SavedSearches" + "Process Categories" ], - "summary": "Returns all icons for saved searches", - "description": "Get a list of icons available for SavedSearches.", - "operationId": "getSavedSearchesIcons", + "summary": "Update a process Category", + "description": "Updates the current element", + "operationId": "updateProcessCategory", "parameters": [ { - "$ref": "#/components/parameters/per_page" + "name": "process_category_id", + "in": "path", + "description": "ID of process category to return", + "required": true, + "schema": { + "type": "integer" + } } ], - "responses": { - "200": { - "description": "list of icons for saved searches", - "content": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategoryEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchIcon" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/ProcessCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Process Categories" + ], + "summary": "Delete a process category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcessCategory", + "parameters": [ + { + "name": "process_category_id", + "in": "path", + "description": "ID of process category to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" } } } @@ -2710,14 +2922,14 @@ } } }, - "/version_histories": { + "/processes": { "get": { "tags": [ - "Version History" + "Processes" ], - "summary": "Return all version History according to the model", - "description": "Get the list of records of Version History", - "operationId": "getVersionHistories", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -2731,13 +2943,28 @@ { "$ref": "#/components/parameters/per_page" }, + { + "$ref": "#/components/parameters/status" + }, { "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/pmql" + }, + { + "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 Version History", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -2745,16 +2972,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -2766,17 +2988,17 @@ }, "post": { "tags": [ - "Version History" + "Processes" ], - "summary": "Save a new Version History", - "description": "Create a new Version History.", - "operationId": "createVersion", + "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/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } @@ -2787,7 +3009,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2795,32 +3017,51 @@ } } }, - "/version_histories/{version_history_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Version History" + "Processes" ], - "summary": "Get single Version History by ID", - "description": "Get a single Version History.", - "operationId": "getVersionHistoryById", + "summary": "Get single process by ID", + "description": "Display the specified resource.", + "operationId": "getProcessById", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the Version History", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" + } + } + } + }, + "204": { + "description": "Process not found", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + "example": "The requested process was not found" + } + }, + "type": "object" } } } @@ -2829,19 +3070,19 @@ }, "put": { "tags": [ - "Version History" + "Processes" ], - "summary": "Update a Version History", - "description": "Update a Version History.", - "operationId": "updateVersion", + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -2850,18 +3091,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2870,29 +3111,69 @@ }, "delete": { "tags": [ - "Version History" + "Processes" ], - "summary": "Delete a Version History", - "description": "Delete a Version History.", - "operationId": "deleteVersion", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { - "description": "success", + "description": "success" + } + } + } + }, + "/processes/{processId}/start_events": { + "get": { + "tags": [ + "Processes" + ], + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "Successfully found the start events process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2900,31 +3181,42 @@ } } }, - "/version_histories/clone": { - "post": { + "/processes/{processId}/draft": { + "put": { "tags": [ - "Version History" + "Processes" + ], + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + } ], - "summary": "Clone a new Version History", - "description": "Clone a new Version History.", - "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2932,54 +3224,14 @@ } } }, - "/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": { + "/start_processes": { "get": { "tags": [ - "Environment Variables" + "Processes" ], - "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", - "description": "Fetch a collection of variables based on paged request and filter if provided", - "operationId": "getEnvironmentVariables", + "summary": "Returns 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" @@ -2995,11 +3247,20 @@ }, { "$ref": "#/components/parameters/include" + }, + { + "name": "without_event_definitions", + "in": "path", + "description": "If true return only processes that haven't start event definitions", + "required": false, + "schema": { + "type": "boolean" + } } ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { @@ -3007,11 +3268,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessWithStartEvents" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3020,31 +3281,34 @@ } } } - }, - "post": { + } + }, + "/processes/{processId}/restore": { + "put": { "tags": [ - "Environment Variables" + "Processes" ], - "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/EnvironmentVariableEditable" - } + "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": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/Process" } } } @@ -3052,19 +3316,19 @@ } } }, - "/environment_variables/{environment_variable_id}": { - "get": { + "/processes/{processId}/export": { + "post": { "tags": [ - "Environment Variables" + "Processes" ], - "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": "Export a single process by ID and return a URL to download it", + "description": "Export the specified process.", + "operationId": "exportProcess", "parameters": [ { - "name": "environment_variable_id", + "name": "processId", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of process to export", "required": true, "schema": { "type": "integer" @@ -3072,42 +3336,45 @@ } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" } } } } } - }, - "put": { + } + }, + "/processes/import/validation": { + "post": { "tags": [ - "Environment Variables" - ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", - "parameters": [ - { - "name": "environment_variable_id", - "in": "path", - "description": "ID of environment variables to update", - "required": true, - "schema": { - "type": "integer" - } - } + "Processes" ], + "summary": "Validate a import", + "description": "Validate the specified process before importing.", + "operationId": "validateImport", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } @@ -3118,74 +3385,81 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessImport" } } } } } - }, - "delete": { + } + }, + "/processes/import": { + "post": { "tags": [ - "Environment Variables" + "Processes" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", - "parameters": [ - { - "name": "environment_variable_id", - "in": "path", - "description": "ID of environment_variables to return", - "required": true, - "schema": { - "type": "integer" + "summary": "Import a new process", + "description": "Import the specified process.", + "operationId": "importProcess", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { "200": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessImport" + } + } + } } } } }, - "/files": { + "/processes/{processId}/bpmn": { "get": { "tags": [ - "Files" + "Processes" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "processId", + "in": "path", + "description": "ID of process", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { "200": { - "description": "list of files", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "url": { + "type": "string" } }, "type": "object" @@ -3194,87 +3468,36 @@ } } } - }, - "post": { + } + }, + "/processes/import/{code}/is_ready": { + "head": { "tags": [ - "Files" + "Processes" ], - "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", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "importReady", "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", + "name": "code", + "in": "path", + "description": "Import code", "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": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "check is import is ready", "content": { "application/json": { "schema": { "properties": { - "id": { - "type": "string" - }, - "model_id": { - "type": "string" - }, - "file_name": { - "type": "string" - }, - "mime_type": { - "type": "string" + "ready": { + "type": "boolean" } }, "type": "object" @@ -3285,117 +3508,118 @@ } } }, - "/files/{file_id}": { - "get": { + "/processes/{process_id}/import/assignments": { + "post": { "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": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", "parameters": [ { - "name": "file_id", + "name": "process_id", "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" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessAssignments" } } - }, - "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": { + "/process_events/{process_id}": { + "post": { "tags": [ - "Files" + "Processes" ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", + "summary": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", "parameters": [ { - "name": "file_id", + "name": "process_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } + }, + { + "name": "event", + "in": "query", + "description": "Node ID of the start event", + "required": true, + "schema": { + "type": "string" + } } ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "File stream", + "description": "success", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/processRequest" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups": { + "/requests": { "get": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Returns all groups that the user has access to", + "summary": "Returns all process Requests that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getGroups", + "operationId": "getProcessesRequests", "parameters": [ { - "$ref": "#/components/parameters/status" + "name": "type", + "in": "query", + "description": "Only return requests by type (all|in_progress|completed)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "in_progress", + "completed", + "started_me" + ] + } }, { "$ref": "#/components/parameters/filter" @@ -3415,7 +3639,7 @@ ], "responses": { "200": { - "description": "list of groups", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -3423,7 +3647,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/processRequest" } }, "meta": { @@ -3436,67 +3660,37 @@ } } } - }, - "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}": { + "/requests/{process_request_id}": { "get": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Get single group by ID", + "summary": "Get single process request by ID", "description": "Display the specified resource.", - "operationId": "getGroupById", + "operationId": "getProcessRequestById", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the group", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/processRequest" } } } @@ -3508,16 +3702,16 @@ }, "put": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", + "summary": "Update a process request", + "description": "Update a request", + "operationId": "updateProcessRequest", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -3529,7 +3723,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/processRequestEditable" } } } @@ -3545,16 +3739,16 @@ }, "delete": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", + "summary": "Delete a process request", + "description": "Delete a request", + "operationId": "deleteProcessRequest", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -3563,7 +3757,14 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } }, "404": { "$ref": "#/components/responses/404" @@ -3571,123 +3772,52 @@ } } }, - "/groups/{group_id}/users": { - "get": { + "/requests/{process_request_id}/events/{event_id}": { + "post": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", + "summary": "Update a process request event", + "description": "Trigger a intermediate catch event", + "operationId": "updateProcessRequestEvent", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group", + "description": "ID of process request to return", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { - "$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", + "name": "event_id", "in": "path", - "description": "ID of group", + "description": "ID of process event to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$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" - } - } - } + "204": { + "description": "success" } } } }, - "/group_members": { + "/requests/{request_id}/files": { "get": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Returns all groups for a given member", + "summary": "Returns the list of files associated with a request", "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", + "operationId": "getRequestFiles", "parameters": [ { - "$ref": "#/components/parameters/member_id" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -3697,11 +3827,20 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { "200": { - "description": "list of group_members", + "description": "list of files", "content": { "application/json": { "schema": { @@ -3709,11 +3848,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groupMembers" + "$ref": "#/components/schemas/media" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -3725,28 +3869,63 @@ }, "post": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Save a new group member", + "summary": "Save a new media file to a request", "description": "Store a newly created resource in storage.", - "operationId": "createGroupMember", + "operationId": "createRequestFile", + "parameters": [ + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Variable name in the request data to use for the file name", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/groupMembersEditable" + "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/createGroupMembers" + "properties": { + "message": { + "type": "string" + }, + "fileUploadId": { + "type": "integer" + } + }, + "type": "object" } } } @@ -3754,93 +3933,105 @@ } } }, - "/group_members/{group_member_id}": { + "/requests/{request_id}/files/{file_id}": { "get": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Get single group member by ID", + "summary": "Get a file uploaded to a request", "description": "Display the specified resource.", - "operationId": "getGroupMemberById", + "operationId": "getRequestFilesById", "parameters": [ { - "name": "group_member_id", + "name": "request_id", "in": "path", - "description": "ID of group members to return", + "description": "ID of the request", "required": true, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "file_id", + "in": "path", + "description": "ID of the file to return", + "required": true, + "schema": { + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the group members", + "description": "File stream", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/getGroupMembersById" + "type": "string", + "format": "binary" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Delete a group member", - "description": "Delete a group membership", - "operationId": "deleteGroupMember", + "summary": "Delete all media associated with a request", + "description": "Remove the specified resource from storage.", + "operationId": "deleteRequestFile", "parameters": [ { - "name": "group_member_id", + "name": "file_id", "in": "path", - "description": "ID of group_members to return", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "string" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/group_members_available": { + "/screen_categories": { "get": { "tags": [ - "Group Members" + "Screen Categories" ], - "summary": "Returns all groups available for a given member", - "description": "Display a listing of groups available", - "operationId": "getGroupMembersAvailable", + "summary": "Returns all screens categories that the user has access to", + "description": "Display a listing of the Screen Categories.", + "operationId": "getScreenCategories", "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, + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", "schema": { "type": "string" } }, - { - "$ref": "#/components/parameters/filter" - }, { "$ref": "#/components/parameters/order_by" }, @@ -3853,7 +4044,7 @@ ], "responses": { "200": { - "description": "list of groups available to be assigned as member", + "description": "list of screens categories", "content": { "application/json": { "schema": { @@ -3861,11 +4052,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/availableGroupMembers" + "$ref": "#/components/schemas/ScreenCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -3874,87 +4065,145 @@ } } } + }, + "post": { + "tags": [ + "Screen Categories" + ], + "summary": "Save a new Screen Category", + "description": "Store a newly created Screen Category in storage", + "operationId": "createScreenCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } } }, - "/user_members_available": { + "/screen_categories/{screen_category_id}": { "get": { "tags": [ - "Group Members" + "Screen Categories" ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", + "summary": "Get single screen category by ID", + "description": "Display the specified screen category.", + "operationId": "getScreenCategoryById", "parameters": [ { - "name": "group_id", + "name": "screen_category_id", "in": "path", - "description": "ID of group to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } + }, + "put": { + "tags": [ + "Screen Categories" + ], + "summary": "Update a screen Category", + "description": "Updates the current element", + "operationId": "updateScreenCategory", + "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name. Can be a substring.", + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, "schema": { "type": "string" } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, "responses": { "200": { - "description": "list of users available to be assigned as member", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } - } - }, - "/notifications": { - "get": { + }, + "delete": { "tags": [ - "Notifications" + "Screen Categories" ], - "summary": "Returns all notifications that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getNotifications", + "summary": "Delete a screen category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScreenCategory", "parameters": [ { - "name": "status", - "in": "query", - "description": "Only return notifications by status (unread, all, etc.)", - "required": false, + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/screens": { + "get": { + "tags": [ + "Screens" + ], + "summary": "Returns all screens that the user has access to", + "description": "Get a list of Screens.", + "operationId": "getScreens", + "parameters": [ { "$ref": "#/components/parameters/filter" }, @@ -3969,11 +4218,20 @@ }, { "$ref": "#/components/parameters/include" + }, + { + "name": "exclude", + "in": "query", + "description": "Comma separated list of fields to exclude from the response", + "schema": { + "type": "string", + "default": "" + } } ], "responses": { "200": { - "description": "list of notifications", + "description": "list of screens", "content": { "application/json": { "schema": { @@ -3981,10 +4239,12 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } }, - "meta": {} + "meta": { + "type": "object" + } }, "type": "object" } @@ -3995,17 +4255,17 @@ }, "post": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Save a new notifications", - "description": "Store a newly created resource in storage.", - "operationId": "createNotification", + "summary": "Save a new screens", + "description": "Create a new Screen.", + "operationId": "createScreen", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -4016,7 +4276,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } } } @@ -4024,19 +4284,19 @@ } } }, - "/notifications/{notification_id}": { + "/screens/{screens_id}": { "get": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", + "summary": "Get single screens by ID", + "description": "Get a single Screen.", + "operationId": "getScreensById", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screens to return", "required": true, "schema": { "type": "string" @@ -4045,11 +4305,11 @@ ], "responses": { "200": { - "description": "Successfully found the notification", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } } } @@ -4058,16 +4318,16 @@ }, "put": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", + "summary": "Update a screen", + "description": "Update a Screen.", + "operationId": "updateScreen", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -4079,7 +4339,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -4092,16 +4352,16 @@ }, "delete": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", + "summary": "Delete a screen", + "description": "Delete a Screen.", + "operationId": "deleteScreen", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -4115,109 +4375,136 @@ } } }, - "/read_notifications": { + "/screens/{screens_id}/draft": { "put": { "tags": [ - "Notifications" + "Screens" + ], + "summary": "Update a draft screen", + "description": "Update a draft Screen.", + "operationId": "updateDraftScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Mark notifications as read by the user", - "description": "Update notification as read", - "operationId": "markNotificationAsRead", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/screensEditable" } } } }, "responses": { - "201": { + "204": { "description": "success" } } } }, - "/unread_notifications": { + "/screens/{screens_id}/duplicate": { "put": { "tags": [ - "Notifications" + "Screens" + ], + "summary": "duplicate a screen", + "description": "duplicate a Screen.", + "operationId": "duplicateScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } ], - "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" + "$ref": "#/components/schemas/screensEditable" } } } }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/read_all_notifications": { - "put": { + "/screens/{screensId}/export": { + "post": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Mark notifications as read by id and type", - "description": "Update all notification as read.", - "operationId": "markAllAsRead", + "summary": "Export a single screen by ID", + "description": "Export the specified screen.", + "operationId": "exportScreen", + "parameters": [ + { + "name": "screensId", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully exported the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screenExported" + } + } + } + } + } + } + }, + "/screens/import": { + "post": { + "tags": [ + "Screens" + ], + "summary": "Import a new screen", + "description": "Import the specified screen.", + "operationId": "importScreen", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "id": { - "description": "Polymorphic relation id", - "type": "integer" - }, - "type": { - "description": "Polymorphic relation type", - "type": "string" + "file": { + "description": "file to import", + "type": "string", + "format": "binary" } }, "type": "object" @@ -4227,43 +4514,48 @@ }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } + } } } } }, - "/permissions": { - "put": { + "/screens/preview": { + "post": { "tags": [ - "Permissions" + "Screens" ], - "summary": "Update the permissions of a user", - "description": "Update permissions", - "operationId": "51b3555fb753f44324bf5c3880e01454", + "summary": "Preview a screen", + "description": "Get preview a screen", + "operationId": "preview", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "user_id": { - "description": "ID of the user whose permissions are configured", - "type": "integer" + "config": { + "type": "object" }, - "group_id": { - "description": "ID of the group whose permissions are configured", - "type": "integer" + "watchers": { + "type": "object" }, - "is_administrator": { - "description": "Whether the user should have Super Admin privileges", - "type": "boolean", - "default": false + "computed": { + "type": "object" }, - "permission_names": { - "type": "array", - "items": { - "type": "string" - } + "custom_css": { + "type": "string" } }, "type": "object" @@ -4272,50 +4564,99 @@ } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/process_categories": { + "/screens/{screen_id}/translate/{language}": { "get": { "tags": [ - "Process Categories" + "Screens" ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", + "summary": "Translates the screen to the desired language", + "description": "Translates the controls inside a screen", + "operationId": "translateScreen", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", + "name": "screen_id", + "in": "path", + "description": "ID of the screen", + "required": true, "schema": { "type": "string" } }, { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "language", + "in": "path", + "description": "Language used for the translation of the string", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of processes categories", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "data": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + } + }, + "/script_categories": { + "get": { + "tags": [ + "Script Categories" + ], + "summary": "Returns all scripts categories that the user has access to", + "description": "Display a listing of the Script Categories.", + "operationId": "getScriptCategories", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of scripts categories", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } }, "meta": { @@ -4331,17 +4672,17 @@ }, "post": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Save a new process Category", - "description": "Store a newly created Process Category in storage", - "operationId": "createProcessCategory", + "summary": "Save a new Script Category", + "description": "Store a newly created Script Category in storage", + "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -4352,7 +4693,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4360,32 +4701,32 @@ } } }, - "/process_categories/{process_category_id}": { + "/script_categories/{script_category_id}": { "get": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "summary": "Get single script category by ID", + "description": "Display the specified script category.", + "operationId": "getScriptCategoryById", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4394,19 +4735,19 @@ }, "put": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Update a process Category", + "summary": "Update a script Category", "description": "Updates the current element", - "operationId": "updateProcessCategory", + "operationId": "updateScriptCategory", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -4415,7 +4756,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -4426,7 +4767,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4435,44 +4776,37 @@ }, "delete": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Delete a process category", + "summary": "Delete a script category", "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "operationId": "deleteScriptCategory", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "description": "success" } } } }, - "/processes": { + "/scripts": { "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "summary": "Returns all scripts that the user has access to", + "description": "Get a list of scripts in a process.", + "operationId": "getScripts", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4486,25 +4820,13 @@ { "$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 processes", + "description": "list of scripts", "content": { "application/json": { "schema": { @@ -4512,11 +4834,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -4528,17 +4850,17 @@ }, "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Save a new process", - "description": "Store a newly created resource in storage.", - "operationId": "createProcess", + "summary": "Save a new script", + "description": "Create a new script in a process.", + "operationId": "createScript", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -4549,7 +4871,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } } } @@ -4557,69 +4879,72 @@ } } }, - "/processes/{processId}": { - "get": { + "/scripts/{script_id}/preview": { + "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Get single process by ID", - "description": "Display the specified resource.", - "operationId": "getProcessById", + "summary": "Test script code without saving it", + "description": "Previews executing a script, with sample data/config data", + "operationId": "previewScript", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/include" } ], - "responses": { - "200": { - "description": "Successfully found the process", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } - }, - "204": { - "description": "Process not found", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string", - "example": "The requested process was not found" + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" } }, - "type": "object" - } + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "code": { + "type": "string" + }, + "nonce": { + "type": "string" + } + }, + "type": "object" } } } + }, + "responses": { + "200": { + "description": "success if the script was queued" + } } - }, - "put": { + } + }, + "/scripts/execute/{script_id}": { + "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", + "summary": "Execute script", + "description": "Executes a script, with sample data/config data", + "operationId": "executeScript", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -4627,116 +4952,218 @@ } ], "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" - } - } - } - }, - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } - } + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "sync": { + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success if the script was queued", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsPreview" + } + } + } + } } - }, - "delete": { + } + }, + "/scripts/execution/{key}": { + "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Get the response of a script execution by execution key", + "description": "Get the response of a script execution", + "operationId": "getScriptExecutionResponse", "parameters": [ { - "name": "processId", + "name": "key", "in": "path", - "description": "ID of process to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "response of a script execution", + "content": { + "application/json": { + "schema": {} + } + } } } } }, - "/processes/{processId}/start_events": { + "/scripts/{script_id}": { "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", + "summary": "Get single script by ID", + "description": "Get a single script in a process.", + "operationId": "getScriptsById", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the start events process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/scripts" } } } } } + }, + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a script", + "description": "Update a script in a process.", + "operationId": "updateScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Scripts" + ], + "summary": "Delete a script", + "description": "Delete a script in a process.", + "operationId": "deleteScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/scripts/{script_id}/draft": { + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a draft script", + "description": "Update a draft script.", + "operationId": "updateDraftScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } } }, - "/processes/{processId}/draft": { + "/scripts/{scripts_id}/duplicate": { "put": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "summary": "duplicate a script", + "description": "Duplicate a Script.", + "operationId": "duplicateScript", "parameters": [ { - "name": "processId", + "name": "scripts_id", "in": "path", - "description": "ID of process to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -4745,18 +5172,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } } } @@ -4764,14 +5191,14 @@ } } }, - "/start_processes": { + "/script-executors": { "get": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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": "Returns all script executors that the user has access to", + "description": "Get a list of script executors.", + "operationId": "getScriptExecutors", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4784,23 +5211,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "without_event_definitions", - "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, - "schema": { - "type": "boolean" - } } ], "responses": { "200": { - "description": "list of processes that the user can start", + "description": "list of script executors", "content": { "application/json": { "schema": { @@ -4808,11 +5223,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" + "$ref": "#/components/schemas/scriptExecutors" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -4821,34 +5236,39 @@ } } } - } - }, - "/processes/{processId}/restore": { - "put": { + }, + "post": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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" + "summary": "Create a script executor", + "description": "Create a script executor", + "operationId": "createScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } } } - ], + }, "responses": { "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -4856,33 +5276,43 @@ } } }, - "/processes/{processId}/export": { - "post": { + "/script-executors/{script_executor}": { + "put": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Update script executor", + "description": "Update and rebuild the script executor", + "operationId": "updateScriptExecutor", "parameters": [ { - "name": "processId", + "name": "script_executor", "in": "path", - "description": "ID of process to export", + "description": "ID of script executor to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, "responses": { "200": { - "description": "Successfully built the process for export", + "description": "success", "content": { "application/json": { "schema": { "properties": { - "url": { + "status": { "type": "string" } }, @@ -4892,40 +5322,37 @@ } } } - } - }, - "/processes/import/validation": { - "post": { + }, + "delete": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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" - } + "summary": "Delete a script executor", + "description": "Delete a script executor", + "operationId": "deleteScriptExecutor", + "parameters": [ + { + "name": "script_executor", + "in": "path", + "description": "ID of script executor to return", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" } } } @@ -4933,24 +5360,22 @@ } } }, - "/processes/import": { + "/script-executors/cancel": { "post": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Import a new process", - "description": "Import the specified process.", - "operationId": "importProcess", + "summary": "Cancel a script executor", + "description": "Cancel a script executor", + "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" + "pidFile": { + "type": "string" } }, "type": "object" @@ -4964,7 +5389,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -4972,34 +5405,43 @@ } } }, - "/processes/{processId}/bpmn": { + "/script-executors/available-languages": { "get": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Returns all available languages", + "description": "Get a list of available languages.", + "operationId": "getAvailableLanguages", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "list of available languages", "content": { "application/json": { "schema": { "properties": { - "url": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableLanguages" + } + }, + "meta": { + "type": "object" } }, "type": "object" @@ -5010,34 +5452,43 @@ } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/security-logs": { + "get": { "tags": [ - "Processes" + "Security Logs" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Returns all security logs", + "description": "Get a list of Security Logs.", + "operationId": "getSecurityLogs", "parameters": [ { - "name": "code", - "in": "path", - "description": "Import code", - "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": "check is import is ready", + "description": "list of security logs", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + }, + "meta": { + "type": "object" } }, "type": "object" @@ -5048,119 +5499,148 @@ } } }, - "/processes/{process_id}/import/assignments": { - "post": { + "/security-logs/{securityLog}": { + "get": { "tags": [ - "Processes" + "Security Logs" ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", + "summary": "Get single security log by ID", + "description": "Display the specified resource.", + "operationId": "getSecurityLog", "parameters": [ { - "name": "process_id", + "name": "securityLog", "in": "path", - "description": "ID of process to return", + "description": "ID of security log to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessAssignments" + "responses": { + "200": { + "description": "Successfully found the security log", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + } + }, + "type": "object" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/process_events/{process_id}": { - "post": { - "tags": [ - "Processes" + "/settings": { + "get": { + "tags": [ + "Settings" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Returns all settings", + "description": "Display a listing of the resource.", + "operationId": "getSettings", "parameters": [ { - "name": "process_id", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/filter" }, { - "name": "event", - "in": "query", - "description": "Node ID of the start event", + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/settings" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings/{setting_id}": { + "put": { + "tags": [ + "Settings" + ], + "summary": "Update a setting", + "description": "Update a setting", + "operationId": "updateSetting", + "parameters": [ + { + "name": "setting_id", + "in": "path", + "description": "ID of setting to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "requestBody": { - "description": "data that will be stored as part of the created request", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/settingsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/requests": { + "/signals": { "get": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Returns all process Requests that the user has access to", + "summary": "Returns all signals", "description": "Display a listing of the resource.", - "operationId": "getProcessesRequests", + "operationId": "getSignals", "parameters": [ - { - "name": "type", - "in": "query", - "description": "Only return requests by type (all|in_progress|completed)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "all", - "in_progress", - "completed", - "started_me" - ] - } - }, { "$ref": "#/components/parameters/filter" }, @@ -5172,14 +5652,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes", + "description": "list of signals", "content": { "application/json": { "schema": { @@ -5187,11 +5664,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/signals" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -5200,61 +5677,84 @@ } } } + }, + "post": { + "tags": [ + "Signals" + ], + "summary": "Creates a new Global Signal", + "description": "Creates a new global signal", + "operationId": "createSignal", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } } }, - "/requests/{process_request_id}": { + "/signals/{signal_id}": { "get": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Get single process request by ID", + "summary": "Get a single signal by ID", "description": "Display the specified resource.", - "operationId": "getProcessRequestById", + "operationId": "getSignalsById", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "signal id", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/signals" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Update a process request", - "description": "Update a request", - "operationId": "updateProcessRequest", + "summary": "Update a signal", + "operationId": "updateSignal", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of signal to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -5263,101 +5763,59 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestEditable" + "$ref": "#/components/schemas/signalsEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } } } }, "delete": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Delete a process request", - "description": "Delete a request", - "operationId": "deleteProcessRequest", + "summary": "Delete a signal", + "operationId": "deleteSignal", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of signal to delete", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" + "description": "success" } } } }, - "/requests/{process_request_id}/events/{event_id}": { - "post": { + "/task_assignments": { + "get": { "tags": [ - "Process Requests" + "Task Assignments" ], - "summary": "Update a process request event", - "description": "Trigger a intermediate catch event", - "operationId": "updateProcessRequestEvent", + "summary": "Returns all task assignments", + "description": "Display a listing of the resource.", + "operationId": "getTaskAssignments", "parameters": [ { - "name": "process_request_id", - "in": "path", - "description": "ID of process request to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event_id", - "in": "path", - "description": "ID of process event to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/requests/{request_id}/files": { - "get": { - "tags": [ - "Request Files" - ], - "summary": "Returns the list of files associated with a request", - "description": "Display a listing of the resource.", - "operationId": "getRequestFiles", - "parameters": [ - { - "$ref": "#/components/parameters/filter" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -5367,20 +5825,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } } ], "responses": { "200": { - "description": "list of files", + "description": "list of task assignments", "content": { "application/json": { "schema": { @@ -5388,16 +5837,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/taskAssignments" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "type": "object" } }, "type": "object" @@ -5409,169 +5853,144 @@ }, "post": { "tags": [ - "Request Files" - ], - "summary": "Save a new media file to a request", - "description": "Store a newly created resource in storage.", - "operationId": "createRequestFile", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Variable name in the request data to use for the file name", - "required": false, - "schema": { - "type": "string" - } - } + "Task Assignments" ], + "summary": "Save a new Task Assignment", + "description": "Store a newly created task assignment in storage.", + "operationId": "createTaskAssignments", "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/taskAssignmentsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - }, - "fileUploadId": { - "type": "integer" - } - }, - "type": "object" + "$ref": "#/components/schemas/taskAssignments" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/requests/{request_id}/files/{file_id}": { - "get": { + "/task_assignments/{task_assignment}": { + "put": { "tags": [ - "Request Files" + "Task Assignments" ], - "summary": "Get a file uploaded to a request", - "description": "Display the specified resource.", - "operationId": "getRequestFilesById", + "summary": "Update a Task Assignment", + "description": "Update a task assignment", + "operationId": "updateTaskAssignments", "parameters": [ { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "file_id", + "name": "task_assignment", "in": "path", - "description": "ID of the file to return", + "description": "ID of task assignment to update", "required": true, "schema": { "type": "integer" } } ], - "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" } } + } + }, + "responses": { + "204": { + "description": "success" }, "404": { "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Request Files" + "Task Assignments" ], - "summary": "Delete all media associated with a request", - "description": "Remove the specified resource from storage.", - "operationId": "deleteRequestFile", + "summary": "Delete a Task Assignment", + "description": "Remove an assignment", + "operationId": "deleteTaskAssignments", "parameters": [ { - "name": "file_id", + "name": "task_assignment", "in": "path", - "description": "ID of the file", + "description": "ID of task assignment to delete", "required": true, "schema": { "type": "integer" } - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, "responses": { - "204": { + "200": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/screen_categories": { + "/tasks": { "get": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Returns all screens categories that the user has access to", - "description": "Display a listing of the Screen Categories.", - "operationId": "getScreenCategories", + "summary": "Returns all tasks that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getTasks", "parameters": [ { - "name": "filter", + "name": "process_request_id", "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "description": "Process request id", + "required": false, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "all_tasks", + "in": "query", + "description": "Return all task types. Not just user tasks.", + "required": false, + "schema": { + "type": "boolean" } }, + { + "$ref": "#/components/parameters/filter" + }, { "$ref": "#/components/parameters/order_by" }, @@ -5579,12 +5998,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of screens categories", + "description": "list of tasks", "content": { "application/json": { "schema": { @@ -5592,11 +6011,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5605,52 +6024,31 @@ } } } - }, - "post": { - "tags": [ - "Screen Categories" - ], - "summary": "Save a new Screen Category", - "description": "Store a newly created Screen Category in storage", - "operationId": "createScreenCategory", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenCategory" - } - } - } - } - } } }, - "/screen_categories/{screen_category_id}": { + "/tasks/{task_id}": { "get": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Get single screen category by ID", - "description": "Display the specified screen category.", - "operationId": "getScreenCategoryById", + "summary": "Get a single task by ID", + "description": "Display the specified resource.", + "operationId": "getTasksById", "parameters": [ { - "name": "screen_category_id", + "name": "task_id", "in": "path", - "description": "ID of screen category to return", + "description": "task id", "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "include", + "in": "query", + "description": "include", + "required": false, "schema": { "type": "string" } @@ -5658,32 +6056,35 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Update a screen Category", + "summary": "Update a task", "description": "Updates the current element", - "operationId": "updateScreenCategory", + "operationId": "updateTask", "parameters": [ { - "name": "screen_category_id", + "name": "task_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of task to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5692,7 +6093,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "required": [ + "status", + "data" + ], + "properties": { + "status": { + "type": "string", + "example": "COMPLETED" + }, + "data": { + "type": "object" + } + }, + "type": "object" } } } @@ -5703,49 +6117,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } } } - } - } - }, - "delete": { - "tags": [ - "Screen Categories" - ], - "summary": "Delete a screen category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScreenCategory", - "parameters": [ - { - "name": "screen_category_id", - "in": "path", - "description": "ID of screen category to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens": { + "/users": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Returns all screens that the user has access to", - "description": "Get a list of Screens.", - "operationId": "getScreens", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "$ref": "#/components/parameters/status" + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5760,9 +6164,9 @@ "$ref": "#/components/parameters/include" }, { - "name": "exclude", + "name": "exclude_ids", "in": "query", - "description": "Comma separated list of fields to exclude from the response", + "description": "Comma separated list of IDs to exclude from the response", "schema": { "type": "string", "default": "" @@ -5771,7 +6175,7 @@ ], "responses": { "200": { - "description": "list of screens", + "description": "list of users", "content": { "application/json": { "schema": { @@ -5779,11 +6183,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5795,17 +6199,17 @@ }, "post": { "tags": [ - "Screens" + "Users" ], - "summary": "Save a new screens", - "description": "Create a new Screen.", - "operationId": "createScreen", + "summary": "Save a new users", + "description": "Store a newly created resource in storage.", + "operationId": "createUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } @@ -5816,61 +6220,119 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens/{screens_id}": { + "/users_task_count": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Get single screens by ID", - "description": "Get a single Screen.", - "operationId": "getScreensById", + "summary": "Returns all users and their total tasks", + "description": "Display a listing of users and their task counts.", + "operationId": "getUsersTaskCount", "parameters": [ { - "name": "screens_id", + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "schema": { + "type": "string" + } + }, + { + "name": "include_ids", + "in": "query", + "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "schema": { + "type": "string", + "default": "" + } + } + ], + "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}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get single user by ID", + "description": "Display the specified resource.", + "operationId": "getUserById", + "parameters": [ + { + "name": "user_id", "in": "path", - "description": "ID of screens to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Update a screen", - "description": "Update a Screen.", - "operationId": "updateScreen", + "summary": "Update a user", + "description": "Update a user", + "operationId": "updateUser", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5879,7 +6341,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } @@ -5887,86 +6349,95 @@ "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Screens" + "Users" ], - "summary": "Delete a screen", - "description": "Delete a Screen.", - "operationId": "deleteScreen", + "summary": "Delete a user", + "description": "Delete a user", + "operationId": "deleteUser", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to delete", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/screens/{screens_id}/draft": { - "put": { + "/users/{user_id}/get_pinned_controls": { + "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Update a draft screen", - "description": "Update a draft Screen.", - "operationId": "updateDraftScreen", - "parameters": [ + "summary": "Get the pinned BPMN elements of a specific user", + "description": "Return the user's pinned nodes.", + "operationId": "getPinnnedControls", + "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return the pinned nodes of", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screensEditable" + "responses": { + "200": { + "description": "Pinned nodes returned succesfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } } } - } - }, - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/screens/{screens_id}/duplicate": { + "/users/{user_id}/update_pinned_controls": { "put": { "tags": [ - "Screens" + "Users" ], - "summary": "duplicate a screen", - "description": "duplicate a Screen.", - "operationId": "duplicateScreen", + "summary": "Update a user's pinned BPMN elements on Modeler", + "description": "Update a user's pinned BPMN elements on Modeler", + "operationId": "updatePinnedControls", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5975,170 +6446,132 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screens" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens/{screensId}/export": { - "post": { + "/users/{user_id}/groups": { + "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Export a single screen by ID", - "description": "Export the specified screen.", - "operationId": "exportScreen", + "summary": "Set the groups a users belongs to", + "description": "Update a user's groups", + "operationId": "updateUserGroups", "parameters": [ { - "name": "screensId", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user", "required": true, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully exported the screen", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screenExported" - } - } + "type": "integer" } } - } - } - }, - "/screens/import": { - "post": { - "tags": [ - "Screens" ], - "summary": "Import a new screen", - "description": "Import the specified screen.", - "operationId": "importScreen", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/updateUserGroups" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/screens/preview": { - "post": { + "/users/restore": { + "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Preview a screen", - "description": "Get preview a screen", - "operationId": "preview", + "summary": "Restore a soft deleted user", + "description": "Reverses the soft delete of a user", + "operationId": "restoreUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "config": { - "type": "object" - }, - "watchers": { - "type": "object" - }, - "computed": { - "type": "object" - }, - "custom_css": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/restoreUser" } } } }, "responses": { "200": { - "description": "Successfully found the screen", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screens" - } - } - } + "description": "success" } } } }, - "/screens/{screen_id}/translate/{language}": { + "/users/get_filter_configuration/{name}": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Translates the screen to the desired language", - "description": "Translates the controls inside a screen", - "operationId": "translateScreen", + "summary": "Get filter configuration by name", + "description": "Get filter configuration.", + "operationId": "getFilterConfiguration", "parameters": [ { - "name": "screen_id", + "name": "name", "in": "path", - "description": "ID of the screen", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/store_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Store filter configuration by name", + "description": "Store filter configuration.", + "operationId": "storeFilterConfiguration", + "parameters": [ { - "name": "language", + "name": "name", "in": "path", - "description": "Language used for the translation of the string", "required": true, "schema": { "type": "string" @@ -6147,48 +6580,46 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/script_categories": { + "/users/{user_id}/tokens": { "get": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Returns all scripts categories that the user has access to", - "description": "Display a listing of the Script Categories.", - "operationId": "getScriptCategories", + "summary": "Display listing of access tokens for the specified user.", + "description": "Display listing of access tokens for the specified user.", + "operationId": "getTokens", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, "schema": { - "type": "string" + "type": "integer" } }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, { "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of scripts categories", + "description": "List of tokens.", "content": { "application/json": { "schema": { @@ -6196,11 +6627,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6212,28 +6643,44 @@ }, "post": { "tags": [ - "Script Categories" + "Personal Tokens" + ], + "summary": "Create new token for a specific user", + "description": "Create a new personal access token for the user.", + "operationId": "createTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + } ], - "summary": "Save a new Script Category", - "description": "Store a newly created Script Category in storage", - "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" } } } }, "responses": { "201": { - "description": "success", + "description": "New token instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } } } @@ -6241,19 +6688,28 @@ } } }, - "/script_categories/{script_category_id}": { + "/users/{user_id}/tokens/{token_id}": { "get": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Get single script category by ID", - "description": "Display the specified script category.", - "operationId": "getScriptCategoryById", + "summary": "Get single token by ID", + "description": "Show a personal access token for the user", + "operationId": "getTokenById", "parameters": [ { - "name": "script_category_id", + "name": "user_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "ID of token to return", "required": true, "schema": { "type": "string" @@ -6262,91 +6718,130 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "Successfully found the token", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } } } } } }, - "put": { + "delete": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Update a script Category", - "description": "Updates the current element", - "operationId": "updateScriptCategory", + "summary": "Delete a token", + "description": "Delete the given token for a user", + "operationId": "deleteToken", "parameters": [ { - "name": "script_category_id", + "name": "user_id", "in": "path", - "description": "ID of script category to return", + "description": "User ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "Token ID", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" - } - } - } - }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } + "204": { + "description": "success" } } - }, - "delete": { + } + }, + "/processes/variables": { + "get": { "tags": [ - "Script Categories" + "Processes Variables" ], - "summary": "Delete a script category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScriptCategory", + "summary": "Get variables for multiple processes with pagination", + "operationId": "getProcessesVariables", "parameters": [ { - "name": "script_category_id", - "in": "path", - "description": "ID of script category to return", - "required": true, + "name": "processIds", + "in": "query", + "description": "Comma-separated list of process IDs", + "required": false, "schema": { - "type": "string" + "type": "string", + "example": "1,2,3", + "nullable": true + } + }, + { + "name": "page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "in": "query", + "description": "Items per page", + "required": false, + "schema": { + "type": "integer", + "default": 20 } } ], "responses": { - "204": { - "description": "success" + "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": [ + { + "url": "https://pm4.local:8092/api/1.1", + "description": "API v1.1 Server" + } + ] } }, - "/scripts": { + "/analytics-reporting": { "get": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Returns all scripts that the user has access to", - "description": "Get a list of scripts in a process.", - "operationId": "getScripts", + "summary": "Returns all analytics reporting that the user has access to", + "description": "Get a list of Analytics Reporting.", + "operationId": "getAnalyticsReporting", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -6366,7 +6861,7 @@ ], "responses": { "200": { - "description": "list of scripts", + "description": "list of analytics reporting", "content": { "application/json": { "schema": { @@ -6374,11 +6869,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/analyticsReporting" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6390,17 +6885,17 @@ }, "post": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Save a new script", - "description": "Create a new script in a process.", - "operationId": "createScript", + "summary": "Save a new Analytics Reporting", + "description": "Create a new Analytics Reporting.", + "operationId": "createAnalyticsReporting", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } @@ -6411,7 +6906,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/analyticsReporting" } } } @@ -6419,161 +6914,190 @@ } } }, - "/scripts/{script_id}/preview": { - "post": { + "/analytics-reporting/{analytic_reporting_id}": { + "get": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Test script code without saving it", - "description": "Previews executing a script, with sample data/config data", - "operationId": "previewScript", + "summary": "Get single analytic reporting by ID", + "description": "Get a single Analytic Reporting.", + "operationId": "getAnalyticReportingById", "parameters": [ { - "name": "script_id", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "code": { - "type": "string" - }, - "nonce": { - "type": "string" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success if the script was queued" + "description": "Successfully found the analytics reporting", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } } } - } - }, - "/scripts/execute/{script_id}": { - "post": { + }, + "put": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Execute script", - "description": "Executes a script, with sample data/config data", - "operationId": "executeScript", + "summary": "Update a analytic reporting", + "description": "Update a Analytics Reporting.", + "operationId": "updateAnalyticReporting", "parameters": [ { - "name": "script_id", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "sync": { - "type": "boolean" - } - }, - "type": "object" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } }, "responses": { - "200": { - "description": "success if the script was queued", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsPreview" - } - } - } + "204": { + "description": "success" } } - } - }, - "/scripts/execution/{key}": { - "get": { + }, + "delete": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Get the response of a script execution by execution key", - "description": "Get the response of a script execution", - "operationId": "getScriptExecutionResponse", + "summary": "Delete an analytic reporting", + "description": "Delete a Analytics Reporting.", + "operationId": "deleteAnalyticReporting", "parameters": [ { - "name": "key", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to return", "required": true, "schema": { "type": "string" } } ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/collections": { + "get": { + "tags": [ + "Collections" + ], + "summary": "Returns all collections that the user has access to", + "description": "Get a list of Collections.", + "operationId": "getCollections", + "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": "response of a script execution", + "description": "list of collections", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/collections" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Collections" + ], + "summary": "Save a new collections", + "description": "Create a new Collection.", + "operationId": "createCollection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collections" + } } } } } } }, - "/scripts/{script_id}": { + "/collections/{collection_id}": { "get": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Get single script by ID", - "description": "Get a single script in a process.", - "operationId": "getScriptsById", + "summary": "Get single collections by ID", + "description": "Get a single Collection.", + "operationId": "getCollectionById", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to return", "required": true, "schema": { "type": "string" @@ -6582,11 +7106,11 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "Successfully found the collections", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/collections" } } } @@ -6595,16 +7119,16 @@ }, "put": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Update a script", - "description": "Update a script in a process.", - "operationId": "updateScript", + "summary": "Update a collection", + "description": "Update a Collection.", + "operationId": "updateCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to update", "required": true, "schema": { "type": "string" @@ -6616,7 +7140,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/collectionsEditable" } } } @@ -6629,16 +7153,16 @@ }, "delete": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Delete a script", - "description": "Delete a script in a process.", - "operationId": "deleteScript", + "summary": "Delete a collection", + "description": "Delete a Collection.", + "operationId": "deleteCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to return", "required": true, "schema": { "type": "string" @@ -6652,67 +7176,56 @@ } } }, - "/scripts/{script_id}/draft": { - "put": { + "/collections/{collection_id}/export": { + "post": { "tags": [ - "Scripts" + "Screens" ], - "summary": "Update a draft script", - "description": "Update a draft script.", - "operationId": "updateDraftScript", + "summary": "Trigger export collections job", + "description": "Export the specified collection.", + "operationId": "exportCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the collection to export", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, "responses": { - "204": { + "202": { "description": "success" } } } }, - "/scripts/{scripts_id}/duplicate": { - "put": { + "/collections/import": { + "post": { "tags": [ - "Scripts" - ], - "summary": "duplicate a script", - "description": "Duplicate a Script.", - "operationId": "duplicateScript", - "parameters": [ - { - "name": "scripts_id", - "in": "path", - "description": "ID of script to return", - "required": true, - "schema": { - "type": "string" - } - } + "Collections" ], + "summary": "Import a new collection", + "description": "Import the specified collection.", + "operationId": "importCollection", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "required": [ + "file" + ], + "properties": { + "file": { + "description": "file to upload", + "type": "file", + "format": "file" + } + }, + "type": "object" } } } @@ -6723,23 +7236,71 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/collections" } } } - } - } + }, + "200": { + "description": "success" + } + } } }, - "/script-executors": { + "/collections/{collection_id}/truncate": { + "delete": { + "tags": [ + "Collections" + ], + "summary": "Deletes all records in a collection", + "description": "Truncate a Collection.", + "operationId": "truncateCollection", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of collection to truncate", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/collections/{collection_id}/records": { "get": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Returns all script executors that the user has access to", - "description": "Get a list of script executors.", - "operationId": "getScriptExecutors", + "summary": "Returns all records", + "description": "Get the list of records of a collection.", + "operationId": "getRecords", "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of collection to get records for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pmql", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/per_page" + }, { "$ref": "#/components/parameters/filter" }, @@ -6750,12 +7311,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of script executors", + "description": "list of records of a collection", "content": { "application/json": { "schema": { @@ -6763,11 +7324,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scriptExecutors" + "$ref": "#/components/schemas/records" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6779,36 +7340,39 @@ }, "post": { "tags": [ - "Rebuild Script Executors" + "Collections" + ], + "summary": "Save a new record in a collection", + "description": "Create a new record in a Collection.", + "operationId": "createRecord", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of the collection", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Create a script executor", - "description": "Create a script executor", - "operationId": "createScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" + "$ref": "#/components/schemas/recordsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/records" } } } @@ -6816,279 +7380,185 @@ } } }, - "/script-executors/{script_executor}": { - "put": { + "/collections/{collection_id}/records/{record_id}": { + "get": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Update script executor", - "description": "Update and rebuild the script executor", - "operationId": "updateScriptExecutor", + "summary": "Get single record of a collection", + "description": "Get a single record of a Collection.", + "operationId": "getRecordById", "parameters": [ { - "name": "script_executor", + "name": "collection_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of the collection", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" - } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record to return", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { - "description": "success", + "description": "Successfully found the record", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/records" } } } } } }, - "delete": { + "put": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Delete a script executor", - "description": "Delete a script executor", - "operationId": "deleteScriptExecutor", + "summary": "Update a record", + "description": "Update a record in a Collection.", + "operationId": "updateRecord", "parameters": [ { - "name": "script_executor", + "name": "collection_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of collection", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" - } - } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record ", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/script-executors/cancel": { - "post": { - "tags": [ - "Rebuild Script Executors" ], - "summary": "Cancel a script executor", - "description": "Cancel a script executor", - "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "pidFile": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/recordsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } - } - }, - "/script-executors/available-languages": { - "get": { + }, + "delete": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Returns all available languages", - "description": "Get a list of available languages.", - "operationId": "getAvailableLanguages", + "summary": "Delete a collection record", + "description": "Delete a record of a Collection.", + "operationId": "deleteRecord", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" + "name": "collection_id", + "in": "path", + "description": "ID of collection", + "required": true, + "schema": { + "type": "string" + } }, { - "$ref": "#/components/parameters/per_page" + "name": "record_id", + "in": "path", + "description": "ID of record in collection", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "list of available languages", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/availableLanguages" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } - } - }, - "/security-logs": { - "get": { + }, + "patch": { "tags": [ - "Security Logs" + "Collections" ], - "summary": "Returns all security logs", - "description": "Get a list of Security Logs.", - "operationId": "getSecurityLogs", + "summary": "Partial update of a record", + "description": "Implements a partial update of a record in a Collection.", + "operationId": "patchRecord", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of security logs", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } + "name": "collection_id", + "in": "path", + "description": "ID of collection ", + "required": true, + "schema": { + "type": "string" } - } - } - } - }, - "/security-logs/{securityLog}": { - "get": { - "tags": [ - "Security Logs" - ], - "summary": "Get single security log by ID", - "description": "Display the specified resource.", - "operationId": "getSecurityLog", - "parameters": [ + }, { - "name": "securityLog", + "name": "record_id", "in": "path", - "description": "ID of security log to return", + "description": "ID of the record ", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "Successfully found the security log", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" } } } + }, + "responses": { + "200": { + "description": "success" + } } } }, - "/settings": { + "/comments/tasks": { "get": { "tags": [ - "Settings" + "Comments" ], - "summary": "Returns all settings", + "summary": "Returns all the tasks that are active.", "description": "Display a listing of the resource.", - "operationId": "getSettings", + "operationId": "getCommentTasks", "parameters": [ + { + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, + "schema": { + "type": "integer" + } + }, { "$ref": "#/components/parameters/filter" }, @@ -7097,17 +7567,11 @@ }, { "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of settings", + "description": "list all tasks taht are active", "content": { "application/json": { "schema": { @@ -7115,7 +7579,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/settings" + "$ref": "#/components/schemas/processRequestToken" } }, "meta": { @@ -7130,56 +7594,14 @@ } } }, - "/settings/{setting_id}": { - "put": { - "tags": [ - "Settings" - ], - "summary": "Update a setting", - "description": "Update a setting", - "operationId": "updateSetting", - "parameters": [ - { - "name": "setting_id", - "in": "path", - "description": "ID of setting to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/settingsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/signals": { + "/data_source_categories": { "get": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Returns all signals", - "description": "Display a listing of the resource.", - "operationId": "getSignals", + "summary": "Returns all Data Connectors categories that the user has access to", + "description": "Display a listing of the Data Connector Categories.", + "operationId": "getDataSourceCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -7196,7 +7618,7 @@ ], "responses": { "200": { - "description": "list of signals", + "description": "list of Data Connectors categories", "content": { "application/json": { "schema": { @@ -7204,11 +7626,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7220,17 +7647,17 @@ }, "post": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Creates a new Global Signal", - "description": "Creates a new global signal", - "operationId": "createSignal", + "summary": "Save a new Data Connector Category", + "description": "Store a newly created Data Connector Category in storage", + "operationId": "createDataSourceCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -7241,7 +7668,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7249,19 +7676,19 @@ } } }, - "/signals/{signal_id}": { + "/data_source_categories/{data_source_category_id}": { "get": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Get a single signal by ID", - "description": "Display the specified resource.", - "operationId": "getSignalsById", + "summary": "Get single Data Connector category by ID", + "description": "Display the specified data Source category.", + "operationId": "getDatasourceCategoryById", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "signal id", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7270,11 +7697,11 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7283,15 +7710,16 @@ }, "put": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Update a signal", - "operationId": "updateSignal", + "summary": "Update a Data Connector Category", + "description": "Updates the current element", + "operationId": "updateDatasourceCategory", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of signal to update", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7303,7 +7731,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -7314,7 +7742,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7323,15 +7751,16 @@ }, "delete": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Delete a signal", - "operationId": "deleteSignal", + "summary": "Delete a Data Connector category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDataSourceCategory", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of signal to delete", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7345,14 +7774,14 @@ } } }, - "/task_assignments": { + "/data_sources": { "get": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Returns all task assignments", - "description": "Display a listing of the resource.", - "operationId": "getTaskAssignments", + "summary": "Returns all Data Connectors that the user has access to", + "description": "Get the list of records of a Data Connector", + "operationId": "getDataSources", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -7365,11 +7794,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of task assignments", + "description": "list of Data Connectors", "content": { "application/json": { "schema": { @@ -7377,11 +7809,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/dataSource" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7393,17 +7830,17 @@ }, "post": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Save a new Task Assignment", - "description": "Store a newly created task assignment in storage.", - "operationId": "createTaskAssignments", + "summary": "Save a new Data Connector", + "description": "Create a new Data Connector.", + "operationId": "createDataSource", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } @@ -7414,73 +7851,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/dataSource" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/task_assignments/{task_assignment}": { - "put": { + "/data_sources/{data_source_id}": { + "get": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Update a Task Assignment", - "description": "Update a task assignment", - "operationId": "updateTaskAssignments", + "summary": "Get single Data Connector by ID", + "description": "Get a single Data Connector.", + "operationId": "getDataSourceById", "parameters": [ { - "name": "task_assignment", + "name": "data_source_id", "in": "path", - "description": "ID of task assignment to update", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "responses": { + "200": { + "description": "Successfully found the Data Connector", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSource" + } } } } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } } }, - "delete": { + "put": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Delete a Task Assignment", - "description": "Remove an assignment", - "operationId": "deleteTaskAssignments", + "summary": "Update a Data Connector", + "description": "Update a Data Connector.", + "operationId": "updateDataSource", "parameters": [ { - "name": "task_assignment", + "name": "data_source_id", "in": "path", - "description": "ID of task assignment to delete", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7489,142 +7914,72 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/tasks": { - "get": { - "tags": [ - "Tasks" - ], - "summary": "Returns all tasks that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getTasks", - "parameters": [ - { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "all_tasks", - "in": "query", - "description": "Return all task types. Not just user tasks.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "list of tasks", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/processRequestToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/tasks/{task_id}": { - "get": { + }, + "delete": { "tags": [ - "Tasks" + "DataSources" ], - "summary": "Get a single task by ID", - "description": "Display the specified resource.", - "operationId": "getTasksById", + "summary": "Delete a Data Connector", + "description": "Delete a Data Connector.", + "operationId": "deleteDataSource", "parameters": [ { - "name": "task_id", + "name": "data_source_id", "in": "path", - "description": "task id", + "description": "ID of Data Connector to return", "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "include", - "in": "query", - "description": "include", - "required": false, "schema": { "type": "string" } } ], "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/dataSource" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "put": { + } + }, + "/data_sources/{data_source_id}/test": { + "post": { "tags": [ - "Tasks" + "DataSources" ], - "summary": "Update a task", - "description": "Updates the current element", - "operationId": "updateTask", + "summary": "Send a Data Connector request", + "description": "Send a Data Connector request.", + "operationId": "sendDataSource", "parameters": [ { - "name": "task_id", + "name": "data_source_id", "in": "path", - "description": "ID of task to update", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7633,174 +7988,201 @@ "content": { "application/json": { "schema": { - "required": [ - "status", - "data" - ], - "properties": { - "status": { - "type": "string", - "example": "COMPLETED" - }, - "data": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/dataSource" } } } - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users": { - "get": { + "/requests/{request_id}/data_sources/{data_source_id}": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getUsers", + "summary": "execute Data Source", + "description": "Execute a data Source endpoint", + "operationId": "executeDataSourceForRequest", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "name": "request_id", + "in": "path", + "description": "ID of the request in whose context the datasource will be executed", + "required": true, "schema": { "type": "string" } }, { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "exclude_ids", - "in": "query", - "description": "Comma separated list of IDs to exclude from the response", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { - "type": "string", - "default": "" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "list of users", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } } } - }, + } + }, + "/requests/data_sources/{data_source_id}": { "post": { "tags": [ - "Users" + "DataSources" + ], + "summary": "execute Data Source", + "operationId": "executeDataSource", + "parameters": [ + { + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Save a new users", - "description": "Store a newly created resource in storage.", - "operationId": "createUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + }, + "data": { + "type": "object" + } + }, + "type": "object" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/DataSourceResponse" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users_task_count": { - "get": { + "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users and their total tasks", - "description": "Display a listing of users and their task counts.", - "operationId": "getUsersTaskCount", + "summary": "Get Data from Data Source", + "operationId": "getDataFromDataSource", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { "type": "string" } }, { - "name": "include_ids", - "in": "query", - "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "name": "endpoint", + "in": "path", + "description": "Endpoint of the data source", + "required": true, "schema": { - "type": "string", - "default": "" + "type": "string" } } ], "responses": { "200": { - "description": "List of users with task counts", + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceResponse" + } + } + } + } + } + } + }, + "/version_histories": { + "get": { + "tags": [ + "Version History" + ], + "summary": "Return all version History according to the model", + "description": "Get the list of records of Version History", + "operationId": "getVersionHistories", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of Version History", "content": { "application/json": { "schema": { @@ -7808,11 +8190,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7821,58 +8208,85 @@ } } } + }, + "post": { + "tags": [ + "Version History" + ], + "summary": "Save a new Version History", + "description": "Create a new Version History.", + "operationId": "createVersion", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } + } + } } }, - "/users/{user_id}": { + "/version_histories/{version_history_id}": { "get": { "tags": [ - "Users" + "Version History" ], - "summary": "Get single user by ID", - "description": "Display the specified resource.", - "operationId": "getUserById", + "summary": "Get single Version History by ID", + "description": "Get a single Version History.", + "operationId": "getVersionHistoryById", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the Version History", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Users" + "Version History" ], - "summary": "Update a user", - "description": "Update a user", - "operationId": "updateUser", + "summary": "Update a Version History", + "description": "Update a Version History.", + "operationId": "updateVersion", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7881,797 +8295,99 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete a user", - "description": "Delete a user", - "operationId": "deleteUser", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to delete", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/get_pinned_controls": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get the pinned BPMN elements of a specific user", - "description": "Return the user's pinned nodes.", - "operationId": "getPinnnedControls", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to return the pinned nodes of", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Pinned nodes returned succesfully", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - } - }, - "/users/{user_id}/update_pinned_controls": { - "put": { + }, + "delete": { "tags": [ - "Users" + "Version History" ], - "summary": "Update a user's pinned BPMN elements on Modeler", - "description": "Update a user's pinned BPMN elements on Modeler", - "operationId": "updatePinnedControls", + "summary": "Delete a Version History", + "description": "Delete a Version History.", + "operationId": "deleteVersion", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/usersEditable" - } - } - } - }, "responses": { "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/users/{user_id}/groups": { - "put": { - "tags": [ - "Users" - ], - "summary": "Set the groups a users belongs to", - "description": "Update a user's groups", - "operationId": "updateUserGroups", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/updateUserGroups" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/users/restore": { - "put": { + "/version_histories/clone": { + "post": { "tags": [ - "Users" + "Version History" ], - "summary": "Restore a soft deleted user", - "description": "Reverses the soft delete of a user", - "operationId": "restoreUser", + "summary": "Clone a new Version History", + "description": "Clone a new Version History.", + "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/restoreUser" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/users/get_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get filter configuration by name", - "description": "Get filter configuration.", - "operationId": "getFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/store_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Store filter configuration by name", - "description": "Store filter configuration.", - "operationId": "storeFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } - }, - "/users/{user_id}/tokens": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Display listing of access tokens for the specified user.", - "description": "Display listing of access tokens for the specified user.", - "operationId": "getTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "List of tokens.", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } - } - } - }, - "post": { - "tags": [ - "Personal Tokens" - ], - "summary": "Create new token for a specific user", - "description": "Create a new personal access token for the user.", - "operationId": "createTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "201": { - "description": "New token instance", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" - } - } - } - } - } - } - }, - "/users/{user_id}/tokens/{token_id}": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Get single token by ID", - "description": "Show a personal access token for the user", - "operationId": "getTokenById", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", - "in": "path", - "description": "ID of token to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Personal Tokens" - ], - "summary": "Delete a token", - "description": "Delete the given token for a user", - "operationId": "deleteToken", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User ID", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", - "in": "path", - "description": "Token ID", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/processes/variables": { - "get": { - "tags": [ - "Processes Variables" - ], - "summary": "Get variables for multiple processes with pagination", - "operationId": "660c9459febd17c58400be4b4d49a152", - "parameters": [ - { - "name": "processIds", - "in": "query", - "description": "Comma-separated list of process IDs", - "required": false, - "schema": { - "type": "string", - "example": "1,2,3", - "nullable": true - } - }, - { - "name": "page", - "in": "query", - "description": "Page number", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "per_page", - "in": "query", - "description": "Items per page", - "required": false, - "schema": { - "type": "integer", - "default": 20 - } - } - ], - "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": [ - { - "url": "https://nolans-laptop.tail0babd.ts.net/api/1.1", - "description": "API v1.1 Server" - } - ] - } } }, "components": { "schemas": { "DateTime": { - "properties": { - "date": { - "type": "string" - } - }, - "type": "object" - }, - "analyticsReportingEditable": { - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "link": { - "type": "string" - } - }, - "type": "object" - }, - "analyticsReporting": { - "allOf": [ - { - "$ref": "#/components/schemas/analyticsReportingEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_by_id": { - "type": "string", - "format": "id" - }, - "updated_by_id": { - "type": "string", - "format": "id" - } - }, - "type": "object" - } - ] - }, - "collectionsEditable": { - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "custom_title": { - "type": "string" - }, - "create_screen_id": { - "type": "string", - "format": "id" - }, - "read_screen_id": { - "type": "string", - "format": "id" - }, - "update_screen_id": { - "type": "string", - "format": "id" - }, - "signal_create": { - "type": "boolean" - }, - "signal_update": { - "type": "boolean" - }, - "signal_delete": { - "type": "boolean" - } - }, - "type": "object" - }, - "collections": { - "allOf": [ - { - "$ref": "#/components/schemas/collectionsEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_by_id": { - "type": "string", - "format": "id" - }, - "updated_by_id": { - "type": "string", - "format": "id" - }, - "columns": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "type": "object" - } - ] - }, - "recordsEditable": { - "properties": { - "data": { - "type": "object" - } - }, - "type": "object" - }, - "records": { - "allOf": [ - { - "$ref": "#/components/schemas/recordsEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "collection_id": { - "type": "string", - "format": "id" - } - }, - "type": "object" - } - ] - }, - "DataSourceCallParameters": { - "properties": { - "endpoint": { - "type": "string" - }, - "dataMapping": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - } - }, - "outboundConfig": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "type": "object" - }, - "DataSourceResponse": { - "properties": { - "status": { - "type": "integer" - }, - "response": { - "type": "object" - } - }, - "type": "object" - }, - "dataSourceEditable": { - "properties": { - "id": { - "description": "Class DataSource", - "type": "string", - "format": "id" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "endpoints": { - "type": "string" - }, - "mappings": { - "type": "string" - }, - "authtype": { - "type": "string" - }, - "credentials": { - "type": "string" - }, - "status": { - "type": "string" - }, - "data_source_category_id": { - "type": "string" - } - }, - "type": "object" - }, - "dataSource": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/dataSourceEditable" - }, - { - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, - "dataSourceCategoryEditable": { - "properties": { - "name": { - "description": "Represents a business data Source category definition.", + "properties": { + "date": { "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] } }, "type": "object" }, - "DataSourceCategory": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/dataSourceCategoryEditable" - }, - { - "properties": { - "id": { - "type": "string", - "format": "id" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, "decisionTableEditable": { "properties": { "id": { @@ -8958,55 +8674,6 @@ } ] }, - "versionHistoryEditable": { - "properties": { - "versionable_id": { - "description": "Class VersionHistoryCollection", - "type": "integer" - }, - "versionable_type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "description": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] - } - }, - "type": "object" - }, - "versionHistory": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/versionHistoryEditable" - }, - { - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, "updateUserGroups": { "properties": { "groups": { @@ -10649,61 +10316,235 @@ "user_id": { "type": "integer" }, - "occured_at": { + "occured_at": { + "type": "string" + } + }, + "type": "object" + }, + "settingsEditable": { + "properties": { + "key": { + "description": "Class Settings", + "type": "string" + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "name": { + "type": "string" + }, + "helper": { + "type": "string" + }, + "group": { + "type": "string" + }, + "format": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "readonly": { + "type": "boolean" + }, + "variables": { + "type": "string" + }, + "sansSerifFont": { + "type": "string" + } + }, + "type": "object" + }, + "settings": { + "allOf": [ + { + "$ref": "#/components/schemas/settingsEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "TokenClient": { + "properties": { + "id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "redirect": { + "type": "string" + }, + "personal_access_client": { + "type": "boolean" + }, + "password_client": { + "type": "boolean" + }, + "revoked": { + "type": "boolean" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + "usersEditable": { + "properties": { + "email": { + "description": "The attributes that are mass assignable.", + "type": "string", + "format": "email" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "address": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postal": { + "type": "string" + }, + "country": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "fax": { + "type": "string" + }, + "cell": { + "type": "string" + }, + "title": { + "type": "string" + }, + "timezone": { + "type": "string" + }, + "datetime_format": { + "type": "string" + }, + "language": { + "type": "string" + }, + "is_administrator": { + "type": "boolean" + }, + "expires_at": { + "type": "string" + }, + "loggedin_at": { + "type": "string" + }, + "remember_token": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE", + "SCHEDULED", + "OUT_OF_OFFICE", + "BLOCKED" + ] + }, + "fullname": { "type": "string" - } - }, - "type": "object" - }, - "settingsEditable": { - "properties": { - "key": { - "description": "Class Settings", + }, + "avatar": { "type": "string" }, - "config": { + "media": { "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/media" } }, - "name": { - "type": "string" + "birthdate": { + "type": "string", + "format": "date" }, - "helper": { - "type": "string" + "delegation_user_id": { + "type": "string", + "format": "id" }, - "group": { - "type": "string" + "manager_id": { + "type": "string", + "format": "id" }, - "format": { - "type": "string" + "meta": { + "type": "object", + "additionalProperties": true }, - "hidden": { + "force_change_password": { "type": "boolean" }, - "readonly": { + "email_task_notification": { "type": "boolean" - }, - "variables": { - "type": "string" - }, - "sansSerifFont": { - "type": "string" } }, "type": "object" }, - "settings": { + "users": { "allOf": [ { - "$ref": "#/components/schemas/settingsEditable" + "$ref": "#/components/schemas/usersEditable" }, { "properties": { "id": { - "type": "string", - "format": "id" + "type": "integer" }, "created_at": { "type": "string", @@ -10712,38 +10553,39 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" } }, "type": "object" } ] }, - "TokenClient": { + "UserToken": { "properties": { "id": { - "type": "integer" + "type": "string" }, "user_id": { "type": "integer" }, - "name": { - "type": "string" - }, - "provider": { - "type": "string" + "client_id": { + "type": "integer" }, - "redirect": { + "name": { "type": "string" }, - "personal_access_client": { - "type": "boolean" - }, - "password_client": { - "type": "boolean" + "scopes": { + "type": "object" }, "revoked": { "type": "boolean" }, + "client": { + "$ref": "#/components/schemas/TokenClient" + }, "created_at": { "type": "string", "format": "date-time" @@ -10751,133 +10593,287 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" } }, "type": "object" }, - "usersEditable": { + "analyticsReportingEditable": { "properties": { - "email": { - "description": "The attributes that are mass assignable.", - "type": "string", - "format": "email" - }, - "firstname": { + "name": { "type": "string" }, - "lastname": { + "description": { "type": "string" }, - "username": { + "link": { "type": "string" + } + }, + "type": "object" + }, + "analyticsReporting": { + "allOf": [ + { + "$ref": "#/components/schemas/analyticsReportingEditable" }, - "password": { + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "collectionsEditable": { + "properties": { + "name": { "type": "string" }, - "address": { + "description": { "type": "string" }, - "city": { + "custom_title": { "type": "string" }, - "state": { - "type": "string" + "create_screen_id": { + "type": "string", + "format": "id" }, - "postal": { + "read_screen_id": { + "type": "string", + "format": "id" + }, + "update_screen_id": { + "type": "string", + "format": "id" + }, + "signal_create": { + "type": "boolean" + }, + "signal_update": { + "type": "boolean" + }, + "signal_delete": { + "type": "boolean" + } + }, + "type": "object" + }, + "collections": { + "allOf": [ + { + "$ref": "#/components/schemas/collectionsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + }, + "columns": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + ] + }, + "recordsEditable": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "records": { + "allOf": [ + { + "$ref": "#/components/schemas/recordsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "collection_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "DataSourceCallParameters": { + "properties": { + "endpoint": { "type": "string" }, - "country": { - "type": "string" + "dataMapping": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "outboundConfig": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "DataSourceResponse": { + "properties": { + "status": { + "type": "integer" }, - "phone": { - "type": "string" + "response": { + "type": "object" + } + }, + "type": "object" + }, + "dataSourceEditable": { + "properties": { + "id": { + "description": "Class DataSource", + "type": "string", + "format": "id" }, - "fax": { + "name": { "type": "string" }, - "cell": { + "description": { "type": "string" }, - "title": { + "endpoints": { "type": "string" }, - "timezone": { + "mappings": { "type": "string" }, - "datetime_format": { + "authtype": { "type": "string" }, - "language": { + "credentials": { "type": "string" }, - "is_administrator": { - "type": "boolean" - }, - "expires_at": { + "status": { "type": "string" }, - "loggedin_at": { + "data_source_category_id": { "type": "string" + } + }, + "type": "object" + }, + "dataSource": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceEditable" }, - "remember_token": { + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "dataSourceCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business data Source category definition.", "type": "string" }, "status": { "type": "string", "enum": [ "ACTIVE", - "INACTIVE", - "SCHEDULED", - "OUT_OF_OFFICE", - "BLOCKED" + "INACTIVE" ] - }, - "fullname": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "media": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "birthdate": { - "type": "string", - "format": "date" - }, - "delegation_user_id": { - "type": "string", - "format": "id" - }, - "manager_id": { - "type": "string", - "format": "id" - }, - "meta": { - "type": "object", - "additionalProperties": true - }, - "force_change_password": { - "type": "boolean" - }, - "email_task_notification": { - "type": "boolean" } }, "type": "object" }, - "users": { + "DataSourceCategory": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" }, { "properties": { "id": { - "type": "integer" + "type": "string", + "format": "id" }, "created_at": { "type": "string", @@ -10886,53 +10882,60 @@ "updated_at": { "type": "string", "format": "date-time" - }, - "deleted_at": { - "type": "string", - "format": "date-time" } }, "type": "object" } ] }, - "UserToken": { + "versionHistoryEditable": { "properties": { - "id": { - "type": "string" - }, - "user_id": { + "versionable_id": { + "description": "Class VersionHistoryCollection", "type": "integer" }, - "client_id": { - "type": "integer" + "versionable_type": { + "type": "string" }, "name": { "type": "string" }, - "scopes": { - "type": "object" - }, - "revoked": { - "type": "boolean" - }, - "client": { - "$ref": "#/components/schemas/TokenClient" - }, - "created_at": { - "type": "string", - "format": "date-time" + "subject": { + "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "description": { + "type": "string" }, - "expires_at": { + "status": { "type": "string", - "format": "date-time" + "enum": [ + "ACTIVE", + "INACTIVE" + ] } }, "type": "object" + }, + "versionHistory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/versionHistoryEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] } }, "responses": { @@ -11049,6 +11052,14 @@ "type": "string", "default": "" } + }, + "pmql": { + "name": "pmql", + "in": "query", + "description": "PMQL query to filter results", + "schema": { + "type": "string" + } } }, "securitySchemes": { @@ -11057,9 +11068,9 @@ "description": "Laravel passport oauth2 security.", "flows": { "authorizationCode": { - "authorizationUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/authorize", - "tokenUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/token", - "refreshUrl": "https://nolans-laptop.tail0babd.ts.net/token/refresh", + "authorizationUrl": "https://pm4.local:8092/oauth/authorize", + "tokenUrl": "https://pm4.local:8092/oauth/token", + "refreshUrl": "https://pm4.local:8092/token/refresh", "scopes": {} } } @@ -11072,30 +11083,6 @@ } }, "tags": [ - { - "name": "AnalyticsReporting", - "description": "AnalyticsReporting" - }, - { - "name": "Collections", - "description": "Collections" - }, - { - "name": "Screens", - "description": "Screens" - }, - { - "name": "Comments", - "description": "Comments" - }, - { - "name": "DataSourcesCategories", - "description": "DataSourcesCategories" - }, - { - "name": "DataSources", - "description": "DataSources" - }, { "name": "DecisionTableCategories", "description": "DecisionTableCategories" @@ -11124,10 +11111,6 @@ "name": "Groups", "description": "Groups" }, - { - "name": "Version History", - "description": "Version History" - }, { "name": "CssSettings", "description": "CssSettings" @@ -11172,6 +11155,10 @@ "name": "Screen Categories", "description": "Screen Categories" }, + { + "name": "Screens", + "description": "Screens" + }, { "name": "Script Categories", "description": "Script Categories" @@ -11211,6 +11198,30 @@ { "name": "Processes Variables", "description": "Processes Variables" + }, + { + "name": "AnalyticsReporting", + "description": "AnalyticsReporting" + }, + { + "name": "Collections", + "description": "Collections" + }, + { + "name": "Comments", + "description": "Comments" + }, + { + "name": "DataSourcesCategories", + "description": "DataSourcesCategories" + }, + { + "name": "DataSources", + "description": "DataSources" + }, + { + "name": "Version History", + "description": "Version History" } ], "security": [ From dfd302142d724cf8663d691a026db38cdd767d2f Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 22 Apr 2025 10:30:10 -0400 Subject: [PATCH 06/53] Add missing page and per_page parameters to documentation --- ProcessMaker/Http/Controllers/Api/OpenApiSpec.php | 6 ++++++ ProcessMaker/Http/Controllers/Api/TaskController.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index 2dd79a6baa..cd6aa847cf 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -44,6 +44,12 @@ * @OA\Schema(type="string", enum={"asc", "desc"}, default="asc"), * ), * @OA\Parameter( + * parameter="page", + * name="page", + * in="query", + * @OA\Schema(type="integer", default="1"), + * ), + * @OA\Parameter( * parameter="per_page", * name="per_page", * in="query", diff --git a/ProcessMaker/Http/Controllers/Api/TaskController.php b/ProcessMaker/Http/Controllers/Api/TaskController.php index 2d691af0ee..22453a6808 100644 --- a/ProcessMaker/Http/Controllers/Api/TaskController.php +++ b/ProcessMaker/Http/Controllers/Api/TaskController.php @@ -104,6 +104,8 @@ class TaskController extends Controller * @OA\Parameter(ref="#/components/parameters/order_by"), * @OA\Parameter(ref="#/components/parameters/order_direction"), * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter(ref="#/components/parameters/page"), + * @OA\Parameter(ref="#/components/parameters/per_page"), * * @OA\Response( * response=200, From 9d3a24ab2c7bbaeea4386320c2fcf2fed013adae Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 24 Apr 2025 14:52:49 -0700 Subject: [PATCH 07/53] Update cors.php --- config/cors.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cors.php b/config/cors.php index 481af047b7..b327f18f78 100644 --- a/config/cors.php +++ b/config/cors.php @@ -21,6 +21,7 @@ 'allowed_origins' => [ 'http://localhost:4200', + 'https://legendary-adventure-2n21ppv.pages.github.io', ], 'allowed_origins_patterns' => [], From de556705a0a629e8fbcab3df2f5ace0af4c23dde Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 25 Apr 2025 17:20:10 -0400 Subject: [PATCH 08/53] Enhance Api2TypescriptCommand for improved TypeScript SDK generation --- .../Commands/Api2TypescriptCommand.php | 257 +++++++++++++++++- .../Api/NotificationController.php | 1 + .../Api/TaskAssignmentController.php | 4 - ProcessMaker/Models/ProcessRequest.php | 2 +- .../stubs/api2typescript/api-spec.blade.php | 37 +++ resources/stubs/api2typescript/api.blade.php | 34 ++- .../stubs/api2typescript/composable.blade.php | 8 + .../stubs/api2typescript/types.blade.php | 6 +- 8 files changed, 317 insertions(+), 32 deletions(-) create mode 100644 resources/stubs/api2typescript/api-spec.blade.php diff --git a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php index 4d8593ed39..2646eeb6b1 100644 --- a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php +++ b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php @@ -2,8 +2,10 @@ namespace ProcessMaker\Console\Commands; +use Exception; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Arr; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Str; @@ -32,6 +34,8 @@ class Api2TypescriptCommand extends Command */ protected $files; + protected array $openapi; + /** * Create a new command instance. * @@ -63,6 +67,7 @@ public function handle() $this->error("Failed to parse OpenAPI JSON file."); return 1; } + $this->openapi = $openapi; // Create output directory if it doesn't exist if (!$this->files->exists($outputDirectory)) { @@ -283,11 +288,121 @@ protected function generateApiClassForTag($openapi, $tag, $outputDir) 'tagLower' => $tagLower, 'className' => $className, 'imports' => array_unique($imports), - 'methods' => $methods + 'methods' => $methods, + 'helper' => $this, ]; + // Generate the api.ts file $content = Blade::render($this->getStub('api'), $data); $this->files->put("$outputDir/$tagLower.api.ts", $content); + + // Generate the api.spec.ts file + $content = Blade::render($this->getStub('api-spec'), $data); + $this->files->put("$outputDir/$tagLower.api.spec.ts", $content); + } + + public function mockResponse(array $method) + { + return $method['responseExample']; + } + + public function mockParamsArray(array $method, bool $camelCase): array + { + $params = []; + // Add path parameters + foreach ($method['pathParams'] as $param) { + $key = Str::camel($param['name']); + $params[$key] = $this->mockValue($param); + } + // Add request body parameter for POST/PUT methods + if (!empty($method['requestBody'])) { + if (isset($method['requestBody']['content']['multipart/form-data']['schema'])) { + $params['$body'] = $this->mockFromSchema($method['requestBody']['content']['multipart/form-data']['schema']); + } elseif (isset($method['requestBody']['content']['application/json']['schema'])) { + $schema = $method['requestBody']['content']['application/json']['schema']; + $params['$body'] = $this->mockFromSchema($schema); + } else { + throw new Exception("Failed to mock request body for " . $method['operationId']); + } + } elseif ($method['httpMethod'] === 'post' || $method['httpMethod'] === 'put' || $method['httpMethod'] === 'patch') { + $params['$body'] = (object) []; + } + $queryParams = []; + foreach ($method['queryParams'] as $param) { + $key = $camelCase ? Str::camel($param['name']) : $param['name']; + if (isset($param['$ref'])) { + $queryParams[$key] = $this->mockValue($this->getSchemaByRef($param['$ref'])); + } else { + $queryParams[$key] = $this->mockValue($param); + } + } + if (!empty($queryParams)) { + $params['$queryParams'] = $queryParams; + } + return $params; + } + + public function mockParams(array $method) + { + $params = $this->mockParamsArray($method, true); + foreach ($params as $key => $value) { + $params[$key] = $this->json($value, 6); + } + return implode(', ', $params); + } + + private function getSchemaByRef(string $ref) + { + $refs = str_replace('/', '.', substr($ref, 2)); + return Arr::get($this->openapi, $refs, null); + } + + public function mockUrl(array $method) + { + $params = $this->mockParamsArray($method, false); + // replace ${param} with the value + $path = $method['apiPath']; + foreach ($params as $key => $value) { + if (is_array($value) || is_object($value)) { + continue; + } + $path = str_replace('${' . $key . '}', urlencode($value), $path); + } + // Add the query params to the path from $queryParams + if (isset($params['$queryParams'])) { + $first = true; + foreach ($params['$queryParams'] as $key => $value) { + if (is_array($value)) { + $value = implode(',', $value); + } + $path .= ($first ? '?' : '&') . urlencode($key) . '=' . urlencode($value); + $first = false; + } + } + $arguments = "'{$path}'"; + if (isset($params['$body'])) { + $arguments .= ", " . $this->json($params['$body'], 6); + } + return $arguments; + } + + public function json($value, int $leftMargin = 0) + { + if ($leftMargin > 0) { + $json = json_encode($value, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); + // change the indent to 2 spaces + $json = preg_replace_callback( + '/^(?: {4})+/m', + function($m) { + return str_repeat(' ', 2 * (strlen($m[0]) / 4)); + }, + $json + ); + // add the left margin + $json = str_replace("\n", "\n" . str_repeat(' ', $leftMargin), $json); + return $json; + } + return json_encode($value, JSON_UNESCAPED_SLASHES); } private function getResponseReference(string $operationId, array $responses) @@ -311,6 +426,105 @@ private function getResponseReference(string $operationId, array $responses) throw new \Exception("Failed to find response schema for $operationId"); } + private function getResponseExample(string $operationId, array $responses) + { + $responseSchema = $responses['200']['content']['application/json']['schema'] ?? + $responses['201']['content']['application/json']['schema'] ?? + $responses['202']['content']['application/json']['schema'] ?? null; + + if (empty($responseSchema)) { + return (object) []; + } + + return $this->mockFromSchema($responseSchema); + } + + private function mockFromSchema(array $responseSchema) + { + $response = []; + if (isset($responseSchema['properties'])) { + foreach ($responseSchema['properties'] as $key => $value) { + if (empty($value)) { + throw new Exception("Empty value for " . $key); + } + $response[$key] = $this->mockValue($value); + } + } elseif (isset($responseSchema['$ref'])) { + return $this->mockFromSchema($this->getSchemaByRef($responseSchema['$ref'])); + } + return (object) $response; + } + + private function mockValue(array $value) + { + if (!isset($value['type']) && isset($value['schema'])) { + $value = $value['schema']; + } + if (!isset($value['type']) && isset($value['allOf'])) { + return $this->mockValueFromObject($value); + } + if (!isset($value['type']) && isset($value['$ref'])) { + return $this->mockValueFromObject($value); + } + if (!isset($value['type'])) { + throw new \Exception("Failed to mock value for " . json_encode($value)); + } + switch ($value['type']) { + case 'string': + switch ($value['format'] ?? null) { + case 'id': + return '1'; + case 'date-time': + return '2025-04-23T00:00:00Z'; + default: + return 'foo'; + } + case 'integer': + case 'number': + return 1; + case 'boolean': + return true; + case 'array': + if (isset($value['items']['$ref'])) { + return [$this->mockValue($this->getSchemaByRef($value['items']['$ref']))]; + $ref = explode('/', $value['items']['$ref']); + $ref = end($ref); + return [$this->mockValue($this->openapi['components']['schemas'][$ref])]; + } + return [1, 2, 3]; + case 'object': + return $this->mockValueFromObject($value); + default: + return $value; + } + } + + private function mockValueFromObject(array $value) + { + $withProperties = $this->findItemWithKeyInArray($value['allOf'] ?? [], 'properties'); + $withRef = $this->findItemWithKeyInArray($value['allOf'] ?? [], '$ref'); + if (isset($value['allOf']) && $withProperties) { + return $this->mockFromSchema($withProperties); + } elseif (isset($value['allOf']) && $withRef) { + $ref = explode('/', $withRef['$ref']); + $ref = end($ref); + return $this->mockValue($this->openapi['components']['schemas'][$ref]); + } elseif (isset($value['properties'])) { + return $this->mockFromSchema($value); + } + return (object) ['foo' => $value]; + } + + private function findItemWithKeyInArray(array $array, string $key) + { + foreach ($array as $item) { + if (isset($item[$key])) { + return $item; + } + } + return null; + } + private function findResponseSchema(string $operationId, array $responseSchema, array $imports) { $responseProperties = $responseSchema['properties'] ?? null; @@ -373,11 +587,10 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) } // Add request body parameter for POST/PUT methods - if (($httpMethod === 'post' || $httpMethod === 'put')/* && $requestBody*/) { + if (($httpMethod === 'post' || $httpMethod === 'put' || $httpMethod === 'patch')) { if (isset($requestBody['content']['application/json']['schema']['$ref'])) { $schemaRef = $requestBody['content']['application/json']['schema']['$ref']; $schemaName = $this->getSchemaNameFromRef($schemaRef); - // $this->generateInterface($schemaName, $requestBody['content']['application/json']['schema']); $imports[] = $schemaName; $paramList[] = "data: " . $schemaName; } else { @@ -417,6 +630,7 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) }*/ $returnType = $this->getResponseReference($operationId, $responses); + $responseExample = $this->getResponseExample($operationId, $responses); // Build path with parameters @@ -431,9 +645,11 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) 'httpMethod' => $httpMethod, 'paramList' => $paramList, 'returnType' => $returnType, + 'responseExample' => $responseExample, 'apiPath' => $apiPath, 'queryParams' => $queryParams, - 'pathParams' => $pathParams + 'pathParams' => $pathParams, + 'requestBody' => $requestBody, ]; } @@ -579,7 +795,8 @@ protected function generateQueryParamInterface($parameters, $tagLower, $operatio $interface = "export interface " . $interfaceName . " {\n"; foreach ($queryParams as $param) { - $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string') . ";\n"; + $refType = $this->getTypeOf($param); + $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($refType) . ";\n"; } $interface .= "}"; @@ -587,6 +804,18 @@ protected function generateQueryParamInterface($parameters, $tagLower, $operatio return $interface; } + private function getTypeOf(array $definition) + { + if (isset($definition['schema']['type'])) { + return $definition['schema']['type']; + } + if (isset($definition['$ref'])) { + return $this->getTypeOf($this->getSchemaByRef($definition['$ref'])); + } + + throw new Exception("Failed to get type of " . json_encode($definition)); + } + private function generateResponseType($operationId, $responseSchema, $outputDir) { $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; @@ -616,13 +845,25 @@ protected function formatInterfaceName($name) /** * Convert swagger type to TypeScript type */ - protected function getTypescriptType($property) + public function getTypescriptType($property) { + if ($property === 'true' || $property === true) { + return 'any'; + } if (isset($property['$ref'])) { + $schema = $this->getSchemaByRef($property['$ref']); + if (isset($schema['schema'])) { + return $this->getTypescriptType($schema['schema']); + } return $this->getSchemaNameFromRef($property['$ref']); } - - $type = $property['type'] ?? 'string'; + if (!isset($property['type']) && isset($property['schema']['type'])) { + return $this->getTypescriptType($property['schema']); + } + if (!isset($property['type'])) { + throw new Exception("Failed to get type of " . json_encode($property)); + } + $type = $property['type']; switch ($type) { case 'integer': diff --git a/ProcessMaker/Http/Controllers/Api/NotificationController.php b/ProcessMaker/Http/Controllers/Api/NotificationController.php index c94d72c1e3..16374aedb9 100644 --- a/ProcessMaker/Http/Controllers/Api/NotificationController.php +++ b/ProcessMaker/Http/Controllers/Api/NotificationController.php @@ -64,6 +64,7 @@ class NotificationController extends Controller * ), * @OA\Property( * property="meta", + * type="object", * @OA\Schema(ref="#/components/schemas/metadata"), * ), * ), diff --git a/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php b/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php index 05568ee8c5..7d35cf5c5e 100644 --- a/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php +++ b/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php @@ -176,10 +176,6 @@ public function update(ProcessTaskAssignment $task_assignment, Request $request) * type="integer", * ) * ), - * @OA\RequestBody( - * required=true, - * @OA\JsonContent(ref="#/components/schemas/taskAssignmentsEditable") - * ), * @OA\Response( * response=200, * description="success", diff --git a/ProcessMaker/Models/ProcessRequest.php b/ProcessMaker/Models/ProcessRequest.php index aee92ce58b..ad10c5e0a2 100644 --- a/ProcessMaker/Models/ProcessRequest.php +++ b/ProcessMaker/Models/ProcessRequest.php @@ -88,7 +88,7 @@ * @OA\Property(property="process_category_id", type="string", format="id"), * @OA\Property(property="created_at", type="string", format="date-time"), * @OA\Property(property="updated_at", type="string", format="date-time"), - * @OA\Property(property="user", @OA\Schema(ref="#/components/schemas/users")), + * @OA\Property(property="user", type="object", @OA\Schema(ref="#/components/schemas/users")), * @OA\Property(property="participants", type="array", @OA\Items(ref="#/components/schemas/users")), * ) * }, diff --git a/resources/stubs/api2typescript/api-spec.blade.php b/resources/stubs/api2typescript/api-spec.blade.php new file mode 100644 index 0000000000..fcbd47fc20 --- /dev/null +++ b/resources/stubs/api2typescript/api-spec.blade.php @@ -0,0 +1,37 @@ +import { {{ $className }} } from './{{ $tagLower }}.api'; + +describe('{{ $className }}', () => { + // Mock API client + const mockApiClient = { + head: vi.fn(), + get: vi.fn(), + post: vi.fn(), + put: vi.fn(), + delete: vi.fn(), + patch: vi.fn(), + }; + + // Create instance + let api: {{ $className }}; + + beforeEach(() => { + api = new {{ $className }}(mockApiClient); + vi.resetAllMocks(); + }); + +@foreach ($methods as $method) + + describe('{{ $method['methodName'] }}', () => { + it('{{ $method['summary'] }}', async () => { + const mockResponse = {!! $helper->json($helper->mockResponse($method), 6) !!}; + mockApiClient.{{ $method['httpMethod'] }}.mockResolvedValue(mockResponse); + + const result = await api.{{ $method['methodName'] }}({!! $helper->mockParams($method) !!}); + + expect(mockApiClient.{{ $method['httpMethod'] }}).toHaveBeenCalledWith({!! $helper->mockUrl($method) !!}); + expect(result).toEqual(mockResponse); + }); + }); + +@endforeach +}); diff --git a/resources/stubs/api2typescript/api.blade.php b/resources/stubs/api2typescript/api.blade.php index 7d2940303d..014354d940 100644 --- a/resources/stubs/api2typescript/api.blade.php +++ b/resources/stubs/api2typescript/api.blade.php @@ -8,10 +8,12 @@ export class {{ $className }} { constructor(private apiClient: { + head: (endpoint: string) => Promise; get: (endpoint: string) => Promise; post: (endpoint: string, data: Record) => Promise; put: (endpoint: string, data: Record) => Promise; delete: (endpoint: string) => Promise; + patch: (endpoint: string, data: Record) => Promise; }) {} @foreach ($methods as $method) @@ -26,10 +28,20 @@ @foreach ($method['queryParams'] as $param) @php $paramName = Illuminate\Support\Str::camel($param['name']); -$paramType = $param['schema']['type'] ?? 'string'; -$paramValue = ($paramType === 'integer' || $paramType === 'number') ? "params.{$paramName}.toString()" : "params.{$paramName}"; +$paramType = $helper->getTypescriptType($param); +if ($paramType === 'boolean') { + $paramValue = "params.{$paramName} ? '1' : '0'"; +} elseif ($paramType === 'integer' || $paramType === 'number') { + $paramValue = "String(params.{$paramName})"; +} elseif ($paramType === 'array' || $paramType === 'string[]') { + $paramValue = "params.{$paramName}.join(',')"; +} elseif ($paramType === 'string') { + $paramValue = "params.{$paramName}"; +} else { + $paramValue = "JSON.stringify(params.{$paramName})"; +} @endphp - if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {{ $paramValue }}); + if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {!! $paramValue !!}); // {{ $paramType }} @endforeach } @@ -38,21 +50,15 @@ @if ($method['httpMethod'] === 'get' || $method['httpMethod'] === 'head') @if (!empty($method['queryParams'])) - return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); + return this.apiClient.{{ $method['httpMethod'] }}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); @else - return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); + return this.apiClient.{{ $method['httpMethod'] }}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); @endif -@elseif ($method['httpMethod'] === 'post') +@elseif ($method['httpMethod'] === 'post' ||$method['httpMethod'] === 'put' || $method['httpMethod'] === 'patch') @if (!empty($method['queryParams'])) - return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); + return this.apiClient.{{$method['httpMethod']}}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); @else - return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); -@endif -@elseif ($method['httpMethod'] === 'put') -@if (!empty($method['queryParams'])) - return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); -@else - return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); + return this.apiClient.{{$method['httpMethod']}}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); @endif @elseif ($method['httpMethod'] === 'delete') return this.apiClient.delete<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); diff --git a/resources/stubs/api2typescript/composable.blade.php b/resources/stubs/api2typescript/composable.blade.php index 2771ec5b04..90d435db3f 100644 --- a/resources/stubs/api2typescript/composable.blade.php +++ b/resources/stubs/api2typescript/composable.blade.php @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { {{ $className }} } from '../api/{{ $tagLower }}.api'; /** @@ -6,10 +7,17 @@ * @returns {{ $className }} instance */ export const {{ $hookName }} = (apiClient: { + head: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars get: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars post: (endpoint: string, data: Record) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars put: (endpoint: string, data: Record) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars delete: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + patch: (endpoint: string, data: Record) => Promise; }) => { return new {{ $className }}(apiClient); }; \ No newline at end of file diff --git a/resources/stubs/api2typescript/types.blade.php b/resources/stubs/api2typescript/types.blade.php index 33ab9b96fa..fc7c32125c 100644 --- a/resources/stubs/api2typescript/types.blade.php +++ b/resources/stubs/api2typescript/types.blade.php @@ -1,13 +1,9 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ @foreach ($interfaces as $interface) {!! $interface !!} @endforeach -/*export interface PaginatedResponse { - data: T[]; - meta: Metadata; -}*/ - @foreach ($queryParamInterfaces as $interface) {!! $interface !!} From beb05eecf9b07790c24c3893e0d6bb746ceae138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Wed, 30 Apr 2025 12:42:04 -0400 Subject: [PATCH 09/53] FOUR-24005 Outreach-Campaigns BE --- .pre-commit | 34 ------------------- .../Http/Controllers/Api/OpenApiSpec.php | 7 ++++ 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/.pre-commit b/.pre-commit index 08d458fa3e..e69de29bb2 100755 --- a/.pre-commit +++ b/.pre-commit @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -export PATH="$PATH:$HOME/.composer/vendor/bin" - -if ! command -v php-cs-fixer &> /dev/null; then - echo "php-cs-fixer could not be found" - echo "It must be installed globally with composer: composer global require friendsofphp/php-cs-fixer" - echo "Make sure it's in your \$PATH" - exit 1 -fi - - -pm4dir="$(dirname "$(readlink -f "$0")")" -files=$(git status --porcelain=v2 | grep -E '^\d [AM].*\.php$' | cut -d ' ' -f 9) -errors=() -if [ -n "$files" ]; then - while read file; do - echo "Checking $file" - php-cs-fixer fix --dry-run --verbose "$file" 2> /dev/null - if [ $? -ne 0 ]; then - errors+=("$file") - fi - done <<< "$files" -fi - - -if [ ${#errors[@]} -gt 0 ]; then - echo "" - echo "php-cs-fixer failed for files: ${errors[@]}" - echo "" - echo "You can attempt to fix these automatically by running 'php-cs-fixer fix [file]'" - echo "" - exit 1 -fi diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index cd6aa847cf..a1ddf5f480 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -63,6 +63,13 @@ * @OA\Schema(type="string", default=""), * ), * @OA\Parameter( + * parameter="fields", + * name="fields", + * in="query", + * description="Fields to map the response object.", + * @OA\Schema(type="string"), + * ), + * @OA\Parameter( * parameter="member_id", * name="member_id", * in="query", From 6d1b1476f90750df90fc4dc6205fce7d6701332a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Wed, 30 Apr 2025 12:42:08 -0400 Subject: [PATCH 10/53] FOUR-24005 Outreach-Campaigns BE --- .pre-commit | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.pre-commit b/.pre-commit index e69de29bb2..08d458fa3e 100755 --- a/.pre-commit +++ b/.pre-commit @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +export PATH="$PATH:$HOME/.composer/vendor/bin" + +if ! command -v php-cs-fixer &> /dev/null; then + echo "php-cs-fixer could not be found" + echo "It must be installed globally with composer: composer global require friendsofphp/php-cs-fixer" + echo "Make sure it's in your \$PATH" + exit 1 +fi + + +pm4dir="$(dirname "$(readlink -f "$0")")" +files=$(git status --porcelain=v2 | grep -E '^\d [AM].*\.php$' | cut -d ' ' -f 9) +errors=() +if [ -n "$files" ]; then + while read file; do + echo "Checking $file" + php-cs-fixer fix --dry-run --verbose "$file" 2> /dev/null + if [ $? -ne 0 ]; then + errors+=("$file") + fi + done <<< "$files" +fi + + +if [ ${#errors[@]} -gt 0 ]; then + echo "" + echo "php-cs-fixer failed for files: ${errors[@]}" + echo "" + echo "You can attempt to fix these automatically by running 'php-cs-fixer fix [file]'" + echo "" + exit 1 +fi From 4a01a2cbcd75df52da0dc61ecef4b049c3754504 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Apr 2025 17:54:08 -0700 Subject: [PATCH 11/53] Add initial support for PM Apps --- .../Http/Controllers/Api/UserController.php | 14 + ProcessMaker/Http/Kernel.php | 3 +- config/cors.php | 6 +- routes/api.php | 2 + storage/api-docs/api-docs.json | 8089 ++++++++++------- 5 files changed, 5069 insertions(+), 3045 deletions(-) diff --git a/ProcessMaker/Http/Controllers/Api/UserController.php b/ProcessMaker/Http/Controllers/Api/UserController.php index 0ecbf49fe0..b26e26b2a1 100644 --- a/ProcessMaker/Http/Controllers/Api/UserController.php +++ b/ProcessMaker/Http/Controllers/Api/UserController.php @@ -946,4 +946,18 @@ public function updateLanguage(Request $request) return response([], 204); } + + public function current() + { + return response([ + 'data' => Auth::user(), + ], 200); + } + + public function logout(Request $request) + { + $request->user()->token()->revoke(); + + return response()->json(['message' => 'OK']); + } } diff --git a/ProcessMaker/Http/Kernel.php b/ProcessMaker/Http/Kernel.php index 97ffae0d6c..c083dbee34 100644 --- a/ProcessMaker/Http/Kernel.php +++ b/ProcessMaker/Http/Kernel.php @@ -24,6 +24,7 @@ class Kernel extends HttpKernel Middleware\BrowserCache::class, ServerTimingMiddleware::class, Middleware\FileSizeCheck::class, + \Illuminate\Http\Middleware\HandleCors::class, ]; /** @@ -89,7 +90,7 @@ class Kernel extends HttpKernel 'no-cache' => Middleware\NoCache::class, 'admin' => Middleware\IsAdmin::class, 'etag' => Middleware\Etag\HandleEtag::class, - 'file_size_check' => Middleware\FileSizeCheck::class + 'file_size_check' => Middleware\FileSizeCheck::class, ]; /** diff --git a/config/cors.php b/config/cors.php index 8a39e6daa6..979cc947db 100644 --- a/config/cors.php +++ b/config/cors.php @@ -15,11 +15,13 @@ | */ - 'paths' => ['api/*', 'sanctum/csrf-cookie'], + 'paths' => ['api/*', 'sanctum/csrf-cookie', 'oauth/*'], 'allowed_methods' => ['*'], - 'allowed_origins' => ['*'], + 'allowed_origins' => [ + 'http://localhost:4200', + ], 'allowed_origins_patterns' => [], diff --git a/routes/api.php b/routes/api.php index 1d48e244e3..35d4c6ceb0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -60,6 +60,8 @@ Route::put('users/update_language', [UserController::class, 'updateLanguage'])->name('users.updateLanguage'); Route::get('users_task_count', [UserController::class, 'getUsersTaskCount'])->name('users.users_task_count') ->middleware('can:view-users'); + Route::get('users/current', [UserController::class, 'current'])->name('users.current'); + Route::post('users/logout', [UserController::class, 'logout'])->name('users.logout'); // User Groups Route::put('users/{user}/groups', [UserController::class, 'updateGroups'])->name('users.groups.update')->middleware('can:edit-users'); diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 3755004f8f..ebcc60c8ac 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,6 +18,177 @@ } ], "paths": { + "/analytics-reporting": { + "get": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Returns all analytics reporting that the user has access to", + "description": "Get a list of Analytics Reporting.", + "operationId": "getAnalyticsReporting", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of analytics reporting", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/analyticsReporting" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Save a new Analytics Reporting", + "description": "Create a new Analytics Reporting.", + "operationId": "createAnalyticsReporting", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReportingEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } + } + } + } + }, + "/analytics-reporting/{analytic_reporting_id}": { + "get": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Get single analytic reporting by ID", + "description": "Get a single Analytic Reporting.", + "operationId": "getAnalyticReportingById", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the analytics reporting", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } + } + } + }, + "put": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Update a analytic reporting", + "description": "Update a Analytics Reporting.", + "operationId": "updateAnalyticReporting", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReportingEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "AnalyticsReporting" + ], + "summary": "Delete an analytic reporting", + "description": "Delete a Analytics Reporting.", + "operationId": "deleteAnalyticReporting", + "parameters": [ + { + "name": "analytic_reporting_id", + "in": "path", + "description": "ID of analytic reporting to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, "/collections": { "get": { "tags": [ @@ -554,48 +725,84 @@ } } }, - "/saved-searches/{saved_search_id}/charts": { + "/comments/tasks": { "get": { "tags": [ - "SavedSearchCharts" + "Comments" ], - "summary": "Returns all saved search charts that the user has access to", - "description": "Get a list of SavedSearchCharts.", - "operationId": "getSavedSearchCharts", + "summary": "Returns all the tasks that are active.", + "description": "Display a listing of the resource.", + "operationId": "getCommentTasks", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", + "name": "process_request_id", "in": "query", - "description": "Only return saved searches by type", + "description": "Process request id", "required": false, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "integer" } }, + { + "$ref": "#/components/parameters/filter" + }, { "$ref": "#/components/parameters/order_by" }, { "$ref": "#/components/parameters/order_direction" + } + ], + "responses": { + "200": { + "description": "list all tasks taht are active", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequestToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/data_source_categories": { + "get": { + "tags": [ + "DataSourcesCategories" + ], + "summary": "Returns all Data Connectors categories that the user has access to", + "description": "Display a listing of the Data Connector Categories.", + "operationId": "getDataSourceCategories", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/order_by" }, { - "$ref": "#/components/parameters/include" + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of saved search charts", + "description": "list of Data Connectors categories", "content": { "application/json": { "schema": { @@ -603,7 +810,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } }, "meta": { @@ -622,111 +829,63 @@ } } }, - "put": { + "post": { "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" - } - } + "DataSourcesCategories" ], + "summary": "Save a new Data Connector Category", + "description": "Store a newly created Data Connector Category in storage", + "operationId": "createDataSourceCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchChart" - } + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } }, "responses": { - "204": { - "description": "success" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceCategory" + } + } + } } } - }, - "post": { + } + }, + "/data_source_categories/{data_source_category_id}": { + "get": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Save a new saved search chart", - "description": "Create a new SavedSearchChart.", - "operationId": "createSavedSearchChart", + "summary": "Get single Data Connector category by ID", + "description": "Display the specified data Source category.", + "operationId": "getDatasourceCategoryById", "parameters": [ { - "name": "saved_search_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of saved search to which this chart will be saved", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" - } - } - } - }, "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } - } - } - } - }, - "/saved-searches/charts/{chart_id}": { - "get": { - "tags": [ - "SavedSearchCharts" - ], - "summary": "Get single saved search chart by ID", - "description": "Get a single SavedSearchChart.", - "operationId": "getSavedSearchChartById", - "parameters": [ - { - "name": "chart_id", - "in": "path", - "description": "ID of chart to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the saved search chart", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -735,16 +894,16 @@ }, "put": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Update a saved search chart", - "description": "Update a SavedSearchChart.", - "operationId": "updateSavedSearchChart", + "summary": "Update a Data Connector Category", + "description": "Updates the current element", + "operationId": "updateDatasourceCategory", "parameters": [ { - "name": "chart_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -756,7 +915,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -767,7 +926,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -776,16 +935,16 @@ }, "delete": { "tags": [ - "SavedSearchCharts" + "DataSourcesCategories" ], - "summary": "Delete a saved search chart", - "description": "Delete a SavedSearchChart.", - "operationId": "deleteSavedSearchChart", + "summary": "Delete a Data Connector category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDataSourceCategory", "parameters": [ { - "name": "chart_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -799,52 +958,73 @@ } } }, - "/saved-searches/charts/{chart_id}/fields": { + "/data_sources": { "get": { "tags": [ - "SavedSearchCharts" + "DataSources" ], - "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 Data Connectors that the user has access to", + "description": "Get the list of records of a Data Connector", + "operationId": "getDataSources", "parameters": [ { - "name": "chart_id", - "in": "path", - "description": "ID of Saved Search 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" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the saved search", + "description": "list of Data Connectors", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataSource" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } } } - } - }, - "/saved-searches/reports": { + }, "post": { "tags": [ - "Reports" + "DataSources" ], - "summary": "Save a new report", - "operationId": "createReport", + "summary": "Save a new Data Connector", + "description": "Create a new Data Connector.", + "operationId": "createDataSource", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } @@ -855,7 +1035,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "$ref": "#/components/schemas/dataSource" } } } @@ -863,174 +1043,91 @@ } } }, - "/saved-searches/reports/{reportId}": { - "put": { + "/data_sources/{data_source_id}": { + "get": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Update a saved search", - "description": "Update a Report", - "operationId": "updateReport", + "summary": "Get single Data Connector by ID", + "description": "Get a single Data Connector.", + "operationId": "getDataSourceById", "parameters": [ { - "name": "reportId", + "name": "data_source_id", "in": "path", - "description": "ID of report", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/saved-searches": { - "get": { + }, + "put": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Returns all saved searches that the user has access to", - "description": "Get a list of SavedSearches.", - "operationId": "getSavedSearches", + "summary": "Update a Data Connector", + "description": "Update a Data Connector.", + "operationId": "updateDataSource", "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, + "name": "data_source_id", + "in": "path", + "description": "ID of Data Connector to return", + "required": true, "schema": { - "type": "string", - "enum": [ - "mine", - "shared" - ] - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "list of saved searches", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearch" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" - } - } + "type": "string" } } - } - }, - "post": { - "tags": [ - "SavedSearches" ], - "summary": "Save a new saved search", - "description": "Create a new SavedSearch.", - "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "201": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/saved-searches/{savedSearchId}": { - "get": { + }, + "delete": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Get single saved searches by ID", - "description": "Get a single SavedSearch.", - "operationId": "getSavedSearchById", + "summary": "Delete a Data Connector", + "description": "Delete a Data Connector.", + "operationId": "deleteDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1038,30 +1135,32 @@ } ], "responses": { - "200": { - "description": "Successfully found the saved search", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } } } - }, - "put": { + } + }, + "/data_sources/{data_source_id}/test": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Update a saved search", - "description": "Update a SavedSearch.", - "operationId": "updateSavedSearch", + "summary": "Send a Data Connector request", + "description": "Send a Data Connector request.", + "operationId": "sendDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1073,18 +1172,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/dataSource" } } } @@ -1092,76 +1191,56 @@ } } }, - "/saved-searches/{savedSearchId}/columns": { - "get": { + "/requests/{request_id}/data_sources/{data_source_id}": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Returns all columns associated with a Saved Search", - "description": "Display a listing of columns.", - "operationId": "getSavedSearchColumns", + "summary": "execute Data Source", + "description": "Execute a data Source endpoint", + "operationId": "executeDataSourceForRequest", "parameters": [ { - "name": "savedSearchId", + "name": "request_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of the request in whose context the datasource will be executed", "required": true, "schema": { "type": "string" } }, { - "name": "include", - "in": "query", - "description": "Include specific categories. Comma separated list.", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "current", - "default", - "available", - "data" - ] - }, - "uniqueItems": false + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "Categorized list of columns", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "current": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "default": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "available": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1169,110 +1248,49 @@ } } }, - "/saved-searches/{savedSearchId}/users": { - "get": { + "/requests/data_sources/{data_source_id}": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchUsers", + "summary": "execute Data Source", + "operationId": "executeDataSource", "parameters": [ { - "name": "savedSearchId", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of DataSource to be run", "required": true, "schema": { "type": "string" } - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], - "responses": { - "200": { - "description": "list of users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" }, - "type": "object" - } + "data": { + "type": "object" + } + }, + "type": "object" } } } - } - } - }, - "/saved-searches/{savedSearchId}/groups": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchGroups", - "parameters": [ - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - } - ], + }, "responses": { "200": { - "description": "list of groups", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1280,68 +1298,40 @@ } } }, - "/saved-searches/{saved_search_id}": { - "delete": { + "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "post": { "tags": [ - "SavedSearches" + "DataSources" ], - "summary": "Delete a saved search", - "description": "Delete a SavedSearch.", - "operationId": "deleteSavedSearch", + "summary": "Get Data from Data Source", + "operationId": "getDataFromDataSource", "parameters": [ { - "name": "saved_search_id", + "name": "data_source_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of DataSource to be run", "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" + "name": "endpoint", + "in": "path", + "description": "Endpoint of the data source", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of icons for saved searches", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchIcon" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } @@ -1349,14 +1339,14 @@ } } }, - "/version_histories": { + "/decision_table_categories": { "get": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Return all version History according to the model", - "description": "Get the list of records of Version History", - "operationId": "getVersionHistories", + "summary": "Returns all Decision Tables categories that the user has access to", + "description": "Display a listing of the Decision Tables Categories.", + "operationId": "getDecisionTableCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1369,14 +1359,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Version History", + "description": "list of Decision Tables categories", "content": { "application/json": { "schema": { @@ -1384,7 +1371,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } }, "meta": { @@ -1405,17 +1392,17 @@ }, "post": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Save a new Version History", - "description": "Create a new Version History.", - "operationId": "createVersion", + "summary": "Save a new Decision Table Category", + "description": "Store a newly created Decision Tables Category in storage", + "operationId": "createDecisionTableCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -1426,7 +1413,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1434,19 +1421,19 @@ } } }, - "/version_histories/{version_history_id}": { + "/decision_table_categories/{decision_table_categories_id}": { "get": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Get single Version History by ID", - "description": "Get a single Version History.", - "operationId": "getVersionHistoryById", + "summary": "Get single Decision Table category by ID", + "description": "Display the specified decision Tables category.", + "operationId": "getDecisionTableCategoryById", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1455,11 +1442,11 @@ ], "responses": { "200": { - "description": "Successfully found the Version History", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1468,16 +1455,16 @@ }, "put": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Update a Version History", - "description": "Update a Version History.", - "operationId": "updateVersion", + "summary": "Update a Decision Table Category", + "description": "Updates the current element", + "operationId": "updateDecisionTableCategory", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1489,18 +1476,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1509,16 +1496,16 @@ }, "delete": { "tags": [ - "Version History" + "DecisionTableCategories" ], - "summary": "Delete a Version History", - "description": "Delete a Version History.", - "operationId": "deleteVersion", + "summary": "Delete a Decision Table category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDecisionTableCategory", "parameters": [ { - "name": "version_history_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -1527,98 +1514,19 @@ ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } - } - } - } - }, - "/version_histories/clone": { - "post": { - "tags": [ - "Version History" - ], - "summary": "Clone a new Version History", - "description": "Clone a new Version History.", - "operationId": "cloneVersion", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } - } - } - } - }, - "/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" - } - } - } + "description": "success" } } } }, - "/environment_variables": { + "/decision_tables": { "get": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", - "description": "Fetch a collection of variables based on paged request and filter if provided", - "operationId": "getEnvironmentVariables", + "summary": "Returns all Decision tables that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getDecisionTables", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1638,7 +1546,7 @@ ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of Decision Tables", "content": { "application/json": { "schema": { @@ -1646,11 +1554,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -1662,17 +1575,17 @@ }, "post": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Create a new environment variable", - "description": "Creates a new global Environment Variable in the system", - "operationId": "createEnvironmentVariable", + "summary": "Save a new Decision Table", + "description": "Store a newly created resource in storage.", + "operationId": "createDecisionTable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -1683,7 +1596,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1691,32 +1604,32 @@ } } }, - "/environment_variables/{environment_variable_id}": { + "/decision_tables/{decision_table_id}": { "get": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "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 Decision Table by ID", + "description": "Display the specified resource.", + "operationId": "getDecisionTableById", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1725,19 +1638,19 @@ }, "put": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", + "summary": "Update a Decision Table", + "description": "Update a Decision table", + "operationId": "updateDecisionTable", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment variables to update", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -1746,18 +1659,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1766,117 +1679,96 @@ }, "delete": { "tags": [ - "Environment Variables" + "DecisionTables" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", + "summary": "Delete a Decision Table", + "description": "Delete a Decision tables", + "operationId": "deleteDecisionTable", "parameters": [ { - "name": "environment_variable_id", + "name": "decision_table_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "description": "success" + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } } }, - "/files": { - "get": { + "/decision_tables/{decision_table_id}/duplicate": { + "put": { "tags": [ - "Files" + "DecisionTables" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "duplicate a Decision Table", + "description": "duplicate a Decision table.", + "operationId": "duplicateDecisionTable", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "decision_table_id", + "in": "path", + "description": "ID of Decision Table to return", + "required": true, + "schema": { + "type": "string" + } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTableEditable" + } + } + } + }, "responses": { - "200": { - "description": "list of files", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/decisionTable" } } } } } - }, + } + }, + "/decision_tables/{decision_table_id}/excel-import": { "post": { "tags": [ - "Files" + "DecisionTables" ], - "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", + "summary": "Import a new decision table", + "description": "Import a Decision table from excel", + "operationId": "importExcel", "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", + "name": "decision_table_id", + "in": "path", + "description": "ID of Decision Table to return", "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": { @@ -1886,7 +1778,7 @@ "schema": { "properties": { "file": { - "description": "save a new media file", + "description": "file to import", "type": "string", "format": "binary" } @@ -1897,23 +1789,14 @@ } }, "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" + "status": { + "type": "object" } }, "type": "object" @@ -1924,120 +1807,139 @@ } } }, - "/files/{file_id}": { - "get": { + "/decision_tables/{decision_table_id}/export": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "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": "Export a single Decision Table by ID", + "description": "Export the specified screen.", + "operationId": "exportDecisionTable", "parameters": [ { - "name": "file_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the file", + "description": "Successfully exported the decision table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/DecisionTableExported" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/decision_tables/import": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "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" + "summary": "Import a new Decision Table", + "description": "Import the specified Decision Table.", + "operationId": "importDecisionTable", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } + } } } } }, - "/files/{file_id}/contents": { - "get": { + "/decision_tables/{decision_table_id}/execute": { + "post": { "tags": [ - "Files" + "DecisionTables" ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", + "summary": "Execute a Decision Table definition", + "description": "Execute a Decision Table definition", + "operationId": "previewDecisionTable", "parameters": [ { - "name": "file_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the file to return", + "description": "Decision Table unique Identifier", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "File stream", + "description": "Successfully executed", "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "application/json": { + "schema": {} } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups": { + "/saved-searches/{saved_search_id}/charts": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getGroups", + "summary": "Returns all saved search charts that the user has access to", + "description": "Get a list of SavedSearchCharts.", + "operationId": "getSavedSearchCharts", "parameters": [ { - "$ref": "#/components/parameters/status" + "$ref": "#/components/parameters/filter" }, { - "$ref": "#/components/parameters/filter" + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] + } }, { "$ref": "#/components/parameters/order_by" @@ -2054,7 +1956,7 @@ ], "responses": { "200": { - "description": "list of groups", + "description": "list of saved search charts", "content": { "application/json": { "schema": { @@ -2062,11 +1964,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2076,19 +1983,67 @@ } } }, + "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": [ - "Groups" + "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" + } + } ], - "summary": "Save a new group", - "description": "Store a newly created resource in storage.", - "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } @@ -2099,67 +2054,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/groups/{group_id}": { + "/saved-searches/charts/{chart_id}": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Get single group by ID", - "description": "Display the specified resource.", - "operationId": "getGroupById", + "summary": "Get single saved search chart by ID", + "description": "Get a single SavedSearchChart.", + "operationId": "getSavedSearchChartById", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the group", + "description": "Successfully found the saved search chart", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/SavedSearchChart" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", + "summary": "Update a saved search chart", + "description": "Update a SavedSearchChart.", + "operationId": "updateSavedSearchChart", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -2168,94 +2117,75 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } }, "delete": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", + "summary": "Delete a saved search chart", + "description": "Delete a SavedSearchChart.", + "operationId": "deleteSavedSearchChart", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups/{group_id}/users": { + "/saved-searches/charts/{chart_id}/fields": { "get": { "tags": [ - "Groups" + "SavedSearchCharts" ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", + "summary": "Get available chart fields for a Saved Search by ID", + "description": "Get available chart fields for a Saved Search.", + "operationId": "getSavedSearchFieldsById", "parameters": [ { - "name": "group_id", + "name": "chart_id", "in": "path", - "description": "ID of group", + "description": "ID of Saved Search to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of members of a group", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2263,52 +2193,73 @@ } } }, - "/groups/{group_id}/groups": { - "get": { + "/saved-searches/reports": { + "post": { "tags": [ - "Groups" + "Reports" ], - "summary": "Returns all users of a group", - "description": "Display the list of groups in a group", - "operationId": "getGroupGroupss", + "summary": "Save a new report", + "operationId": "createReport", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Report" + } + } + } + } + } + } + }, + "/saved-searches/reports/{reportId}": { + "put": { + "tags": [ + "SavedSearches" + ], + "summary": "Update a saved search", + "description": "Update a Report", + "operationId": "updateReport", "parameters": [ { - "name": "group_id", + "name": "reportId", "in": "path", - "description": "ID of group", + "description": "ID of report", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$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": "list of members of a group", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2316,17 +2267,44 @@ } } }, - "/group_members": { + "/saved-searches": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Returns all groups for a given member", - "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", + "summary": "Returns all saved searches that the user has access to", + "description": "Get a list of SavedSearches.", + "operationId": "getSavedSearches", "parameters": [ { - "$ref": "#/components/parameters/member_id" + "$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/order_by" @@ -2336,11 +2314,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of group_members", + "description": "list of saved searches", "content": { "application/json": { "schema": { @@ -2348,11 +2329,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groupMembers" + "$ref": "#/components/schemas/SavedSearch" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2364,17 +2350,17 @@ }, "post": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Save a new group member", - "description": "Store a newly created resource in storage.", - "operationId": "createGroupMember", + "summary": "Save a new saved search", + "description": "Create a new SavedSearch.", + "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupMembersEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -2385,7 +2371,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/createGroupMembers" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2393,19 +2379,19 @@ } } }, - "/group_members/{group_member_id}": { + "/saved-searches/{savedSearchId}": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Get single group member by ID", - "description": "Display the specified resource.", - "operationId": "getGroupMemberById", + "summary": "Get single saved searches by ID", + "description": "Get a single SavedSearch.", + "operationId": "getSavedSearchById", "parameters": [ { - "name": "group_member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group members to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2414,97 +2400,126 @@ ], "responses": { "200": { - "description": "Successfully found the group members", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/getGroupMembersById" + "$ref": "#/components/schemas/SavedSearch" } } } } } }, - "delete": { + "put": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Delete a group member", - "description": "Delete a group membership", - "operationId": "deleteGroupMember", + "summary": "Update a saved search", + "description": "Update a SavedSearch.", + "operationId": "updateSavedSearch", "parameters": [ { - "name": "group_member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group_members to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchEditable" + } + } + } + }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearch" + } + } + } } } } }, - "/group_members_available": { + "/saved-searches/{savedSearchId}/columns": { "get": { "tags": [ - "Group Members" + "SavedSearches" ], - "summary": "Returns all groups available for a given member", - "description": "Display a listing of groups available", - "operationId": "getGroupMembersAvailable", + "summary": "Returns all columns associated with a Saved Search", + "description": "Display a listing of columns.", + "operationId": "getSavedSearchColumns", "parameters": [ { - "name": "member_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group member to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } }, { - "name": "member_type", - "in": "path", - "description": "type of group member to return", - "required": true, + "name": "include", + "in": "query", + "description": "Include specific categories. Comma separated list.", "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string", + "enum": [ + "current", + "default", + "available", + "data" + ] + }, + "uniqueItems": false } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of groups available to be assigned as member", + "description": "Categorized list of columns", "content": { "application/json": { "schema": { "properties": { - "data": { + "current": { "type": "array", "items": { - "$ref": "#/components/schemas/availableGroupMembers" + "$ref": "#/components/schemas/columns" } }, - "meta": { - "$ref": "#/components/schemas/metadata" + "default": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "available": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } } }, "type": "object" @@ -2515,19 +2530,19 @@ } } }, - "/user_members_available": { + "/saved-searches/{savedSearchId}/users": { "get": { "tags": [ - "Group Members" + "Users" ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchUsers", "parameters": [ { - "name": "group_id", + "name": "savedSearchId", "in": "path", - "description": "ID of group to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2536,7 +2551,7 @@ { "name": "filter", "in": "query", - "description": "Filter results by string. Searches Name. Can be a substring.", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", "schema": { "type": "string" } @@ -2549,11 +2564,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users available to be assigned as member", + "description": "list of users", "content": { "application/json": { "schema": { @@ -2576,24 +2594,131 @@ } } }, - "/notifications": { + "/saved-searches/{savedSearchId}/groups": { "get": { "tags": [ - "Notifications" + "Groups" ], - "summary": "Returns all notifications that the user has access to", + "summary": "Returns all groups that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getNotifications", + "operationId": "getSavedSearchGroups", "parameters": [ { - "name": "status", - "in": "query", - "description": "Only return notifications by status (unread, all, etc.)", - "required": false, + "$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" + } + } + } + } + } + } + }, + "/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" }, @@ -2612,7 +2737,7 @@ ], "responses": { "200": { - "description": "list of notifications", + "description": "list of Version History", "content": { "application/json": { "schema": { @@ -2620,10 +2745,17 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } }, - "meta": {} + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } }, "type": "object" } @@ -2634,17 +2766,17 @@ }, "post": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Save a new notifications", - "description": "Store a newly created resource in storage.", - "operationId": "createNotification", + "summary": "Save a new Version History", + "description": "Create a new Version History.", + "operationId": "createVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } @@ -2655,7 +2787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2663,19 +2795,19 @@ } } }, - "/notifications/{notification_id}": { + "/version_histories/{version_history_id}": { "get": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", + "summary": "Get single Version History by ID", + "description": "Get a single Version History.", + "operationId": "getVersionHistoryById", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2684,11 +2816,11 @@ ], "responses": { "200": { - "description": "Successfully found the notification", + "description": "Successfully found the Version History", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2697,16 +2829,16 @@ }, "put": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", + "summary": "Update a Version History", + "description": "Update a Version History.", + "operationId": "updateVersion", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2718,29 +2850,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "204": { - "description": "success" - } - } - }, + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } + } + } + }, "delete": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", + "summary": "Delete a Version History", + "description": "Delete a Version History.", + "operationId": "deleteVersion", "parameters": [ { - "name": "notification_id", + "name": "version_history_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2749,113 +2888,68 @@ ], "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" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } } } } - }, - "responses": { - "201": { - "description": "success" - } } } }, - "/unread_notifications": { - "put": { + "/version_histories/clone": { + "post": { "tags": [ - "Notifications" + "Version History" ], - "summary": "Mark notifications as unread by the user", - "description": "Update notifications as unread", - "operationId": "markNotificationAsUnread", + "summary": "Clone a new Version History", + "description": "Clone a new Version History.", + "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } } } } }, - "/read_all_notifications": { - "put": { + "/customize-ui": { + "post": { "tags": [ - "Notifications" + "CssSettings" ], - "summary": "Mark notifications as read by id and type", - "description": "Update all notification as read.", - "operationId": "markAllAsRead", + "summary": "Create or update a new setting", + "description": "Create a new Settings css-override", + "operationId": "updateCssSetting", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "id": { - "description": "Polymorphic relation id", - "type": "integer" + "variables": { + "type": "string" }, - "type": { - "description": "Polymorphic relation type", + "sansSerifFont": { "type": "string" } }, @@ -2866,73 +2960,29 @@ }, "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" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/settings" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/process_categories": { + "/environment_variables": { "get": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", + "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", + "description": "Fetch a collection of variables based on paged request and filter if provided", + "operationId": "getEnvironmentVariables", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -2942,11 +2992,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes categories", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -2954,7 +3007,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { @@ -2970,17 +3023,17 @@ }, "post": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Save a new process Category", - "description": "Store a newly created Process Category in storage", - "operationId": "createProcessCategory", + "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/ProcessCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -2991,7 +3044,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -2999,19 +3052,19 @@ } } }, - "/process_categories/{process_category_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "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": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { "type": "integer" @@ -3019,12 +3072,12 @@ } ], "responses": { - "200": { - "description": "Successfully found the process", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3033,16 +3086,16 @@ }, "put": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Update a process Category", - "description": "Updates the current element", - "operationId": "updateProcessCategory", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment variables to update", "required": true, "schema": { "type": "integer" @@ -3054,7 +3107,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -3065,7 +3118,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3074,16 +3127,15 @@ }, "delete": { "tags": [ - "Process Categories" + "Environment Variables" ], - "summary": "Delete a process category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "process_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { "type": "integer" @@ -3091,27 +3143,20 @@ } ], "responses": { - "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "200": { + "description": "success" } } } }, - "/processes": { + "/files": { "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "summary": "Returns the list of files", + "description": "Display a listing of the resource.", + "operationId": "getFiles", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -3124,26 +3169,11 @@ }, { "$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 processes", + "description": "list of files", "content": { "application/json": { "schema": { @@ -3151,7 +3181,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/media" } }, "meta": { @@ -3167,28 +3197,87 @@ }, "post": { "tags": [ - "Processes" + "Files" ], - "summary": "Save a new process", + "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": "createProcess", + "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" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "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/Process" + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" } } } @@ -3196,94 +3285,82 @@ } } }, - "/processes/{processId}": { + "/files/{file_id}": { "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Get single process by ID", - "description": "Display the specified resource.", - "operationId": "getProcessById", + "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": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file to return", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/media" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, - "put": { + "delete": { "tags": [ - "Processes" + "Files" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessEditable" - } - } - } - }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/files/{file_id}/contents": { + "get": { "tags": [ - "Processes" + "Files" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "processId", + "name": "file_id", "in": "path", - "description": "ID of process to return", + "description": "ID of the file to return", "required": true, "schema": { "type": "integer" @@ -3291,29 +3368,46 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/processes/{processId}/start_events": { + "/groups": { "get": { "tags": [ - "Processes" + "Groups" ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } + "$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" @@ -3321,7 +3415,7 @@ ], "responses": { "200": { - "description": "Successfully found the start events process", + "description": "list of groups", "content": { "application/json": { "schema": { @@ -3329,7 +3423,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessStartEvents" + "$ref": "#/components/schemas/groups" } }, "meta": { @@ -3342,21 +3436,88 @@ } } } - } - }, - "/processes/{processId}/draft": { - "put": { + }, + "post": { "tags": [ - "Processes" + "Groups" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "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": "processId", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "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" @@ -3368,62 +3529,79 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } + "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" + } } } }, - "/start_processes": { + "/groups/{group_id}/users": { "get": { "tags": [ - "Processes" + "Groups" ], - "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": "Returns all users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, + "schema": { + "type": "integer" + } }, { - "$ref": "#/components/parameters/order_by" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "without_event_definitions", - "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, - "schema": { - "type": "boolean" - } } ], "responses": { "200": { - "description": "list of processes that the user can start", + "description": "list of members of a group", "content": { "application/json": { "schema": { @@ -3431,7 +3609,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" + "$ref": "#/components/schemas/users" } }, "meta": { @@ -3446,32 +3624,52 @@ } } }, - "/processes/{processId}/restore": { - "put": { + "/groups/{group_id}/groups": { + "get": { "tags": [ - "Processes" + "Groups" ], - "summary": "Restore an inactive process", - "description": "Reverses the soft delete of the element.", - "operationId": "restoreProcess", + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", "parameters": [ { - "name": "processId", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "description": "ID of group", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "success", + "description": "list of members of a group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -3479,34 +3677,43 @@ } } }, - "/processes/{processId}/export": { - "post": { + "/group_members": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process to export", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/member_id" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "list of group_members", "content": { "application/json": { "schema": { "properties": { - "url": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3515,40 +3722,31 @@ } } } - } - }, - "/processes/import/validation": { + }, "post": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Validate a import", - "description": "Validate the specified process before importing.", - "operationId": "validateImport", + "summary": "Save a new group member", + "description": "Store a newly created resource in storage.", + "operationId": "createGroupMember", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/groupMembersEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "$ref": "#/components/schemas/createGroupMembers" } } } @@ -3556,111 +3754,118 @@ } } }, - "/processes/import": { - "post": { + "/group_members/{group_member_id}": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "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 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": "success", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "$ref": "#/components/schemas/getGroupMembersById" } } } } } - } - }, - "/processes/{processId}/bpmn": { - "get": { + }, + "delete": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", "parameters": [ { - "name": "processId", + "name": "group_member_id", "in": "path", - "description": "ID of process", + "description": "ID of group_members to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "description": "Successfully built the process for export", - "content": { - "application/json": { - "schema": { - "properties": { - "url": { - "type": "string" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/group_members_available": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Returns all groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ { - "name": "code", + "name": "member_id", "in": "path", - "description": "Import code", + "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": "check is import is ready", + "description": "list of groups available to be assigned as member", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableGroupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3671,88 +3876,60 @@ } } }, - "/processes/{process_id}/import/assignments": { - "post": { - "tags": [ - "Processes" - ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", - "parameters": [ - { - "name": "process_id", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessAssignments" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/process_events/{process_id}": { - "post": { + "/user_members_available": { + "get": { "tags": [ - "Processes" + "Group Members" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Returns all users available for a given group", + "description": "Display a listing of users available", + "operationId": "getUserMembersAvailable", "parameters": [ { - "name": "process_id", + "name": "group_id", "in": "path", - "description": "ID of process to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { - "name": "event", + "name": "filter", "in": "query", - "description": "Node ID of the start event", - "required": true, + "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" } ], - "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": "list of users available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -3760,28 +3937,22 @@ } } }, - "/requests": { + "/notifications": { "get": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Returns all process Requests that the user has access to", + "summary": "Returns all notifications that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getProcessesRequests", + "operationId": "getNotifications", "parameters": [ { - "name": "type", + "name": "status", "in": "query", - "description": "Only return requests by type (all|in_progress|completed)", + "description": "Only return notifications by status (unread, all, etc.)", "required": false, "schema": { - "type": "string", - "enum": [ - "all", - "in_progress", - "completed", - "started_me" - ] + "type": "string" } }, { @@ -3802,7 +3973,7 @@ ], "responses": { "200": { - "description": "list of processes", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -3810,12 +3981,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/Notification" } }, - "meta": { - "$ref": "#/components/schemas/metadata" - } + "meta": {} }, "type": "object" } @@ -3823,61 +3992,85 @@ } } } - } + }, + "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" + } + } + } + } + } + } }, - "/requests/{process_request_id}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Get single process request by ID", + "summary": "Get single notification by ID", "description": "Display the specified resource.", - "operationId": "getProcessRequestById", + "operationId": "getNotificationById", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/Notification" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Update a process request", - "description": "Update a request", - "operationId": "updateProcessRequest", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -3886,7 +4079,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -3894,179 +4087,137 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Delete a process request", - "description": "Delete a request", - "operationId": "deleteProcessRequest", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "process_request_id", + "name": "notification_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of notification to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" + "description": "success" } } } }, - "/requests/{process_request_id}/events/{event_id}": { - "post": { + "/read_notifications": { + "put": { "tags": [ - "Process Requests" + "Notifications" ], - "summary": "Update a process request event", - "description": "Trigger a intermediate catch event", - "operationId": "updateProcessRequestEvent", - "parameters": [ - { - "name": "process_request_id", - "in": "path", - "description": "ID of process request to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event_id", - "in": "path", - "description": "ID of process event to return", - "required": true, - "schema": { - "type": "string" + "summary": "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": { - "204": { + "201": { "description": "success" } } } }, - "/requests/{request_id}/files": { - "get": { + "/unread_notifications": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Returns the list of files associated with a request", - "description": "Display a listing of the resource.", - "operationId": "getRequestFiles", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - } + "Notifications" ], - "responses": { - "200": { - "description": "list of files", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "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" } }, - "type": "object" - } + "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" + } } - }, - "post": { + } + }, + "/read_all_notifications": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Save a new media file to a request", - "description": "Store a newly created resource in storage.", - "operationId": "createRequestFile", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Variable name in the request data to use for the file name", - "required": false, - "schema": { - "type": "string" - } - } + "Notifications" ], + "summary": "Mark notifications as read by id and type", + "description": "Update all notification as read.", + "operationId": "markAllAsRead", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" + "id": { + "description": "Polymorphic relation id", + "type": "integer" + }, + "type": { + "description": "Polymorphic relation type", + "type": "string" } }, "type": "object" @@ -4075,122 +4226,71 @@ } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string" - }, - "fileUploadId": { - "type": "integer" - } - }, - "type": "object" - } - } - } + "201": { + "description": "success" } } } }, - "/requests/{request_id}/files/{file_id}": { - "get": { + "/permissions": { + "put": { "tags": [ - "Request Files" - ], - "summary": "Get a file uploaded to a request", - "description": "Display the specified resource.", - "operationId": "getRequestFilesById", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "file_id", - "in": "path", - "description": "ID of the file to return", - "required": true, - "schema": { - "type": "integer" - } - } + "Permissions" ], - "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "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" } } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "delete": { - "tags": [ - "Request Files" - ], - "summary": "Delete all media associated with a request", - "description": "Remove the specified resource from storage.", - "operationId": "deleteRequestFile", - "parameters": [ - { - "name": "file_id", - "in": "path", - "description": "ID of the file", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "string" - } } - ], + }, "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/screen_categories": { + "/process_categories": { "get": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Returns all screens categories that the user has access to", - "description": "Display a listing of the Screen Categories.", - "operationId": "getScreenCategories", + "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, Description, and Status. All fields must match exactly.", + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", "schema": { "type": "string" } @@ -4207,7 +4307,7 @@ ], "responses": { "200": { - "description": "list of screens categories", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -4215,7 +4315,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { @@ -4231,17 +4331,17 @@ }, "post": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Save a new Screen Category", - "description": "Store a newly created Screen Category in storage", - "operationId": "createScreenCategory", + "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/ScreenCategoryEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -4252,7 +4352,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4260,32 +4360,32 @@ } } }, - "/screen_categories/{screen_category_id}": { + "/process_categories/{process_category_id}": { "get": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Get single screen category by ID", - "description": "Display the specified screen category.", - "operationId": "getScreenCategoryById", + "summary": "Get single process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4294,19 +4394,19 @@ }, "put": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Update a screen Category", + "summary": "Update a process Category", "description": "Updates the current element", - "operationId": "updateScreenCategory", + "operationId": "updateProcessCategory", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4315,7 +4415,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -4326,7 +4426,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -4335,37 +4435,44 @@ }, "delete": { "tags": [ - "Screen Categories" + "Process Categories" ], - "summary": "Delete a screen category", + "summary": "Delete a process category", "description": "Remove the specified resource from storage.", - "operationId": "deleteScreenCategory", + "operationId": "deleteProcessCategory", "parameters": [ { - "name": "screen_category_id", + "name": "process_category_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } } }, - "/screens": { + "/processes": { "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Returns all screens that the user has access to", - "description": "Get a list of Screens.", - "operationId": "getScreens", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4379,13 +4486,16 @@ { "$ref": "#/components/parameters/per_page" }, + { + "$ref": "#/components/parameters/status" + }, { "$ref": "#/components/parameters/include" }, { - "name": "exclude", + "name": "simplified_data_for_selector", "in": "query", - "description": "Comma separated list of fields to exclude from the response", + "description": "Comma separated list of fields to include in the response", "schema": { "type": "string", "default": "" @@ -4394,7 +4504,7 @@ ], "responses": { "200": { - "description": "list of screens", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -4402,11 +4512,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -4418,17 +4528,17 @@ }, "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Save a new screens", - "description": "Create a new Screen.", - "operationId": "createScreen", + "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/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } @@ -4439,7 +4549,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } } } @@ -4447,32 +4557,51 @@ } } }, - "/screens/{screens_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Get single screens by ID", - "description": "Get a single Screen.", - "operationId": "getScreensById", + "summary": "Get single process by ID", + "description": "Display the specified resource.", + "operationId": "getProcessById", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screens to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" + } + } + } + }, + "204": { + "description": "Process not found", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + "example": "The requested process was not found" + } + }, + "type": "object" } } } @@ -4481,19 +4610,19 @@ }, "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "Update a screen", - "description": "Update a Screen.", - "operationId": "updateScreen", + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4502,32 +4631,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } }, "delete": { "tags": [ - "Screens" + "Processes" ], - "summary": "Delete a screen", - "description": "Delete a Screen.", - "operationId": "deleteScreen", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4538,58 +4674,69 @@ } } }, - "/screens/{screens_id}/draft": { - "put": { + "/processes/{processId}/start_events": { + "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Update a draft screen", - "description": "Update a draft Screen.", - "operationId": "updateDraftScreen", + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screensEditable" + "responses": { + "200": { + "description": "Successfully found the start events process", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/screens/{screens_id}/duplicate": { + "/processes/{processId}/draft": { "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "duplicate a screen", - "description": "duplicate a Screen.", - "operationId": "duplicateScreen", + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", "parameters": [ { - "name": "screens_id", + "name": "processId", "in": "path", - "description": "ID of screen to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4598,18 +4745,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/Process" } } } @@ -4617,32 +4764,58 @@ } } }, - "/screens/{screensId}/export": { - "post": { + "/start_processes": { + "get": { "tags": [ - "Screens" + "Processes" ], - "summary": "Export a single screen by ID", - "description": "Export the specified screen.", - "operationId": "exportScreen", + "summary": "Returns the list of processes that the user can start", + "description": "Returns the list of processes that the user can start.", + "operationId": "startProcesses", "parameters": [ { - "name": "screensId", + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "without_event_definitions", "in": "path", - "description": "ID of screen to return", - "required": true, + "description": "If true return only processes that haven't start event definitions", + "required": false, "schema": { - "type": "string" + "type": "boolean" } } ], "responses": { "200": { - "description": "Successfully exported the screen", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screenExported" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessWithStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -4650,40 +4823,67 @@ } } }, - "/screens/import": { - "post": { + "/processes/{processId}/restore": { + "put": { "tags": [ - "Screens" + "Processes" ], - "summary": "Import a new screen", - "description": "Import the specified screen.", - "operationId": "importScreen", - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } + "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": { "schema": { - "properties": { - "status": { - "type": "object" + "$ref": "#/components/schemas/Process" + } + } + } + } + } + } + }, + "/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", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to export", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Successfully built the process for export", + "content": { + "application/json": { + "schema": { + "properties": { + "url": { + "type": "string" } }, "type": "object" @@ -4694,31 +4894,24 @@ } } }, - "/screens/preview": { + "/processes/import/validation": { "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Preview a screen", - "description": "Get preview a screen", - "operationId": "preview", + "summary": "Validate a import", + "description": "Validate the specified process before importing.", + "operationId": "validateImport", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "config": { - "type": "object" - }, - "watchers": { - "type": "object" - }, - "computed": { - "type": "object" - }, - "custom_css": { - "type": "string" + "file": { + "description": "file to import", + "type": "string", + "format": "binary" } }, "type": "object" @@ -4728,11 +4921,11 @@ }, "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/ProcessImport" } } } @@ -4740,41 +4933,38 @@ } } }, - "/screens/{screen_id}/translate/{language}": { - "get": { + "/processes/import": { + "post": { "tags": [ - "Screens" + "Processes" ], - "summary": "Translates the screen to the desired language", - "description": "Translates the controls inside a screen", - "operationId": "translateScreen", - "parameters": [ - { - "name": "screen_id", - "in": "path", - "description": "ID of the screen", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "language", - "in": "path", - "description": "Language used for the translation of the string", - "required": true, - "schema": { - "type": "string" + "summary": "Import a new process", + "description": "Import the specified process.", + "operationId": "importProcess", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/ProcessImport" } } } @@ -4782,48 +4972,34 @@ } } }, - "/script_categories": { + "/processes/{processId}/bpmn": { "get": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Returns all scripts categories that the user has access to", - "description": "Display a listing of the Script Categories.", - "operationId": "getScriptCategories", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "name": "processId", + "in": "path", + "description": "ID of process", + "required": true, "schema": { - "type": "string" + "type": "integer" } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of scripts categories", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ScriptCategory" - } - }, - "meta": { - "type": "object" + "url": { + "type": "string" } }, "type": "object" @@ -4832,51 +5008,21 @@ } } } - }, - "post": { - "tags": [ - "Script Categories" - ], - "summary": "Save a new Script Category", - "description": "Store a newly created Script Category in storage", - "operationId": "createScriptCategory", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } - } - } } }, - "/script_categories/{script_category_id}": { - "get": { + "/processes/import/{code}/is_ready": { + "head": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Get single script category by ID", - "description": "Display the specified script category.", - "operationId": "getScriptCategoryById", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "6a131993b7c879ddcd3d3a291dd8380f", "parameters": [ { - "name": "script_category_id", + "name": "code", "in": "path", - "description": "ID of script category to return", + "description": "Import code", "required": true, "schema": { "type": "string" @@ -4885,32 +5031,39 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "check is import is ready", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "properties": { + "ready": { + "type": "boolean" + } + }, + "type": "object" } } } } } - }, - "put": { + } + }, + "/processes/{process_id}/import/assignments": { + "post": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Update a script Category", - "description": "Updates the current element", - "operationId": "updateScriptCategory", + "summary": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", "parameters": [ { - "name": "script_category_id", + "name": "process_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -4919,58 +5072,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "$ref": "#/components/schemas/ProcessAssignments" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } + "204": { + "description": "success" } } - }, - "delete": { + } + }, + "/process_events/{process_id}": { + "post": { "tags": [ - "Script Categories" + "Processes" ], - "summary": "Delete a script category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScriptCategory", + "summary": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", "parameters": [ { - "name": "script_category_id", + "name": "process_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "event", + "in": "query", + "description": "Node ID of the start event", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } } } } }, - "/scripts": { + "/requests": { "get": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Returns all scripts that the user has access to", - "description": "Get a list of scripts in a process.", - "operationId": "getScripts", + "summary": "Returns all process Requests that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getProcessesRequests", "parameters": [ + { + "name": "type", + "in": "query", + "description": "Only return requests by type (all|in_progress|completed)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "in_progress", + "completed", + "started_me" + ] + } + }, { "$ref": "#/components/parameters/filter" }, @@ -4989,7 +5179,7 @@ ], "responses": { "200": { - "description": "list of scripts", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -4997,11 +5187,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/processRequest" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5010,50 +5200,58 @@ } } } - }, - "post": { + } + }, + "/requests/{process_request_id}": { + "get": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Save a new script", - "description": "Create a new script in a process.", - "operationId": "createScript", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } + "summary": "Get single process request by ID", + "description": "Display the specified resource.", + "operationId": "getProcessRequestById", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } - }, + ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/processRequest" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{script_id}/preview": { - "post": { + }, + "put": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Test script code without saving it", - "description": "Previews executing a script, with sample data/config data", - "operationId": "previewScript", + "summary": "Update a process request", + "description": "Update a request", + "operationId": "updateProcessRequest", "parameters": [ { - "name": "script_id", + "name": "process_request_id", "in": "path", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -5061,108 +5259,81 @@ } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "code": { - "type": "string" - }, - "nonce": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/processRequestEditable" } } } }, "responses": { - "200": { - "description": "success if the script was queued" + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/execute/{script_id}": { - "post": { + }, + "delete": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Execute script", - "description": "Executes a script, with sample data/config data", - "operationId": "executeScript", + "summary": "Delete a process request", + "description": "Delete a request", + "operationId": "deleteProcessRequest", "parameters": [ { - "name": "script_id", + "name": "process_request_id", "in": "path", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "type": "object" - } - } - } - }, "responses": { - "200": { - "description": "success if the script was queued", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsPreview" + "$ref": "#/components/schemas/processRequest" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/scripts/execution/{key}": { - "get": { + "/requests/{process_request_id}/events/{event_id}": { + "post": { "tags": [ - "Scripts" + "Process Requests" ], - "summary": "Get the response of a script execution by execution key", - "description": "Get the response of a script execution", - "operationId": "getScriptExecutionResponse", + "summary": "Update a process request event", + "description": "Trigger a intermediate catch event", + "operationId": "updateProcessRequestEvent", "parameters": [ { - "name": "key", + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "event_id", "in": "path", + "description": "ID of process event to return", "required": true, "schema": { "type": "string" @@ -5170,62 +5341,94 @@ } ], "responses": { - "200": { - "description": "response of a script execution", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "success" } } } }, - "/scripts/{script_id}": { + "/requests/{request_id}/files": { "get": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Get single script by ID", - "description": "Get a single script in a process.", - "operationId": "getScriptsById", + "summary": "Returns the list of files associated with a request", + "description": "Display a listing of the resource.", + "operationId": "getRequestFiles", "parameters": [ { - "name": "script_id", - "in": "path", - "description": "ID of script 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" + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the script", + "description": "list of files", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/media" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } } } }, - "put": { + "post": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Update a script", - "description": "Update a script in a process.", - "operationId": "updateScript", + "summary": "Save a new media file to a request", + "description": "Store a newly created resource in storage.", + "operationId": "createRequestFile", "parameters": [ { - "name": "script_id", + "name": "request_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the request", "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Variable name in the request data to use for the file name", + "required": false, "schema": { "type": "string" } @@ -5234,134 +5437,140 @@ "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "properties": { + "file": { + "description": "save a new media file", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + }, + "fileUploadId": { + "type": "integer" + } + }, + "type": "object" + } + } + } } } - }, - "delete": { + } + }, + "/requests/{request_id}/files/{file_id}": { + "get": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "Delete a script", - "description": "Delete a script in a process.", - "operationId": "deleteScript", + "summary": "Get a file uploaded to a request", + "description": "Display the specified resource.", + "operationId": "getRequestFilesById", "parameters": [ { - "name": "script_id", + "name": "request_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the request", "required": true, "schema": { - "type": "string" + "type": "integer" } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/scripts/{script_id}/draft": { - "put": { - "tags": [ - "Scripts" - ], - "summary": "Update a draft script", - "description": "Update a draft script.", - "operationId": "updateDraftScript", - "parameters": [ + }, { - "name": "script_id", + "name": "file_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "responses": { + "200": { + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } } } - } - }, - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{scripts_id}/duplicate": { - "put": { + }, + "delete": { "tags": [ - "Scripts" + "Request Files" ], - "summary": "duplicate a script", - "description": "Duplicate a Script.", - "operationId": "duplicateScript", + "summary": "Delete all media associated with a request", + "description": "Remove the specified resource from storage.", + "operationId": "deleteRequestFile", "parameters": [ { - "name": "scripts_id", + "name": "file_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the file", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scripts" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/script-executors": { + "/screen_categories": { "get": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Returns all script executors that the user has access to", - "description": "Get a list of script executors.", - "operationId": "getScriptExecutors", + "summary": "Returns all screens categories that the user has access to", + "description": "Display a listing of the Screen Categories.", + "operationId": "getScreenCategories", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5375,7 +5584,7 @@ ], "responses": { "200": { - "description": "list of script executors", + "description": "list of screens categories", "content": { "application/json": { "schema": { @@ -5383,7 +5592,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scriptExecutors" + "$ref": "#/components/schemas/ScreenCategory" } }, "meta": { @@ -5399,36 +5608,28 @@ }, "post": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Create a script executor", - "description": "Create a script executor", - "operationId": "createScriptExecutor", + "summary": "Save a new Screen Category", + "description": "Store a newly created Screen Category in storage", + "operationId": "createScreenCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" + "$ref": "#/components/schemas/ScreenCategoryEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } @@ -5436,109 +5637,62 @@ } } }, - "/script-executors/{script_executor}": { - "put": { + "/screen_categories/{screen_category_id}": { + "get": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Update script executor", - "description": "Update and rebuild the script executor", - "operationId": "updateScriptExecutor", + "summary": "Get single screen category by ID", + "description": "Display the specified screen category.", + "operationId": "getScreenCategoryById", "parameters": [ { - "name": "script_executor", + "name": "screen_category_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } }, - "delete": { + "put": { "tags": [ - "Rebuild Script Executors" + "Screen Categories" ], - "summary": "Delete a script executor", - "description": "Delete a script executor", - "operationId": "deleteScriptExecutor", + "summary": "Update a screen Category", + "description": "Updates the current element", + "operationId": "updateScreenCategory", "parameters": [ { - "name": "script_executor", + "name": "screen_category_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" - } - } - } - } - } - } - }, - "/script-executors/cancel": { - "post": { - "tags": [ - "Rebuild Script Executors" - ], - "summary": "Cancel a script executor", - "description": "Cancel a script executor", - "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "pidFile": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategoryEditable" } } } @@ -5549,30 +5703,46 @@ "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } + }, + "delete": { + "tags": [ + "Screen Categories" + ], + "summary": "Delete a screen category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScreenCategory", + "parameters": [ + { + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } } }, - "/script-executors/available-languages": { + "/screens": { "get": { "tags": [ - "Rebuild Script Executors" + "Screens" ], - "summary": "Returns all available languages", - "description": "Get a list of available languages.", - "operationId": "getAvailableLanguages", + "summary": "Returns all screens that the user has access to", + "description": "Get a list of Screens.", + "operationId": "getScreens", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -5585,11 +5755,23 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude", + "in": "query", + "description": "Comma separated list of fields to exclude from the response", + "schema": { + "type": "string", + "default": "" + } } ], "responses": { "200": { - "description": "list of available languages", + "description": "list of screens", "content": { "application/json": { "schema": { @@ -5597,7 +5779,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/availableLanguages" + "$ref": "#/components/schemas/screens" } }, "meta": { @@ -5610,48 +5792,31 @@ } } } - } - }, - "/security-logs": { - "get": { + }, + "post": { "tags": [ - "Security Logs" + "Screens" ], - "summary": "Returns all security logs", - "description": "Get a list of Security Logs.", - "operationId": "getSecurityLogs", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "summary": "Save a new screens", + "description": "Create a new Screen.", + "operationId": "createScreen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } } - ], + }, "responses": { - "200": { - "description": "list of security logs", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/screens" } } } @@ -5659,19 +5824,19 @@ } } }, - "/security-logs/{securityLog}": { + "/screens/{screens_id}": { "get": { "tags": [ - "Security Logs" + "Screens" ], - "summary": "Get single security log by ID", - "description": "Display the specified resource.", - "operationId": "getSecurityLog", + "summary": "Get single screens by ID", + "description": "Get a single Screen.", + "operationId": "getScreensById", "parameters": [ { - "name": "securityLog", + "name": "screens_id", "in": "path", - "description": "ID of security log to return", + "description": "ID of screens to return", "required": true, "schema": { "type": "string" @@ -5680,92 +5845,92 @@ ], "responses": { "200": { - "description": "Successfully found the security log", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/screens" } } } } } - } - }, - "/settings": { - "get": { + }, + "put": { "tags": [ - "Settings" + "Screens" ], - "summary": "Returns all settings", - "description": "Display a listing of the resource.", - "operationId": "getSettings", + "summary": "Update a screen", + "description": "Update a Screen.", + "operationId": "updateScreen", "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": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } } ], - "responses": { - "200": { - "description": "list of settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/settings" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" } } } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Screens" + ], + "summary": "Delete a screen", + "description": "Delete a Screen.", + "operationId": "deleteScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } } } }, - "/settings/{setting_id}": { + "/screens/{screens_id}/draft": { "put": { "tags": [ - "Settings" + "Screens" ], - "summary": "Update a setting", - "description": "Update a setting", - "operationId": "updateSetting", + "summary": "Update a draft screen", + "description": "Update a draft Screen.", + "operationId": "updateDraftScreen", "parameters": [ { - "name": "setting_id", + "name": "screens_id", "in": "path", - "description": "ID of setting to return", + "description": "ID of screen to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -5774,7 +5939,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/settingsEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -5782,75 +5947,35 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/signals": { - "get": { + "/screens/{screens_id}/duplicate": { + "put": { "tags": [ - "Signals" + "Screens" ], - "summary": "Returns all signals", - "description": "Display a listing of the resource.", - "operationId": "getSignals", + "summary": "duplicate a screen", + "description": "duplicate a Screen.", + "operationId": "duplicateScreen", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of signals", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/signals" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" } } - } - }, - "post": { - "tags": [ - "Signals" ], - "summary": "Creates a new Global Signal", - "description": "Creates a new global signal", - "operationId": "createSignal", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -5861,7 +5986,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screens" } } } @@ -5869,19 +5994,19 @@ } } }, - "/signals/{signal_id}": { - "get": { + "/screens/{screensId}/export": { + "post": { "tags": [ - "Signals" + "Screens" ], - "summary": "Get a single signal by ID", - "description": "Display the specified resource.", - "operationId": "getSignalsById", + "summary": "Export a single screen by ID", + "description": "Export the specified screen.", + "operationId": "exportScreen", "parameters": [ { - "name": "signal_id", + "name": "screensId", "in": "path", - "description": "signal id", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -5890,68 +6015,130 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully exported the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screenExported" } } } } } - }, - "put": { + } + }, + "/screens/import": { + "post": { "tags": [ - "Signals" + "Screens" ], - "summary": "Update a signal", - "operationId": "updateSignal", - "parameters": [ - { - "name": "signal_id", - "in": "path", - "description": "ID of signal to update", - "required": true, - "schema": { - "type": "string" + "summary": "Import a new screen", + "description": "Import the specified screen.", + "operationId": "importScreen", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } } } + } + } + }, + "/screens/preview": { + "post": { + "tags": [ + "Screens" ], + "summary": "Preview a screen", + "description": "Get preview a screen", + "operationId": "preview", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "properties": { + "config": { + "type": "object" + }, + "watchers": { + "type": "object" + }, + "computed": { + "type": "object" + }, + "custom_css": { + "type": "string" + } + }, + "type": "object" } } } }, "responses": { "200": { - "description": "success", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/screens" } } } } } - }, - "delete": { + } + }, + "/screens/{screen_id}/translate/{language}": { + "get": { "tags": [ - "Signals" + "Screens" ], - "summary": "Delete a signal", - "operationId": "deleteSignal", + "summary": "Translates the screen to the desired language", + "description": "Translates the controls inside a screen", + "operationId": "translateScreen", "parameters": [ { - "name": "signal_id", + "name": "screen_id", "in": "path", - "description": "ID of signal to delete", + "description": "ID of the screen", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "language", + "in": "path", + "description": "Language used for the translation of the string", "required": true, "schema": { "type": "string" @@ -5959,23 +6146,35 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/task_assignments": { + "/script_categories": { "get": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Returns all task assignments", - "description": "Display a listing of the resource.", - "operationId": "getTaskAssignments", + "summary": "Returns all scripts categories that the user has access to", + "description": "Display a listing of the Script Categories.", + "operationId": "getScriptCategories", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5989,7 +6188,7 @@ ], "responses": { "200": { - "description": "list of task assignments", + "description": "list of scripts categories", "content": { "application/json": { "schema": { @@ -5997,7 +6196,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/ScriptCategory" } }, "meta": { @@ -6013,17 +6212,17 @@ }, "post": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Save a new Task Assignment", - "description": "Store a newly created task assignment in storage.", - "operationId": "createTaskAssignments", + "summary": "Save a new Script Category", + "description": "Store a newly created Script Category in storage", + "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -6034,73 +6233,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/ScriptCategory" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/task_assignments/{task_assignment}": { - "put": { + "/script_categories/{script_category_id}": { + "get": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Update a Task Assignment", - "description": "Update a task assignment", - "operationId": "updateTaskAssignments", + "summary": "Get single script category by ID", + "description": "Display the specified script category.", + "operationId": "getScriptCategoryById", "parameters": [ { - "name": "task_assignment", + "name": "script_category_id", "in": "path", - "description": "ID of task assignment to update", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "responses": { + "200": { + "description": "Successfully found the script", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } } } } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } } }, - "delete": { + "put": { "tags": [ - "Task Assignments" + "Script Categories" ], - "summary": "Delete a Task Assignment", - "description": "Remove an assignment", - "operationId": "deleteTaskAssignments", + "summary": "Update a script Category", + "description": "Updates the current element", + "operationId": "updateScriptCategory", "parameters": [ { - "name": "task_assignment", + "name": "script_category_id", "in": "path", - "description": "ID of task assignment to delete", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6109,45 +6296,58 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } }, "responses": { "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Script Categories" + ], + "summary": "Delete a script category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScriptCategory", + "parameters": [ + { + "name": "script_category_id", + "in": "path", + "description": "ID of script category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { "description": "success" } } } }, - "/tasks": { + "/scripts": { "get": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Returns all tasks that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getTasks", + "summary": "Returns all scripts that the user has access to", + "description": "Get a list of scripts in a process.", + "operationId": "getScripts", "parameters": [ - { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "all_tasks", - "in": "query", - "description": "Return all task types. Not just user tasks.", - "required": false, - "schema": { - "type": "boolean" - } - }, { "$ref": "#/components/parameters/filter" }, @@ -6157,13 +6357,16 @@ { "$ref": "#/components/parameters/order_direction" }, + { + "$ref": "#/components/parameters/per_page" + }, { "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of tasks", + "description": "list of scripts", "content": { "application/json": { "schema": { @@ -6171,11 +6374,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/scripts" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -6184,64 +6387,50 @@ } } } - } - }, - "/tasks/{task_id}": { - "get": { + }, + "post": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Get a single task by ID", - "description": "Display the specified resource.", - "operationId": "getTasksById", - "parameters": [ - { - "name": "task_id", - "in": "path", - "description": "task id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "include", - "in": "query", - "description": "include", - "required": false, - "schema": { - "type": "string" + "summary": "Save a new script", + "description": "Create a new script in a process.", + "operationId": "createScript", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } } } - ], + }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "put": { + } + }, + "/scripts/{script_id}/preview": { + "post": { "tags": [ - "Tasks" + "Scripts" ], - "summary": "Update a task", - "description": "Updates the current element", - "operationId": "updateTask", + "summary": "Test script code without saving it", + "description": "Previews executing a script, with sample data/config data", + "operationId": "previewScript", "parameters": [ { - "name": "task_id", + "name": "script_id", "in": "path", - "description": "ID of task to update", "required": true, "schema": { "type": "integer" @@ -6249,21 +6438,27 @@ } ], "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "required": [ - "status", - "data" - ], "properties": { - "status": { - "type": "string", - "example": "COMPLETED" - }, "data": { - "type": "object" + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "code": { + "type": "string" + }, + "nonce": { + "type": "string" } }, "type": "object" @@ -6273,226 +6468,146 @@ }, "responses": { "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequestToken" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" + "description": "success if the script was queued" } } } }, - "/users": { - "get": { + "/scripts/execute/{script_id}": { + "post": { "tags": [ - "Users" + "Scripts" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getUsers", + "summary": "Execute script", + "description": "Executes a script, with sample data/config data", + "operationId": "executeScript", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "exclude_ids", - "in": "query", - "description": "Comma separated list of IDs to exclude from the response", + "name": "script_id", + "in": "path", + "required": true, "schema": { - "type": "string", - "default": "" - } - } - ], - "responses": { - "200": { - "description": "list of users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } + "type": "integer" } } - } - }, - "post": { - "tags": [ - "Users" ], - "summary": "Save a new users", - "description": "Store a newly created resource in storage.", - "operationId": "createUser", "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "sync": { + "type": "boolean" + } + }, + "type": "object" } } } }, "responses": { - "201": { - "description": "success", + "200": { + "description": "success if the script was queued", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scriptsPreview" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users_task_count": { + "/scripts/execution/{key}": { "get": { "tags": [ - "Users" + "Scripts" ], - "summary": "Returns all users and their total tasks", - "description": "Display a listing of users and their task counts.", - "operationId": "getUsersTaskCount", + "summary": "Get the response of a script execution by execution key", + "description": "Get the response of a script execution", + "operationId": "getScriptExecutionResponse", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "name": "key", + "in": "path", + "required": true, "schema": { "type": "string" } - }, - { - "name": "include_ids", - "in": "query", - "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", - "schema": { - "type": "string", - "default": "" - } } ], "responses": { "200": { - "description": "List of users with task counts", + "description": "response of a script execution", "content": { "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "schema": {} } } } } } }, - "/users/{user_id}": { + "/scripts/{script_id}": { "get": { "tags": [ - "Users" + "Scripts" ], - "summary": "Get single user by ID", - "description": "Display the specified resource.", - "operationId": "getUserById", + "summary": "Get single script by ID", + "description": "Get a single script in a process.", + "operationId": "getScriptsById", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Update a user", - "description": "Update a user", - "operationId": "updateUser", + "summary": "Update a script", + "description": "Update a script in a process.", + "operationId": "updateScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6501,7 +6616,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -6509,95 +6624,50 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Users" + "Scripts" ], - "summary": "Delete a user", - "description": "Delete a user", - "operationId": "deleteUser", + "summary": "Delete a script", + "description": "Delete a script in a process.", + "operationId": "deleteScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to delete", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/{user_id}/get_pinned_controls": { - "get": { + "/scripts/{script_id}/draft": { + "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Get the pinned BPMN elements of a specific user", - "description": "Return the user's pinned nodes.", - "operationId": "getPinnnedControls", + "summary": "Update a draft script", + "description": "Update a draft script.", + "operationId": "updateDraftScript", "parameters": [ { - "name": "user_id", + "name": "script_id", "in": "path", - "description": "ID of user to return the pinned nodes of", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Pinned nodes returned succesfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/update_pinned_controls": { - "put": { - "tags": [ - "Users" - ], - "summary": "Update a user's pinned BPMN elements on Modeler", - "description": "Update a user's pinned BPMN elements on Modeler", - "operationId": "updatePinnedControls", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -6606,7 +6676,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -6614,164 +6684,70 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users/{user_id}/groups": { + "/scripts/{scripts_id}/duplicate": { "put": { "tags": [ - "Users" + "Scripts" ], - "summary": "Set the groups a users belongs to", - "description": "Update a user's groups", - "operationId": "updateUserGroups", + "summary": "duplicate a script", + "description": "Duplicate a Script.", + "operationId": "duplicateScript", "parameters": [ { - "name": "user_id", + "name": "scripts_id", "in": "path", - "description": "ID of user", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/updateUserGroups" - } + "type": "string" } } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/users/restore": { - "put": { - "tags": [ - "Users" ], - "summary": "Restore a soft deleted user", - "description": "Reverses the soft delete of a user", - "operationId": "restoreUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/restoreUser" + "$ref": "#/components/schemas/scriptsEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/users/get_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get filter configuration by name", - "description": "Get filter configuration.", - "operationId": "getFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/scripts" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/store_filter_configuration/{name}": { + "/script-executors": { "get": { "tags": [ - "Users" + "Rebuild Script Executors" ], - "summary": "Store filter configuration by name", - "description": "Store filter configuration.", - "operationId": "storeFilterConfiguration", + "summary": "Returns all script executors that the user has access to", + "description": "Get a list of script executors.", + "operationId": "getScriptExecutors", "parameters": [ { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } + "$ref": "#/components/parameters/filter" }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/tokens": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Display listing of access tokens for the specified user.", - "description": "Display listing of access tokens for the specified user.", - "operationId": "getTokens", - "parameters": [ { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" @@ -6779,7 +6755,7 @@ ], "responses": { "200": { - "description": "List of tokens.", + "description": "list of script executors", "content": { "application/json": { "schema": { @@ -6787,11 +6763,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/UserToken" + "$ref": "#/components/schemas/scriptExecutors" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -6803,44 +6779,36 @@ }, "post": { "tags": [ - "Personal Tokens" - ], - "summary": "Create new token for a specific user", - "description": "Create a new personal access token for the user.", - "operationId": "createTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - } + "Rebuild Script Executors" ], + "summary": "Create a script executor", + "description": "Create a script executor", + "operationId": "createScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/scriptExecutorsEditable" } } } }, "responses": { - "201": { - "description": "New token instance", + "200": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserToken" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -6848,41 +6816,47 @@ } } }, - "/users/{user_id}/tokens/{token_id}": { - "get": { + "/script-executors/{script_executor}": { + "put": { "tags": [ - "Personal Tokens" + "Rebuild Script Executors" ], - "summary": "Get single token by ID", - "description": "Show a personal access token for the user", - "operationId": "getTokenById", + "summary": "Update script executor", + "description": "Update and rebuild the script executor", + "operationId": "updateScriptExecutor", "parameters": [ { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", + "name": "script_executor", "in": "path", - "description": "ID of token to return", + "description": "ID of script executor to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "Successfully found the token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" } } } @@ -6891,25 +6865,193 @@ }, "delete": { "tags": [ - "Personal Tokens" + "Rebuild Script Executors" ], - "summary": "Delete a token", - "description": "Delete the given token for a user", - "operationId": "deleteToken", + "summary": "Delete a script executor", + "description": "Delete a script executor", + "operationId": "deleteScriptExecutor", "parameters": [ { - "name": "user_id", + "name": "script_executor", "in": "path", - "description": "User ID", + "description": "ID of script executor to return", "required": true, "schema": { - "type": "integer" + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/script-executors/cancel": { + "post": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Cancel a script executor", + "description": "Cancel a script executor", + "operationId": "cancelScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "pidFile": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + } } + } + } + } + }, + "/script-executors/available-languages": { + "get": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Returns all available languages", + "description": "Get a list of available languages.", + "operationId": "getAvailableLanguages", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "name": "token_id", + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of available languages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableLanguages" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Returns all security logs", + "description": "Get a list of Security Logs.", + "operationId": "getSecurityLogs", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of security logs", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs/{securityLog}": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Get single security log by ID", + "description": "Display the specified resource.", + "operationId": "getSecurityLog", + "parameters": [ + { + "name": "securityLog", "in": "path", - "description": "Token ID", + "description": "ID of security log to return", "required": true, "schema": { "type": "string" @@ -6917,68 +7059,1649 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the security log", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + } + }, + "type": "object" + } + } + } } } } - } - }, - "components": { - "schemas": { - "DateTime": { - "properties": { - "date": { - "type": "string" + }, + "/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Returns all settings", + "description": "Display a listing of the resource.", + "operationId": "getSettings", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/settings" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings/{setting_id}": { + "put": { + "tags": [ + "Settings" + ], + "summary": "Update a setting", + "description": "Update a setting", + "operationId": "updateSetting", + "parameters": [ + { + "name": "setting_id", + "in": "path", + "description": "ID of setting to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/settingsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/signals": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Returns all signals", + "description": "Display a listing of the resource.", + "operationId": "getSignals", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of signals", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/signals" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Signals" + ], + "summary": "Creates a new Global Signal", + "description": "Creates a new global signal", + "operationId": "createSignal", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + } + }, + "/signals/{signal_id}": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Get a single signal by ID", + "description": "Display the specified resource.", + "operationId": "getSignalsById", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "signal id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "put": { + "tags": [ + "Signals" + ], + "summary": "Update a signal", + "operationId": "updateSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Signals" + ], + "summary": "Delete a signal", + "operationId": "deleteSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to delete", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/task_assignments": { + "get": { + "tags": [ + "Task Assignments" + ], + "summary": "Returns all task assignments", + "description": "Display a listing of the resource.", + "operationId": "getTaskAssignments", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of task assignments", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/taskAssignments" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Task Assignments" + ], + "summary": "Save a new Task Assignment", + "description": "Store a newly created task assignment in storage.", + "operationId": "createTaskAssignments", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignments" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/task_assignments/{task_assignment}": { + "put": { + "tags": [ + "Task Assignments" + ], + "summary": "Update a Task Assignment", + "description": "Update a task assignment", + "operationId": "updateTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Task Assignments" + ], + "summary": "Delete a Task Assignment", + "description": "Remove an assignment", + "operationId": "deleteTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Returns all tasks that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getTasks", + "parameters": [ + { + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "all_tasks", + "in": "query", + "description": "Return all task types. Not just user tasks.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of tasks", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequestToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/tasks/{task_id}": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Get a single task by ID", + "description": "Display the specified resource.", + "operationId": "getTasksById", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "task id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "include", + "in": "query", + "description": "include", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Tasks" + ], + "summary": "Update a task", + "description": "Updates the current element", + "operationId": "updateTask", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "ID of task to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "required": [ + "status", + "data" + ], + "properties": { + "status": { + "type": "string", + "example": "COMPLETED" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getUsers", + "parameters": [ + { + "$ref": "#/components/parameters/status" + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude_ids", + "in": "query", + "description": "Comma separated list of IDs to exclude from the response", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "list of users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Users" + ], + "summary": "Save a new users", + "description": "Store a newly created resource in storage.", + "operationId": "createUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users_task_count": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users and their total tasks", + "description": "Display a listing of users and their task counts.", + "operationId": "getUsersTaskCount", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "schema": { + "type": "string" + } + }, + { + "name": "include_ids", + "in": "query", + "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "schema": { + "type": "string", + "default": "" + } + } + ], + "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}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get single user by ID", + "description": "Display the specified resource.", + "operationId": "getUserById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user", + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete a user", + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/get_pinned_controls": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get the pinned BPMN elements of a specific user", + "description": "Return the user's pinned nodes.", + "operationId": "getPinnnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return the pinned nodes of", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Pinned nodes returned succesfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/update_pinned_controls": { + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user's pinned BPMN elements on Modeler", + "description": "Update a user's pinned BPMN elements on Modeler", + "operationId": "updatePinnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users/{user_id}/groups": { + "put": { + "tags": [ + "Users" + ], + "summary": "Set the groups a users belongs to", + "description": "Update a user's groups", + "operationId": "updateUserGroups", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/updateUserGroups" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/users/restore": { + "put": { + "tags": [ + "Users" + ], + "summary": "Restore a soft deleted user", + "description": "Reverses the soft delete of a user", + "operationId": "restoreUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/restoreUser" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/users/get_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get filter configuration by name", + "description": "Get filter configuration.", + "operationId": "getFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/store_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Store filter configuration by name", + "description": "Store filter configuration.", + "operationId": "storeFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/tokens": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Display listing of access tokens for the specified user.", + "description": "Display listing of access tokens for the specified user.", + "operationId": "getTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "List of tokens.", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Personal Tokens" + ], + "summary": "Create new token for a specific user", + "description": "Create a new personal access token for the user.", + "operationId": "createTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "New token instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + } + }, + "/users/{user_id}/tokens/{token_id}": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Get single token by ID", + "description": "Show a personal access token for the user", + "operationId": "getTokenById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "ID of token to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Personal Tokens" + ], + "summary": "Delete a token", + "description": "Delete the given token for a user", + "operationId": "deleteToken", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "Token ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/processes/variables": { + "get": { + "tags": [ + "Processes Variables" + ], + "summary": "Get variables for multiple processes with pagination", + "operationId": "660c9459febd17c58400be4b4d49a152", + "parameters": [ + { + "name": "processIds", + "in": "query", + "description": "Comma-separated list of process IDs", + "required": false, + "schema": { + "type": "string", + "example": "1,2,3", + "nullable": true + } + }, + { + "name": "page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "in": "query", + "description": "Items per page", + "required": false, + "schema": { + "type": "integer", + "default": 20 + } + } + ], + "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": [ + { + "url": "https://nolans-laptop.tail0babd.ts.net/api/1.1", + "description": "API v1.1 Server" + } + ] + } + } + }, + "components": { + "schemas": { + "DateTime": { + "properties": { + "date": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReportingEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "link": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReporting": { + "allOf": [ + { + "$ref": "#/components/schemas/analyticsReportingEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "collectionsEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "custom_title": { + "type": "string" + }, + "create_screen_id": { + "type": "string", + "format": "id" + }, + "read_screen_id": { + "type": "string", + "format": "id" + }, + "update_screen_id": { + "type": "string", + "format": "id" + }, + "signal_create": { + "type": "boolean" + }, + "signal_update": { + "type": "boolean" + }, + "signal_delete": { + "type": "boolean" + } + }, + "type": "object" + }, + "collections": { + "allOf": [ + { + "$ref": "#/components/schemas/collectionsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + }, + "columns": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + ] + }, + "recordsEditable": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "records": { + "allOf": [ + { + "$ref": "#/components/schemas/recordsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "collection_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "DataSourceCallParameters": { + "properties": { + "endpoint": { + "type": "string" + }, + "dataMapping": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "outboundConfig": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "DataSourceResponse": { + "properties": { + "status": { + "type": "integer" + }, + "response": { + "type": "object" + } + }, + "type": "object" + }, + "dataSourceEditable": { + "properties": { + "id": { + "description": "Class DataSource", + "type": "string", + "format": "id" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "endpoints": { + "type": "string" + }, + "mappings": { + "type": "string" + }, + "authtype": { + "type": "string" + }, + "credentials": { + "type": "string" + }, + "status": { + "type": "string" + }, + "data_source_category_id": { + "type": "string" + } + }, + "type": "object" + }, + "dataSource": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "dataSourceCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business data Source category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DataSourceCategory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceCategoryEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" } - }, - "type": "object" + ] }, - "collectionsEditable": { + "decisionTableEditable": { "properties": { + "id": { + "description": "Class Screen", + "type": "string", + "format": "id" + }, "name": { "type": "string" }, "description": { "type": "string" }, - "custom_title": { + "definition": { "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" + "decision_table_categories_id": { + "type": "string" } }, "type": "object" }, - "collections": { + "decisionTable": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" }, { "properties": { - "id": { - "type": "integer" - }, "created_at": { "type": "string", "format": "date-time" @@ -6986,47 +8709,55 @@ "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": { + "DecisionTableExported": { "properties": { - "data": { - "type": "object" + "url": { + "type": "string" } }, "type": "object" }, - "records": { + "decisionTableCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business decision Table category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DecisionTableCategory": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/recordsEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" }, { "properties": { "id": { - "type": "integer" - }, - "collection_id": { "type": "string", "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" } }, "type": "object" @@ -7297,6 +9028,132 @@ }, "type": "object" }, + "Variable": { + "properties": { + "id": { + "type": "integer", + "example": 1 + }, + "process_id": { + "type": "integer", + "example": 1 + }, + "uuid": { + "type": "string", + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "field": { + "type": "string", + "enum": [ + "string", + "number", + "boolean", + "array" + ], + "example": "string" + }, + "label": { + "type": "string", + "example": "Variable 1 for Process 1" + }, + "name": { + "type": "string", + "example": "var_1_1" + }, + "asset": { + "properties": { + "id": { + "type": "string", + "example": "asset_1_1" + }, + "type": { + "type": "string", + "enum": [ + "sensor", + "actuator", + "controller", + "device" + ], + "example": "sensor" + }, + "name": { + "type": "string", + "example": "Asset 1 for Process 1" + }, + "uuid": { + "type": "string", + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" + } + }, + "type": "object" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + "PaginationMeta": { + "properties": { + "current_page": { + "type": "integer", + "example": 1 + }, + "from": { + "type": "integer", + "example": 1 + }, + "last_page": { + "type": "integer", + "example": 5 + }, + "path": { + "type": "string", + "example": "http://processmaker.com/processes/variables" + }, + "per_page": { + "type": "integer", + "example": 20 + }, + "to": { + "type": "integer", + "example": 20 + }, + "total": { + "type": "integer", + "example": 100 + }, + "links": { + "properties": { + "first": { + "type": "string", + "example": "http://processmaker.com/processes/variables?page=1" + }, + "last": { + "type": "string", + "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" + } + }, + "type": "object" + }, "metadata": { "properties": { "filter": { @@ -8632,6 +10489,9 @@ }, "key": { "type": "string" + }, + "output": { + "type": "object" } }, "type": "object" @@ -9002,6 +10862,9 @@ }, "force_change_password": { "type": "boolean" + }, + "email_task_notification": { + "type": "boolean" } }, "type": "object" @@ -9194,9 +11057,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": "https://nolans-laptop.tail0babd.ts.net/oauth/authorize", + "tokenUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/token", + "refreshUrl": "https://nolans-laptop.tail0babd.ts.net/token/refresh", "scopes": {} } } @@ -9208,6 +11071,148 @@ } } }, + "tags": [ + { + "name": "AnalyticsReporting", + "description": "AnalyticsReporting" + }, + { + "name": "Collections", + "description": "Collections" + }, + { + "name": "Screens", + "description": "Screens" + }, + { + "name": "Comments", + "description": "Comments" + }, + { + "name": "DataSourcesCategories", + "description": "DataSourcesCategories" + }, + { + "name": "DataSources", + "description": "DataSources" + }, + { + "name": "DecisionTableCategories", + "description": "DecisionTableCategories" + }, + { + "name": "DecisionTables", + "description": "DecisionTables" + }, + { + "name": "SavedSearchCharts", + "description": "SavedSearchCharts" + }, + { + "name": "Reports", + "description": "Reports" + }, + { + "name": "SavedSearches", + "description": "SavedSearches" + }, + { + "name": "Users", + "description": "Users" + }, + { + "name": "Groups", + "description": "Groups" + }, + { + "name": "Version History", + "description": "Version History" + }, + { + "name": "CssSettings", + "description": "CssSettings" + }, + { + "name": "Environment Variables", + "description": "Environment Variables" + }, + { + "name": "Files", + "description": "Files" + }, + { + "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": "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": "Personal Tokens", + "description": "Personal Tokens" + }, + { + "name": "Processes Variables", + "description": "Processes Variables" + } + ], "security": [ { "passport": [], From bafe6305e7a1cc1dcc147fc68d68e1fe97cfc3e2 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Wed, 16 Apr 2025 17:58:08 -0700 Subject: [PATCH 12/53] Make secrets nullable --- ...9_update_oauth_clients_secret_nullable.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php diff --git a/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php b/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php new file mode 100644 index 0000000000..08e05d6987 --- /dev/null +++ b/database/migrations/2025_04_17_005609_update_oauth_clients_secret_nullable.php @@ -0,0 +1,27 @@ +string('secret', 100)->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('oauth_clients', function (Blueprint $table) { + $table->string('secret', 100)->nullable(false)->change(); + }); + } +}; From d2d0e204cb3ed728c11c208128a83fb2561f145f Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Apr 2025 07:20:48 -0700 Subject: [PATCH 13/53] Update cors.php --- config/cors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cors.php b/config/cors.php index 979cc947db..481af047b7 100644 --- a/config/cors.php +++ b/config/cors.php @@ -31,6 +31,6 @@ 'max_age' => 0, - 'supports_credentials' => false, + 'supports_credentials' => true, ]; From 074c482e96e76127e8401719b049fe7cfedc3553 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 17 Apr 2025 07:57:23 -0700 Subject: [PATCH 14/53] Update LoginController.php --- ProcessMaker/Http/Controllers/Auth/LoginController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Auth/LoginController.php b/ProcessMaker/Http/Controllers/Auth/LoginController.php index 190475ec1b..a223b6853b 100644 --- a/ProcessMaker/Http/Controllers/Auth/LoginController.php +++ b/ProcessMaker/Http/Controllers/Auth/LoginController.php @@ -288,6 +288,10 @@ private function forgetUserSession() public function loggedOut(Request $request) { + if ($request->has('redirectTo')) { + return redirect($request->get('redirectTo')); + } + $response = redirect(route('login')); if ($request->has('timeout')) { $response->with('timeout', true); From 3d7debbafb31f7d402c111c132fca72827e08d6c Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 24 Apr 2025 14:52:49 -0700 Subject: [PATCH 15/53] Update cors.php --- config/cors.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cors.php b/config/cors.php index 481af047b7..b327f18f78 100644 --- a/config/cors.php +++ b/config/cors.php @@ -21,6 +21,7 @@ 'allowed_origins' => [ 'http://localhost:4200', + 'https://legendary-adventure-2n21ppv.pages.github.io', ], 'allowed_origins_patterns' => [], From 842832f9dd51cc1aa8dca901b07a05e2a3fa2a1c Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 21 Apr 2025 11:48:11 -0400 Subject: [PATCH 16/53] Add Api2TypescriptCommand for generating TypeScript SDK from OpenAPI spec - Implemented a new console command `make:api-typescript` to convert OpenAPI JSON specifications into TypeScript interfaces, API classes, and composables for Vue applications. - Added methods for parsing JSON, generating TypeScript types, API classes, and composables based on OpenAPI tags. - Created necessary stub files for TypeScript generation including API index, response types, and composables. - Updated OpenAPI spec to include new parameters and operation IDs for better integration with the generated SDK. --- .../Commands/Api2TypescriptCommand.php | 704 ++ .../Http/Controllers/Api/OpenApiSpec.php | 7 + .../Controllers/Api/PermissionController.php | 1 + .../Controllers/Api/ProcessController.php | 2 + .../Api/V1_1/ProcessVariableController.php | 1 + .../stubs/api2typescript/api-index.blade.php | 9 + .../api2typescript/api-response.blade.php | 7 + resources/stubs/api2typescript/api.blade.php | 63 + .../stubs/api2typescript/composable.blade.php | 15 + .../composables-index.blade.php | 9 + .../stubs/api2typescript/main-index.blade.php | 4 + .../stubs/api2typescript/readme.blade.php | 45 + .../stubs/api2typescript/types.blade.php | 14 + storage/api-docs/api-docs.json | 8929 +++++++++-------- 14 files changed, 5351 insertions(+), 4459 deletions(-) create mode 100644 ProcessMaker/Console/Commands/Api2TypescriptCommand.php create mode 100644 resources/stubs/api2typescript/api-index.blade.php create mode 100644 resources/stubs/api2typescript/api-response.blade.php create mode 100644 resources/stubs/api2typescript/api.blade.php create mode 100644 resources/stubs/api2typescript/composable.blade.php create mode 100644 resources/stubs/api2typescript/composables-index.blade.php create mode 100644 resources/stubs/api2typescript/main-index.blade.php create mode 100644 resources/stubs/api2typescript/readme.blade.php create mode 100644 resources/stubs/api2typescript/types.blade.php diff --git a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php new file mode 100644 index 0000000000..4d8593ed39 --- /dev/null +++ b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php @@ -0,0 +1,704 @@ +files = $files; + } + + /** + * Execute the console command. + * + * @return int + */ + public function handle() + { + $openapiFile = url('/docs?api-docs.json'); //$this->argument('input'); + $outputDirectory = $this->argument('output'); + + // update the api-docs.json file + Artisan::call('l5-swagger:generate'); + + // Parse JSON file + $openapi = $this->parseJsonFile(); + if (!$openapi) { + $this->error("Failed to parse OpenAPI JSON file."); + return 1; + } + + // Create output directory if it doesn't exist + if (!$this->files->exists($outputDirectory)) { + $this->files->makeDirectory($outputDirectory, 0755, true); + } + + // Create subdirectories + $typesDir = "$outputDirectory/types"; + $apiDir = "$outputDirectory/api"; + $composablesDir = "$outputDirectory/composables"; + + foreach ([$typesDir, $apiDir, $composablesDir] as $dir) { + if (!$this->files->exists($dir)) { + $this->files->makeDirectory($dir, 0755, true); + } + } + + // Extract API info + $apiTitle = $openapi['info']['title'] ?? 'API'; + $apiDescription = $openapi['info']['description'] ?? 'API Description'; + $apiVersion = $openapi['info']['version'] ?? '1.0.0'; + + // Extract tag names + $tags = []; + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + if (isset($details['tags']) && is_array($details['tags'])) { + foreach ($details['tags'] as $tag) { + $tags[$tag] = true; + } + } + } + } + $tags = array_keys($tags); + + $this->generateTypesForTag($openapi, 'types', $typesDir); + // Process each tag as a separate API client + foreach ($tags as $tag) { + $this->generateApiClassForTag($openapi, $tag, $apiDir); + $this->generateComposableForTag($tag, $composablesDir); + } + + // Generate index files + $this->generateIndexFiles($tags, $apiDir, $composablesDir, $typesDir, $outputDirectory); + + $this->info("TypeScript SDK generated successfully in $outputDirectory"); + return 0; + } + + /** + * Parse a JSON file + */ + protected function parseJsonFile() + { + $content = file_get_contents(storage_path('api-docs/api-docs.json')); + $data = json_decode($content, true); + if (json_last_error() !== JSON_ERROR_NONE) { + $this->error("JSON parse error: " . json_last_error_msg()); + return null; + } + + return $data; + } + + /** + * Map OpenAPI type to TypeScript type + */ + protected function mapSwaggerTypeToTypescript($type) + { + switch ($type) { + case 'integer': + return 'number'; + case 'number': + return 'number'; + case 'boolean': + return 'boolean'; + case 'array': + return 'any[]'; + case 'object': + return 'Record'; + default: + return 'string'; + } + } + + /** + * Generate TypeScript interfaces for schemas related to a tag + */ + protected function generateTypesForTag($openapi, $tag, $outputDir) + { + $tagLower = strtolower($tag); + $interfaces = []; + $queryParamInterfaces = []; + + // Get all schemas from components + $schemas = $openapi['components']['schemas'] ?? []; + + // Process paths to find related schemas and generate query param interfaces + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + // Skip if not related to current tag + // if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + // continue; + // } + + // Generate query param interfaces for GET methods + if (isset($details['parameters'])) { + $queryParamInterface = $this->generateQueryParamInterface($details['parameters'], $tagLower, $details['operationId']); + if ($queryParamInterface) { + $queryParamInterfaces[] = $queryParamInterface; + } + } + + // Check request body schema reference + if (isset($details['requestBody']['content']['application/json']['schema']['$ref'])) { + $schemaRef = $details['requestBody']['content']['application/json']['schema']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + + // Generate response type for operationId + $responseSchema = $details['responses']['200']['content']['application/json']['schema'] ?? + $details['responses']['201']['content']['application/json']['schema'] ?? null; + if ($responseSchema && isset($responseSchema['properties'])) { + $queryParamInterfaces[] = $this->generateResponseType($details['operationId'], $responseSchema, $tagLower); + } + + // Check response schema references + foreach ($details['responses'] ?? [] as $response) { + if (isset($response['content']['application/json']['schema']['$ref'])) { + $schemaRef = $response['content']['application/json']['schema']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + + // Check for arrays with items having refs + if (isset($response['content']['application/json']['schema']['properties']['data']['items']['$ref'])) { + $schemaRef = $response['content']['application/json']['schema']['properties']['data']['items']['$ref']; + $this->collectSchemaFromRef($schemaRef, $schemas); + } + } + } + } + + // Generate TypeScript interfaces from schemas + foreach ($schemas as $name => $schema) { + $interfaces[] = $this->generateInterface($name, $schema); + } + + // Write interfaces to file + $data = [ + 'interfaces' => array_filter($interfaces), + 'queryParamInterfaces' => array_filter($queryParamInterfaces), + ]; + + $content = Blade::render($this->getStub('types'), $data); + $this->files->put("$outputDir/types.ts", $content); + } + + /** + * Generate TypeScript API class for a tag + */ + protected function generateApiClassForTag($openapi, $tag, $outputDir) + { + $tagLower = lcfirst(Str::camel($tag)); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + + // Import interfaces + $imports = [ + // ucfirst($tagLower), + // fix the editable name + // "Editable" . ucfirst($tagLower), + // "PaginatedResponse" + ]; + + // Add query param interfaces to imports + foreach ($openapi['paths'] as $path => $methods) { + foreach ($methods as $method => $details) { + if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + continue; + } + + $operationId = $details['operationId'] ?? ''; + if ($operationId) { + if (isset($details['parameters'])) { + // Import the query param interface + $interfaceName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + $interfaceCode = $this->generateQueryParamInterface($details['parameters'], $tagLower, $details['operationId']); + if ($interfaceCode) { + $imports[] = $interfaceName; + } + } + + // Import the paginated response type and its type + $reference = $this->getResponseReference($operationId, $details['responses']); + if ($reference) { + $imports[] = $reference; + } + } + } + } + + // Generate methods for each path + $methods = []; + foreach ($openapi['paths'] as $path => $pathMethods) { + foreach ($pathMethods as $method => $details) { + // Skip if not related to current tag + if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { + continue; + } + + $operationId = $details['operationId'] ?? ''; + if ($operationId) { + $methods[] = $this->generateMethod($method, $path, $details, $imports); + } + } + } + + $data = [ + 'tagLower' => $tagLower, + 'className' => $className, + 'imports' => array_unique($imports), + 'methods' => $methods + ]; + + $content = Blade::render($this->getStub('api'), $data); + $this->files->put("$outputDir/$tagLower.api.ts", $content); + } + + private function getResponseReference(string $operationId, array $responses) + { + $responseSchema = $responses['200']['content']['application/json']['schema'] ?? + $responses['201']['content']['application/json']['schema'] ?? + $responses['202']['content']['application/json']['schema'] ?? + $responses['203']['content']['application/json']['schema'] ?? + $responses['204']['content']['application/json']['schema'] ?? null; + + if (!$responseSchema) { + return null; + } + if ($responseSchema && isset($responseSchema['properties'])) { + $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; + return $interfaceName; + } elseif ($responseSchema) { + return $this->getSchemaNameFromRef($responseSchema['$ref']); + } + + throw new \Exception("Failed to find response schema for $operationId"); + } + + private function findResponseSchema(string $operationId, array $responseSchema, array $imports) + { + $responseProperties = $responseSchema['properties'] ?? null; + if ($responseProperties) { + $refs = $this->findRefs($responseProperties); + foreach ($refs as $ref) { + $imports[] = $this->getSchemaNameFromRef($ref); + } + } elseif (isset($responseSchema['$ref'])) { + $imports[] = $this->getSchemaNameFromRef($responseSchema['$ref']); + } else { + throw new \Exception("Failed to find response schema for $operationId"); + } + + return $imports; + } + + private function findRefs(array $schema) + { + $refs = []; + foreach ($schema as $key => $value) { + if (isset($value['$ref'])) { + $refs[] = $value['$ref']; + } + if (is_array($value)) { + $refs = array_merge($refs, $this->findRefs($value)); + } + } + + return $refs; + } + + /** + * Generate a TypeScript method for an API endpoint + */ + protected function generateMethod($httpMethod, $path, $details, &$imports) + { + $operationId = $details['operationId']; + $methodName = $this->camelCase($operationId); + $summary = $details['summary'] ?? ''; + $parameters = $details['parameters'] ?? []; + $requestBody = $details['requestBody'] ?? null; + $responses = $details['responses'] ?? []; + + $parameters = $this->filterValidParameters($parameters); + // Determine method signature based on parameters and request body + $paramList = []; + $pathParams = []; + $queryParams = []; + + // Process path parameters + foreach ($parameters as $param) { + if ($param['in'] === 'path') { + $pathParams[] = $param; + $paramType = $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string'); + $paramList[] = $this->camelCase($param['name']) . ": " . $paramType; + } elseif ($param['in'] === 'query') { + $queryParams[] = $param; + } + } + + // Add request body parameter for POST/PUT methods + if (($httpMethod === 'post' || $httpMethod === 'put')/* && $requestBody*/) { + if (isset($requestBody['content']['application/json']['schema']['$ref'])) { + $schemaRef = $requestBody['content']['application/json']['schema']['$ref']; + $schemaName = $this->getSchemaNameFromRef($schemaRef); + // $this->generateInterface($schemaName, $requestBody['content']['application/json']['schema']); + $imports[] = $schemaName; + $paramList[] = "data: " . $schemaName; + } else { + $paramList[] = "data: Record"; + } + } + + // Handle GET methods with query parameters + if (!empty($queryParams)) { + $queryParamTypeName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + $paramList[] = "params?: " . $queryParamTypeName; + } + + // Determine return type + /*$returnType = 'void'; + foreach ($responses as $code => $response) { + if ("$code"[0] === '2') { // 2xx response + if (isset($response['content']['application/json']['schema'])) { + $schema = $response['content']['application/json']['schema']; + + if (isset($schema['$ref'])) { + $returnType = $this->getSchemaNameFromRef($schema['$ref']); + } elseif (isset($schema['type']) && $schema['type'] === 'object' && isset($schema['properties']['data']['type']) && $schema['properties']['data']['type'] === 'array') { + // Handle paginated response + if (isset($schema['properties']['data']['items']['$ref'])) { + $itemType = $this->getSchemaNameFromRef($schema['properties']['data']['items']['$ref']); + $returnType = "PaginatedResponse<" . $itemType . ">"; + } else { + $returnType = "PaginatedResponse"; + } + } else { + $returnType = "any"; + } + } + break; + } + }*/ + + $returnType = $this->getResponseReference($operationId, $responses); + + + // Build path with parameters + $apiPath = $path; + foreach ($pathParams as $param) { + $apiPath = str_replace('{' . $param['name'] . '}', '${' . $this->camelCase($param['name']) . '}', $apiPath); + } + + return [ + 'methodName' => $methodName, + 'summary' => $summary, + 'httpMethod' => $httpMethod, + 'paramList' => $paramList, + 'returnType' => $returnType, + 'apiPath' => $apiPath, + 'queryParams' => $queryParams, + 'pathParams' => $pathParams + ]; + } + + private function filterValidParameters(array $parameters) + { + // add in=query to the parameters if it is not set + foreach ($parameters as $i => $param) { + if (isset($param['ref']) || isset($param['$ref'])) { + $ref = $param['ref'] ?? $param['$ref']; + $refParts = explode('/', $ref); + $refName = end($refParts); + $parameters[$i]['in'] = 'query'; + $parameters[$i]['name'] = $refName; + } elseif (!isset($param['in'])) { + $parameters[$i]['in'] = 'query'; + dd($parameters[$i]); + } + } + return $parameters; + return array_filter($parameters, function ($param) { + return isset($param['in']); + }); + } + + /** + * Generate a TypeScript composable for a tag + */ + protected function generateComposableForTag($tag, $outputDir) + { + $tagLower = Str::camel($tag); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + $hookName = "useProcessMaker" . ucfirst($tagLower); + + $data = [ + 'tagLower' => $tagLower, + 'className' => $className, + 'hookName' => $hookName + ]; + + $content = Blade::render($this->getStub('composable'), $data); + $this->files->put("$outputDir/" . $hookName . ".ts", $content); + } + + /** + * Generate index files for the SDK + */ + protected function generateIndexFiles($tags, $apiDir, $composablesDir, $typesDir, $outputDir) + { + // API index + $apiClasses = []; + foreach ($tags as $tag) { + $tagLower = Str::camel($tag); + $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; + $apiClasses[] = [ + 'className' => $className, + 'tagLower' => $tagLower + ]; + } + + $data = ['apiClasses' => $apiClasses]; + $content = Blade::render($this->getStub('api-index'), $data); + $this->files->put("$apiDir/index.ts", $content); + + // Composables index + $hooks = []; + foreach ($tags as $tag) { + $tagLower = Str::camel($tag); + $hookName = "useProcessMaker" . ucfirst($tagLower); + $hooks[] = $hookName; + } + + $data = ['hooks' => $hooks]; + $content = Blade::render($this->getStub('composables-index'), $data); + $this->files->put("$composablesDir/index.ts", $content); + + // Main SDK index + $data = ['tags' => $tags]; + $content = Blade::render($this->getStub('main-index'), $data); + $this->files->put("$outputDir/index.ts", $content); + + // API Response type + $content = Blade::render($this->getStub('api-response'), []); + $this->files->put("$typesDir/api.ts", $content); + + // README + $data = [ + 'tags' => $tags, + 'firstTag' => !empty($tags) ? $tags[0] : null + ]; + $content = Blade::render($this->getStub('readme'), $data); + $this->files->put("$outputDir/README.md", $content); + } + + /** + * Generate interface from OpenAPI schema + */ + protected function generateInterface($name, $schema) + { + $properties = $schema['properties'] ?? []; + + $interfaceName = $this->formatInterfaceName($name); + + if (empty($properties)) { + return "export interface $interfaceName {\n [key: string]: any;\n}"; + } + + $interface = "export interface $interfaceName {\n"; + + foreach ($properties as $propName => $propDetails) { + $interface .= " " . $propName; + + // Check if property is required + $required = $schema['required'] ?? []; + if (!in_array($propName, $required)) { + $interface .= "?"; + } + + $interface .= ": " . $this->getTypescriptType($propDetails) . ";\n"; + } + + $interface .= "}"; + + return $interface; + } + + /** + * Generate query param interface for GET endpoints + */ + protected function generateQueryParamInterface($parameters, $tagLower, $operationId) + { + $parameters = $this->filterValidParameters($parameters); + + $queryParams = array_filter($parameters, function ($param) { + return $param['in'] === 'query'; + }); + + if (empty($queryParams)) { + return ""; + } + + $interfaceName = ucfirst($this->camelCase($operationId)) . "QueryParams"; + + $interface = "export interface " . $interfaceName . " {\n"; + + foreach ($queryParams as $param) { + $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string') . ";\n"; + } + + $interface .= "}"; + + return $interface; + } + + private function generateResponseType($operationId, $responseSchema, $outputDir) + { + $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; + + $code = "export interface $interfaceName {\n"; + + foreach ($responseSchema['properties'] as $propName => $propDetails) { + $code .= " " . $propName . ": " . $this->getTypescriptType($propDetails) . ";\n"; + } + + $code .= "}"; + + return $code; + } + + /** + * Format interface name to PascalCase + */ + protected function formatInterfaceName($name) + { + $name = str_replace('#/components/schemas/', '', $name); + + // Convert snake_case to PascalCase + return Str::studly($name); + } + + /** + * Convert swagger type to TypeScript type + */ + protected function getTypescriptType($property) + { + if (isset($property['$ref'])) { + return $this->getSchemaNameFromRef($property['$ref']); + } + + $type = $property['type'] ?? 'string'; + + switch ($type) { + case 'integer': + return 'number'; + case 'number': + return 'number'; + case 'boolean': + return 'boolean'; + case 'array': + if (isset($property['items']['$ref'])) { + $itemType = $this->getSchemaNameFromRef($property['items']['$ref']); + return $itemType . '[]'; + } else { + $itemType = $this->getTypescriptType($property['items'] ?? ['type' => 'string']); + return $itemType . '[]'; + } + case 'object': + if (isset($property['additionalProperties'])) { + $valueType = $this->getTypescriptType($property['additionalProperties']); + return "Record"; + } + return 'Record'; + default: + return 'string'; + } + } + + /** + * Get schema name from reference + */ + protected function getSchemaNameFromRef($ref) + { + $parts = explode('/', $ref); + return $this->formatInterfaceName(end($parts)); + } + + /** + * Collect schema from reference for later processing + */ + protected function collectSchemaFromRef($ref, &$schemas) + { + return; + // $schemaName = $this->getSchemaNameFromRef($ref); + // if ($schemaName !== 'UpdateUserGroups') { + // return; + // } + // dump($schemaName, $ref); + } + + /** + * Get parameter value with appropriate conversion for TypeScript + */ + protected function getParamValueConversion($paramName, $param) + { + $type = $param['schema']['type'] ?? 'string'; + + if ($type === 'integer' || $type === 'number') { + return "params.$paramName.toString()"; + } + + return "params.$paramName"; + } + + /** + * Convert string to camelCase + */ + protected function camelCase($str) + { + return Str::camel($str); + } + + /** + * Get stub template content + */ + protected function getStub($type) + { + return $this->files->get(resource_path("stubs/api2typescript/{$type}.blade.php")); + } +} diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index f99e69b916..2dd79a6baa 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -74,6 +74,13 @@ * in="query", * @OA\Schema(type="string", default=""), * ), + * @OA\Parameter( + * parameter="pmql", + * name="pmql", + * in="query", + * description="PMQL query to filter results", + * @OA\Schema(type="string"), + * ), * @OA\Schema( * schema="DateTime", * @OA\Property(property="date", type="string"), diff --git a/ProcessMaker/Http/Controllers/Api/PermissionController.php b/ProcessMaker/Http/Controllers/Api/PermissionController.php index 03b468fa22..f5636d846d 100644 --- a/ProcessMaker/Http/Controllers/Api/PermissionController.php +++ b/ProcessMaker/Http/Controllers/Api/PermissionController.php @@ -48,6 +48,7 @@ public function index(Request $request) * @OA\Put( * path="/permissions", * summary="Update the permissions of a user", + * operationId="updatePermissions", * tags={"Permissions"}, * * @OA\RequestBody( diff --git a/ProcessMaker/Http/Controllers/Api/ProcessController.php b/ProcessMaker/Http/Controllers/Api/ProcessController.php index b782c2cf0b..1b9e6dc39c 100644 --- a/ProcessMaker/Http/Controllers/Api/ProcessController.php +++ b/ProcessMaker/Http/Controllers/Api/ProcessController.php @@ -87,6 +87,7 @@ class ProcessController extends Controller * @OA\Parameter(ref="#/components/parameters/per_page"), * @OA\Parameter(ref="#/components/parameters/status"), * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter(ref="#/components/parameters/pmql"), * @OA\Parameter( * name="simplified_data_for_selector", * in="query", @@ -1310,6 +1311,7 @@ public function downloadBpmn(Request $request, Process $process) * @OA\Head( * path="/processes/import/{code}/is_ready", * summary="Check if the import is ready", + * operationId="importReady", * tags={"Processes"}, * * @OA\Parameter( diff --git a/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php b/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php index d57af422fb..ec45f6fb7d 100644 --- a/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php +++ b/ProcessMaker/Http/Controllers/Api/V1_1/ProcessVariableController.php @@ -66,6 +66,7 @@ class ProcessVariableController extends Controller * ) * @OA\Get( * path="/processes/variables", + * operationId="getProcessesVariables", * summary="Get variables for multiple processes with pagination", * servers={ * @OA\Server(url=L5_SWAGGER_API_V1_1, description="API v1.1 Server") diff --git a/resources/stubs/api2typescript/api-index.blade.php b/resources/stubs/api2typescript/api-index.blade.php new file mode 100644 index 0000000000..565d644764 --- /dev/null +++ b/resources/stubs/api2typescript/api-index.blade.php @@ -0,0 +1,9 @@ +@foreach ($apiClasses as $class) +import { {{ $class['className'] }} } from './{{ $class['tagLower'] }}.api'; +@endforeach + +export { +@foreach ($apiClasses as $class) + {{ $class['className'] }}, +@endforeach +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/api-response.blade.php b/resources/stubs/api2typescript/api-response.blade.php new file mode 100644 index 0000000000..31951ad37c --- /dev/null +++ b/resources/stubs/api2typescript/api-response.blade.php @@ -0,0 +1,7 @@ +export interface ApiResponse { + data?: T; + status?: number; + statusText?: string; + error?: string; + message?: string; +} \ No newline at end of file diff --git a/resources/stubs/api2typescript/api.blade.php b/resources/stubs/api2typescript/api.blade.php new file mode 100644 index 0000000000..7d2940303d --- /dev/null +++ b/resources/stubs/api2typescript/api.blade.php @@ -0,0 +1,63 @@ +@if (!empty($imports)) +import { +@foreach ($imports as $import) + {{ $import }}, +@endforeach +} from '../types/types'; +@endif + +export class {{ $className }} { + constructor(private apiClient: { + get: (endpoint: string) => Promise; + post: (endpoint: string, data: Record) => Promise; + put: (endpoint: string, data: Record) => Promise; + delete: (endpoint: string) => Promise; + }) {} + +@foreach ($methods as $method) + /** + * {{ $method['summary'] }} + */ + {!! $method['methodName'] !!}({!! implode(', ', $method['paramList']) !!}): Promise<{!! $method['returnType'] ?: 'void' !!}> { +@if (!empty($method['queryParams'])) + const queryParams = new URLSearchParams(); + + if (params) { +@foreach ($method['queryParams'] as $param) +@php +$paramName = Illuminate\Support\Str::camel($param['name']); +$paramType = $param['schema']['type'] ?? 'string'; +$paramValue = ($paramType === 'integer' || $paramType === 'number') ? "params.{$paramName}.toString()" : "params.{$paramName}"; +@endphp + if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {{ $paramValue }}); +@endforeach + } + + const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ''; +@endif + +@if ($method['httpMethod'] === 'get' || $method['httpMethod'] === 'head') +@if (!empty($method['queryParams'])) + return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); +@else + return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); +@endif +@elseif ($method['httpMethod'] === 'post') +@if (!empty($method['queryParams'])) + return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); +@else + return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); +@endif +@elseif ($method['httpMethod'] === 'put') +@if (!empty($method['queryParams'])) + return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); +@else + return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); +@endif +@elseif ($method['httpMethod'] === 'delete') + return this.apiClient.delete<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); +@endif + } + +@endforeach +} \ No newline at end of file diff --git a/resources/stubs/api2typescript/composable.blade.php b/resources/stubs/api2typescript/composable.blade.php new file mode 100644 index 0000000000..2771ec5b04 --- /dev/null +++ b/resources/stubs/api2typescript/composable.blade.php @@ -0,0 +1,15 @@ +import { {{ $className }} } from '../api/{{ $tagLower }}.api'; + +/** + * Hook to access ProcessMaker {{ ucfirst($tagLower) }} API + * @param apiClient - API client with authentication handling + * @returns {{ $className }} instance + */ +export const {{ $hookName }} = (apiClient: { + get: (endpoint: string) => Promise; + post: (endpoint: string, data: Record) => Promise; + put: (endpoint: string, data: Record) => Promise; + delete: (endpoint: string) => Promise; +}) => { + return new {{ $className }}(apiClient); +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/composables-index.blade.php b/resources/stubs/api2typescript/composables-index.blade.php new file mode 100644 index 0000000000..f0297a04c5 --- /dev/null +++ b/resources/stubs/api2typescript/composables-index.blade.php @@ -0,0 +1,9 @@ +@foreach ($hooks as $hook) +import { {{ $hook }} } from './{{ $hook }}'; +@endforeach + +export { +@foreach ($hooks as $hook) + {{ $hook }}, +@endforeach +}; \ No newline at end of file diff --git a/resources/stubs/api2typescript/main-index.blade.php b/resources/stubs/api2typescript/main-index.blade.php new file mode 100644 index 0000000000..43a1b8be5e --- /dev/null +++ b/resources/stubs/api2typescript/main-index.blade.php @@ -0,0 +1,4 @@ +// Generated ProcessMaker SDK +export * from './lib/processmaker-sdk' +export * from './composables'; +export * from './engine'; diff --git a/resources/stubs/api2typescript/readme.blade.php b/resources/stubs/api2typescript/readme.blade.php new file mode 100644 index 0000000000..32e8b7a46b --- /dev/null +++ b/resources/stubs/api2typescript/readme.blade.php @@ -0,0 +1,45 @@ +# ProcessMaker SDK + +This SDK provides typed access to the ProcessMaker API. + +## Features + +- Fully typed API interfaces +- Composable hooks for easy integration +@foreach ($tags as $tag) +- Complete implementation of the ProcessMaker {{ ucfirst(strtolower($tag)) }} API +@endforeach + +## Usage + +@if ($firstTag) +### {{ ucfirst(strtolower($firstTag)) }} API + +```typescript +import { useProcessMakerApi } from '~/composables/useProcessMakerApi'; +import { useProcessMaker{{ ucfirst(strtolower($firstTag)) }} } from 'shared'; + +// In your component or service +const api = useProcessMakerApi(); +const {{ strtolower($firstTag) }}Api = useProcessMaker{{ ucfirst(strtolower($firstTag)) }}(api); + +// Example: Get all {{ strtolower($firstTag) }} +const get{{ ucfirst(strtolower($firstTag)) }} = async () => { + try { + const response = await {{ strtolower($firstTag) }}Api.get{{ ucfirst(strtolower($firstTag)) }}(); + return response.data; + } catch (error) { + console.error('Error fetching {{ strtolower($firstTag) }}:', error); + throw error; + } +}; +``` +@endif + +## Available APIs + +Currently, the SDK includes: + +@foreach ($tags as $tag) +- **{{ ucfirst(strtolower($tag)) }} API**: Complete implementation of the ProcessMaker {{ ucfirst(strtolower($tag)) }} API +@endforeach \ No newline at end of file diff --git a/resources/stubs/api2typescript/types.blade.php b/resources/stubs/api2typescript/types.blade.php new file mode 100644 index 0000000000..33ab9b96fa --- /dev/null +++ b/resources/stubs/api2typescript/types.blade.php @@ -0,0 +1,14 @@ +@foreach ($interfaces as $interface) +{!! $interface !!} + +@endforeach + +/*export interface PaginatedResponse { + data: T[]; + meta: Metadata; +}*/ + +@foreach ($queryParamInterfaces as $interface) +{!! $interface !!} + +@endforeach diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index ebcc60c8ac..9373a2878e 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,14 +18,14 @@ } ], "paths": { - "/analytics-reporting": { + "/decision_table_categories": { "get": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Returns all analytics reporting that the user has access to", - "description": "Get a list of Analytics Reporting.", - "operationId": "getAnalyticsReporting", + "summary": "Returns all Decision Tables categories that the user has access to", + "description": "Display a listing of the Decision Tables Categories.", + "operationId": "getDecisionTableCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -38,14 +38,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of analytics reporting", + "description": "list of Decision Tables categories", "content": { "application/json": { "schema": { @@ -53,11 +50,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -69,17 +71,17 @@ }, "post": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Save a new Analytics Reporting", - "description": "Create a new Analytics Reporting.", - "operationId": "createAnalyticsReporting", + "summary": "Save a new Decision Table Category", + "description": "Store a newly created Decision Tables Category in storage", + "operationId": "createDecisionTableCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReportingEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -90,7 +92,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -98,19 +100,19 @@ } } }, - "/analytics-reporting/{analytic_reporting_id}": { + "/decision_table_categories/{decision_table_categories_id}": { "get": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Get single analytic reporting by ID", - "description": "Get a single Analytic Reporting.", - "operationId": "getAnalyticReportingById", + "summary": "Get single Decision Table category by ID", + "description": "Display the specified decision Tables category.", + "operationId": "getDecisionTableCategoryById", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -119,11 +121,11 @@ ], "responses": { "200": { - "description": "Successfully found the analytics reporting", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReporting" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -132,16 +134,16 @@ }, "put": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Update a analytic reporting", - "description": "Update a Analytics Reporting.", - "operationId": "updateAnalyticReporting", + "summary": "Update a Decision Table Category", + "description": "Updates the current element", + "operationId": "updateDecisionTableCategory", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to update", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -153,29 +155,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/analyticsReportingEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DecisionTableCategory" + } + } + } } } }, "delete": { "tags": [ - "AnalyticsReporting" + "DecisionTableCategories" ], - "summary": "Delete an analytic reporting", - "description": "Delete a Analytics Reporting.", - "operationId": "deleteAnalyticReporting", + "summary": "Delete a Decision Table category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDecisionTableCategory", "parameters": [ { - "name": "analytic_reporting_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of analytic reporting to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { "type": "string" @@ -189,14 +198,14 @@ } } }, - "/collections": { + "/decision_tables": { "get": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Returns all collections that the user has access to", - "description": "Get a list of Collections.", - "operationId": "getCollections", + "summary": "Returns all Decision tables that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getDecisionTables", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -216,7 +225,7 @@ ], "responses": { "200": { - "description": "list of collections", + "description": "list of Decision Tables", "content": { "application/json": { "schema": { @@ -224,11 +233,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -240,17 +254,17 @@ }, "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Save a new collections", - "description": "Create a new Collection.", - "operationId": "createCollection", + "summary": "Save a new Decision Table", + "description": "Store a newly created resource in storage.", + "operationId": "createDecisionTable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -261,7 +275,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } @@ -269,19 +283,19 @@ } } }, - "/collections/{collection_id}": { + "/decision_tables/{decision_table_id}": { "get": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Get single collections by ID", - "description": "Get a single Collection.", - "operationId": "getCollectionById", + "summary": "Get single Decision Table by ID", + "description": "Display the specified resource.", + "operationId": "getDecisionTableById", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to return", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -290,11 +304,11 @@ ], "responses": { "200": { - "description": "Successfully found the collections", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } @@ -303,16 +317,16 @@ }, "put": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Update a collection", - "description": "Update a Collection.", - "operationId": "updateCollection", + "summary": "Update a Decision Table", + "description": "Update a Decision table", + "operationId": "updateDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to update", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -324,29 +338,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } }, "delete": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Delete a collection", - "description": "Delete a Collection.", - "operationId": "deleteCollection", + "summary": "Delete a Decision Table", + "description": "Delete a Decision tables", + "operationId": "deleteDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to return", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" @@ -355,61 +376,43 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/decisionTable" + } + } + } } } } }, - "/collections/{collection_id}/export": { - "post": { + "/decision_tables/{decision_table_id}/duplicate": { + "put": { "tags": [ - "Screens" + "DecisionTables" ], - "summary": "Trigger export collections job", - "description": "Export the specified collection.", - "operationId": "exportCollection", + "summary": "duplicate a Decision Table", + "description": "duplicate a Decision table.", + "operationId": "duplicateDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection to export", + "description": "ID of Decision Table to return", "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": { + "application/json": { "schema": { - "required": [ - "file" - ], - "properties": { - "file": { - "description": "file to upload", - "type": "file", - "format": "file" - } - }, - "type": "object" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -420,99 +423,59 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/decisionTable" } } } - }, - "200": { - "description": "success" } } } }, - "/collections/{collection_id}/truncate": { - "delete": { + "/decision_tables/{decision_table_id}/excel-import": { + "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Deletes all records in a collection", - "description": "Truncate a Collection.", - "operationId": "truncateCollection", + "summary": "Import a new decision table", + "description": "Import a Decision table from excel", + "operationId": "importExcel", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of collection to truncate", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/collections/{collection_id}/records": { - "get": { - "tags": [ - "Collections" - ], - "summary": "Returns all records", - "description": "Get the list of records of a collection.", - "operationId": "getRecords", - "parameters": [ - { - "name": "collection_id", - "in": "path", - "description": "ID of collection to get records for", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pmql", - "in": "query", - "schema": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/include" } - ], + }, "responses": { - "200": { - "description": "list of records of a collection", + "201": { + "description": "success", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/records" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "status": { + "type": "object" } }, "type": "object" @@ -521,31 +484,62 @@ } } } - }, + } + }, + "/decision_tables/{decision_table_id}/export": { "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Save a new record in a collection", - "description": "Create a new record in a Collection.", - "operationId": "createRecord", + "summary": "Export a single Decision Table by ID", + "description": "Export the specified screen.", + "operationId": "exportDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection", + "description": "ID of Decision Table to return", "required": true, "schema": { "type": "string" } } ], + "responses": { + "200": { + "description": "Successfully exported the decision table", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DecisionTableExported" + } + } + } + } + } + } + }, + "/decision_tables/import": { + "post": { + "tags": [ + "DecisionTables" + ], + "summary": "Import a new Decision Table", + "description": "Import the specified Decision Table.", + "operationId": "importDecisionTable", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/recordsEditable" + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } @@ -556,7 +550,12 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" } } } @@ -564,41 +563,99 @@ } } }, - "/collections/{collection_id}/records/{record_id}": { - "get": { + "/decision_tables/{decision_table_id}/execute": { + "post": { "tags": [ - "Collections" + "DecisionTables" ], - "summary": "Get single record of a collection", - "description": "Get a single record of a Collection.", - "operationId": "getRecordById", + "summary": "Execute a Decision Table definition", + "description": "Execute a Decision Table definition", + "operationId": "previewDecisionTable", "parameters": [ { - "name": "collection_id", + "name": "decision_table_id", "in": "path", - "description": "ID of the collection", + "description": "Decision Table unique Identifier", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "Successfully executed", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/saved-searches/{saved_search_id}/charts": { + "get": { + "tags": [ + "SavedSearchCharts" + ], + "summary": "Returns all saved search charts that the user has access to", + "description": "Get a list of SavedSearchCharts.", + "operationId": "getSavedSearchCharts", + "parameters": [ + { + "$ref": "#/components/parameters/filter" }, { - "name": "record_id", - "in": "path", - "description": "ID of the record to return", - "required": true, + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the record", + "description": "list of saved search charts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } @@ -607,25 +664,16 @@ }, "put": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Update a record", - "description": "Update a record in a Collection.", - "operationId": "updateRecord", + "summary": "Update several saved search charts at once", + "description": "Batch update several SavedSearchCharts.", + "operationId": "batchUpdateSavedSearchCharts", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "saved_search_id", "in": "path", - "description": "ID of the record ", + "description": "ID of saved search to which these charts will be saved", "required": true, "schema": { "type": "string" @@ -637,7 +685,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/recordsEditable" + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } } } } @@ -648,27 +699,61 @@ } } }, - "delete": { + "post": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Delete a collection record", - "description": "Delete a record of a Collection.", - "operationId": "deleteRecord", + "summary": "Save a new saved search chart", + "description": "Create a new SavedSearchChart.", + "operationId": "createSavedSearchChart", "parameters": [ { - "name": "collection_id", + "name": "saved_search_id", "in": "path", - "description": "ID of collection", + "description": "ID of saved search to which this chart will be saved", "required": true, "schema": { "type": "string" } - }, + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChartEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } + } + } + } + }, + "/saved-searches/charts/{chart_id}": { + "get": { + "tags": [ + "SavedSearchCharts" + ], + "summary": "Get single saved search chart by ID", + "description": "Get a single SavedSearchChart.", + "operationId": "getSavedSearchChartById", + "parameters": [ { - "name": "record_id", + "name": "chart_id", "in": "path", - "description": "ID of record in collection", + "description": "ID of chart to return", "required": true, "schema": { "type": "string" @@ -676,32 +761,30 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the saved search chart", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } }, - "patch": { + "put": { "tags": [ - "Collections" + "SavedSearchCharts" ], - "summary": "Partial update of a record", - "description": "Implements a partial update of a record in a Collection.", - "operationId": "patchRecord", + "summary": "Update a saved search chart", + "description": "Update a SavedSearchChart.", + "operationId": "updateSavedSearchChart", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection ", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "chart_id", "in": "path", - "description": "ID of the record ", + "description": "ID of chart to return", "required": true, "schema": { "type": "string" @@ -713,135 +796,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } }, "responses": { "200": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChart" + } + } + } } } - } - }, - "/comments/tasks": { - "get": { + }, + "delete": { "tags": [ - "Comments" + "SavedSearchCharts" ], - "summary": "Returns all the tasks that are active.", - "description": "Display a listing of the resource.", - "operationId": "getCommentTasks", + "summary": "Delete a saved search chart", + "description": "Delete a SavedSearchChart.", + "operationId": "deleteSavedSearchChart", "parameters": [ { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, + "name": "chart_id", + "in": "path", + "description": "ID of chart to return", + "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" } ], "responses": { - "200": { - "description": "list all tasks taht are active", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/processRequestToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/data_source_categories": { + "/saved-searches/charts/{chart_id}/fields": { "get": { "tags": [ - "DataSourcesCategories" + "SavedSearchCharts" ], - "summary": "Returns all Data Connectors categories that the user has access to", - "description": "Display a listing of the Data Connector Categories.", - "operationId": "getDataSourceCategories", + "summary": "Get available chart fields for a Saved Search by ID", + "description": "Get available chart fields for a Saved Search.", + "operationId": "getSavedSearchFieldsById", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "chart_id", + "in": "path", + "description": "ID of Saved Search to return", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of Data Connectors categories", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataSourceCategory" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, + } + }, + "/saved-searches/reports": { "post": { "tags": [ - "DataSourcesCategories" + "Reports" ], - "summary": "Save a new Data Connector Category", - "description": "Store a newly created Data Connector Category in storage", - "operationId": "createDataSourceCategory", + "summary": "Save a new report", + "operationId": "createReport", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceCategoryEditable" + "$ref": "#/components/schemas/ReportEditable" } } } @@ -852,7 +895,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceCategory" + "$ref": "#/components/schemas/Report" } } } @@ -860,50 +903,19 @@ } } }, - "/data_source_categories/{data_source_category_id}": { - "get": { - "tags": [ - "DataSourcesCategories" - ], - "summary": "Get single Data Connector category by ID", - "description": "Display the specified data Source category.", - "operationId": "getDatasourceCategoryById", - "parameters": [ - { - "name": "data_source_category_id", - "in": "path", - "description": "ID of Data Connector category to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the Data Connector", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DataSourceCategory" - } - } - } - } - } - }, + "/saved-searches/reports/{reportId}": { "put": { "tags": [ - "DataSourcesCategories" + "SavedSearches" ], - "summary": "Update a Data Connector Category", - "description": "Updates the current element", - "operationId": "updateDatasourceCategory", + "summary": "Update a saved search", + "description": "Update a Report", + "operationId": "updateReport", "parameters": [ { - "name": "data_source_category_id", + "name": "reportId", "in": "path", - "description": "ID of Data Connector category to return", + "description": "ID of report", "required": true, "schema": { "type": "string" @@ -915,7 +927,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceCategoryEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -926,49 +938,52 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceCategory" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, - "delete": { + } + }, + "/saved-searches": { + "get": { "tags": [ - "DataSourcesCategories" + "SavedSearches" ], - "summary": "Delete a Data Connector category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteDataSourceCategory", + "summary": "Returns all saved searches that the user has access to", + "description": "Get a list of SavedSearches.", + "operationId": "getSavedSearches", "parameters": [ { - "name": "data_source_category_id", - "in": "path", - "description": "ID of Data Connector category to return", - "required": true, + "$ref": "#/components/parameters/filter" + }, + { + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/data_sources": { - "get": { - "tags": [ - "DataSources" - ], - "summary": "Returns all Data Connectors that the user has access to", - "description": "Get the list of records of a Data Connector", - "operationId": "getDataSources", - "parameters": [ + }, { - "$ref": "#/components/parameters/filter" + "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/order_by" @@ -985,7 +1000,7 @@ ], "responses": { "200": { - "description": "list of Data Connectors", + "description": "list of saved searches", "content": { "application/json": { "schema": { @@ -993,7 +1008,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } }, "meta": { @@ -1014,17 +1029,17 @@ }, "post": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Save a new Data Connector", - "description": "Create a new Data Connector.", - "operationId": "createDataSource", + "summary": "Save a new saved search", + "description": "Create a new SavedSearch.", + "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -1035,7 +1050,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -1043,19 +1058,19 @@ } } }, - "/data_sources/{data_source_id}": { + "/saved-searches/{savedSearchId}": { "get": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Get single Data Connector by ID", - "description": "Get a single Data Connector.", - "operationId": "getDataSourceById", + "summary": "Get single saved searches by ID", + "description": "Get a single SavedSearch.", + "operationId": "getSavedSearchById", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -1064,11 +1079,11 @@ ], "responses": { "200": { - "description": "Successfully found the Data Connector", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -1077,16 +1092,16 @@ }, "put": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Update a Data Connector", - "description": "Update a Data Connector.", - "operationId": "updateDataSource", + "summary": "Update a saved search", + "description": "Update a SavedSearch.", + "operationId": "updateSavedSearch", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -1098,49 +1113,95 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSourceEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, - "delete": { + } + }, + "/saved-searches/{savedSearchId}/columns": { + "get": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "Delete a Data Connector", - "description": "Delete a Data Connector.", - "operationId": "deleteDataSource", + "summary": "Returns all columns associated with a Saved Search", + "description": "Display a listing of columns.", + "operationId": "getSavedSearchColumns", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } + }, + { + "name": "include", + "in": "query", + "description": "Include specific categories. Comma separated list.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "current", + "default", + "available", + "data" + ] + }, + "uniqueItems": false + } } ], "responses": { - "204": { - "description": "success", + "200": { + "description": "Categorized list of columns", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "properties": { + "current": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "default": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "available": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + } + }, + "type": "object" } } } @@ -1148,42 +1209,63 @@ } } }, - "/data_sources/{data_source_id}/test": { - "post": { + "/saved-searches/{savedSearchId}/users": { + "get": { "tags": [ - "DataSources" + "Users" ], - "summary": "Send a Data Connector request", - "description": "Send a Data Connector request.", - "operationId": "sendDataSource", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchUsers", "parameters": [ { - "name": "data_source_id", + "name": "savedSearchId", "in": "path", - "description": "ID of Data Connector to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dataSourceEditable" - } + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } - }, + ], "responses": { - "204": { - "description": "success", + "200": { + "description": "list of users", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dataSource" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -1191,56 +1273,46 @@ } } }, - "/requests/{request_id}/data_sources/{data_source_id}": { - "post": { + "/saved-searches/{savedSearchId}/groups": { + "get": { "tags": [ - "DataSources" + "Groups" ], - "summary": "execute Data Source", - "description": "Execute a data Source endpoint", - "operationId": "executeDataSourceForRequest", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchGroups", "parameters": [ { - "name": "request_id", - "in": "path", - "description": "ID of the request in whose context the datasource will be executed", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/order_by" }, { - "name": "data_source_id", - "in": "path", - "description": "ID of DataSource to be run", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "config": { - "$ref": "#/components/schemas/DataSourceCallParameters" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "list of groups", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -1248,49 +1320,68 @@ } } }, - "/requests/data_sources/{data_source_id}": { - "post": { + "/saved-searches/{saved_search_id}": { + "delete": { "tags": [ - "DataSources" + "SavedSearches" ], - "summary": "execute Data Source", - "operationId": "executeDataSource", + "summary": "Delete a saved search", + "description": "Delete a SavedSearch.", + "operationId": "deleteSavedSearch", "parameters": [ { - "name": "data_source_id", + "name": "saved_search_id", "in": "path", - "description": "ID of DataSource to be run", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "config": { - "$ref": "#/components/schemas/DataSourceCallParameters" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } - } + "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": "success", + "description": "list of icons for saved searches", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchIcon" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" } } } @@ -1298,40 +1389,39 @@ } } }, - "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "/customize-ui": { "post": { "tags": [ - "DataSources" + "CssSettings" ], - "summary": "Get Data from Data Source", - "operationId": "getDataFromDataSource", - "parameters": [ - { - "name": "data_source_id", - "in": "path", - "description": "ID of DataSource to be run", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "endpoint", - "in": "path", - "description": "Endpoint of the data source", - "required": true, - "schema": { - "type": "string" + "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": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DataSourceResponse" + "$ref": "#/components/schemas/settings" } } } @@ -1339,14 +1429,14 @@ } } }, - "/decision_table_categories": { + "/environment_variables": { "get": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Returns all Decision Tables categories that the user has access to", - "description": "Display a listing of the Decision Tables Categories.", - "operationId": "getDecisionTableCategories", + "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" @@ -1359,11 +1449,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Decision Tables categories", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -1371,16 +1464,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "type": "object" } }, "type": "object" @@ -1392,17 +1480,17 @@ }, "post": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Save a new Decision Table Category", - "description": "Store a newly created Decision Tables Category in storage", - "operationId": "createDecisionTableCategory", + "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/decisionTableCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -1413,7 +1501,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1421,32 +1509,32 @@ } } }, - "/decision_table_categories/{decision_table_categories_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Get single Decision Table category by ID", - "description": "Display the specified decision Tables category.", - "operationId": "getDecisionTableCategoryById", + "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": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully found the Decision Table", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1455,19 +1543,19 @@ }, "put": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Update a Decision Table Category", - "description": "Updates the current element", - "operationId": "updateDecisionTableCategory", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment variables to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -1476,7 +1564,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTableCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -1487,7 +1575,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DecisionTableCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -1496,37 +1584,36 @@ }, "delete": { "tags": [ - "DecisionTableCategories" + "Environment Variables" ], - "summary": "Delete a Decision Table category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteDecisionTableCategory", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "decision_table_categories_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of Decision Table category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { + "200": { "description": "success" } } } }, - "/decision_tables": { + "/files": { "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Returns all Decision tables that the user has access to", + "summary": "Returns the list of files", "description": "Display a listing of the resource.", - "operationId": "getDecisionTables", + "operationId": "getFiles", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1539,14 +1626,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of Decision Tables", + "description": "list of files", "content": { "application/json": { "schema": { @@ -1554,16 +1638,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/media" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -1575,28 +1654,87 @@ }, "post": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Save a new Decision Table", + "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": "createDecisionTable", + "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" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/decisionTableEditable" + "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/decisionTable" + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" } } } @@ -1604,136 +1742,171 @@ } } }, - "/decision_tables/{decision_table_id}": { + "/files/{file_id}": { "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Get single Decision Table by ID", - "description": "Display the specified resource.", - "operationId": "getDecisionTableById", + "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": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the Decision Table", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/media" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, - "put": { + "delete": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Update a Decision Table", - "description": "Update a Decision table", - "operationId": "updateDecisionTable", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/decisionTableEditable" - } - } - } - }, "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/decisionTable" - } - } - } + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/files/{file_id}/contents": { + "get": { "tags": [ - "DecisionTables" + "Files" ], - "summary": "Delete a Decision Table", - "description": "Delete a Decision tables", - "operationId": "deleteDecisionTable", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "decision_table_id", + "name": "file_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { - "description": "success", + "200": { + "description": "File stream", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "type": "string", + "format": "binary" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/decision_tables/{decision_table_id}/duplicate": { - "put": { + "/groups": { + "get": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "duplicate a Decision Table", - "description": "duplicate a Decision table.", - "operationId": "duplicateDecisionTable", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "name": "decision_table_id", - "in": "path", - "description": "ID of Decision Table to return", - "required": true, - "schema": { - "type": "string" + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of groups", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } } } + } + }, + "post": { + "tags": [ + "Groups" ], + "summary": "Save a new group", + "description": "Store a newly created resource in storage.", + "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTableEditable" + "$ref": "#/components/schemas/groupsEditable" } } } @@ -1744,219 +1917,148 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/decisionTable" + "$ref": "#/components/schemas/groups" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/decision_tables/{decision_table_id}/excel-import": { - "post": { + "/groups/{group_id}": { + "get": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Import a new decision table", - "description": "Import a Decision table from excel", - "operationId": "importExcel", + "summary": "Get single group by ID", + "description": "Display the specified resource.", + "operationId": "getGroupById", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } - } - } - }, "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the group", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/groups" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/decision_tables/{decision_table_id}/export": { - "post": { + }, + "put": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Export a single Decision Table by ID", - "description": "Export the specified screen.", - "operationId": "exportDecisionTable", + "summary": "Update a group", + "description": "Update a user", + "operationId": "updateGroup", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "ID of Decision Table to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully exported the decision table", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DecisionTableExported" - } - } + "type": "integer" } } - } - } - }, - "/decision_tables/import": { - "post": { - "tags": [ - "DecisionTables" ], - "summary": "Import a new Decision Table", - "description": "Import the specified Decision Table.", - "operationId": "importDecisionTable", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/decision_tables/{decision_table_id}/execute": { - "post": { + }, + "delete": { "tags": [ - "DecisionTables" + "Groups" ], - "summary": "Execute a Decision Table definition", - "description": "Execute a Decision Table definition", - "operationId": "previewDecisionTable", + "summary": "Delete a group", + "description": "Delete a user", + "operationId": "deleteGroup", "parameters": [ { - "name": "decision_table_id", + "name": "group_id", "in": "path", - "description": "Decision Table unique Identifier", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully executed", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/saved-searches/{saved_search_id}/charts": { + "/groups/{group_id}/users": { "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 users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", - "in": "query", - "description": "Only return saved searches by type", - "required": false, + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "integer" } }, { - "$ref": "#/components/parameters/order_by" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_direction" }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of saved search charts", + "description": "list of members of a group", "content": { "application/json": { "schema": { @@ -1964,16 +2066,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -1982,68 +2079,120 @@ } } } - }, - "put": { + } + }, + "/groups/{group_id}/groups": { + "get": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Update several saved search charts at once", - "description": "Batch update several SavedSearchCharts.", - "operationId": "batchUpdateSavedSearchCharts", + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", "parameters": [ { - "name": "saved_search_id", + "name": "group_id", "in": "path", - "description": "ID of saved search to which these charts will be saved", + "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": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "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" } } } } - }, - "responses": { - "204": { - "description": "success" - } } - }, - "post": { + } + }, + "/group_members": { + "get": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Save a new saved search chart", - "description": "Create a new SavedSearchChart.", - "operationId": "createSavedSearchChart", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "name": "saved_search_id", - "in": "path", - "description": "ID of saved search to which this chart will be saved", - "required": true, - "schema": { - "type": "string" + "$ref": "#/components/parameters/member_id" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of group_members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } } } + } + }, + "post": { + "tags": [ + "Group Members" ], + "summary": "Save a new group member", + "description": "Store a newly created resource in storage.", + "operationId": "createGroupMember", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" + "$ref": "#/components/schemas/groupMembersEditable" } } } @@ -2054,7 +2203,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/createGroupMembers" } } } @@ -2062,73 +2211,32 @@ } } }, - "/saved-searches/charts/{chart_id}": { + "/group_members/{group_member_id}": { "get": { "tags": [ - "SavedSearchCharts" - ], - "summary": "Get single saved search chart by ID", - "description": "Get a single SavedSearchChart.", - "operationId": "getSavedSearchChartById", - "parameters": [ - { - "name": "chart_id", - "in": "path", - "description": "ID of chart to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the saved search chart", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } - } - } - }, - "put": { - "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Update a saved search chart", - "description": "Update a SavedSearchChart.", - "operationId": "updateSavedSearchChart", + "summary": "Get single group member by ID", + "description": "Display the specified resource.", + "operationId": "getGroupMemberById", "parameters": [ { - "name": "chart_id", + "name": "group_member_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group members to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/getGroupMembersById" } } } @@ -2137,16 +2245,16 @@ }, "delete": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "summary": "Delete a saved search chart", - "description": "Delete a SavedSearchChart.", - "operationId": "deleteSavedSearchChart", + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", "parameters": [ { - "name": "chart_id", + "name": "group_member_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group_members to return", "required": true, "schema": { "type": "string" @@ -2160,32 +2268,64 @@ } } }, - "/saved-searches/charts/{chart_id}/fields": { + "/group_members_available": { "get": { "tags": [ - "SavedSearchCharts" + "Group Members" ], - "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 groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ { - "name": "chart_id", + "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": "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": "Successfully found the saved search", + "description": "list of groups available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableGroupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2193,30 +2333,60 @@ } } }, - "/saved-searches/reports": { - "post": { + "/user_members_available": { + "get": { "tags": [ - "Reports" + "Group Members" ], - "summary": "Save a new report", - "operationId": "createReport", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportEditable" - } + "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": { - "201": { - "description": "success", + "200": { + "description": "list of users available to be assigned as member", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2224,87 +2394,26 @@ } } }, - "/saved-searches/reports/{reportId}": { - "put": { + "/notifications": { + "get": { "tags": [ - "SavedSearches" - ], - "summary": "Update a saved search", - "description": "Update a Report", - "operationId": "updateReport", - "parameters": [ - { - "name": "reportId", - "in": "path", - "description": "ID of report", - "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" - } - } - } - } - } - } - }, - "/saved-searches": { - "get": { - "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Returns all saved searches that the user has access to", - "description": "Get a list of SavedSearches.", - "operationId": "getSavedSearches", + "summary": "Returns all notifications that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getNotifications", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", + "name": "status", "in": "query", - "description": "Only return saved searches by type", + "description": "Only return notifications by status (unread, all, etc.)", "required": false, "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] + "type": "string" } }, { - "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/filter" }, { "$ref": "#/components/parameters/order_by" @@ -2321,7 +2430,7 @@ ], "responses": { "200": { - "description": "list of saved searches", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -2329,17 +2438,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } + "meta": {} }, "type": "object" } @@ -2350,17 +2452,17 @@ }, "post": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Save a new saved search", - "description": "Create a new SavedSearch.", - "operationId": "createSavedSearch", + "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/SavedSearchEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -2371,7 +2473,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } } } @@ -2379,19 +2481,19 @@ } } }, - "/saved-searches/{savedSearchId}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Get single saved searches by ID", - "description": "Get a single SavedSearch.", - "operationId": "getSavedSearchById", + "summary": "Get single notification by ID", + "description": "Display the specified resource.", + "operationId": "getNotificationById", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -2400,11 +2502,11 @@ ], "responses": { "200": { - "description": "Successfully found the saved search", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/Notification" } } } @@ -2413,16 +2515,16 @@ }, "put": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Update a saved search", - "description": "Update a SavedSearch.", - "operationId": "updateSavedSearch", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -2434,124 +2536,218 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearch" - } - } - } + "204": { + "description": "success" } } - } - }, - "/saved-searches/{savedSearchId}/columns": { - "get": { + }, + "delete": { "tags": [ - "SavedSearches" + "Notifications" ], - "summary": "Returns all columns associated with a Saved Search", - "description": "Display a listing of columns.", - "operationId": "getSavedSearchColumns", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "savedSearchId", + "name": "notification_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" } - }, - { - "name": "include", - "in": "query", - "description": "Include specific categories. Comma separated list.", - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "current", - "default", - "available", - "data" - ] - }, - "uniqueItems": false - } } ], "responses": { - "200": { - "description": "Categorized list of columns", - "content": { - "application/json": { - "schema": { - "properties": { - "current": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "default": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "available": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/columns" - } + "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" } }, - "type": "object" - } + "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" + } } } }, - "/saved-searches/{savedSearchId}/users": { - "get": { + "/unread_notifications": { + "put": { "tags": [ - "Users" + "Notifications" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchUsers", - "parameters": [ - { - "name": "savedSearchId", - "in": "path", - "description": "ID of saved search to return", - "required": true, - "schema": { - "type": "string" + "summary": "Mark notifications as unread by the user", + "description": "Update notifications as unread", + "operationId": "markNotificationAsUnread", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "message_ids": { + "description": "list of message ids that will be marked as read", + "type": "array", + "items": { + "type": "string" + } + }, + "routes": { + "description": "all messages that has an url that is in this list will be marked as read", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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": "updatePermissions", + "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 First Name, Last Name, Email and Username.", + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", "schema": { "type": "string" } @@ -2564,14 +2760,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -2579,11 +2772,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -2592,48 +2785,31 @@ } } } - } - }, - "/saved-searches/{savedSearchId}/groups": { - "get": { + }, + "post": { "tags": [ - "Groups" + "Process Categories" ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchGroups", - "parameters": [ - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" + "summary": "Save a new process Category", + "description": "Store a newly created Process Category in storage", + "operationId": "createProcessCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategoryEditable" + } + } } - ], + }, "responses": { - "200": { - "description": "list of groups", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -2641,68 +2817,104 @@ } } }, - "/saved-searches/{saved_search_id}": { - "delete": { + "/process_categories/{process_category_id}": { + "get": { "tags": [ - "SavedSearches" + "Process Categories" ], - "summary": "Delete a saved search", - "description": "Delete a SavedSearch.", - "operationId": "deleteSavedSearch", + "summary": "Get single process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "saved_search_id", + "name": "process_category_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of process category to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategory" + } + } + } } } - } - }, - "/saved-searches/icons": { - "get": { + }, + "put": { "tags": [ - "SavedSearches" + "Process Categories" ], - "summary": "Returns all icons for saved searches", - "description": "Get a list of icons available for SavedSearches.", - "operationId": "getSavedSearchesIcons", + "summary": "Update a process Category", + "description": "Updates the current element", + "operationId": "updateProcessCategory", "parameters": [ { - "$ref": "#/components/parameters/per_page" + "name": "process_category_id", + "in": "path", + "description": "ID of process category to return", + "required": true, + "schema": { + "type": "integer" + } } ], - "responses": { - "200": { - "description": "list of icons for saved searches", - "content": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategoryEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchIcon" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" + "$ref": "#/components/schemas/ProcessCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Process Categories" + ], + "summary": "Delete a process category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcessCategory", + "parameters": [ + { + "name": "process_category_id", + "in": "path", + "description": "ID of process category to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" } } } @@ -2710,14 +2922,14 @@ } } }, - "/version_histories": { + "/processes": { "get": { "tags": [ - "Version History" + "Processes" ], - "summary": "Return all version History according to the model", - "description": "Get the list of records of Version History", - "operationId": "getVersionHistories", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -2731,13 +2943,28 @@ { "$ref": "#/components/parameters/per_page" }, + { + "$ref": "#/components/parameters/status" + }, { "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/pmql" + }, + { + "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 Version History", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -2745,16 +2972,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -2766,17 +2988,17 @@ }, "post": { "tags": [ - "Version History" + "Processes" ], - "summary": "Save a new Version History", - "description": "Create a new Version History.", - "operationId": "createVersion", + "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/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } @@ -2787,7 +3009,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2795,32 +3017,51 @@ } } }, - "/version_histories/{version_history_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Version History" + "Processes" ], - "summary": "Get single Version History by ID", - "description": "Get a single Version History.", - "operationId": "getVersionHistoryById", + "summary": "Get single process by ID", + "description": "Display the specified resource.", + "operationId": "getProcessById", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the Version History", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" + } + } + } + }, + "204": { + "description": "Process not found", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + "example": "The requested process was not found" + } + }, + "type": "object" } } } @@ -2829,19 +3070,19 @@ }, "put": { "tags": [ - "Version History" + "Processes" ], - "summary": "Update a Version History", - "description": "Update a Version History.", - "operationId": "updateVersion", + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -2850,18 +3091,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2870,29 +3111,69 @@ }, "delete": { "tags": [ - "Version History" + "Processes" ], - "summary": "Delete a Version History", - "description": "Delete a Version History.", - "operationId": "deleteVersion", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "version_history_id", + "name": "processId", "in": "path", - "description": "ID of Version History to return", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { - "description": "success", + "description": "success" + } + } + } + }, + "/processes/{processId}/start_events": { + "get": { + "tags": [ + "Processes" + ], + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "Successfully found the start events process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -2900,31 +3181,42 @@ } } }, - "/version_histories/clone": { - "post": { + "/processes/{processId}/draft": { + "put": { "tags": [ - "Version History" + "Processes" + ], + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + } ], - "summary": "Clone a new Version History", - "description": "Clone a new Version History.", - "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Process" } } } @@ -2932,54 +3224,14 @@ } } }, - "/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": { + "/start_processes": { "get": { "tags": [ - "Environment Variables" + "Processes" ], - "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", - "description": "Fetch a collection of variables based on paged request and filter if provided", - "operationId": "getEnvironmentVariables", + "summary": "Returns 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" @@ -2995,11 +3247,20 @@ }, { "$ref": "#/components/parameters/include" + }, + { + "name": "without_event_definitions", + "in": "path", + "description": "If true return only processes that haven't start event definitions", + "required": false, + "schema": { + "type": "boolean" + } } ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { @@ -3007,11 +3268,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessWithStartEvents" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3020,31 +3281,34 @@ } } } - }, - "post": { + } + }, + "/processes/{processId}/restore": { + "put": { "tags": [ - "Environment Variables" + "Processes" ], - "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/EnvironmentVariableEditable" - } + "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": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/Process" } } } @@ -3052,19 +3316,19 @@ } } }, - "/environment_variables/{environment_variable_id}": { - "get": { + "/processes/{processId}/export": { + "post": { "tags": [ - "Environment Variables" + "Processes" ], - "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": "Export a single process by ID and return a URL to download it", + "description": "Export the specified process.", + "operationId": "exportProcess", "parameters": [ { - "name": "environment_variable_id", + "name": "processId", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of process to export", "required": true, "schema": { "type": "integer" @@ -3072,42 +3336,45 @@ } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" } } } } } - }, - "put": { + } + }, + "/processes/import/validation": { + "post": { "tags": [ - "Environment Variables" - ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", - "parameters": [ - { - "name": "environment_variable_id", - "in": "path", - "description": "ID of environment variables to update", - "required": true, - "schema": { - "type": "integer" - } - } + "Processes" ], + "summary": "Validate a import", + "description": "Validate the specified process before importing.", + "operationId": "validateImport", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } @@ -3118,74 +3385,81 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessImport" } } } } } - }, - "delete": { + } + }, + "/processes/import": { + "post": { "tags": [ - "Environment Variables" + "Processes" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", - "parameters": [ - { - "name": "environment_variable_id", - "in": "path", - "description": "ID of environment_variables to return", - "required": true, - "schema": { - "type": "integer" + "summary": "Import a new process", + "description": "Import the specified process.", + "operationId": "importProcess", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } } } - ], + }, "responses": { "200": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessImport" + } + } + } } } } }, - "/files": { + "/processes/{processId}/bpmn": { "get": { "tags": [ - "Files" + "Processes" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "processId", + "in": "path", + "description": "ID of process", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { "200": { - "description": "list of files", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "url": { + "type": "string" } }, "type": "object" @@ -3194,87 +3468,36 @@ } } } - }, - "post": { + } + }, + "/processes/import/{code}/is_ready": { + "head": { "tags": [ - "Files" + "Processes" ], - "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", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "importReady", "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", + "name": "code", + "in": "path", + "description": "Import code", "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": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "check is import is ready", "content": { "application/json": { "schema": { "properties": { - "id": { - "type": "string" - }, - "model_id": { - "type": "string" - }, - "file_name": { - "type": "string" - }, - "mime_type": { - "type": "string" + "ready": { + "type": "boolean" } }, "type": "object" @@ -3285,117 +3508,118 @@ } } }, - "/files/{file_id}": { - "get": { + "/processes/{process_id}/import/assignments": { + "post": { "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": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", "parameters": [ { - "name": "file_id", + "name": "process_id", "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" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessAssignments" } } - }, - "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": { + "/process_events/{process_id}": { + "post": { "tags": [ - "Files" + "Processes" ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", + "summary": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", "parameters": [ { - "name": "file_id", + "name": "process_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } + }, + { + "name": "event", + "in": "query", + "description": "Node ID of the start event", + "required": true, + "schema": { + "type": "string" + } } ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "File stream", + "description": "success", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/processRequest" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/groups": { + "/requests": { "get": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Returns all groups that the user has access to", + "summary": "Returns all process Requests that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getGroups", + "operationId": "getProcessesRequests", "parameters": [ { - "$ref": "#/components/parameters/status" + "name": "type", + "in": "query", + "description": "Only return requests by type (all|in_progress|completed)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "in_progress", + "completed", + "started_me" + ] + } }, { "$ref": "#/components/parameters/filter" @@ -3415,7 +3639,7 @@ ], "responses": { "200": { - "description": "list of groups", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -3423,7 +3647,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/processRequest" } }, "meta": { @@ -3436,67 +3660,37 @@ } } } - }, - "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}": { + "/requests/{process_request_id}": { "get": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Get single group by ID", + "summary": "Get single process request by ID", "description": "Display the specified resource.", - "operationId": "getGroupById", + "operationId": "getProcessRequestById", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the group", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/processRequest" } } } @@ -3508,16 +3702,16 @@ }, "put": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", + "summary": "Update a process request", + "description": "Update a request", + "operationId": "updateProcessRequest", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -3529,7 +3723,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/processRequestEditable" } } } @@ -3545,16 +3739,16 @@ }, "delete": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", + "summary": "Delete a process request", + "description": "Delete a request", + "operationId": "deleteProcessRequest", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group to return", + "description": "ID of process request to return", "required": true, "schema": { "type": "integer" @@ -3563,7 +3757,14 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } }, "404": { "$ref": "#/components/responses/404" @@ -3571,123 +3772,52 @@ } } }, - "/groups/{group_id}/users": { - "get": { + "/requests/{process_request_id}/events/{event_id}": { + "post": { "tags": [ - "Groups" + "Process Requests" ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", + "summary": "Update a process request event", + "description": "Trigger a intermediate catch event", + "operationId": "updateProcessRequestEvent", "parameters": [ { - "name": "group_id", + "name": "process_request_id", "in": "path", - "description": "ID of group", + "description": "ID of process request to return", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { - "$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", + "name": "event_id", "in": "path", - "description": "ID of group", + "description": "ID of process event to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$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" - } - } - } + "204": { + "description": "success" } } } }, - "/group_members": { + "/requests/{request_id}/files": { "get": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Returns all groups for a given member", + "summary": "Returns the list of files associated with a request", "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", + "operationId": "getRequestFiles", "parameters": [ { - "$ref": "#/components/parameters/member_id" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -3697,11 +3827,20 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { "200": { - "description": "list of group_members", + "description": "list of files", "content": { "application/json": { "schema": { @@ -3709,11 +3848,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groupMembers" + "$ref": "#/components/schemas/media" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -3725,28 +3869,63 @@ }, "post": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Save a new group member", + "summary": "Save a new media file to a request", "description": "Store a newly created resource in storage.", - "operationId": "createGroupMember", + "operationId": "createRequestFile", + "parameters": [ + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Variable name in the request data to use for the file name", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/groupMembersEditable" + "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/createGroupMembers" + "properties": { + "message": { + "type": "string" + }, + "fileUploadId": { + "type": "integer" + } + }, + "type": "object" } } } @@ -3754,93 +3933,105 @@ } } }, - "/group_members/{group_member_id}": { + "/requests/{request_id}/files/{file_id}": { "get": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Get single group member by ID", + "summary": "Get a file uploaded to a request", "description": "Display the specified resource.", - "operationId": "getGroupMemberById", + "operationId": "getRequestFilesById", "parameters": [ { - "name": "group_member_id", + "name": "request_id", "in": "path", - "description": "ID of group members to return", + "description": "ID of the request", "required": true, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "file_id", + "in": "path", + "description": "ID of the file to return", + "required": true, + "schema": { + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the group members", + "description": "File stream", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/getGroupMembersById" + "type": "string", + "format": "binary" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Group Members" + "Request Files" ], - "summary": "Delete a group member", - "description": "Delete a group membership", - "operationId": "deleteGroupMember", + "summary": "Delete all media associated with a request", + "description": "Remove the specified resource from storage.", + "operationId": "deleteRequestFile", "parameters": [ { - "name": "group_member_id", + "name": "file_id", "in": "path", - "description": "ID of group_members to return", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "string" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/group_members_available": { + "/screen_categories": { "get": { "tags": [ - "Group Members" + "Screen Categories" ], - "summary": "Returns all groups available for a given member", - "description": "Display a listing of groups available", - "operationId": "getGroupMembersAvailable", + "summary": "Returns all screens categories that the user has access to", + "description": "Display a listing of the Screen Categories.", + "operationId": "getScreenCategories", "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, + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", "schema": { "type": "string" } }, - { - "$ref": "#/components/parameters/filter" - }, { "$ref": "#/components/parameters/order_by" }, @@ -3853,7 +4044,7 @@ ], "responses": { "200": { - "description": "list of groups available to be assigned as member", + "description": "list of screens categories", "content": { "application/json": { "schema": { @@ -3861,11 +4052,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/availableGroupMembers" + "$ref": "#/components/schemas/ScreenCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -3874,87 +4065,145 @@ } } } + }, + "post": { + "tags": [ + "Screen Categories" + ], + "summary": "Save a new Screen Category", + "description": "Store a newly created Screen Category in storage", + "operationId": "createScreenCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } } }, - "/user_members_available": { + "/screen_categories/{screen_category_id}": { "get": { "tags": [ - "Group Members" + "Screen Categories" ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", + "summary": "Get single screen category by ID", + "description": "Display the specified screen category.", + "operationId": "getScreenCategoryById", "parameters": [ { - "name": "group_id", + "name": "screen_category_id", "in": "path", - "description": "ID of group to return", + "description": "ID of screen category to return", "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } + }, + "put": { + "tags": [ + "Screen Categories" + ], + "summary": "Update a screen Category", + "description": "Updates the current element", + "operationId": "updateScreenCategory", + "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name. Can be a substring.", + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, "schema": { "type": "string" } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, "responses": { "200": { - "description": "list of users available to be assigned as member", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/ScreenCategory" } } } } } - } - }, - "/notifications": { - "get": { + }, + "delete": { "tags": [ - "Notifications" + "Screen Categories" ], - "summary": "Returns all notifications that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getNotifications", + "summary": "Delete a screen category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScreenCategory", "parameters": [ { - "name": "status", - "in": "query", - "description": "Only return notifications by status (unread, all, etc.)", - "required": false, + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/screens": { + "get": { + "tags": [ + "Screens" + ], + "summary": "Returns all screens that the user has access to", + "description": "Get a list of Screens.", + "operationId": "getScreens", + "parameters": [ { "$ref": "#/components/parameters/filter" }, @@ -3969,11 +4218,20 @@ }, { "$ref": "#/components/parameters/include" + }, + { + "name": "exclude", + "in": "query", + "description": "Comma separated list of fields to exclude from the response", + "schema": { + "type": "string", + "default": "" + } } ], "responses": { "200": { - "description": "list of notifications", + "description": "list of screens", "content": { "application/json": { "schema": { @@ -3981,10 +4239,12 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } }, - "meta": {} + "meta": { + "type": "object" + } }, "type": "object" } @@ -3995,17 +4255,17 @@ }, "post": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Save a new notifications", - "description": "Store a newly created resource in storage.", - "operationId": "createNotification", + "summary": "Save a new screens", + "description": "Create a new Screen.", + "operationId": "createScreen", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -4016,7 +4276,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } } } @@ -4024,19 +4284,19 @@ } } }, - "/notifications/{notification_id}": { + "/screens/{screens_id}": { "get": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", + "summary": "Get single screens by ID", + "description": "Get a single Screen.", + "operationId": "getScreensById", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screens to return", "required": true, "schema": { "type": "string" @@ -4045,11 +4305,11 @@ ], "responses": { "200": { - "description": "Successfully found the notification", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/screens" } } } @@ -4058,16 +4318,16 @@ }, "put": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", + "summary": "Update a screen", + "description": "Update a Screen.", + "operationId": "updateScreen", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -4079,7 +4339,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/screensEditable" } } } @@ -4092,16 +4352,16 @@ }, "delete": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", + "summary": "Delete a screen", + "description": "Delete a Screen.", + "operationId": "deleteScreen", "parameters": [ { - "name": "notification_id", + "name": "screens_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of screen to return", "required": true, "schema": { "type": "string" @@ -4115,109 +4375,136 @@ } } }, - "/read_notifications": { + "/screens/{screens_id}/draft": { "put": { "tags": [ - "Notifications" + "Screens" + ], + "summary": "Update a draft screen", + "description": "Update a draft Screen.", + "operationId": "updateDraftScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Mark notifications as read by the user", - "description": "Update notification as read", - "operationId": "markNotificationAsRead", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/screensEditable" } } } }, "responses": { - "201": { + "204": { "description": "success" } } } }, - "/unread_notifications": { + "/screens/{screens_id}/duplicate": { "put": { "tags": [ - "Notifications" + "Screens" + ], + "summary": "duplicate a screen", + "description": "duplicate a Screen.", + "operationId": "duplicateScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } ], - "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" + "$ref": "#/components/schemas/screensEditable" } } } }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/read_all_notifications": { - "put": { + "/screens/{screensId}/export": { + "post": { "tags": [ - "Notifications" + "Screens" ], - "summary": "Mark notifications as read by id and type", - "description": "Update all notification as read.", - "operationId": "markAllAsRead", + "summary": "Export a single screen by ID", + "description": "Export the specified screen.", + "operationId": "exportScreen", + "parameters": [ + { + "name": "screensId", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully exported the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screenExported" + } + } + } + } + } + } + }, + "/screens/import": { + "post": { + "tags": [ + "Screens" + ], + "summary": "Import a new screen", + "description": "Import the specified screen.", + "operationId": "importScreen", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "id": { - "description": "Polymorphic relation id", - "type": "integer" - }, - "type": { - "description": "Polymorphic relation type", - "type": "string" + "file": { + "description": "file to import", + "type": "string", + "format": "binary" } }, "type": "object" @@ -4227,43 +4514,48 @@ }, "responses": { "201": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } + } } } } }, - "/permissions": { - "put": { + "/screens/preview": { + "post": { "tags": [ - "Permissions" + "Screens" ], - "summary": "Update the permissions of a user", - "description": "Update permissions", - "operationId": "51b3555fb753f44324bf5c3880e01454", + "summary": "Preview a screen", + "description": "Get preview a screen", + "operationId": "preview", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "user_id": { - "description": "ID of the user whose permissions are configured", - "type": "integer" + "config": { + "type": "object" }, - "group_id": { - "description": "ID of the group whose permissions are configured", - "type": "integer" + "watchers": { + "type": "object" }, - "is_administrator": { - "description": "Whether the user should have Super Admin privileges", - "type": "boolean", - "default": false + "computed": { + "type": "object" }, - "permission_names": { - "type": "array", - "items": { - "type": "string" - } + "custom_css": { + "type": "string" } }, "type": "object" @@ -4272,50 +4564,99 @@ } }, "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } } } } }, - "/process_categories": { + "/screens/{screen_id}/translate/{language}": { "get": { "tags": [ - "Process Categories" + "Screens" ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", + "summary": "Translates the screen to the desired language", + "description": "Translates the controls inside a screen", + "operationId": "translateScreen", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", + "name": "screen_id", + "in": "path", + "description": "ID of the screen", + "required": true, "schema": { "type": "string" } }, { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "language", + "in": "path", + "description": "Language used for the translation of the string", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "list of processes categories", + "description": "Successfully found the screen", "content": { "application/json": { "schema": { - "properties": { - "data": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + } + }, + "/script_categories": { + "get": { + "tags": [ + "Script Categories" + ], + "summary": "Returns all scripts categories that the user has access to", + "description": "Display a listing of the Script Categories.", + "operationId": "getScriptCategories", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of scripts categories", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } }, "meta": { @@ -4331,17 +4672,17 @@ }, "post": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Save a new process Category", - "description": "Store a newly created Process Category in storage", - "operationId": "createProcessCategory", + "summary": "Save a new Script Category", + "description": "Store a newly created Script Category in storage", + "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -4352,7 +4693,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4360,32 +4701,32 @@ } } }, - "/process_categories/{process_category_id}": { + "/script_categories/{script_category_id}": { "get": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "summary": "Get single script category by ID", + "description": "Display the specified script category.", + "operationId": "getScriptCategoryById", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4394,19 +4735,19 @@ }, "put": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Update a process Category", + "summary": "Update a script Category", "description": "Updates the current element", - "operationId": "updateProcessCategory", + "operationId": "updateScriptCategory", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -4415,7 +4756,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/ScriptCategoryEditable" } } } @@ -4426,7 +4767,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/ScriptCategory" } } } @@ -4435,44 +4776,37 @@ }, "delete": { "tags": [ - "Process Categories" + "Script Categories" ], - "summary": "Delete a process category", + "summary": "Delete a script category", "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "operationId": "deleteScriptCategory", "parameters": [ { - "name": "process_category_id", + "name": "script_category_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of script category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "description": "success" } } } }, - "/processes": { + "/scripts": { "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "summary": "Returns all scripts that the user has access to", + "description": "Get a list of scripts in a process.", + "operationId": "getScripts", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4486,25 +4820,13 @@ { "$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 processes", + "description": "list of scripts", "content": { "application/json": { "schema": { @@ -4512,11 +4834,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -4528,17 +4850,17 @@ }, "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Save a new process", - "description": "Store a newly created resource in storage.", - "operationId": "createProcess", + "summary": "Save a new script", + "description": "Create a new script in a process.", + "operationId": "createScript", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } @@ -4549,7 +4871,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } } } @@ -4557,69 +4879,72 @@ } } }, - "/processes/{processId}": { - "get": { + "/scripts/{script_id}/preview": { + "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Get single process by ID", - "description": "Display the specified resource.", - "operationId": "getProcessById", + "summary": "Test script code without saving it", + "description": "Previews executing a script, with sample data/config data", + "operationId": "previewScript", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/include" } ], - "responses": { - "200": { - "description": "Successfully found the process", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } - }, - "204": { - "description": "Process not found", - "content": { - "application/json": { - "schema": { - "properties": { - "message": { - "type": "string", - "example": "The requested process was not found" + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" } }, - "type": "object" - } + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "code": { + "type": "string" + }, + "nonce": { + "type": "string" + } + }, + "type": "object" } } } + }, + "responses": { + "200": { + "description": "success if the script was queued" + } } - }, - "put": { + } + }, + "/scripts/execute/{script_id}": { + "post": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", + "summary": "Execute script", + "description": "Executes a script, with sample data/config data", + "operationId": "executeScript", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -4627,116 +4952,218 @@ } ], "requestBody": { - "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" - } - } - } - }, - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } - } + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "sync": { + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success if the script was queued", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsPreview" + } + } + } + } } - }, - "delete": { + } + }, + "/scripts/execution/{key}": { + "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Get the response of a script execution by execution key", + "description": "Get the response of a script execution", + "operationId": "getScriptExecutionResponse", "parameters": [ { - "name": "processId", + "name": "key", "in": "path", - "description": "ID of process to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "response of a script execution", + "content": { + "application/json": { + "schema": {} + } + } } } } }, - "/processes/{processId}/start_events": { + "/scripts/{script_id}": { "get": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", + "summary": "Get single script by ID", + "description": "Get a single script in a process.", + "operationId": "getScriptsById", "parameters": [ { - "name": "processId", + "name": "script_id", "in": "path", - "description": "ID of process to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the start events process", + "description": "Successfully found the script", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/scripts" } } } } } + }, + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a script", + "description": "Update a script in a process.", + "operationId": "updateScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Scripts" + ], + "summary": "Delete a script", + "description": "Delete a script in a process.", + "operationId": "deleteScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/scripts/{script_id}/draft": { + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a draft script", + "description": "Update a draft script.", + "operationId": "updateDraftScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } } }, - "/processes/{processId}/draft": { + "/scripts/{scripts_id}/duplicate": { "put": { "tags": [ - "Processes" + "Scripts" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "summary": "duplicate a script", + "description": "Duplicate a Script.", + "operationId": "duplicateScript", "parameters": [ { - "name": "processId", + "name": "scripts_id", "in": "path", - "description": "ID of process to return", + "description": "ID of script to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -4745,18 +5172,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/scriptsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/scripts" } } } @@ -4764,14 +5191,14 @@ } } }, - "/start_processes": { + "/script-executors": { "get": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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": "Returns all script executors that the user has access to", + "description": "Get a list of script executors.", + "operationId": "getScriptExecutors", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -4784,23 +5211,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "without_event_definitions", - "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, - "schema": { - "type": "boolean" - } } ], "responses": { "200": { - "description": "list of processes that the user can start", + "description": "list of script executors", "content": { "application/json": { "schema": { @@ -4808,11 +5223,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" + "$ref": "#/components/schemas/scriptExecutors" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -4821,34 +5236,39 @@ } } } - } - }, - "/processes/{processId}/restore": { - "put": { + }, + "post": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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" + "summary": "Create a script executor", + "description": "Create a script executor", + "operationId": "createScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } } } - ], + }, "responses": { "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -4856,33 +5276,43 @@ } } }, - "/processes/{processId}/export": { - "post": { + "/script-executors/{script_executor}": { + "put": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Update script executor", + "description": "Update and rebuild the script executor", + "operationId": "updateScriptExecutor", "parameters": [ { - "name": "processId", + "name": "script_executor", "in": "path", - "description": "ID of process to export", + "description": "ID of script executor to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, "responses": { "200": { - "description": "Successfully built the process for export", + "description": "success", "content": { "application/json": { "schema": { "properties": { - "url": { + "status": { "type": "string" } }, @@ -4892,40 +5322,37 @@ } } } - } - }, - "/processes/import/validation": { - "post": { + }, + "delete": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "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" - } + "summary": "Delete a script executor", + "description": "Delete a script executor", + "operationId": "deleteScriptExecutor", + "parameters": [ + { + "name": "script_executor", + "in": "path", + "description": "ID of script executor to return", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" } } } @@ -4933,24 +5360,22 @@ } } }, - "/processes/import": { + "/script-executors/cancel": { "post": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Import a new process", - "description": "Import the specified process.", - "operationId": "importProcess", + "summary": "Cancel a script executor", + "description": "Cancel a script executor", + "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" + "pidFile": { + "type": "string" } }, "type": "object" @@ -4964,7 +5389,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" } } } @@ -4972,34 +5405,43 @@ } } }, - "/processes/{processId}/bpmn": { + "/script-executors/available-languages": { "get": { "tags": [ - "Processes" + "Rebuild Script Executors" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Returns all available languages", + "description": "Get a list of available languages.", + "operationId": "getAvailableLanguages", "parameters": [ { - "name": "processId", - "in": "path", - "description": "ID of process", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "list of available languages", "content": { "application/json": { "schema": { "properties": { - "url": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableLanguages" + } + }, + "meta": { + "type": "object" } }, "type": "object" @@ -5010,34 +5452,43 @@ } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/security-logs": { + "get": { "tags": [ - "Processes" + "Security Logs" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Returns all security logs", + "description": "Get a list of Security Logs.", + "operationId": "getSecurityLogs", "parameters": [ { - "name": "code", - "in": "path", - "description": "Import code", - "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": "check is import is ready", + "description": "list of security logs", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + }, + "meta": { + "type": "object" } }, "type": "object" @@ -5048,119 +5499,148 @@ } } }, - "/processes/{process_id}/import/assignments": { - "post": { + "/security-logs/{securityLog}": { + "get": { "tags": [ - "Processes" + "Security Logs" ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", + "summary": "Get single security log by ID", + "description": "Display the specified resource.", + "operationId": "getSecurityLog", "parameters": [ { - "name": "process_id", + "name": "securityLog", "in": "path", - "description": "ID of process to return", + "description": "ID of security log to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessAssignments" + "responses": { + "200": { + "description": "Successfully found the security log", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + } + }, + "type": "object" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/process_events/{process_id}": { - "post": { - "tags": [ - "Processes" + "/settings": { + "get": { + "tags": [ + "Settings" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Returns all settings", + "description": "Display a listing of the resource.", + "operationId": "getSettings", "parameters": [ { - "name": "process_id", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/filter" }, { - "name": "event", - "in": "query", - "description": "Node ID of the start event", + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/settings" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings/{setting_id}": { + "put": { + "tags": [ + "Settings" + ], + "summary": "Update a setting", + "description": "Update a setting", + "operationId": "updateSetting", + "parameters": [ + { + "name": "setting_id", + "in": "path", + "description": "ID of setting to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "requestBody": { - "description": "data that will be stored as part of the created request", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/settingsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/requests": { + "/signals": { "get": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Returns all process Requests that the user has access to", + "summary": "Returns all signals", "description": "Display a listing of the resource.", - "operationId": "getProcessesRequests", + "operationId": "getSignals", "parameters": [ - { - "name": "type", - "in": "query", - "description": "Only return requests by type (all|in_progress|completed)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "all", - "in_progress", - "completed", - "started_me" - ] - } - }, { "$ref": "#/components/parameters/filter" }, @@ -5172,14 +5652,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes", + "description": "list of signals", "content": { "application/json": { "schema": { @@ -5187,11 +5664,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/signals" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -5200,61 +5677,84 @@ } } } + }, + "post": { + "tags": [ + "Signals" + ], + "summary": "Creates a new Global Signal", + "description": "Creates a new global signal", + "operationId": "createSignal", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } } }, - "/requests/{process_request_id}": { + "/signals/{signal_id}": { "get": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Get single process request by ID", + "summary": "Get a single signal by ID", "description": "Display the specified resource.", - "operationId": "getProcessRequestById", + "operationId": "getSignalsById", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "signal id", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/signals" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Update a process request", - "description": "Update a request", - "operationId": "updateProcessRequest", + "summary": "Update a signal", + "operationId": "updateSignal", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of signal to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -5263,101 +5763,59 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestEditable" + "$ref": "#/components/schemas/signalsEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } } } }, "delete": { "tags": [ - "Process Requests" + "Signals" ], - "summary": "Delete a process request", - "description": "Delete a request", - "operationId": "deleteProcessRequest", + "summary": "Delete a signal", + "operationId": "deleteSignal", "parameters": [ { - "name": "process_request_id", + "name": "signal_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of signal to delete", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequest" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" + "description": "success" } } } }, - "/requests/{process_request_id}/events/{event_id}": { - "post": { + "/task_assignments": { + "get": { "tags": [ - "Process Requests" + "Task Assignments" ], - "summary": "Update a process request event", - "description": "Trigger a intermediate catch event", - "operationId": "updateProcessRequestEvent", + "summary": "Returns all task assignments", + "description": "Display a listing of the resource.", + "operationId": "getTaskAssignments", "parameters": [ { - "name": "process_request_id", - "in": "path", - "description": "ID of process request to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event_id", - "in": "path", - "description": "ID of process event to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/requests/{request_id}/files": { - "get": { - "tags": [ - "Request Files" - ], - "summary": "Returns the list of files associated with a request", - "description": "Display a listing of the resource.", - "operationId": "getRequestFiles", - "parameters": [ - { - "$ref": "#/components/parameters/filter" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -5367,20 +5825,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } } ], "responses": { "200": { - "description": "list of files", + "description": "list of task assignments", "content": { "application/json": { "schema": { @@ -5388,16 +5837,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/taskAssignments" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "type": "object" } }, "type": "object" @@ -5409,169 +5853,144 @@ }, "post": { "tags": [ - "Request Files" - ], - "summary": "Save a new media file to a request", - "description": "Store a newly created resource in storage.", - "operationId": "createRequestFile", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Variable name in the request data to use for the file name", - "required": false, - "schema": { - "type": "string" - } - } + "Task Assignments" ], + "summary": "Save a new Task Assignment", + "description": "Store a newly created task assignment in storage.", + "operationId": "createTaskAssignments", "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/taskAssignmentsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - }, - "fileUploadId": { - "type": "integer" - } - }, - "type": "object" + "$ref": "#/components/schemas/taskAssignments" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/requests/{request_id}/files/{file_id}": { - "get": { + "/task_assignments/{task_assignment}": { + "put": { "tags": [ - "Request Files" + "Task Assignments" ], - "summary": "Get a file uploaded to a request", - "description": "Display the specified resource.", - "operationId": "getRequestFilesById", + "summary": "Update a Task Assignment", + "description": "Update a task assignment", + "operationId": "updateTaskAssignments", "parameters": [ { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "file_id", + "name": "task_assignment", "in": "path", - "description": "ID of the file to return", + "description": "ID of task assignment to update", "required": true, "schema": { "type": "integer" } } ], - "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" } } + } + }, + "responses": { + "204": { + "description": "success" }, "404": { "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Request Files" + "Task Assignments" ], - "summary": "Delete all media associated with a request", - "description": "Remove the specified resource from storage.", - "operationId": "deleteRequestFile", + "summary": "Delete a Task Assignment", + "description": "Remove an assignment", + "operationId": "deleteTaskAssignments", "parameters": [ { - "name": "file_id", + "name": "task_assignment", "in": "path", - "description": "ID of the file", + "description": "ID of task assignment to delete", "required": true, "schema": { "type": "integer" } - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, "responses": { - "204": { + "200": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/screen_categories": { + "/tasks": { "get": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Returns all screens categories that the user has access to", - "description": "Display a listing of the Screen Categories.", - "operationId": "getScreenCategories", + "summary": "Returns all tasks that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getTasks", "parameters": [ { - "name": "filter", + "name": "process_request_id", "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "description": "Process request id", + "required": false, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "all_tasks", + "in": "query", + "description": "Return all task types. Not just user tasks.", + "required": false, + "schema": { + "type": "boolean" } }, + { + "$ref": "#/components/parameters/filter" + }, { "$ref": "#/components/parameters/order_by" }, @@ -5579,12 +5998,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of screens categories", + "description": "list of tasks", "content": { "application/json": { "schema": { @@ -5592,11 +6011,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5605,52 +6024,31 @@ } } } - }, - "post": { - "tags": [ - "Screen Categories" - ], - "summary": "Save a new Screen Category", - "description": "Store a newly created Screen Category in storage", - "operationId": "createScreenCategory", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenCategory" - } - } - } - } - } } }, - "/screen_categories/{screen_category_id}": { + "/tasks/{task_id}": { "get": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Get single screen category by ID", - "description": "Display the specified screen category.", - "operationId": "getScreenCategoryById", + "summary": "Get a single task by ID", + "description": "Display the specified resource.", + "operationId": "getTasksById", "parameters": [ { - "name": "screen_category_id", + "name": "task_id", "in": "path", - "description": "ID of screen category to return", + "description": "task id", "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "include", + "in": "query", + "description": "include", + "required": false, "schema": { "type": "string" } @@ -5658,32 +6056,35 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Screen Categories" + "Tasks" ], - "summary": "Update a screen Category", + "summary": "Update a task", "description": "Updates the current element", - "operationId": "updateScreenCategory", + "operationId": "updateTask", "parameters": [ { - "name": "screen_category_id", + "name": "task_id", "in": "path", - "description": "ID of screen category to return", + "description": "ID of task to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5692,7 +6093,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "required": [ + "status", + "data" + ], + "properties": { + "status": { + "type": "string", + "example": "COMPLETED" + }, + "data": { + "type": "object" + } + }, + "type": "object" } } } @@ -5703,49 +6117,39 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/processRequestToken" } } } - } - } - }, - "delete": { - "tags": [ - "Screen Categories" - ], - "summary": "Delete a screen category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScreenCategory", - "parameters": [ - { - "name": "screen_category_id", - "in": "path", - "description": "ID of screen category to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens": { + "/users": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Returns all screens that the user has access to", - "description": "Get a list of Screens.", - "operationId": "getScreens", + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "$ref": "#/components/parameters/status" + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -5760,9 +6164,9 @@ "$ref": "#/components/parameters/include" }, { - "name": "exclude", + "name": "exclude_ids", "in": "query", - "description": "Comma separated list of fields to exclude from the response", + "description": "Comma separated list of IDs to exclude from the response", "schema": { "type": "string", "default": "" @@ -5771,7 +6175,7 @@ ], "responses": { "200": { - "description": "list of screens", + "description": "list of users", "content": { "application/json": { "schema": { @@ -5779,11 +6183,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -5795,17 +6199,17 @@ }, "post": { "tags": [ - "Screens" + "Users" ], - "summary": "Save a new screens", - "description": "Create a new Screen.", - "operationId": "createScreen", + "summary": "Save a new users", + "description": "Store a newly created resource in storage.", + "operationId": "createUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } @@ -5816,61 +6220,119 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens/{screens_id}": { + "/users_task_count": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Get single screens by ID", - "description": "Get a single Screen.", - "operationId": "getScreensById", + "summary": "Returns all users and their total tasks", + "description": "Display a listing of users and their task counts.", + "operationId": "getUsersTaskCount", "parameters": [ { - "name": "screens_id", + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "schema": { + "type": "string" + } + }, + { + "name": "include_ids", + "in": "query", + "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "schema": { + "type": "string", + "default": "" + } + } + ], + "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}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get single user by ID", + "description": "Display the specified resource.", + "operationId": "getUserById", + "parameters": [ + { + "name": "user_id", "in": "path", - "description": "ID of screens to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Update a screen", - "description": "Update a Screen.", - "operationId": "updateScreen", + "summary": "Update a user", + "description": "Update a user", + "operationId": "updateUser", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5879,7 +6341,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } @@ -5887,86 +6349,95 @@ "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } }, "delete": { "tags": [ - "Screens" + "Users" ], - "summary": "Delete a screen", - "description": "Delete a Screen.", - "operationId": "deleteScreen", + "summary": "Delete a user", + "description": "Delete a user", + "operationId": "deleteUser", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to delete", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/screens/{screens_id}/draft": { - "put": { + "/users/{user_id}/get_pinned_controls": { + "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Update a draft screen", - "description": "Update a draft Screen.", - "operationId": "updateDraftScreen", - "parameters": [ + "summary": "Get the pinned BPMN elements of a specific user", + "description": "Return the user's pinned nodes.", + "operationId": "getPinnnedControls", + "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return the pinned nodes of", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screensEditable" + "responses": { + "200": { + "description": "Pinned nodes returned succesfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } } } - } - }, - "responses": { - "204": { - "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/screens/{screens_id}/duplicate": { + "/users/{user_id}/update_pinned_controls": { "put": { "tags": [ - "Screens" + "Users" ], - "summary": "duplicate a screen", - "description": "duplicate a Screen.", - "operationId": "duplicateScreen", + "summary": "Update a user's pinned BPMN elements on Modeler", + "description": "Update a user's pinned BPMN elements on Modeler", + "operationId": "updatePinnedControls", "parameters": [ { - "name": "screens_id", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -5975,170 +6446,132 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/usersEditable" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screens" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/screens/{screensId}/export": { - "post": { + "/users/{user_id}/groups": { + "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Export a single screen by ID", - "description": "Export the specified screen.", - "operationId": "exportScreen", + "summary": "Set the groups a users belongs to", + "description": "Update a user's groups", + "operationId": "updateUserGroups", "parameters": [ { - "name": "screensId", + "name": "user_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of user", "required": true, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully exported the screen", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screenExported" - } - } + "type": "integer" } } - } - } - }, - "/screens/import": { - "post": { - "tags": [ - "Screens" ], - "summary": "Import a new screen", - "description": "Import the specified screen.", - "operationId": "importScreen", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/updateUserGroups" } } } }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/screens/preview": { - "post": { + "/users/restore": { + "put": { "tags": [ - "Screens" + "Users" ], - "summary": "Preview a screen", - "description": "Get preview a screen", - "operationId": "preview", + "summary": "Restore a soft deleted user", + "description": "Reverses the soft delete of a user", + "operationId": "restoreUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "config": { - "type": "object" - }, - "watchers": { - "type": "object" - }, - "computed": { - "type": "object" - }, - "custom_css": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/restoreUser" } } } }, "responses": { "200": { - "description": "Successfully found the screen", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screens" - } - } - } + "description": "success" } } } }, - "/screens/{screen_id}/translate/{language}": { + "/users/get_filter_configuration/{name}": { "get": { "tags": [ - "Screens" + "Users" ], - "summary": "Translates the screen to the desired language", - "description": "Translates the controls inside a screen", - "operationId": "translateScreen", + "summary": "Get filter configuration by name", + "description": "Get filter configuration.", + "operationId": "getFilterConfiguration", "parameters": [ { - "name": "screen_id", + "name": "name", "in": "path", - "description": "ID of the screen", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/store_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Store filter configuration by name", + "description": "Store filter configuration.", + "operationId": "storeFilterConfiguration", + "parameters": [ { - "name": "language", + "name": "name", "in": "path", - "description": "Language used for the translation of the string", "required": true, "schema": { "type": "string" @@ -6147,48 +6580,46 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/users" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/script_categories": { + "/users/{user_id}/tokens": { "get": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Returns all scripts categories that the user has access to", - "description": "Display a listing of the Script Categories.", - "operationId": "getScriptCategories", + "summary": "Display listing of access tokens for the specified user.", + "description": "Display listing of access tokens for the specified user.", + "operationId": "getTokens", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, "schema": { - "type": "string" + "type": "integer" } }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, { "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of scripts categories", + "description": "List of tokens.", "content": { "application/json": { "schema": { @@ -6196,11 +6627,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6212,28 +6643,44 @@ }, "post": { "tags": [ - "Script Categories" + "Personal Tokens" + ], + "summary": "Create new token for a specific user", + "description": "Create a new personal access token for the user.", + "operationId": "createTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + } ], - "summary": "Save a new Script Category", - "description": "Store a newly created Script Category in storage", - "operationId": "createScriptCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" } } } }, "responses": { "201": { - "description": "success", + "description": "New token instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } } } @@ -6241,19 +6688,28 @@ } } }, - "/script_categories/{script_category_id}": { + "/users/{user_id}/tokens/{token_id}": { "get": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Get single script category by ID", - "description": "Display the specified script category.", - "operationId": "getScriptCategoryById", + "summary": "Get single token by ID", + "description": "Show a personal access token for the user", + "operationId": "getTokenById", "parameters": [ { - "name": "script_category_id", + "name": "user_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "ID of token to return", "required": true, "schema": { "type": "string" @@ -6262,91 +6718,130 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "Successfully found the token", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/UserToken" } } } } } }, - "put": { + "delete": { "tags": [ - "Script Categories" + "Personal Tokens" ], - "summary": "Update a script Category", - "description": "Updates the current element", - "operationId": "updateScriptCategory", + "summary": "Delete a token", + "description": "Delete the given token for a user", + "operationId": "deleteToken", "parameters": [ { - "name": "script_category_id", + "name": "user_id", "in": "path", - "description": "ID of script category to return", + "description": "User ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "Token ID", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" - } - } - } - }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScriptCategory" - } - } - } + "204": { + "description": "success" } } - }, - "delete": { + } + }, + "/processes/variables": { + "get": { "tags": [ - "Script Categories" + "Processes Variables" ], - "summary": "Delete a script category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScriptCategory", + "summary": "Get variables for multiple processes with pagination", + "operationId": "getProcessesVariables", "parameters": [ { - "name": "script_category_id", - "in": "path", - "description": "ID of script category to return", - "required": true, + "name": "processIds", + "in": "query", + "description": "Comma-separated list of process IDs", + "required": false, "schema": { - "type": "string" + "type": "string", + "example": "1,2,3", + "nullable": true + } + }, + { + "name": "page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "per_page", + "in": "query", + "description": "Items per page", + "required": false, + "schema": { + "type": "integer", + "default": 20 } } ], "responses": { - "204": { - "description": "success" + "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": [ + { + "url": "https://pm4.local:8092/api/1.1", + "description": "API v1.1 Server" + } + ] } }, - "/scripts": { + "/analytics-reporting": { "get": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Returns all scripts that the user has access to", - "description": "Get a list of scripts in a process.", - "operationId": "getScripts", + "summary": "Returns all analytics reporting that the user has access to", + "description": "Get a list of Analytics Reporting.", + "operationId": "getAnalyticsReporting", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -6366,7 +6861,7 @@ ], "responses": { "200": { - "description": "list of scripts", + "description": "list of analytics reporting", "content": { "application/json": { "schema": { @@ -6374,11 +6869,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/analyticsReporting" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6390,17 +6885,17 @@ }, "post": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Save a new script", - "description": "Create a new script in a process.", - "operationId": "createScript", + "summary": "Save a new Analytics Reporting", + "description": "Create a new Analytics Reporting.", + "operationId": "createAnalyticsReporting", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } @@ -6411,7 +6906,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/analyticsReporting" } } } @@ -6419,161 +6914,190 @@ } } }, - "/scripts/{script_id}/preview": { - "post": { + "/analytics-reporting/{analytic_reporting_id}": { + "get": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Test script code without saving it", - "description": "Previews executing a script, with sample data/config data", - "operationId": "previewScript", + "summary": "Get single analytic reporting by ID", + "description": "Get a single Analytic Reporting.", + "operationId": "getAnalyticReportingById", "parameters": [ { - "name": "script_id", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "code": { - "type": "string" - }, - "nonce": { - "type": "string" - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success if the script was queued" + "description": "Successfully found the analytics reporting", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/analyticsReporting" + } + } + } } } - } - }, - "/scripts/execute/{script_id}": { - "post": { + }, + "put": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Execute script", - "description": "Executes a script, with sample data/config data", - "operationId": "executeScript", + "summary": "Update a analytic reporting", + "description": "Update a Analytics Reporting.", + "operationId": "updateAnalyticReporting", "parameters": [ { - "name": "script_id", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "sync": { - "type": "boolean" - } - }, - "type": "object" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } }, "responses": { - "200": { - "description": "success if the script was queued", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsPreview" - } - } - } + "204": { + "description": "success" } } - } - }, - "/scripts/execution/{key}": { - "get": { + }, + "delete": { "tags": [ - "Scripts" + "AnalyticsReporting" ], - "summary": "Get the response of a script execution by execution key", - "description": "Get the response of a script execution", - "operationId": "getScriptExecutionResponse", + "summary": "Delete an analytic reporting", + "description": "Delete a Analytics Reporting.", + "operationId": "deleteAnalyticReporting", "parameters": [ { - "name": "key", + "name": "analytic_reporting_id", "in": "path", + "description": "ID of analytic reporting to return", "required": true, "schema": { "type": "string" } } ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/collections": { + "get": { + "tags": [ + "Collections" + ], + "summary": "Returns all collections that the user has access to", + "description": "Get a list of Collections.", + "operationId": "getCollections", + "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": "response of a script execution", + "description": "list of collections", "content": { "application/json": { - "schema": {} + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/collections" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Collections" + ], + "summary": "Save a new collections", + "description": "Create a new Collection.", + "operationId": "createCollection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collections" + } } } } } } }, - "/scripts/{script_id}": { + "/collections/{collection_id}": { "get": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Get single script by ID", - "description": "Get a single script in a process.", - "operationId": "getScriptsById", + "summary": "Get single collections by ID", + "description": "Get a single Collection.", + "operationId": "getCollectionById", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to return", "required": true, "schema": { "type": "string" @@ -6582,11 +7106,11 @@ ], "responses": { "200": { - "description": "Successfully found the script", + "description": "Successfully found the collections", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/collections" } } } @@ -6595,16 +7119,16 @@ }, "put": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Update a script", - "description": "Update a script in a process.", - "operationId": "updateScript", + "summary": "Update a collection", + "description": "Update a Collection.", + "operationId": "updateCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to update", "required": true, "schema": { "type": "string" @@ -6616,7 +7140,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/collectionsEditable" } } } @@ -6629,16 +7153,16 @@ }, "delete": { "tags": [ - "Scripts" + "Collections" ], - "summary": "Delete a script", - "description": "Delete a script in a process.", - "operationId": "deleteScript", + "summary": "Delete a collection", + "description": "Delete a Collection.", + "operationId": "deleteCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of collection to return", "required": true, "schema": { "type": "string" @@ -6652,67 +7176,56 @@ } } }, - "/scripts/{script_id}/draft": { - "put": { + "/collections/{collection_id}/export": { + "post": { "tags": [ - "Scripts" + "Screens" ], - "summary": "Update a draft script", - "description": "Update a draft script.", - "operationId": "updateDraftScript", + "summary": "Trigger export collections job", + "description": "Export the specified collection.", + "operationId": "exportCollection", "parameters": [ { - "name": "script_id", + "name": "collection_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the collection to export", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, "responses": { - "204": { + "202": { "description": "success" } } } }, - "/scripts/{scripts_id}/duplicate": { - "put": { + "/collections/import": { + "post": { "tags": [ - "Scripts" - ], - "summary": "duplicate a script", - "description": "Duplicate a Script.", - "operationId": "duplicateScript", - "parameters": [ - { - "name": "scripts_id", - "in": "path", - "description": "ID of script to return", - "required": true, - "schema": { - "type": "string" - } - } + "Collections" ], + "summary": "Import a new collection", + "description": "Import the specified collection.", + "operationId": "importCollection", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "required": [ + "file" + ], + "properties": { + "file": { + "description": "file to upload", + "type": "file", + "format": "file" + } + }, + "type": "object" } } } @@ -6723,23 +7236,71 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/collections" } } } - } - } + }, + "200": { + "description": "success" + } + } } }, - "/script-executors": { + "/collections/{collection_id}/truncate": { + "delete": { + "tags": [ + "Collections" + ], + "summary": "Deletes all records in a collection", + "description": "Truncate a Collection.", + "operationId": "truncateCollection", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of collection to truncate", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/collections/{collection_id}/records": { "get": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Returns all script executors that the user has access to", - "description": "Get a list of script executors.", - "operationId": "getScriptExecutors", + "summary": "Returns all records", + "description": "Get the list of records of a collection.", + "operationId": "getRecords", "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of collection to get records for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pmql", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/per_page" + }, { "$ref": "#/components/parameters/filter" }, @@ -6750,12 +7311,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of script executors", + "description": "list of records of a collection", "content": { "application/json": { "schema": { @@ -6763,11 +7324,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scriptExecutors" + "$ref": "#/components/schemas/records" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -6779,36 +7340,39 @@ }, "post": { "tags": [ - "Rebuild Script Executors" + "Collections" + ], + "summary": "Save a new record in a collection", + "description": "Create a new record in a Collection.", + "operationId": "createRecord", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of the collection", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Create a script executor", - "description": "Create a script executor", - "operationId": "createScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" + "$ref": "#/components/schemas/recordsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/records" } } } @@ -6816,279 +7380,185 @@ } } }, - "/script-executors/{script_executor}": { - "put": { + "/collections/{collection_id}/records/{record_id}": { + "get": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Update script executor", - "description": "Update and rebuild the script executor", - "operationId": "updateScriptExecutor", + "summary": "Get single record of a collection", + "description": "Get a single record of a Collection.", + "operationId": "getRecordById", "parameters": [ { - "name": "script_executor", + "name": "collection_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of the collection", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" - } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record to return", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { - "description": "success", + "description": "Successfully found the record", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/records" } } } } } }, - "delete": { + "put": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Delete a script executor", - "description": "Delete a script executor", - "operationId": "deleteScriptExecutor", + "summary": "Update a record", + "description": "Update a record in a Collection.", + "operationId": "updateRecord", "parameters": [ { - "name": "script_executor", + "name": "collection_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of collection", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" - } - } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record ", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/script-executors/cancel": { - "post": { - "tags": [ - "Rebuild Script Executors" ], - "summary": "Cancel a script executor", - "description": "Cancel a script executor", - "operationId": "cancelScriptExecutor", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "pidFile": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/recordsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } - } - }, - "/script-executors/available-languages": { - "get": { + }, + "delete": { "tags": [ - "Rebuild Script Executors" + "Collections" ], - "summary": "Returns all available languages", - "description": "Get a list of available languages.", - "operationId": "getAvailableLanguages", + "summary": "Delete a collection record", + "description": "Delete a record of a Collection.", + "operationId": "deleteRecord", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" + "name": "collection_id", + "in": "path", + "description": "ID of collection", + "required": true, + "schema": { + "type": "string" + } }, { - "$ref": "#/components/parameters/per_page" + "name": "record_id", + "in": "path", + "description": "ID of record in collection", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { - "200": { - "description": "list of available languages", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/availableLanguages" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } - } - }, - "/security-logs": { - "get": { + }, + "patch": { "tags": [ - "Security Logs" + "Collections" ], - "summary": "Returns all security logs", - "description": "Get a list of Security Logs.", - "operationId": "getSecurityLogs", + "summary": "Partial update of a record", + "description": "Implements a partial update of a record in a Collection.", + "operationId": "patchRecord", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of security logs", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } + "name": "collection_id", + "in": "path", + "description": "ID of collection ", + "required": true, + "schema": { + "type": "string" } - } - } - } - }, - "/security-logs/{securityLog}": { - "get": { - "tags": [ - "Security Logs" - ], - "summary": "Get single security log by ID", - "description": "Display the specified resource.", - "operationId": "getSecurityLog", - "parameters": [ + }, { - "name": "securityLog", + "name": "record_id", "in": "path", - "description": "ID of security log to return", + "description": "ID of the record ", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "Successfully found the security log", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/securityLog" - } - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" } } } + }, + "responses": { + "200": { + "description": "success" + } } } }, - "/settings": { + "/comments/tasks": { "get": { "tags": [ - "Settings" + "Comments" ], - "summary": "Returns all settings", + "summary": "Returns all the tasks that are active.", "description": "Display a listing of the resource.", - "operationId": "getSettings", + "operationId": "getCommentTasks", "parameters": [ + { + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, + "schema": { + "type": "integer" + } + }, { "$ref": "#/components/parameters/filter" }, @@ -7097,17 +7567,11 @@ }, { "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of settings", + "description": "list all tasks taht are active", "content": { "application/json": { "schema": { @@ -7115,7 +7579,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/settings" + "$ref": "#/components/schemas/processRequestToken" } }, "meta": { @@ -7130,56 +7594,14 @@ } } }, - "/settings/{setting_id}": { - "put": { - "tags": [ - "Settings" - ], - "summary": "Update a setting", - "description": "Update a setting", - "operationId": "updateSetting", - "parameters": [ - { - "name": "setting_id", - "in": "path", - "description": "ID of setting to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/settingsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/signals": { + "/data_source_categories": { "get": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Returns all signals", - "description": "Display a listing of the resource.", - "operationId": "getSignals", + "summary": "Returns all Data Connectors categories that the user has access to", + "description": "Display a listing of the Data Connector Categories.", + "operationId": "getDataSourceCategories", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -7196,7 +7618,7 @@ ], "responses": { "200": { - "description": "list of signals", + "description": "list of Data Connectors categories", "content": { "application/json": { "schema": { @@ -7204,11 +7626,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7220,17 +7647,17 @@ }, "post": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Creates a new Global Signal", - "description": "Creates a new global signal", - "operationId": "createSignal", + "summary": "Save a new Data Connector Category", + "description": "Store a newly created Data Connector Category in storage", + "operationId": "createDataSourceCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -7241,7 +7668,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7249,19 +7676,19 @@ } } }, - "/signals/{signal_id}": { + "/data_source_categories/{data_source_category_id}": { "get": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Get a single signal by ID", - "description": "Display the specified resource.", - "operationId": "getSignalsById", + "summary": "Get single Data Connector category by ID", + "description": "Display the specified data Source category.", + "operationId": "getDatasourceCategoryById", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "signal id", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7270,11 +7697,11 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7283,15 +7710,16 @@ }, "put": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Update a signal", - "operationId": "updateSignal", + "summary": "Update a Data Connector Category", + "description": "Updates the current element", + "operationId": "updateDatasourceCategory", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of signal to update", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7303,7 +7731,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -7314,7 +7742,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -7323,15 +7751,16 @@ }, "delete": { "tags": [ - "Signals" + "DataSourcesCategories" ], - "summary": "Delete a signal", - "operationId": "deleteSignal", + "summary": "Delete a Data Connector category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDataSourceCategory", "parameters": [ { - "name": "signal_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of signal to delete", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -7345,14 +7774,14 @@ } } }, - "/task_assignments": { + "/data_sources": { "get": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Returns all task assignments", - "description": "Display a listing of the resource.", - "operationId": "getTaskAssignments", + "summary": "Returns all Data Connectors that the user has access to", + "description": "Get the list of records of a Data Connector", + "operationId": "getDataSources", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -7365,11 +7794,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of task assignments", + "description": "list of Data Connectors", "content": { "application/json": { "schema": { @@ -7377,11 +7809,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/dataSource" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7393,17 +7830,17 @@ }, "post": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Save a new Task Assignment", - "description": "Store a newly created task assignment in storage.", - "operationId": "createTaskAssignments", + "summary": "Save a new Data Connector", + "description": "Create a new Data Connector.", + "operationId": "createDataSource", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } @@ -7414,73 +7851,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignments" + "$ref": "#/components/schemas/dataSource" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/task_assignments/{task_assignment}": { - "put": { + "/data_sources/{data_source_id}": { + "get": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Update a Task Assignment", - "description": "Update a task assignment", - "operationId": "updateTaskAssignments", + "summary": "Get single Data Connector by ID", + "description": "Get a single Data Connector.", + "operationId": "getDataSourceById", "parameters": [ { - "name": "task_assignment", + "name": "data_source_id", "in": "path", - "description": "ID of task assignment to update", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "responses": { + "200": { + "description": "Successfully found the Data Connector", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSource" + } } } } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } } }, - "delete": { + "put": { "tags": [ - "Task Assignments" + "DataSources" ], - "summary": "Delete a Task Assignment", - "description": "Remove an assignment", - "operationId": "deleteTaskAssignments", + "summary": "Update a Data Connector", + "description": "Update a Data Connector.", + "operationId": "updateDataSource", "parameters": [ { - "name": "task_assignment", + "name": "data_source_id", "in": "path", - "description": "ID of task assignment to delete", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7489,142 +7914,72 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/tasks": { - "get": { - "tags": [ - "Tasks" - ], - "summary": "Returns all tasks that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getTasks", - "parameters": [ - { - "name": "process_request_id", - "in": "query", - "description": "Process request id", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "all_tasks", - "in": "query", - "description": "Return all task types. Not just user tasks.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "list of tasks", + "204": { + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/processRequestToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/dataSource" } } } } } - } - }, - "/tasks/{task_id}": { - "get": { + }, + "delete": { "tags": [ - "Tasks" + "DataSources" ], - "summary": "Get a single task by ID", - "description": "Display the specified resource.", - "operationId": "getTasksById", + "summary": "Delete a Data Connector", + "description": "Delete a Data Connector.", + "operationId": "deleteDataSource", "parameters": [ { - "name": "task_id", + "name": "data_source_id", "in": "path", - "description": "task id", + "description": "ID of Data Connector to return", "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "include", - "in": "query", - "description": "include", - "required": false, "schema": { "type": "string" } } ], "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/dataSource" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "put": { + } + }, + "/data_sources/{data_source_id}/test": { + "post": { "tags": [ - "Tasks" + "DataSources" ], - "summary": "Update a task", - "description": "Updates the current element", - "operationId": "updateTask", + "summary": "Send a Data Connector request", + "description": "Send a Data Connector request.", + "operationId": "sendDataSource", "parameters": [ { - "name": "task_id", + "name": "data_source_id", "in": "path", - "description": "ID of task to update", + "description": "ID of Data Connector to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7633,174 +7988,201 @@ "content": { "application/json": { "schema": { - "required": [ - "status", - "data" - ], - "properties": { - "status": { - "type": "string", - "example": "COMPLETED" - }, - "data": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/dataSource" } } } - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users": { - "get": { + "/requests/{request_id}/data_sources/{data_source_id}": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getUsers", + "summary": "execute Data Source", + "description": "Execute a data Source endpoint", + "operationId": "executeDataSourceForRequest", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "name": "request_id", + "in": "path", + "description": "ID of the request in whose context the datasource will be executed", + "required": true, "schema": { "type": "string" } }, { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "exclude_ids", - "in": "query", - "description": "Comma separated list of IDs to exclude from the response", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { - "type": "string", - "default": "" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "list of users", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceResponse" } } } } } - }, + } + }, + "/requests/data_sources/{data_source_id}": { "post": { "tags": [ - "Users" + "DataSources" + ], + "summary": "execute Data Source", + "operationId": "executeDataSource", + "parameters": [ + { + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Save a new users", - "description": "Store a newly created resource in storage.", - "operationId": "createUser", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "properties": { + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" + }, + "data": { + "type": "object" + } + }, + "type": "object" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/DataSourceResponse" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users_task_count": { - "get": { + "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "post": { "tags": [ - "Users" + "DataSources" ], - "summary": "Returns all users and their total tasks", - "description": "Display a listing of users and their task counts.", - "operationId": "getUsersTaskCount", + "summary": "Get Data from Data Source", + "operationId": "getDataFromDataSource", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, "schema": { "type": "string" } }, { - "name": "include_ids", - "in": "query", - "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "name": "endpoint", + "in": "path", + "description": "Endpoint of the data source", + "required": true, "schema": { - "type": "string", - "default": "" + "type": "string" } } ], "responses": { "200": { - "description": "List of users with task counts", + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceResponse" + } + } + } + } + } + } + }, + "/version_histories": { + "get": { + "tags": [ + "Version History" + ], + "summary": "Return all version History according to the model", + "description": "Get the list of records of Version History", + "operationId": "getVersionHistories", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of Version History", "content": { "application/json": { "schema": { @@ -7808,11 +8190,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -7821,58 +8208,85 @@ } } } + }, + "post": { + "tags": [ + "Version History" + ], + "summary": "Save a new Version History", + "description": "Create a new Version History.", + "operationId": "createVersion", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } + } + } } }, - "/users/{user_id}": { + "/version_histories/{version_history_id}": { "get": { "tags": [ - "Users" + "Version History" ], - "summary": "Get single user by ID", - "description": "Display the specified resource.", - "operationId": "getUserById", + "summary": "Get single Version History by ID", + "description": "Get a single Version History.", + "operationId": "getVersionHistoryById", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the Version History", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Users" + "Version History" ], - "summary": "Update a user", - "description": "Update a user", - "operationId": "updateUser", + "summary": "Update a Version History", + "description": "Update a Version History.", + "operationId": "updateVersion", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -7881,797 +8295,99 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete a user", - "description": "Delete a user", - "operationId": "deleteUser", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to delete", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/{user_id}/get_pinned_controls": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get the pinned BPMN elements of a specific user", - "description": "Return the user's pinned nodes.", - "operationId": "getPinnnedControls", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user to return the pinned nodes of", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Pinned nodes returned succesfully", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } - } - }, - "/users/{user_id}/update_pinned_controls": { - "put": { + }, + "delete": { "tags": [ - "Users" + "Version History" ], - "summary": "Update a user's pinned BPMN elements on Modeler", - "description": "Update a user's pinned BPMN elements on Modeler", - "operationId": "updatePinnedControls", + "summary": "Delete a Version History", + "description": "Delete a Version History.", + "operationId": "deleteVersion", "parameters": [ { - "name": "user_id", + "name": "version_history_id", "in": "path", - "description": "ID of user to return", + "description": "ID of Version History to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/usersEditable" - } - } - } - }, "responses": { "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/users/{user_id}/groups": { - "put": { - "tags": [ - "Users" - ], - "summary": "Set the groups a users belongs to", - "description": "Update a user's groups", - "operationId": "updateUserGroups", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/updateUserGroups" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/users/restore": { - "put": { + "/version_histories/clone": { + "post": { "tags": [ - "Users" + "Version History" ], - "summary": "Restore a soft deleted user", - "description": "Reverses the soft delete of a user", - "operationId": "restoreUser", + "summary": "Clone a new Version History", + "description": "Clone a new Version History.", + "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/restoreUser" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { - "200": { - "description": "success" - } - } - } - }, - "/users/get_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get filter configuration by name", - "description": "Get filter configuration.", - "operationId": "getFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/users" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/users/store_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Store filter configuration by name", - "description": "Store filter configuration.", - "operationId": "storeFilterConfiguration", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/versionHistory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } - }, - "/users/{user_id}/tokens": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Display listing of access tokens for the specified user.", - "description": "Display listing of access tokens for the specified user.", - "operationId": "getTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "List of tokens.", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } - } - } - }, - "post": { - "tags": [ - "Personal Tokens" - ], - "summary": "Create new token for a specific user", - "description": "Create a new personal access token for the user.", - "operationId": "createTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "201": { - "description": "New token instance", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" - } - } - } - } - } - } - }, - "/users/{user_id}/tokens/{token_id}": { - "get": { - "tags": [ - "Personal Tokens" - ], - "summary": "Get single token by ID", - "description": "Show a personal access token for the user", - "operationId": "getTokenById", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", - "in": "path", - "description": "ID of token to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the token", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserToken" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Personal Tokens" - ], - "summary": "Delete a token", - "description": "Delete the given token for a user", - "operationId": "deleteToken", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User ID", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "token_id", - "in": "path", - "description": "Token ID", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/processes/variables": { - "get": { - "tags": [ - "Processes Variables" - ], - "summary": "Get variables for multiple processes with pagination", - "operationId": "660c9459febd17c58400be4b4d49a152", - "parameters": [ - { - "name": "processIds", - "in": "query", - "description": "Comma-separated list of process IDs", - "required": false, - "schema": { - "type": "string", - "example": "1,2,3", - "nullable": true - } - }, - { - "name": "page", - "in": "query", - "description": "Page number", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "per_page", - "in": "query", - "description": "Items per page", - "required": false, - "schema": { - "type": "integer", - "default": 20 - } - } - ], - "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": [ - { - "url": "https://nolans-laptop.tail0babd.ts.net/api/1.1", - "description": "API v1.1 Server" - } - ] - } } }, "components": { "schemas": { "DateTime": { - "properties": { - "date": { - "type": "string" - } - }, - "type": "object" - }, - "analyticsReportingEditable": { - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "link": { - "type": "string" - } - }, - "type": "object" - }, - "analyticsReporting": { - "allOf": [ - { - "$ref": "#/components/schemas/analyticsReportingEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_by_id": { - "type": "string", - "format": "id" - }, - "updated_by_id": { - "type": "string", - "format": "id" - } - }, - "type": "object" - } - ] - }, - "collectionsEditable": { - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "custom_title": { - "type": "string" - }, - "create_screen_id": { - "type": "string", - "format": "id" - }, - "read_screen_id": { - "type": "string", - "format": "id" - }, - "update_screen_id": { - "type": "string", - "format": "id" - }, - "signal_create": { - "type": "boolean" - }, - "signal_update": { - "type": "boolean" - }, - "signal_delete": { - "type": "boolean" - } - }, - "type": "object" - }, - "collections": { - "allOf": [ - { - "$ref": "#/components/schemas/collectionsEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "created_by_id": { - "type": "string", - "format": "id" - }, - "updated_by_id": { - "type": "string", - "format": "id" - }, - "columns": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "type": "object" - } - ] - }, - "recordsEditable": { - "properties": { - "data": { - "type": "object" - } - }, - "type": "object" - }, - "records": { - "allOf": [ - { - "$ref": "#/components/schemas/recordsEditable" - }, - { - "properties": { - "id": { - "type": "integer" - }, - "collection_id": { - "type": "string", - "format": "id" - } - }, - "type": "object" - } - ] - }, - "DataSourceCallParameters": { - "properties": { - "endpoint": { - "type": "string" - }, - "dataMapping": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - } - }, - "outboundConfig": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "type": "object" - } - } - }, - "type": "object" - }, - "DataSourceResponse": { - "properties": { - "status": { - "type": "integer" - }, - "response": { - "type": "object" - } - }, - "type": "object" - }, - "dataSourceEditable": { - "properties": { - "id": { - "description": "Class DataSource", - "type": "string", - "format": "id" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "endpoints": { - "type": "string" - }, - "mappings": { - "type": "string" - }, - "authtype": { - "type": "string" - }, - "credentials": { - "type": "string" - }, - "status": { - "type": "string" - }, - "data_source_category_id": { - "type": "string" - } - }, - "type": "object" - }, - "dataSource": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/dataSourceEditable" - }, - { - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, - "dataSourceCategoryEditable": { - "properties": { - "name": { - "description": "Represents a business data Source category definition.", + "properties": { + "date": { "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] } }, "type": "object" }, - "DataSourceCategory": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/dataSourceCategoryEditable" - }, - { - "properties": { - "id": { - "type": "string", - "format": "id" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, "decisionTableEditable": { "properties": { "id": { @@ -8958,55 +8674,6 @@ } ] }, - "versionHistoryEditable": { - "properties": { - "versionable_id": { - "description": "Class VersionHistoryCollection", - "type": "integer" - }, - "versionable_type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "description": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] - } - }, - "type": "object" - }, - "versionHistory": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/versionHistoryEditable" - }, - { - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - }, - "type": "object" - } - ] - }, "updateUserGroups": { "properties": { "groups": { @@ -10649,61 +10316,235 @@ "user_id": { "type": "integer" }, - "occured_at": { + "occured_at": { + "type": "string" + } + }, + "type": "object" + }, + "settingsEditable": { + "properties": { + "key": { + "description": "Class Settings", + "type": "string" + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "name": { + "type": "string" + }, + "helper": { + "type": "string" + }, + "group": { + "type": "string" + }, + "format": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "readonly": { + "type": "boolean" + }, + "variables": { + "type": "string" + }, + "sansSerifFont": { + "type": "string" + } + }, + "type": "object" + }, + "settings": { + "allOf": [ + { + "$ref": "#/components/schemas/settingsEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "TokenClient": { + "properties": { + "id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "redirect": { + "type": "string" + }, + "personal_access_client": { + "type": "boolean" + }, + "password_client": { + "type": "boolean" + }, + "revoked": { + "type": "boolean" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + "usersEditable": { + "properties": { + "email": { + "description": "The attributes that are mass assignable.", + "type": "string", + "format": "email" + }, + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "address": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "postal": { + "type": "string" + }, + "country": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "fax": { + "type": "string" + }, + "cell": { + "type": "string" + }, + "title": { + "type": "string" + }, + "timezone": { + "type": "string" + }, + "datetime_format": { + "type": "string" + }, + "language": { + "type": "string" + }, + "is_administrator": { + "type": "boolean" + }, + "expires_at": { + "type": "string" + }, + "loggedin_at": { + "type": "string" + }, + "remember_token": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE", + "SCHEDULED", + "OUT_OF_OFFICE", + "BLOCKED" + ] + }, + "fullname": { "type": "string" - } - }, - "type": "object" - }, - "settingsEditable": { - "properties": { - "key": { - "description": "Class Settings", + }, + "avatar": { "type": "string" }, - "config": { + "media": { "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/media" } }, - "name": { - "type": "string" + "birthdate": { + "type": "string", + "format": "date" }, - "helper": { - "type": "string" + "delegation_user_id": { + "type": "string", + "format": "id" }, - "group": { - "type": "string" + "manager_id": { + "type": "string", + "format": "id" }, - "format": { - "type": "string" + "meta": { + "type": "object", + "additionalProperties": true }, - "hidden": { + "force_change_password": { "type": "boolean" }, - "readonly": { + "email_task_notification": { "type": "boolean" - }, - "variables": { - "type": "string" - }, - "sansSerifFont": { - "type": "string" } }, "type": "object" }, - "settings": { + "users": { "allOf": [ { - "$ref": "#/components/schemas/settingsEditable" + "$ref": "#/components/schemas/usersEditable" }, { "properties": { "id": { - "type": "string", - "format": "id" + "type": "integer" }, "created_at": { "type": "string", @@ -10712,38 +10553,39 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" } }, "type": "object" } ] }, - "TokenClient": { + "UserToken": { "properties": { "id": { - "type": "integer" + "type": "string" }, "user_id": { "type": "integer" }, - "name": { - "type": "string" - }, - "provider": { - "type": "string" + "client_id": { + "type": "integer" }, - "redirect": { + "name": { "type": "string" }, - "personal_access_client": { - "type": "boolean" - }, - "password_client": { - "type": "boolean" + "scopes": { + "type": "object" }, "revoked": { "type": "boolean" }, + "client": { + "$ref": "#/components/schemas/TokenClient" + }, "created_at": { "type": "string", "format": "date-time" @@ -10751,133 +10593,287 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" } }, "type": "object" }, - "usersEditable": { + "analyticsReportingEditable": { "properties": { - "email": { - "description": "The attributes that are mass assignable.", - "type": "string", - "format": "email" - }, - "firstname": { + "name": { "type": "string" }, - "lastname": { + "description": { "type": "string" }, - "username": { + "link": { "type": "string" + } + }, + "type": "object" + }, + "analyticsReporting": { + "allOf": [ + { + "$ref": "#/components/schemas/analyticsReportingEditable" }, - "password": { + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "collectionsEditable": { + "properties": { + "name": { "type": "string" }, - "address": { + "description": { "type": "string" }, - "city": { + "custom_title": { "type": "string" }, - "state": { - "type": "string" + "create_screen_id": { + "type": "string", + "format": "id" }, - "postal": { + "read_screen_id": { + "type": "string", + "format": "id" + }, + "update_screen_id": { + "type": "string", + "format": "id" + }, + "signal_create": { + "type": "boolean" + }, + "signal_update": { + "type": "boolean" + }, + "signal_delete": { + "type": "boolean" + } + }, + "type": "object" + }, + "collections": { + "allOf": [ + { + "$ref": "#/components/schemas/collectionsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + }, + "columns": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + ] + }, + "recordsEditable": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "records": { + "allOf": [ + { + "$ref": "#/components/schemas/recordsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "collection_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "DataSourceCallParameters": { + "properties": { + "endpoint": { "type": "string" }, - "country": { - "type": "string" + "dataMapping": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "outboundConfig": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "DataSourceResponse": { + "properties": { + "status": { + "type": "integer" }, - "phone": { - "type": "string" + "response": { + "type": "object" + } + }, + "type": "object" + }, + "dataSourceEditable": { + "properties": { + "id": { + "description": "Class DataSource", + "type": "string", + "format": "id" }, - "fax": { + "name": { "type": "string" }, - "cell": { + "description": { "type": "string" }, - "title": { + "endpoints": { "type": "string" }, - "timezone": { + "mappings": { "type": "string" }, - "datetime_format": { + "authtype": { "type": "string" }, - "language": { + "credentials": { "type": "string" }, - "is_administrator": { - "type": "boolean" - }, - "expires_at": { + "status": { "type": "string" }, - "loggedin_at": { + "data_source_category_id": { "type": "string" + } + }, + "type": "object" + }, + "dataSource": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceEditable" }, - "remember_token": { + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "dataSourceCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business data Source category definition.", "type": "string" }, "status": { "type": "string", "enum": [ "ACTIVE", - "INACTIVE", - "SCHEDULED", - "OUT_OF_OFFICE", - "BLOCKED" + "INACTIVE" ] - }, - "fullname": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "media": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "birthdate": { - "type": "string", - "format": "date" - }, - "delegation_user_id": { - "type": "string", - "format": "id" - }, - "manager_id": { - "type": "string", - "format": "id" - }, - "meta": { - "type": "object", - "additionalProperties": true - }, - "force_change_password": { - "type": "boolean" - }, - "email_task_notification": { - "type": "boolean" } }, "type": "object" }, - "users": { + "DataSourceCategory": { + "type": "object", "allOf": [ { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" }, { "properties": { "id": { - "type": "integer" + "type": "string", + "format": "id" }, "created_at": { "type": "string", @@ -10886,53 +10882,60 @@ "updated_at": { "type": "string", "format": "date-time" - }, - "deleted_at": { - "type": "string", - "format": "date-time" } }, "type": "object" } ] }, - "UserToken": { + "versionHistoryEditable": { "properties": { - "id": { - "type": "string" - }, - "user_id": { + "versionable_id": { + "description": "Class VersionHistoryCollection", "type": "integer" }, - "client_id": { - "type": "integer" + "versionable_type": { + "type": "string" }, "name": { "type": "string" }, - "scopes": { - "type": "object" - }, - "revoked": { - "type": "boolean" - }, - "client": { - "$ref": "#/components/schemas/TokenClient" - }, - "created_at": { - "type": "string", - "format": "date-time" + "subject": { + "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time" + "description": { + "type": "string" }, - "expires_at": { + "status": { "type": "string", - "format": "date-time" + "enum": [ + "ACTIVE", + "INACTIVE" + ] } }, "type": "object" + }, + "versionHistory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/versionHistoryEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] } }, "responses": { @@ -11049,6 +11052,14 @@ "type": "string", "default": "" } + }, + "pmql": { + "name": "pmql", + "in": "query", + "description": "PMQL query to filter results", + "schema": { + "type": "string" + } } }, "securitySchemes": { @@ -11057,9 +11068,9 @@ "description": "Laravel passport oauth2 security.", "flows": { "authorizationCode": { - "authorizationUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/authorize", - "tokenUrl": "https://nolans-laptop.tail0babd.ts.net/oauth/token", - "refreshUrl": "https://nolans-laptop.tail0babd.ts.net/token/refresh", + "authorizationUrl": "https://pm4.local:8092/oauth/authorize", + "tokenUrl": "https://pm4.local:8092/oauth/token", + "refreshUrl": "https://pm4.local:8092/token/refresh", "scopes": {} } } @@ -11072,30 +11083,6 @@ } }, "tags": [ - { - "name": "AnalyticsReporting", - "description": "AnalyticsReporting" - }, - { - "name": "Collections", - "description": "Collections" - }, - { - "name": "Screens", - "description": "Screens" - }, - { - "name": "Comments", - "description": "Comments" - }, - { - "name": "DataSourcesCategories", - "description": "DataSourcesCategories" - }, - { - "name": "DataSources", - "description": "DataSources" - }, { "name": "DecisionTableCategories", "description": "DecisionTableCategories" @@ -11124,10 +11111,6 @@ "name": "Groups", "description": "Groups" }, - { - "name": "Version History", - "description": "Version History" - }, { "name": "CssSettings", "description": "CssSettings" @@ -11172,6 +11155,10 @@ "name": "Screen Categories", "description": "Screen Categories" }, + { + "name": "Screens", + "description": "Screens" + }, { "name": "Script Categories", "description": "Script Categories" @@ -11211,6 +11198,30 @@ { "name": "Processes Variables", "description": "Processes Variables" + }, + { + "name": "AnalyticsReporting", + "description": "AnalyticsReporting" + }, + { + "name": "Collections", + "description": "Collections" + }, + { + "name": "Comments", + "description": "Comments" + }, + { + "name": "DataSourcesCategories", + "description": "DataSourcesCategories" + }, + { + "name": "DataSources", + "description": "DataSources" + }, + { + "name": "Version History", + "description": "Version History" } ], "security": [ From 0e05bc8311159b6144438d4fbfc4b2523cfcb9ff Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 22 Apr 2025 10:30:10 -0400 Subject: [PATCH 17/53] Add missing page and per_page parameters to documentation --- ProcessMaker/Http/Controllers/Api/OpenApiSpec.php | 6 ++++++ ProcessMaker/Http/Controllers/Api/TaskController.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index 2dd79a6baa..cd6aa847cf 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -44,6 +44,12 @@ * @OA\Schema(type="string", enum={"asc", "desc"}, default="asc"), * ), * @OA\Parameter( + * parameter="page", + * name="page", + * in="query", + * @OA\Schema(type="integer", default="1"), + * ), + * @OA\Parameter( * parameter="per_page", * name="per_page", * in="query", diff --git a/ProcessMaker/Http/Controllers/Api/TaskController.php b/ProcessMaker/Http/Controllers/Api/TaskController.php index 2d691af0ee..22453a6808 100644 --- a/ProcessMaker/Http/Controllers/Api/TaskController.php +++ b/ProcessMaker/Http/Controllers/Api/TaskController.php @@ -104,6 +104,8 @@ class TaskController extends Controller * @OA\Parameter(ref="#/components/parameters/order_by"), * @OA\Parameter(ref="#/components/parameters/order_direction"), * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter(ref="#/components/parameters/page"), + * @OA\Parameter(ref="#/components/parameters/per_page"), * * @OA\Response( * response=200, From d493942d21cad5654ca0343fe9063aff2e8e4593 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 25 Apr 2025 17:20:10 -0400 Subject: [PATCH 18/53] Enhance Api2TypescriptCommand for improved TypeScript SDK generation --- .../Commands/Api2TypescriptCommand.php | 257 +++++++++++++++++- .../Api/NotificationController.php | 1 + .../Api/TaskAssignmentController.php | 4 - ProcessMaker/Models/ProcessRequest.php | 2 +- .../stubs/api2typescript/api-spec.blade.php | 37 +++ resources/stubs/api2typescript/api.blade.php | 34 ++- .../stubs/api2typescript/composable.blade.php | 8 + .../stubs/api2typescript/types.blade.php | 6 +- 8 files changed, 317 insertions(+), 32 deletions(-) create mode 100644 resources/stubs/api2typescript/api-spec.blade.php diff --git a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php index 4d8593ed39..2646eeb6b1 100644 --- a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php +++ b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php @@ -2,8 +2,10 @@ namespace ProcessMaker\Console\Commands; +use Exception; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Arr; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Str; @@ -32,6 +34,8 @@ class Api2TypescriptCommand extends Command */ protected $files; + protected array $openapi; + /** * Create a new command instance. * @@ -63,6 +67,7 @@ public function handle() $this->error("Failed to parse OpenAPI JSON file."); return 1; } + $this->openapi = $openapi; // Create output directory if it doesn't exist if (!$this->files->exists($outputDirectory)) { @@ -283,11 +288,121 @@ protected function generateApiClassForTag($openapi, $tag, $outputDir) 'tagLower' => $tagLower, 'className' => $className, 'imports' => array_unique($imports), - 'methods' => $methods + 'methods' => $methods, + 'helper' => $this, ]; + // Generate the api.ts file $content = Blade::render($this->getStub('api'), $data); $this->files->put("$outputDir/$tagLower.api.ts", $content); + + // Generate the api.spec.ts file + $content = Blade::render($this->getStub('api-spec'), $data); + $this->files->put("$outputDir/$tagLower.api.spec.ts", $content); + } + + public function mockResponse(array $method) + { + return $method['responseExample']; + } + + public function mockParamsArray(array $method, bool $camelCase): array + { + $params = []; + // Add path parameters + foreach ($method['pathParams'] as $param) { + $key = Str::camel($param['name']); + $params[$key] = $this->mockValue($param); + } + // Add request body parameter for POST/PUT methods + if (!empty($method['requestBody'])) { + if (isset($method['requestBody']['content']['multipart/form-data']['schema'])) { + $params['$body'] = $this->mockFromSchema($method['requestBody']['content']['multipart/form-data']['schema']); + } elseif (isset($method['requestBody']['content']['application/json']['schema'])) { + $schema = $method['requestBody']['content']['application/json']['schema']; + $params['$body'] = $this->mockFromSchema($schema); + } else { + throw new Exception("Failed to mock request body for " . $method['operationId']); + } + } elseif ($method['httpMethod'] === 'post' || $method['httpMethod'] === 'put' || $method['httpMethod'] === 'patch') { + $params['$body'] = (object) []; + } + $queryParams = []; + foreach ($method['queryParams'] as $param) { + $key = $camelCase ? Str::camel($param['name']) : $param['name']; + if (isset($param['$ref'])) { + $queryParams[$key] = $this->mockValue($this->getSchemaByRef($param['$ref'])); + } else { + $queryParams[$key] = $this->mockValue($param); + } + } + if (!empty($queryParams)) { + $params['$queryParams'] = $queryParams; + } + return $params; + } + + public function mockParams(array $method) + { + $params = $this->mockParamsArray($method, true); + foreach ($params as $key => $value) { + $params[$key] = $this->json($value, 6); + } + return implode(', ', $params); + } + + private function getSchemaByRef(string $ref) + { + $refs = str_replace('/', '.', substr($ref, 2)); + return Arr::get($this->openapi, $refs, null); + } + + public function mockUrl(array $method) + { + $params = $this->mockParamsArray($method, false); + // replace ${param} with the value + $path = $method['apiPath']; + foreach ($params as $key => $value) { + if (is_array($value) || is_object($value)) { + continue; + } + $path = str_replace('${' . $key . '}', urlencode($value), $path); + } + // Add the query params to the path from $queryParams + if (isset($params['$queryParams'])) { + $first = true; + foreach ($params['$queryParams'] as $key => $value) { + if (is_array($value)) { + $value = implode(',', $value); + } + $path .= ($first ? '?' : '&') . urlencode($key) . '=' . urlencode($value); + $first = false; + } + } + $arguments = "'{$path}'"; + if (isset($params['$body'])) { + $arguments .= ", " . $this->json($params['$body'], 6); + } + return $arguments; + } + + public function json($value, int $leftMargin = 0) + { + if ($leftMargin > 0) { + $json = json_encode($value, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); + // change the indent to 2 spaces + $json = preg_replace_callback( + '/^(?: {4})+/m', + function($m) { + return str_repeat(' ', 2 * (strlen($m[0]) / 4)); + }, + $json + ); + // add the left margin + $json = str_replace("\n", "\n" . str_repeat(' ', $leftMargin), $json); + return $json; + } + return json_encode($value, JSON_UNESCAPED_SLASHES); } private function getResponseReference(string $operationId, array $responses) @@ -311,6 +426,105 @@ private function getResponseReference(string $operationId, array $responses) throw new \Exception("Failed to find response schema for $operationId"); } + private function getResponseExample(string $operationId, array $responses) + { + $responseSchema = $responses['200']['content']['application/json']['schema'] ?? + $responses['201']['content']['application/json']['schema'] ?? + $responses['202']['content']['application/json']['schema'] ?? null; + + if (empty($responseSchema)) { + return (object) []; + } + + return $this->mockFromSchema($responseSchema); + } + + private function mockFromSchema(array $responseSchema) + { + $response = []; + if (isset($responseSchema['properties'])) { + foreach ($responseSchema['properties'] as $key => $value) { + if (empty($value)) { + throw new Exception("Empty value for " . $key); + } + $response[$key] = $this->mockValue($value); + } + } elseif (isset($responseSchema['$ref'])) { + return $this->mockFromSchema($this->getSchemaByRef($responseSchema['$ref'])); + } + return (object) $response; + } + + private function mockValue(array $value) + { + if (!isset($value['type']) && isset($value['schema'])) { + $value = $value['schema']; + } + if (!isset($value['type']) && isset($value['allOf'])) { + return $this->mockValueFromObject($value); + } + if (!isset($value['type']) && isset($value['$ref'])) { + return $this->mockValueFromObject($value); + } + if (!isset($value['type'])) { + throw new \Exception("Failed to mock value for " . json_encode($value)); + } + switch ($value['type']) { + case 'string': + switch ($value['format'] ?? null) { + case 'id': + return '1'; + case 'date-time': + return '2025-04-23T00:00:00Z'; + default: + return 'foo'; + } + case 'integer': + case 'number': + return 1; + case 'boolean': + return true; + case 'array': + if (isset($value['items']['$ref'])) { + return [$this->mockValue($this->getSchemaByRef($value['items']['$ref']))]; + $ref = explode('/', $value['items']['$ref']); + $ref = end($ref); + return [$this->mockValue($this->openapi['components']['schemas'][$ref])]; + } + return [1, 2, 3]; + case 'object': + return $this->mockValueFromObject($value); + default: + return $value; + } + } + + private function mockValueFromObject(array $value) + { + $withProperties = $this->findItemWithKeyInArray($value['allOf'] ?? [], 'properties'); + $withRef = $this->findItemWithKeyInArray($value['allOf'] ?? [], '$ref'); + if (isset($value['allOf']) && $withProperties) { + return $this->mockFromSchema($withProperties); + } elseif (isset($value['allOf']) && $withRef) { + $ref = explode('/', $withRef['$ref']); + $ref = end($ref); + return $this->mockValue($this->openapi['components']['schemas'][$ref]); + } elseif (isset($value['properties'])) { + return $this->mockFromSchema($value); + } + return (object) ['foo' => $value]; + } + + private function findItemWithKeyInArray(array $array, string $key) + { + foreach ($array as $item) { + if (isset($item[$key])) { + return $item; + } + } + return null; + } + private function findResponseSchema(string $operationId, array $responseSchema, array $imports) { $responseProperties = $responseSchema['properties'] ?? null; @@ -373,11 +587,10 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) } // Add request body parameter for POST/PUT methods - if (($httpMethod === 'post' || $httpMethod === 'put')/* && $requestBody*/) { + if (($httpMethod === 'post' || $httpMethod === 'put' || $httpMethod === 'patch')) { if (isset($requestBody['content']['application/json']['schema']['$ref'])) { $schemaRef = $requestBody['content']['application/json']['schema']['$ref']; $schemaName = $this->getSchemaNameFromRef($schemaRef); - // $this->generateInterface($schemaName, $requestBody['content']['application/json']['schema']); $imports[] = $schemaName; $paramList[] = "data: " . $schemaName; } else { @@ -417,6 +630,7 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) }*/ $returnType = $this->getResponseReference($operationId, $responses); + $responseExample = $this->getResponseExample($operationId, $responses); // Build path with parameters @@ -431,9 +645,11 @@ protected function generateMethod($httpMethod, $path, $details, &$imports) 'httpMethod' => $httpMethod, 'paramList' => $paramList, 'returnType' => $returnType, + 'responseExample' => $responseExample, 'apiPath' => $apiPath, 'queryParams' => $queryParams, - 'pathParams' => $pathParams + 'pathParams' => $pathParams, + 'requestBody' => $requestBody, ]; } @@ -579,7 +795,8 @@ protected function generateQueryParamInterface($parameters, $tagLower, $operatio $interface = "export interface " . $interfaceName . " {\n"; foreach ($queryParams as $param) { - $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($param['schema']['type'] ?? 'string') . ";\n"; + $refType = $this->getTypeOf($param); + $interface .= " " . $this->camelCase($param['name']) . "?: " . $this->mapSwaggerTypeToTypescript($refType) . ";\n"; } $interface .= "}"; @@ -587,6 +804,18 @@ protected function generateQueryParamInterface($parameters, $tagLower, $operatio return $interface; } + private function getTypeOf(array $definition) + { + if (isset($definition['schema']['type'])) { + return $definition['schema']['type']; + } + if (isset($definition['$ref'])) { + return $this->getTypeOf($this->getSchemaByRef($definition['$ref'])); + } + + throw new Exception("Failed to get type of " . json_encode($definition)); + } + private function generateResponseType($operationId, $responseSchema, $outputDir) { $interfaceName = ucfirst($this->camelCase($operationId)) . "Response"; @@ -616,13 +845,25 @@ protected function formatInterfaceName($name) /** * Convert swagger type to TypeScript type */ - protected function getTypescriptType($property) + public function getTypescriptType($property) { + if ($property === 'true' || $property === true) { + return 'any'; + } if (isset($property['$ref'])) { + $schema = $this->getSchemaByRef($property['$ref']); + if (isset($schema['schema'])) { + return $this->getTypescriptType($schema['schema']); + } return $this->getSchemaNameFromRef($property['$ref']); } - - $type = $property['type'] ?? 'string'; + if (!isset($property['type']) && isset($property['schema']['type'])) { + return $this->getTypescriptType($property['schema']); + } + if (!isset($property['type'])) { + throw new Exception("Failed to get type of " . json_encode($property)); + } + $type = $property['type']; switch ($type) { case 'integer': diff --git a/ProcessMaker/Http/Controllers/Api/NotificationController.php b/ProcessMaker/Http/Controllers/Api/NotificationController.php index c94d72c1e3..16374aedb9 100644 --- a/ProcessMaker/Http/Controllers/Api/NotificationController.php +++ b/ProcessMaker/Http/Controllers/Api/NotificationController.php @@ -64,6 +64,7 @@ class NotificationController extends Controller * ), * @OA\Property( * property="meta", + * type="object", * @OA\Schema(ref="#/components/schemas/metadata"), * ), * ), diff --git a/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php b/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php index 05568ee8c5..7d35cf5c5e 100644 --- a/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php +++ b/ProcessMaker/Http/Controllers/Api/TaskAssignmentController.php @@ -176,10 +176,6 @@ public function update(ProcessTaskAssignment $task_assignment, Request $request) * type="integer", * ) * ), - * @OA\RequestBody( - * required=true, - * @OA\JsonContent(ref="#/components/schemas/taskAssignmentsEditable") - * ), * @OA\Response( * response=200, * description="success", diff --git a/ProcessMaker/Models/ProcessRequest.php b/ProcessMaker/Models/ProcessRequest.php index aee92ce58b..ad10c5e0a2 100644 --- a/ProcessMaker/Models/ProcessRequest.php +++ b/ProcessMaker/Models/ProcessRequest.php @@ -88,7 +88,7 @@ * @OA\Property(property="process_category_id", type="string", format="id"), * @OA\Property(property="created_at", type="string", format="date-time"), * @OA\Property(property="updated_at", type="string", format="date-time"), - * @OA\Property(property="user", @OA\Schema(ref="#/components/schemas/users")), + * @OA\Property(property="user", type="object", @OA\Schema(ref="#/components/schemas/users")), * @OA\Property(property="participants", type="array", @OA\Items(ref="#/components/schemas/users")), * ) * }, diff --git a/resources/stubs/api2typescript/api-spec.blade.php b/resources/stubs/api2typescript/api-spec.blade.php new file mode 100644 index 0000000000..fcbd47fc20 --- /dev/null +++ b/resources/stubs/api2typescript/api-spec.blade.php @@ -0,0 +1,37 @@ +import { {{ $className }} } from './{{ $tagLower }}.api'; + +describe('{{ $className }}', () => { + // Mock API client + const mockApiClient = { + head: vi.fn(), + get: vi.fn(), + post: vi.fn(), + put: vi.fn(), + delete: vi.fn(), + patch: vi.fn(), + }; + + // Create instance + let api: {{ $className }}; + + beforeEach(() => { + api = new {{ $className }}(mockApiClient); + vi.resetAllMocks(); + }); + +@foreach ($methods as $method) + + describe('{{ $method['methodName'] }}', () => { + it('{{ $method['summary'] }}', async () => { + const mockResponse = {!! $helper->json($helper->mockResponse($method), 6) !!}; + mockApiClient.{{ $method['httpMethod'] }}.mockResolvedValue(mockResponse); + + const result = await api.{{ $method['methodName'] }}({!! $helper->mockParams($method) !!}); + + expect(mockApiClient.{{ $method['httpMethod'] }}).toHaveBeenCalledWith({!! $helper->mockUrl($method) !!}); + expect(result).toEqual(mockResponse); + }); + }); + +@endforeach +}); diff --git a/resources/stubs/api2typescript/api.blade.php b/resources/stubs/api2typescript/api.blade.php index 7d2940303d..014354d940 100644 --- a/resources/stubs/api2typescript/api.blade.php +++ b/resources/stubs/api2typescript/api.blade.php @@ -8,10 +8,12 @@ export class {{ $className }} { constructor(private apiClient: { + head: (endpoint: string) => Promise; get: (endpoint: string) => Promise; post: (endpoint: string, data: Record) => Promise; put: (endpoint: string, data: Record) => Promise; delete: (endpoint: string) => Promise; + patch: (endpoint: string, data: Record) => Promise; }) {} @foreach ($methods as $method) @@ -26,10 +28,20 @@ @foreach ($method['queryParams'] as $param) @php $paramName = Illuminate\Support\Str::camel($param['name']); -$paramType = $param['schema']['type'] ?? 'string'; -$paramValue = ($paramType === 'integer' || $paramType === 'number') ? "params.{$paramName}.toString()" : "params.{$paramName}"; +$paramType = $helper->getTypescriptType($param); +if ($paramType === 'boolean') { + $paramValue = "params.{$paramName} ? '1' : '0'"; +} elseif ($paramType === 'integer' || $paramType === 'number') { + $paramValue = "String(params.{$paramName})"; +} elseif ($paramType === 'array' || $paramType === 'string[]') { + $paramValue = "params.{$paramName}.join(',')"; +} elseif ($paramType === 'string') { + $paramValue = "params.{$paramName}"; +} else { + $paramValue = "JSON.stringify(params.{$paramName})"; +} @endphp - if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {{ $paramValue }}); + if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {!! $paramValue !!}); // {{ $paramType }} @endforeach } @@ -38,21 +50,15 @@ @if ($method['httpMethod'] === 'get' || $method['httpMethod'] === 'head') @if (!empty($method['queryParams'])) - return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); + return this.apiClient.{{ $method['httpMethod'] }}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`); @else - return this.apiClient.get<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); + return this.apiClient.{{ $method['httpMethod'] }}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); @endif -@elseif ($method['httpMethod'] === 'post') +@elseif ($method['httpMethod'] === 'post' ||$method['httpMethod'] === 'put' || $method['httpMethod'] === 'patch') @if (!empty($method['queryParams'])) - return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); + return this.apiClient.{{$method['httpMethod']}}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); @else - return this.apiClient.post<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); -@endif -@elseif ($method['httpMethod'] === 'put') -@if (!empty($method['queryParams'])) - return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}${queryString}`, data as unknown as Record); -@else - return this.apiClient.put<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); + return this.apiClient.{{$method['httpMethod']}}<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`, data as unknown as Record); @endif @elseif ($method['httpMethod'] === 'delete') return this.apiClient.delete<{!! $method['returnType'] ?: 'void' !!}>(`{{ $method['apiPath'] }}`); diff --git a/resources/stubs/api2typescript/composable.blade.php b/resources/stubs/api2typescript/composable.blade.php index 2771ec5b04..90d435db3f 100644 --- a/resources/stubs/api2typescript/composable.blade.php +++ b/resources/stubs/api2typescript/composable.blade.php @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { {{ $className }} } from '../api/{{ $tagLower }}.api'; /** @@ -6,10 +7,17 @@ * @returns {{ $className }} instance */ export const {{ $hookName }} = (apiClient: { + head: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars get: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars post: (endpoint: string, data: Record) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars put: (endpoint: string, data: Record) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars delete: (endpoint: string) => Promise; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + patch: (endpoint: string, data: Record) => Promise; }) => { return new {{ $className }}(apiClient); }; \ No newline at end of file diff --git a/resources/stubs/api2typescript/types.blade.php b/resources/stubs/api2typescript/types.blade.php index 33ab9b96fa..fc7c32125c 100644 --- a/resources/stubs/api2typescript/types.blade.php +++ b/resources/stubs/api2typescript/types.blade.php @@ -1,13 +1,9 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ @foreach ($interfaces as $interface) {!! $interface !!} @endforeach -/*export interface PaginatedResponse { - data: T[]; - meta: Metadata; -}*/ - @foreach ($queryParamInterfaces as $interface) {!! $interface !!} From 7a61f632d933c69cab3c5724d1b565ca5d62d503 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 30 Apr 2025 12:54:47 -0400 Subject: [PATCH 19/53] Add missing pmql parameter --- ProcessMaker/Http/Controllers/Api/TaskController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ProcessMaker/Http/Controllers/Api/TaskController.php b/ProcessMaker/Http/Controllers/Api/TaskController.php index 22453a6808..789c16b30f 100644 --- a/ProcessMaker/Http/Controllers/Api/TaskController.php +++ b/ProcessMaker/Http/Controllers/Api/TaskController.php @@ -101,6 +101,7 @@ class TaskController extends Controller * ) * ), * @OA\Parameter(ref="#/components/parameters/filter"), + * @OA\Parameter(ref="#/components/parameters/pmql"), * @OA\Parameter(ref="#/components/parameters/order_by"), * @OA\Parameter(ref="#/components/parameters/order_direction"), * @OA\Parameter(ref="#/components/parameters/include"), From db7915101b8531a3132d0ce309dd58b60dd8aae4 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 1 May 2025 14:10:21 -0700 Subject: [PATCH 20/53] Update cors.php --- config/cors.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cors.php b/config/cors.php index b327f18f78..6d0570dac6 100644 --- a/config/cors.php +++ b/config/cors.php @@ -22,6 +22,7 @@ 'allowed_origins' => [ 'http://localhost:4200', 'https://legendary-adventure-2n21ppv.pages.github.io', + 'https://processmaker.github.io', ], 'allowed_origins_patterns' => [], From 8b2c2a7a6d9b5f071b67c0b3fccefd68ff5565d0 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 May 2025 11:19:07 -0400 Subject: [PATCH 21/53] Check if the screen is external url --- .../Http/Controllers/Process/ScreenBuilderController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Process/ScreenBuilderController.php b/ProcessMaker/Http/Controllers/Process/ScreenBuilderController.php index c356f4c27b..d5bc676b4d 100644 --- a/ProcessMaker/Http/Controllers/Process/ScreenBuilderController.php +++ b/ProcessMaker/Http/Controllers/Process/ScreenBuilderController.php @@ -22,6 +22,11 @@ class ScreenBuilderController extends Controller */ public function edit(ScreenBuilderManager $manager, Screen $screen, $processId = null) { + // Check if the screen is external url + if ($screen->config[0]['url'] ?? null) { + return redirect($screen->config[0]['url']); + } + /** * Emit the ModelerStarting event, passing in our ModelerManager instance. This will * allow packages to add additional javascript for modeler initialization which From 26839b0d736e47d4c471cdafff267822012efe65 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 May 2025 11:19:37 -0400 Subject: [PATCH 22/53] Add api/broadcasting endpoints --- ProcessMaker/Providers/BroadcastServiceProvider.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ProcessMaker/Providers/BroadcastServiceProvider.php b/ProcessMaker/Providers/BroadcastServiceProvider.php index 233252f282..2bf84a0200 100644 --- a/ProcessMaker/Providers/BroadcastServiceProvider.php +++ b/ProcessMaker/Providers/BroadcastServiceProvider.php @@ -15,6 +15,11 @@ class BroadcastServiceProvider extends ServiceProvider public function boot() { Broadcast::routes(['middleware'=>['web', 'auth:anon']]); + Broadcast::routes([ + 'middleware' => ['auth:api'], + 'prefix' => 'api', + ]); + require base_path('routes/channels.php'); } } From e74350b26ffcd923b8aab5f67d3e26a9ff6a8d5c Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 May 2025 14:11:08 -0400 Subject: [PATCH 23/53] Added support for PRAGMA_FILTERS in mustache --- ProcessMaker/Bpmn/MustacheOptions.php | 36 ++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/ProcessMaker/Bpmn/MustacheOptions.php b/ProcessMaker/Bpmn/MustacheOptions.php index 846ba30195..4a1b164620 100644 --- a/ProcessMaker/Bpmn/MustacheOptions.php +++ b/ProcessMaker/Bpmn/MustacheOptions.php @@ -21,33 +21,57 @@ public function __construct() ]; } - public function html64($text, Mustache_LambdaHelper $helper) + public function html64($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return base64_encode('' . $text . ''); + } return base64_encode('' . $helper->render($text) . ''); } - public function base64($text, Mustache_LambdaHelper $helper) + public function base64($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return base64_encode($text); + } return base64_encode($helper->render($text)); } - public function key($text, Mustache_LambdaHelper $helper) + public function key($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return urlencode(Hash::make($text)); + } return urlencode(Hash::make($helper->render($text))); } - public function json($text, Mustache_LambdaHelper $helper) + public function json($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return json_encode($text); + } return json_encode($helper->render($text)); } - public function serialize($text, Mustache_LambdaHelper $helper) + public function serialize($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return serialize($text); + } return serialize($helper->render($text)); } - public function xml($text, Mustache_LambdaHelper $helper) + public function xml($text, ?Mustache_LambdaHelper $helper = null) { + if (!$helper) { + // Support for PRAGMA_FILTERS + return xmlrpc_encode($text); + } return xmlrpc_encode($helper->render($text)); } } From ee99f6b2cc67ac1cd728ec737be766fffa1ae619 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 May 2025 15:32:00 -0400 Subject: [PATCH 24/53] Disable SSL verification in local development environment for data connecto requests --- ProcessMaker/Traits/MakeHttpRequests.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ProcessMaker/Traits/MakeHttpRequests.php b/ProcessMaker/Traits/MakeHttpRequests.php index 26da4cecd3..e5041c9184 100644 --- a/ProcessMaker/Traits/MakeHttpRequests.php +++ b/ProcessMaker/Traits/MakeHttpRequests.php @@ -436,7 +436,8 @@ private function call($method, $url, array $headers, $body, $bodyType) { $client = $this->client ?? app()->make(Client::class, [ 'config' => [ - 'verify' => $this->verifySsl, + // Disable SSL verification in local development environment + 'verify' => $this->verifySsl && (config('app.env') !== 'local'), 'timeout' => $this->timeout, ], ]); From 7437e191265422146fbc892232bea9f1aa81d260 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 5 May 2025 15:43:46 -0400 Subject: [PATCH 25/53] Update OpenApiSpec.php to define schema type fields to object --- ProcessMaker/Http/Controllers/Api/OpenApiSpec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php index a1ddf5f480..17b48e71b1 100644 --- a/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php +++ b/ProcessMaker/Http/Controllers/Api/OpenApiSpec.php @@ -67,7 +67,7 @@ * name="fields", * in="query", * description="Fields to map the response object.", - * @OA\Schema(type="string"), + * @OA\Schema(type="object"), * ), * @OA\Parameter( * parameter="member_id", From 72e02ea87cbed87cbf3787a86ee7433f730fc141 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 5 May 2025 15:44:24 -0400 Subject: [PATCH 26/53] Clean sdk generation code --- .../Commands/Api2TypescriptCommand.php | 33 +++++++++++-------- .../api2typescript/api-response.blade.php | 2 +- resources/stubs/api2typescript/api.blade.php | 4 +-- .../stubs/api2typescript/composable.blade.php | 4 +-- .../composables-index.blade.php | 2 +- .../stubs/api2typescript/main-index.blade.php | 1 + .../stubs/api2typescript/readme.blade.php | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php index 2646eeb6b1..9a46e98138 100644 --- a/ProcessMaker/Console/Commands/Api2TypescriptCommand.php +++ b/ProcessMaker/Console/Commands/Api2TypescriptCommand.php @@ -17,7 +17,7 @@ class Api2TypescriptCommand extends Command * * @var string */ - protected $signature = 'make:api-typescript + protected $signature = 'pm-apps:api {output : Output directory for TypeScript files}'; /** @@ -55,7 +55,6 @@ public function __construct(Filesystem $files) */ public function handle() { - $openapiFile = url('/docs?api-docs.json'); //$this->argument('input'); $outputDirectory = $this->argument('output'); // update the api-docs.json file @@ -102,6 +101,8 @@ public function handle() } } $tags = array_keys($tags); + // sort tags alphabetically ascending + sort($tags, SORT_FLAG_CASE | SORT_STRING); $this->generateTypesForTag($openapi, 'types', $typesDir); // Process each tag as a separate API client @@ -168,11 +169,6 @@ protected function generateTypesForTag($openapi, $tag, $outputDir) // Process paths to find related schemas and generate query param interfaces foreach ($openapi['paths'] as $path => $methods) { foreach ($methods as $method => $details) { - // Skip if not related to current tag - // if (!isset($details['tags']) || !in_array($tag, $details['tags'])) { - // continue; - // } - // Generate query param interfaces for GET methods if (isset($details['parameters'])) { $queryParamInterface = $this->generateQueryParamInterface($details['parameters'], $tagLower, $details['operationId']); @@ -234,12 +230,7 @@ protected function generateApiClassForTag($openapi, $tag, $outputDir) $className = "ProcessMaker" . ucfirst($tagLower) . "Api"; // Import interfaces - $imports = [ - // ucfirst($tagLower), - // fix the editable name - // "Editable" . ucfirst($tagLower), - // "PaginatedResponse" - ]; + $imports = []; // Add query param interfaces to imports foreach ($openapi['paths'] as $path => $methods) { @@ -284,10 +275,17 @@ protected function generateApiClassForTag($openapi, $tag, $outputDir) } } + $imports = array_unique($imports); + // sort imports alphabetically ascending + sort($imports, SORT_FLAG_CASE | SORT_STRING); + // sort methods alphabetically ascending by methodName + usort($methods, function($a, $b) { + return strcasecmp($a['methodName'], $b['methodName']); + }); $data = [ 'tagLower' => $tagLower, 'className' => $className, - 'imports' => array_unique($imports), + 'imports' => $imports, 'methods' => $methods, 'helper' => $this, ]; @@ -375,6 +373,9 @@ public function mockUrl(array $method) if (is_array($value)) { $value = implode(',', $value); } + if (is_object($value)) { + $value = json_encode($value); + } $path .= ($first ? '?' : '&') . urlencode($key) . '=' . urlencode($value); $first = false; } @@ -708,6 +709,10 @@ protected function generateIndexFiles($tags, $apiDir, $composablesDir, $typesDir 'tagLower' => $tagLower ]; } + // sort apiClasses alphabetically ascending by className + usort($apiClasses, function($a, $b) { + return strcasecmp($a['className'], $b['className']); + }); $data = ['apiClasses' => $apiClasses]; $content = Blade::render($this->getStub('api-index'), $data); diff --git a/resources/stubs/api2typescript/api-response.blade.php b/resources/stubs/api2typescript/api-response.blade.php index 31951ad37c..94f8936f7f 100644 --- a/resources/stubs/api2typescript/api-response.blade.php +++ b/resources/stubs/api2typescript/api-response.blade.php @@ -4,4 +4,4 @@ statusText?: string; error?: string; message?: string; -} \ No newline at end of file +} diff --git a/resources/stubs/api2typescript/api.blade.php b/resources/stubs/api2typescript/api.blade.php index 014354d940..ec4972cd80 100644 --- a/resources/stubs/api2typescript/api.blade.php +++ b/resources/stubs/api2typescript/api.blade.php @@ -41,7 +41,7 @@ $paramValue = "JSON.stringify(params.{$paramName})"; } @endphp - if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {!! $paramValue !!}); // {{ $paramType }} + if (params.{{ $paramName }}) queryParams.append('{{ $param['name'] }}', {!! $paramValue !!}); // {!! $paramType !!} @endforeach } @@ -66,4 +66,4 @@ } @endforeach -} \ No newline at end of file +} diff --git a/resources/stubs/api2typescript/composable.blade.php b/resources/stubs/api2typescript/composable.blade.php index 90d435db3f..eb2d32ce01 100644 --- a/resources/stubs/api2typescript/composable.blade.php +++ b/resources/stubs/api2typescript/composable.blade.php @@ -7,7 +7,7 @@ * @returns {{ $className }} instance */ export const {{ $hookName }} = (apiClient: { - head: (endpoint: string) => Promise; + head: (endpoint: string) => Promise; // eslint-disable-next-line @typescript-eslint/no-unused-vars get: (endpoint: string) => Promise; // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -20,4 +20,4 @@ patch: (endpoint: string, data: Record) => Promise; }) => { return new {{ $className }}(apiClient); -}; \ No newline at end of file +}; diff --git a/resources/stubs/api2typescript/composables-index.blade.php b/resources/stubs/api2typescript/composables-index.blade.php index f0297a04c5..65423275ed 100644 --- a/resources/stubs/api2typescript/composables-index.blade.php +++ b/resources/stubs/api2typescript/composables-index.blade.php @@ -6,4 +6,4 @@ @foreach ($hooks as $hook) {{ $hook }}, @endforeach -}; \ No newline at end of file +}; diff --git a/resources/stubs/api2typescript/main-index.blade.php b/resources/stubs/api2typescript/main-index.blade.php index 43a1b8be5e..2373abba59 100644 --- a/resources/stubs/api2typescript/main-index.blade.php +++ b/resources/stubs/api2typescript/main-index.blade.php @@ -2,3 +2,4 @@ export * from './lib/processmaker-sdk' export * from './composables'; export * from './engine'; +export * from './types'; diff --git a/resources/stubs/api2typescript/readme.blade.php b/resources/stubs/api2typescript/readme.blade.php index 32e8b7a46b..dfd538da67 100644 --- a/resources/stubs/api2typescript/readme.blade.php +++ b/resources/stubs/api2typescript/readme.blade.php @@ -42,4 +42,4 @@ @foreach ($tags as $tag) - **{{ ucfirst(strtolower($tag)) }} API**: Complete implementation of the ProcessMaker {{ ucfirst(strtolower($tag)) }} API -@endforeach \ No newline at end of file +@endforeach From 282a790625aa7fa315c0c8a542f974eedb650edc Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 6 May 2025 17:24:30 -0400 Subject: [PATCH 27/53] Add package-private-equity --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index e45b04b2b1..98616c7487 100644 --- a/composer.json +++ b/composer.json @@ -179,6 +179,7 @@ "package-webentry": "2.29.0", "package-api-testing": "1.3.0", "package-variable-finder": "1.0.3", + "package-private-equity": "dev-main", "packages": "^0" }, "docker-executors": { From ed1972b1e58d804cbc3801ca7863506656b2b3e1 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 7 May 2025 08:22:59 -0400 Subject: [PATCH 28/53] Add MessageEventThrown event --- ProcessMaker/Events/MessageEventThrown.php | 72 ++++++++++++++++++++++ ProcessMaker/Facades/WorkflowManager.php | 1 + ProcessMaker/Listeners/BpmnSubscriber.php | 56 ++++++++++++++++- routes/api.php | 7 ++- 4 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 ProcessMaker/Events/MessageEventThrown.php diff --git a/ProcessMaker/Events/MessageEventThrown.php b/ProcessMaker/Events/MessageEventThrown.php new file mode 100644 index 0000000000..894ad06b8a --- /dev/null +++ b/ProcessMaker/Events/MessageEventThrown.php @@ -0,0 +1,72 @@ + + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('ProcessMaker.Models.ProcessRequest.' . $this->processRequest->getKey()), + ]; + } + + /** + * Set the event name + * + * @return string + */ + public function broadcastAs() + { + return 'MessageEventThrown'; + } + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + 'event' => [ + 'id' => $this->message->getId(), + 'name' => $this->message->getName(), + ], + 'element' => [ + 'id' => $this->node->getId(), + 'name' => $this->node->getName(), + ], + 'data' => (object) $this->message->getData($this->processRequest), + ]; + } +} diff --git a/ProcessMaker/Facades/WorkflowManager.php b/ProcessMaker/Facades/WorkflowManager.php index 8ae67c78d0..aad7178a19 100644 --- a/ProcessMaker/Facades/WorkflowManager.php +++ b/ProcessMaker/Facades/WorkflowManager.php @@ -25,6 +25,7 @@ * @method static bool registerServiceImplementation($implementation, $class) * @method static bool existsServiceImplementation($implementation) * @method static bool runServiceImplementation($implementation, array $data, array $config, $tokenId = '') + * @method static void triggerBoundaryEvent(\ProcessMaker\Models\Process $process, \ProcessMaker\Models\ProcessRequest $request, \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token, \ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface $boundaryEvent) */ class WorkflowManager extends Facade { diff --git a/ProcessMaker/Listeners/BpmnSubscriber.php b/ProcessMaker/Listeners/BpmnSubscriber.php index c7f0f7f810..176086f2bc 100644 --- a/ProcessMaker/Listeners/BpmnSubscriber.php +++ b/ProcessMaker/Listeners/BpmnSubscriber.php @@ -3,16 +3,19 @@ namespace ProcessMaker\Listeners; use Exception; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Notification; use ProcessMaker\Events\ActivityAssigned; use ProcessMaker\Events\ActivityCompleted; +use ProcessMaker\Events\MessageEventThrown; use ProcessMaker\Events\ProcessCompleted; use ProcessMaker\Facades\Metrics; use ProcessMaker\Facades\WorkflowManager; use ProcessMaker\Jobs\TerminateRequestEndEvent; use ProcessMaker\Models\Comment; use ProcessMaker\Models\FormalExpression; +use ProcessMaker\Models\Message; use ProcessMaker\Models\ProcessRequest; use ProcessMaker\Models\ProcessRequestToken; use ProcessMaker\Nayra\Bpmn\Events\ActivityActivatedEvent; @@ -22,6 +25,7 @@ use ProcessMaker\Nayra\Bpmn\Events\ProcessInstanceCreatedEvent; use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ConditionalEventDefinitionInterface; +use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface; use ProcessMaker\Nayra\Contracts\Bpmn\IntermediateCatchEventInterface; use ProcessMaker\Nayra\Contracts\Bpmn\MessageEventDefinitionInterface; @@ -29,6 +33,7 @@ use ProcessMaker\Nayra\Contracts\Bpmn\ScriptTaskInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface; use ProcessMaker\Nayra\Contracts\Bpmn\TerminateEventDefinitionInterface; +use ProcessMaker\Nayra\Contracts\Bpmn\ThrowEventInterface; use ProcessMaker\Nayra\Contracts\Bpmn\TimerEventDefinitionInterface; use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface; use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface; @@ -279,7 +284,8 @@ public function updateDataWithFlowTransition($transition, $flow, $instance) // Exit if no variable or expression is set $config = json_decode($flow->getProperties()['config'], true); - if (empty($config['update_data']) + if ( + empty($config['update_data']) || empty($config['update_data']['variable']) || empty($config['update_data']['expression']) ) { @@ -316,6 +322,22 @@ public function onTerminateEndEvent($event) }); } + public function onMessageEventDefinition(ThrowEventInterface $node, TokenInterface $token, Message $message) + { + event(new MessageEventThrown($token->getInstance(), $node, $message)); + devtools( + '▶︎ MessageEventThrown', + $message->getName() ?? '(null)', + $message->getId() ?? '(null)', + [ + 'Payload' => json_encode( + (object) $message->getData($token->getInstance()), + JSON_PRETTY_PRINT + ) + ] + ); + } + /** * Subscription. * @@ -340,5 +362,37 @@ public function subscribe($events) $events->listen(IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_ARRIVES, static::class . '@onIntermediateCatchEventActivated'); $events->listen(TerminateEventDefinitionInterface::EVENT_THROW_EVENT_DEFINITION, static::class . '@onTerminateEndEvent'); + $events->listen(MessageEventDefinitionInterface::EVENT_THROW_EVENT_DEFINITION, static::class . '@onMessageEventDefinition'); + + // Log devtools events for local and testing environments + if (App::environment('local') || App::environment('testing')) { + $events->listen('*', function ($event, $args) { + $hasBackslash = strpos($event, '\\') !== false; + if (!$hasBackslash && count($args) > 0) { + $payload = $args[0]; + if ( + $payload instanceof ActivityCompletedEvent + || $payload instanceof ActivityActivatedEvent + || $payload instanceof ActivityClosedEvent + ) { + $payload = $payload->activity; + } + + if ($payload instanceof EntityInterface) { + $element = $payload->getBpmnElement(); + $document = $payload->getOwnerDocument(); + $xml = $element ? $document->saveXML($element) : ''; + devtools( + $event, + $payload->getName() ?? '(null)', + $payload->getId() ?? '(null)', + [ + 'Node' => $xml, + ] + ); + } + } + }); + } } } diff --git a/routes/api.php b/routes/api.php index 35d4c6ceb0..19e84ccde0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -242,7 +242,12 @@ Route::put('requests/{request}/retry', [ProcessRequestController::class, 'retry'])->name('requests.retry')->middleware('can:update,request'); Route::delete('requests/{request}', [ProcessRequestController::class, 'destroy'])->name('requests.destroy')->middleware('can:destroy,request'); Route::get('requests/{request}/tokens', [ProcessRequestController::class, 'getRequestToken'])->name('requests.getRequestToken')->middleware('can:view,request'); - Route::post('requests/{request}/events/{event}', [ProcessRequestController::class, 'activateIntermediateEvent'])->name('requests.update,request'); + Route::post('requests/{request}/events/{event}', [ProcessRequestController::class, 'activateIntermediateEvent']) + ->name('requests.update,request') + ->where('event', '[a-zA-Z0-9_\-\.]+'); + Route::post('requests/{request}/boundary/{boundary_event}', [ProcessRequestController::class, 'triggerBoundaryEvent']) + ->name('requests.triggerBoundaryEvent') + ->where('boundary_event', '[a-zA-Z0-9_\-\.]+'); Route::get('requests/{request}/details-screen-request', [ProcessRequestController::class, 'screenRequested'])->name('requests.detail.screen')->middleware('can:view,request'); Route::get('requests/{request}/end-event-destination', [ProcessRequestController::class, 'endEventDestination'])->name('requests.end_event_destination')->middleware('can:view,request'); From 7ec207f3df8a8d2e1c1fa242e07ed197d5fdf75e Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 7 May 2025 08:23:38 -0400 Subject: [PATCH 29/53] Add triggerBoundaryEvent method --- .../Api/ProcessRequestController.php | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Api/ProcessRequestController.php b/ProcessMaker/Http/Controllers/Api/ProcessRequestController.php index a183a22f9e..cc59e829fe 100644 --- a/ProcessMaker/Http/Controllers/Api/ProcessRequestController.php +++ b/ProcessMaker/Http/Controllers/Api/ProcessRequestController.php @@ -547,6 +547,65 @@ public function activateIntermediateEvent(ProcessRequest $request, $event) return response([]); } + /** + * Trigger a boundary event + * + * @param ProcessRequest $request + * @param string $event + * @return void + * + * @OA\Post( + * path="/requests/{process_request_id}/boundary/{boundary_event_id}", + * summary="Trigger a boundary event", + * operationId="triggerBoundaryEvent", + * tags={"Process Requests"}, + * @OA\Parameter( + * description="ID of process request", + * in="path", + * name="process_request_id", + * required=true, + * @OA\Schema( + * type="integer", + * ) + * ), + * @OA\Parameter( + * description="ID of boundary event", + * in="path", + * name="boundary_event_id", + * required=true, + * @OA\Schema( + * type="string", + * ) + * ), + * @OA\RequestBody( + * @OA\JsonContent( + * required={"data"}, + * @OA\Property(property="data", type="object"), + * ) + * ), + * @OA\Response( + * response=204, + * description="success", + * ), + * ) + */ + public function triggerBoundaryEvent(ProcessRequest $request, $boundaryEventId) + { + $data = (array) request()->json()->all(); + // Get the process definition + $definitions = $request->getVersionDefinitions(); + $boundaryEvent = $definitions->getBoundaryEvent($boundaryEventId); + $activity = $boundaryEvent->getAttachedTo(); + $tokens = $request->tokens() + ->where('element_id', $activity->getId()) + ->where('status', 'ACTIVE')->get(); + foreach ($tokens as $token) { + WorkflowManager::triggerBoundaryEvent($request->process, $request, $token, $boundaryEvent, $data); + } + + return response([], 204); + } + /** * Parse the whitelist parameter * From ae91a7bc61b0ce541d41642362d09f089d5f5bbe Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 7 May 2025 08:24:21 -0400 Subject: [PATCH 30/53] Update main-index.blade.php to export types --- resources/stubs/api2typescript/main-index.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/stubs/api2typescript/main-index.blade.php b/resources/stubs/api2typescript/main-index.blade.php index 2373abba59..fb1cae5fa9 100644 --- a/resources/stubs/api2typescript/main-index.blade.php +++ b/resources/stubs/api2typescript/main-index.blade.php @@ -2,4 +2,5 @@ export * from './lib/processmaker-sdk' export * from './composables'; export * from './engine'; -export * from './types'; +export * from './types/types'; +export * from './api'; From 7a86b8b51050d93c7b136b7d6468afdbc91f5b80 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 7 May 2025 08:25:51 -0400 Subject: [PATCH 31/53] Add devtools helper function for logging Data Sources requests and responses --- ProcessMaker/Traits/MakeHttpRequests.php | 21 +++++++++++++++++ helpers.php | 29 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/ProcessMaker/Traits/MakeHttpRequests.php b/ProcessMaker/Traits/MakeHttpRequests.php index e5041c9184..53003e619b 100644 --- a/ProcessMaker/Traits/MakeHttpRequests.php +++ b/ProcessMaker/Traits/MakeHttpRequests.php @@ -27,6 +27,14 @@ trait MakeHttpRequests 'OAUTH2_PASSWORD' => 'passwordAuthorization', ]; + private $debugData = [ + 'method' => '', + 'url' => '', + 'headers' => [], + 'body' => '', + 'bodyType' => '', + ]; + /** * Verify certificate ssl * @@ -316,9 +324,12 @@ private function response($response, array $data = [], array $config = []) $status = $response->getStatusCode(); $bodyContent = $response->getBody()->getContents(); if (!$this->isJson($bodyContent)) { + devtools($this->debugData['method'], $this->debugData['url'], $status, ['Response' => $bodyContent, 'Request' => $this->debugData['body']]); return ['response' => $bodyContent, 'status' => $status]; } + devtools($this->debugData['method'], $this->debugData['url'], $status, ['Response' => $bodyContent, 'Request' => $this->debugData['body']]); + switch (true) { case $status == 200: $content = json_decode($bodyContent, true); @@ -345,6 +356,7 @@ private function response($response, array $data = [], array $config = []) } } + devtools('', 'MAPPED RESPONSE', '', ['Output' => json_encode($mapped, JSON_PRETTY_PRINT)]); return $mapped; } @@ -353,9 +365,12 @@ private function responseWithHeaderData($response, array $data = [], array $conf $status = $response->getStatusCode(); $bodyContent = $response->getBody()->getContents(); if (!$this->isJson($bodyContent)) { + devtools($this->debugData['method'], $this->debugData['url'], $status, ['Response' => $bodyContent, 'Request' => $this->debugData['body']]); return ['response' => $bodyContent, 'status' => $status]; } + devtools($this->debugData['method'], $this->debugData['url'], $status, ['Response' => $bodyContent, 'Request' => $this->debugData['body']]); + switch (true) { case $status == 200: $content = json_decode($bodyContent, true); @@ -416,6 +431,7 @@ private function responseWithHeaderData($response, array $data = [], array $conf $mapped[$processVar] = $evaluatedApiVar; } + devtools('', 'MAPPED RESPONSE', '', ['Output' => json_encode($mapped, JSON_PRETTY_PRINT)]); return $mapped; } @@ -447,6 +463,11 @@ private function call($method, $url, array $headers, $body, $bodyType) } $request = new Request($method, $url, $headers, $body); + $this->debugData['method'] = $method; + $this->debugData['url'] = $url; + $this->debugData['headers'] = $headers; + $this->debugData['body'] = $body; + $this->debugData['bodyType'] = $bodyType; if ($this->debug_mode) { $this->log('Request: ', var_export(compact('method', 'url', 'body', 'bodyType'), true)); diff --git a/helpers.php b/helpers.php index 18d71f72e0..8ae1486ae3 100644 --- a/helpers.php +++ b/helpers.php @@ -1,6 +1,7 @@ $method, + 'url' => $url, + 'time' => date('Y-m-d H:i:s'), + 'status' => $status, + 'details' => $details, + ]; + + Cache::put($key, $entries, 60 * 5); +} From 03b8f7c921cf8be2293b6d3a971046559060a05d Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 9 May 2025 13:23:36 -0400 Subject: [PATCH 32/53] Add jdavidbakr/mail-tracker package to composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 98616c7487..91d1470631 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "google/apiclient": "^2.18", "guzzlehttp/guzzle": "^7.9", "igaster/laravel-theme": "^2.0", + "jdavidbakr/mail-tracker": "^7.18", "jenssegers/agent": "^2.6", "laravel/framework": "^11.0", "laravel/horizon": "^5.30", From 1b283096e44e6f249300eb650754a6957622ee54 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 08:27:44 -0400 Subject: [PATCH 33/53] Add configuration file for mail-tracker package with customizable settings --- config/mail-tracker.php | 107 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 config/mail-tracker.php diff --git a/config/mail-tracker.php b/config/mail-tracker.php new file mode 100644 index 0000000000..595c4d93ca --- /dev/null +++ b/config/mail-tracker.php @@ -0,0 +1,107 @@ + true, + + /** + * To disable injecting tracking links, set this to false. + */ + 'track-links' => true, + + /** + * Optionally expire old emails, set to 0 to keep forever. + */ + 'expire-days' => 60, + + /** + * Where should the pingback URL route be? + */ + 'route' => [ + 'prefix' => 'email', + 'middleware' => ['api'], + ], + + /** + * If we get a link click without a URL, where should we send it to? + */ + 'redirect-missing-links-to' => '/', + + /** + * Where should the admin route be? + */ + 'admin-route' => [ + 'enabled' => true, // Should the admin routes be enabled? + 'prefix' => 'email-manager', + 'middleware' => [ + 'web', + 'can:see-sent-emails' + ], + ], + + /** + * Admin Template + * example + * 'name' => 'layouts.app' for Default emailTraking use 'emailTrakingViews::layouts.app' + * 'section' => 'content' for Default emailTraking use 'content' + * 'styles_section' => 'styles' for Default emailTraking use 'styles' + */ + 'admin-template' => [ + 'name' => 'emailTrakingViews::layouts.app', + 'section' => 'content', + ], + + /** + * Number of emails per page in the admin view + */ + 'emails-per-page' => 30, + + /** + * Date Format + */ + 'date-format' => 'Y-m-d H:i:s', + + /** + * Default database connection name (optional - use null for default) + */ + 'connection' => null, + + /** + * The SNS notification topic - if set, discard all notifications not in this topic. + */ + 'sns-topic' => null, + + /** + * Determines whether the body of the email is logged in the sent_emails table + */ + 'log-content' => true, + + /** + * Determines whether the body should be stored in a file instead of database + * Can be either 'database' or 'filesystem' + */ + 'log-content-strategy' => 'database', + + /** + * What filesystem we use for storing content html files + */ + 'tracker-filesystem' => null, + 'tracker-filesystem-folder' => 'mail-tracker', + + /** + * What queue should we dispatch our tracking jobs to? Null will use the default queue. + */ + 'tracker-queue' => null, + + /** + * Size limit for content length stored in database + */ + 'content-max-size' => 65535, + + /** + * Length of time to default past email search - if set, will set the default past limit to the amount of days below (Ex: => 356) + */ + 'search-date-start' => null, +]; From f7a544ec9cc95644dbb8acf2f724b715e0b6a51c Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 08:29:39 -0400 Subject: [PATCH 34/53] Add triggerMessageEvent method to WorkflowManagerDefault for handling message events --- ProcessMaker/Facades/WorkflowManager.php | 1 + .../Nayra/Managers/WorkflowManagerDefault.php | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/ProcessMaker/Facades/WorkflowManager.php b/ProcessMaker/Facades/WorkflowManager.php index aad7178a19..a26df908f6 100644 --- a/ProcessMaker/Facades/WorkflowManager.php +++ b/ProcessMaker/Facades/WorkflowManager.php @@ -26,6 +26,7 @@ * @method static bool existsServiceImplementation($implementation) * @method static bool runServiceImplementation($implementation, array $data, array $config, $tokenId = '') * @method static void triggerBoundaryEvent(\ProcessMaker\Models\Process $process, \ProcessMaker\Models\ProcessRequest $request, \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface $token, \ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface $boundaryEvent) + * @method static void triggerMessageEvent(\ProcessMaker\Models\ProcessRequest $request, string $messageEventId, array $data) */ class WorkflowManager extends Facade { diff --git a/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php b/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php index 0f757aa7e2..1ed4ed8c7a 100644 --- a/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php +++ b/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php @@ -18,13 +18,17 @@ use ProcessMaker\Jobs\StartEvent; use ProcessMaker\Jobs\ThrowMessageEvent; use ProcessMaker\Jobs\ThrowSignalEvent; +use ProcessMaker\Managers\DataManager; use ProcessMaker\Models\FormalExpression; use ProcessMaker\Models\Process as Definitions; use ProcessMaker\Models\ProcessRequest; use ProcessMaker\Models\ProcessRequestToken as Token; +use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface; use ProcessMaker\Nayra\Contracts\Bpmn\BoundaryEventInterface; use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface; use ProcessMaker\Nayra\Contracts\Bpmn\EventDefinitionInterface; +use ProcessMaker\Nayra\Contracts\Bpmn\IntermediateCatchEventInterface; +use ProcessMaker\Nayra\Contracts\Bpmn\MessageEventDefinitionInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ProcessInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ScriptTaskInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ServiceTaskInterface; @@ -137,6 +141,42 @@ public function triggerBoundaryEvent( BoundaryEvent::dispatchSync($definitions, $instance, $token, $boundaryEvent, $data); } + /** + * Trigger a message event + * + * @param ProcessRequest $request + * @param string $messageEventId + * @param array $data + */ + public function triggerMessageEvent(ProcessRequest $request, string $messageEventId, array $data) + { + // find active tokens that are waiting for this message event + $tokens = $request->tokens()->where('status', ActivityInterface::TOKEN_STATE_ACTIVE)->get(); + foreach ($tokens as $token) { + $element = $token->getDefinition(true); + $isIntermediateCatchEvent = $element instanceof IntermediateCatchEventInterface; + $isTask = $element instanceof ActivityInterface; + if ($isIntermediateCatchEvent) { + foreach ($element->getEventDefinitions() as $eventDefinition) { + if ($eventDefinition instanceof MessageEventDefinitionInterface && $eventDefinition->getPayload()->getId() === $messageEventId) { + CatchEvent::dispatchSync($request->process, $request, $token, $data); + } + } + } elseif ($isTask) { + $hasBoundaryEvent = $element->getBoundaryEvents()->count() > 0; + if ($hasBoundaryEvent) { + foreach ($element->getBoundaryEvents() as $boundaryEvent) { + foreach ($boundaryEvent->getEventDefinitions() as $eventDefinition) { + if ($eventDefinition instanceof MessageEventDefinitionInterface && $eventDefinition->getPayload()->getId() === $messageEventId) { + BoundaryEvent::dispatchSync($request->process, $request, $token, $boundaryEvent, $data); + } + } + } + } + } + } + } + /** * Trigger an start event and return the instance. * From cf5e2d8a95bc72118cdd77101fb04bfd866b10d6 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 08:31:13 -0400 Subject: [PATCH 35/53] Add EmailViewed event class to handle email view tracking and trigger workflow events --- ProcessMaker/Events/EmailViewed.php | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ProcessMaker/Events/EmailViewed.php diff --git a/ProcessMaker/Events/EmailViewed.php b/ProcessMaker/Events/EmailViewed.php new file mode 100644 index 0000000000..91e109dd65 --- /dev/null +++ b/ProcessMaker/Events/EmailViewed.php @@ -0,0 +1,38 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Viewed-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } +} From dc03e0d7baa6a80b92827dfcff64ff4a4a0e32c3 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 10:38:10 -0400 Subject: [PATCH 36/53] Add EmailSent event class to handle email sent tracking and trigger workflow events --- ProcessMaker/Events/EmailSent.php | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ProcessMaker/Events/EmailSent.php diff --git a/ProcessMaker/Events/EmailSent.php b/ProcessMaker/Events/EmailSent.php new file mode 100644 index 0000000000..5189a9a9bb --- /dev/null +++ b/ProcessMaker/Events/EmailSent.php @@ -0,0 +1,33 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } +} From 9c551f65b8d8d19ecbfc9bcc2aeb574b9434abcf Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 10:39:34 -0400 Subject: [PATCH 37/53] Add BouncedEmail event class to handle permanent bounced email messages and trigger workflow events --- ProcessMaker/Events/BouncedEmail.php | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ProcessMaker/Events/BouncedEmail.php diff --git a/ProcessMaker/Events/BouncedEmail.php b/ProcessMaker/Events/BouncedEmail.php new file mode 100644 index 0000000000..55b3266e7a --- /dev/null +++ b/ProcessMaker/Events/BouncedEmail.php @@ -0,0 +1,38 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } +} From 5dc3cf784f4424988546c3d6664c0cbc594fb231 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 10:39:55 -0400 Subject: [PATCH 38/53] Add EmailComplaint event class to handle email complaint tracking and trigger workflow events --- ProcessMaker/Events/EmailComplaint.php | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ProcessMaker/Events/EmailComplaint.php diff --git a/ProcessMaker/Events/EmailComplaint.php b/ProcessMaker/Events/EmailComplaint.php new file mode 100644 index 0000000000..78cba13008 --- /dev/null +++ b/ProcessMaker/Events/EmailComplaint.php @@ -0,0 +1,33 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } +} From 9e18e30c53e2467472b19d5002c69fd1a824fe05 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 11:33:36 -0400 Subject: [PATCH 39/53] Add EmailDelivered event class to handle email delivery tracking and trigger workflow events --- ProcessMaker/Events/EmailDelivered.php | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ProcessMaker/Events/EmailDelivered.php diff --git a/ProcessMaker/Events/EmailDelivered.php b/ProcessMaker/Events/EmailDelivered.php new file mode 100644 index 0000000000..4aed1c1fd9 --- /dev/null +++ b/ProcessMaker/Events/EmailDelivered.php @@ -0,0 +1,34 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } + +} From 804fd10f620c13fb64d6a75aedaaf85de1c2c1c6 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 11:34:25 -0400 Subject: [PATCH 40/53] Add EmailLinkClicked event class to handle email link click tracking and trigger workflow events --- ProcessMaker/Events/EmailLinkClicked.php | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ProcessMaker/Events/EmailLinkClicked.php diff --git a/ProcessMaker/Events/EmailLinkClicked.php b/ProcessMaker/Events/EmailLinkClicked.php new file mode 100644 index 0000000000..9881bb397a --- /dev/null +++ b/ProcessMaker/Events/EmailLinkClicked.php @@ -0,0 +1,33 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } + } + } +} From 757f8acd8bdd30734071b0a4e29f67410c1ebf56 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 11:35:35 -0400 Subject: [PATCH 41/53] Add views for email tracking functionality including index, show, SMTP detail, URL detail, and email templates --- .../emails/mensaje.blade.php | 30 +++ .../emails/mensaje_layout.blade.php | 195 ++++++++++++++++++ .../vendor/emailTrakingViews/index.blade.php | 112 ++++++++++ .../emailTrakingViews/layouts/app.blade.php | 13 ++ .../vendor/emailTrakingViews/show.blade.php | 1 + .../emailTrakingViews/smtp_detail.blade.php | 33 +++ .../emailTrakingViews/url_detail.blade.php | 50 +++++ 7 files changed, 434 insertions(+) create mode 100644 resources/views/vendor/emailTrakingViews/emails/mensaje.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/emails/mensaje_layout.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/index.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/layouts/app.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/show.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/smtp_detail.blade.php create mode 100644 resources/views/vendor/emailTrakingViews/url_detail.blade.php diff --git a/resources/views/vendor/emailTrakingViews/emails/mensaje.blade.php b/resources/views/vendor/emailTrakingViews/emails/mensaje.blade.php new file mode 100644 index 0000000000..1e4dd69edc --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/emails/mensaje.blade.php @@ -0,0 +1,30 @@ +@extends('emailTrakingViews::emails/mensaje_layout') +@section('title') + Message from {{config('mail-tracker.name')}} +@endsection + +@section('preheader') + Message from {{config('mail-tracker.name')}}
+@endsection +@section('nombre_destinatario') + {{ $data['name'] }} +@endsection +@section('mensaje') +

Static Email Title

+

+ Static Email Content +

+ {{ $data['message'] }} +@endsection +@section('href_call_to_action') + {{env('APP_URL')}} +@endsection +@section('txt_call_to_action') + Call To Action +@endsection +@section('txt_extra') + This email comes from {{config('mail-tracker.name')}} +@endsection +@section('saludo_final') + Regards +@endsection diff --git a/resources/views/vendor/emailTrakingViews/emails/mensaje_layout.blade.php b/resources/views/vendor/emailTrakingViews/emails/mensaje_layout.blade.php new file mode 100644 index 0000000000..1d1f0c4259 --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/emails/mensaje_layout.blade.php @@ -0,0 +1,195 @@ + + + + + + @yield('title') + + + + + + + + + +
  +
+ + + + + + + + + + + +
+ + + + + + + +
+ + {{config('mail-tracker.name')}} + +
+

Hi @yield('nombre_destinatario')

+

@yield('mensaje')

+ + + + + + +
+ + + + + + +
+ @yield('txt_call_to_action') + +
+
+

@yield('txt_extra')

+

@yield('saludo_final')

+
+
+ + + + + + +
+
 
+ + diff --git a/resources/views/vendor/emailTrakingViews/index.blade.php b/resources/views/vendor/emailTrakingViews/index.blade.php new file mode 100644 index 0000000000..5de646dcce --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/index.blade.php @@ -0,0 +1,112 @@ +@extends(config('mail-tracker.admin-template.name')) +@section(config('mail-tracker.admin-template.section')) +
+
+
+

Mail Tracker

+
+
+
+
+

+ SNS Endpoint: {{ route('mailTracker_SNS') }} +

+
+
+
+
+
+ {!! csrf_field() !!} +
+
+ + +
+
+ @if( !is_null(config('mail-tracker.search-date-start')) ) +
+
+ + +
+
+
+
+ + +
+
+ @endif +
+ + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + @foreach($emails as $email) + + + + + + + + + + + + + @endforeach +
SMTPRecipientSubjectFirst ViewOpensFirst ClickClicksSent AtView EmailClick Report
+ + {{ Str::limit($email->smtp_info, 20) }} + + {{$email->recipient}}{{$email->subject}}{{$email->opened_at}}{{$email->opens}}{{$email->clicked_at}}{{$email->clicks}}{{$email->created_at->format(config('mail-tracker.date-format'))}} + + View + + + @if($email->clicks > 0) + Url Report + @else + No Clicks + @endif +
+
+
+
+
+ {!! $emails->render() !!} +
+
+
+@endsection diff --git a/resources/views/vendor/emailTrakingViews/layouts/app.blade.php b/resources/views/vendor/emailTrakingViews/layouts/app.blade.php new file mode 100644 index 0000000000..9d55d24bb7 --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/layouts/app.blade.php @@ -0,0 +1,13 @@ + + + + + + + Mail Tracker + + + + @yield('content') + + \ No newline at end of file diff --git a/resources/views/vendor/emailTrakingViews/show.blade.php b/resources/views/vendor/emailTrakingViews/show.blade.php new file mode 100644 index 0000000000..9c4e553dc5 --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/show.blade.php @@ -0,0 +1 @@ +{!!$email->content!!} diff --git a/resources/views/vendor/emailTrakingViews/smtp_detail.blade.php b/resources/views/vendor/emailTrakingViews/smtp_detail.blade.php new file mode 100644 index 0000000000..2989f94107 --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/smtp_detail.blade.php @@ -0,0 +1,33 @@ +@extends(config('mail-tracker.admin-template.name')) +@section(config('mail-tracker.admin-template.section')) +
+
+
+

Mail Tracker

+
+
+

+ All Sent Emails +

+
+
+
+
+

+ SMTP detail for Email ID {{$details->id}} +

+ + View Message + +
+
+
+
+ Recipient: {{$details->recipient}}
+ Subject: {{$details->subject}}
+ Sent At: {{$details->created_at->format(config('mail-tracker.date-format'))}}
+ SMTP Details: {{ $details->smtp_info }} +
+
+
+@endsection diff --git a/resources/views/vendor/emailTrakingViews/url_detail.blade.php b/resources/views/vendor/emailTrakingViews/url_detail.blade.php new file mode 100644 index 0000000000..45e3449a39 --- /dev/null +++ b/resources/views/vendor/emailTrakingViews/url_detail.blade.php @@ -0,0 +1,50 @@ +@extends(config('mail-tracker.admin-template.name')) +@section(config('mail-tracker.admin-template.section')) +
+
+
+

Mail Tracker

+
+
+

+ All Sent Emails +

+
+
+
+
+

+ Clicked URLs for Email ID {{$details->first()->email->id}} +

+ + View Message + +
+
+
+
+ Recipient: {{$details->first()->email->recipient}}
+ Subject: {{$details->first()->email->subject}}
+ Sent At: {{$details->first()->email->created_at->format(config('mail-tracker.date-format'))}} +
+
+
+
+ + + + + + @foreach($details as $detail) + + + + + + + @endforeach +
UrlClicksFirst Click AtLast Click At
{{$detail->url}}{{$detail->clicks}}{{$detail->created_at->format(config('mail-tracker.date-format'))}}{{$detail->updated_at->format(config('mail-tracker.date-format'))}}
+
+
+
+@endsection From 13893c7b179bdd0a871a7d1225d7e3e45f78b9e8 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 11:36:34 -0400 Subject: [PATCH 42/53] Register email tracking events in EventServiceProvider to handle email interactions and trigger corresponding workflow events --- .../Providers/EventServiceProvider.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ProcessMaker/Providers/EventServiceProvider.php b/ProcessMaker/Providers/EventServiceProvider.php index 5e7a07ed53..9a6f0690df 100644 --- a/ProcessMaker/Providers/EventServiceProvider.php +++ b/ProcessMaker/Providers/EventServiceProvider.php @@ -3,16 +3,28 @@ namespace ProcessMaker\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use jdavidbakr\MailTracker\Events\ComplaintMessageEvent; +use jdavidbakr\MailTracker\Events\EmailDeliveredEvent; +use jdavidbakr\MailTracker\Events\EmailSentEvent; +use jdavidbakr\MailTracker\Events\LinkClickedEvent; +use jdavidbakr\MailTracker\Events\PermanentBouncedMessageEvent; +use jdavidbakr\MailTracker\Events\ViewEmailEvent; use ProcessMaker\Events\ActivityAssigned; use ProcessMaker\Events\ActivityCompleted; use ProcessMaker\Events\ActivityReassignment; use ProcessMaker\Events\AuthClientCreated; use ProcessMaker\Events\AuthClientDeleted; use ProcessMaker\Events\AuthClientUpdated; +use ProcessMaker\Events\BouncedEmail; use ProcessMaker\Events\CategoryCreated; use ProcessMaker\Events\CategoryDeleted; use ProcessMaker\Events\CategoryUpdated; use ProcessMaker\Events\CustomizeUiUpdated; +use ProcessMaker\Events\EmailComplaint; +use ProcessMaker\Events\EmailDelivered; +use ProcessMaker\Events\EmailLinkClicked; +use ProcessMaker\Events\EmailSent; +use ProcessMaker\Events\EmailViewed; use ProcessMaker\Events\EnvironmentVariablesCreated; use ProcessMaker\Events\EnvironmentVariablesDeleted; use ProcessMaker\Events\EnvironmentVariablesUpdated; @@ -111,6 +123,25 @@ class EventServiceProvider extends ServiceProvider TranslationChanged::class => [ InvalidateScreenCacheOnTranslationChange::class, ], + // Email Tracker + EmailSentEvent::class => [ + EmailSent::class, + ], + ViewEmailEvent::class => [ + EmailViewed::class, + ], + LinkClickedEvent::class => [ + EmailLinkClicked::class, + ], + EmailDeliveredEvent::class => [ + EmailDelivered::class, + ], + ComplaintMessageEvent::class => [ + EmailComplaint::class, + ], + PermanentBouncedMessageEvent::class => [ + BouncedEmail::class, + ], ]; /** From a203bf066f39a378ec6e060a83af769d7996275e Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 12 May 2025 12:55:58 -0400 Subject: [PATCH 43/53] Update composer.lock --- composer.lock | 129 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index a687350f3f..f83d9697e4 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": "498a7b05b0f09c4c8279b83c073e77ee", + "content-hash": "4390c170cc7fac64f61278f1b7d4dc48", "packages": [ { "name": "aws/aws-crt-php", @@ -60,6 +60,65 @@ }, "time": "2024-10-18T22:15:13+00:00" }, + { + "name": "aws/aws-php-sns-message-validator", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-php-sns-message-validator.git", + "reference": "80850e8d93fb57889ce609e113895dd2f1d7eed6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-php-sns-message-validator/zipball/80850e8d93fb57889ce609e113895dd2f1d7eed6", + "reference": "80850e8d93fb57889ce609e113895dd2f1d7eed6", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "squizlabs/php_codesniffer": "^2.3", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Aws\\Sns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "Amazon SNS message validation for PHP", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "SNS", + "amazon", + "aws", + "cloud", + "message", + "sdk", + "webhooks" + ], + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sns-message-validator/issues", + "source": "https://github.com/aws/aws-php-sns-message-validator/tree/1.9.1" + }, + "time": "2025-02-25T22:19:51+00:00" + }, { "name": "aws/aws-sdk-php", "version": "3.337.3", @@ -2721,6 +2780,72 @@ }, "time": "2025-02-06T18:54:20+00:00" }, + { + "name": "jdavidbakr/mail-tracker", + "version": "7.18", + "source": { + "type": "git", + "url": "https://github.com/jdavidbakr/mail-tracker.git", + "reference": "1e5d135840769ad8573591e3619810b39da05bba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jdavidbakr/mail-tracker/zipball/1e5d135840769ad8573591e3619810b39da05bba", + "reference": "1e5d135840769ad8573591e3619810b39da05bba", + "shasum": "" + }, + "require": { + "aws/aws-php-sns-message-validator": "^1.8", + "aws/aws-sdk-php": "^3.258", + "guzzlehttp/guzzle": "^7.2", + "illuminate/support": "^10.0|^11.0|^12.0", + "php": "^8.1" + }, + "require-dev": { + "mockery/mockery": "^1.4.4", + "orchestra/testbench": "^8.0|^9.0|^10.0", + "phpunit/phpunit": "^9.5.10|^10.5|^11.5.3" + }, + "suggest": { + "fedeisas/laravel-mail-css-inliner": "Automatically inlines CSS into all outgoing mail." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "jdavidbakr\\MailTracker\\MailTrackerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "jdavidbakr\\MailTracker\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "J David Baker", + "email": "me@jdavidbaker.com", + "homepage": "http://www.jdavidbaker.com", + "role": "Developer" + } + ], + "description": "Logs and tracks all outgoing emails from Laravel", + "homepage": "https://github.com/jdavidbakr/MailTracker", + "keywords": [ + "MailTracker", + "jdavidbakr" + ], + "support": { + "issues": "https://github.com/jdavidbakr/mail-tracker/issues", + "source": "https://github.com/jdavidbakr/mail-tracker/tree/7.18" + }, + "time": "2025-02-25T17:58:11+00:00" + }, { "name": "jenssegers/agent", "version": "v2.6.4", @@ -15846,6 +15971,6 @@ "platform": { "php": "^8.3" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } From ad86cf26d0cd695647ccf2492ce3623b7b2cc3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Busso?= <90727999+agustinbusso@users.noreply.github.com> Date: Tue, 13 May 2025 13:08:14 -0300 Subject: [PATCH 44/53] Add check --- ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php b/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php index 1ed4ed8c7a..f1f9772215 100644 --- a/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php +++ b/ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php @@ -167,7 +167,7 @@ public function triggerMessageEvent(ProcessRequest $request, string $messageEven if ($hasBoundaryEvent) { foreach ($element->getBoundaryEvents() as $boundaryEvent) { foreach ($boundaryEvent->getEventDefinitions() as $eventDefinition) { - if ($eventDefinition instanceof MessageEventDefinitionInterface && $eventDefinition->getPayload()->getId() === $messageEventId) { + if ($eventDefinition instanceof MessageEventDefinitionInterface && $eventDefinition->getPayload()?->getId() === $messageEventId) { BoundaryEvent::dispatchSync($request->process, $request, $token, $boundaryEvent, $data); } } From 413cd62872874aa7b15b69a38abef6c7ce8b0727 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 13 May 2025 16:23:14 -0400 Subject: [PATCH 45/53] Enhance TimerExpression to support FEEL expressions. --- ProcessMaker/Models/TimerExpression.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ProcessMaker/Models/TimerExpression.php b/ProcessMaker/Models/TimerExpression.php index af70744e23..0061859d78 100644 --- a/ProcessMaker/Models/TimerExpression.php +++ b/ProcessMaker/Models/TimerExpression.php @@ -87,7 +87,13 @@ public function getLanguage() public function __invoke($data) { $expression = $this->getProperty(FormalExpressionInterface::BPMN_PROPERTY_BODY); - $expression = $this->mustacheTimerExpression($expression, $data); + $isFeel = $this->getProperty('type') === 'tFormalExpression'; + if ($isFeel) { + $feel = new FeelExpressionEvaluator(); + $expression = $feel->render($expression, $data); + } else { + $expression = $this->mustacheTimerExpression($expression, $data); + } return $this->getDateExpression($expression) ?: $this->getCycleExpression($expression) From d598982b79dff06b6610ca8abe1084ea43bebbf7 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 13 May 2025 16:30:46 -0400 Subject: [PATCH 46/53] Consider namespace --- ProcessMaker/Models/TimerExpression.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProcessMaker/Models/TimerExpression.php b/ProcessMaker/Models/TimerExpression.php index 0061859d78..069fed3bd6 100644 --- a/ProcessMaker/Models/TimerExpression.php +++ b/ProcessMaker/Models/TimerExpression.php @@ -87,7 +87,7 @@ public function getLanguage() public function __invoke($data) { $expression = $this->getProperty(FormalExpressionInterface::BPMN_PROPERTY_BODY); - $isFeel = $this->getProperty('type') === 'tFormalExpression'; + $isFeel = str_contains($this->getProperty('type'), 'tFormalExpression'); if ($isFeel) { $feel = new FeelExpressionEvaluator(); $expression = $feel->render($expression, $data); From 6da78b26060bb93e5343b82fee61caecd1fb15f9 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 13 May 2025 16:59:35 -0400 Subject: [PATCH 47/53] Add test for scheduling Intermediate Timer Event with FEEL syntax --- .../Api/IntermediateTimerEventTest.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Feature/Api/IntermediateTimerEventTest.php b/tests/Feature/Api/IntermediateTimerEventTest.php index 5dd772f8a5..64efba1b0b 100644 --- a/tests/Feature/Api/IntermediateTimerEventTest.php +++ b/tests/Feature/Api/IntermediateTimerEventTest.php @@ -206,4 +206,44 @@ public function testScheduleIntermediateTimerEventWithMustacheSyntax() $iteToken->refresh(); $this->assertEquals('CLOSED', $iteToken->status); } + + public function testScheduleIntermediateTimerEventWithFEELSyntax() + { + $this->be($this->user); + $data = []; + $data['bpmn'] = Process::getProcessTemplate('IntermediateTimerEventFEEL.bpmn'); + $process = Process::factory()->create($data); + $definitions = $process->getDefinitions(); + $startEvent = $definitions->getEvent('_2'); + // now + 8 minutes + $timestamp = time() + 480; + // Pass variables to calculate the date and time using FEEL: date ~ "T" ~ time + $request = WorkflowManager::triggerStartEvent($process, $startEvent, [ + 'date' => date('Y-m-d', $timestamp), + 'time' => date('H:i:sP', $timestamp) + ]); + $task1 = $request->tokens()->where('element_id', '_3')->first(); + WorkflowManager::completeTask($process, $request, $task1, []); // moves to timer event I guess + + // Time travel 5 minutes into the future + Carbon::setTestNow(Carbon::now()->addMinute(5)); + + // Re-schedule events for artisan call + $scheduleManager = new TaskSchedulerManager(); + $scheduleManager->scheduleTasks(); + \Artisan::call('schedule:run'); + + $iteToken = $request->tokens()->where('element_id', '_5')->firstOrFail(); + $this->assertEquals('ACTIVE', $iteToken->status); // Not enough time has passed + + // Time travel 5 more minutes into the future + Carbon::setTestNow(Carbon::now()->addMinute(5)); + + // Re-schedule events for artisan call + $scheduleManager->scheduleTasks(); + \Artisan::call('schedule:run'); + + $iteToken->refresh(); + $this->assertEquals('CLOSED', $iteToken->status); + } } From dd805f1a4b3b53d413d139db9d3b78dfa9eedcf1 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 13 May 2025 17:00:38 -0400 Subject: [PATCH 48/53] Add Intermediate Timer Event FEEL BPMN process --- .../templates/IntermediateTimerEventFEEL.bpmn | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 database/processes/templates/IntermediateTimerEventFEEL.bpmn diff --git a/database/processes/templates/IntermediateTimerEventFEEL.bpmn b/database/processes/templates/IntermediateTimerEventFEEL.bpmn new file mode 100644 index 0000000000..097eb4f440 --- /dev/null +++ b/database/processes/templates/IntermediateTimerEventFEEL.bpmn @@ -0,0 +1,100 @@ + + + + + + + + + + _8 + + + + _8 + _9 + + + _9 + _10 + + + date ~ "T" ~ time + + + + _10 + _11 + + + + + + + _11 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From cba44e4ed0370de3acf22301581ffd13cf579ac1 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 14 May 2025 09:03:59 -0400 Subject: [PATCH 49/53] Add urlencode method to MustacheOptions for URL encoding support --- ProcessMaker/Bpmn/MustacheOptions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ProcessMaker/Bpmn/MustacheOptions.php b/ProcessMaker/Bpmn/MustacheOptions.php index 4a1b164620..a3d0507b0c 100644 --- a/ProcessMaker/Bpmn/MustacheOptions.php +++ b/ProcessMaker/Bpmn/MustacheOptions.php @@ -18,6 +18,7 @@ public function __construct() 'json' => [$this, 'json'], 'serialize' => [$this, 'serialize'], 'xml' => [$this, 'xml'], + 'urlencode' => [$this, 'urlencode'], ]; } @@ -74,4 +75,19 @@ public function xml($text, ?Mustache_LambdaHelper $helper = null) } return xmlrpc_encode($helper->render($text)); } + + /** + * URL encode a string + * + * @param string $text + * @param Mustache_LambdaHelper|null $helper + * @return string + */ + public function urlencode($text, ?Mustache_LambdaHelper $helper = null) + { + if (!$helper) { + return urlencode($text); + } + return urlencode($helper->render($text)); + } } From c34342abf40f1c096aefdaf8eae813af35a732d0 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 16 May 2025 21:53:34 -0400 Subject: [PATCH 50/53] Update sleep interval in Horizon configuration to use a default of 1000ms instead of 3000ms for improved performance. --- config/horizon.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/horizon.php b/config/horizon.php index 7b1a5f8d87..ab9e7e9dad 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -148,7 +148,7 @@ 'balance' => env('PM4_HORIZON_SUPERVISOR_BPMN_BALANCE', 'simple'), 'tries' => env('PM4_HORIZON_SUPERVISOR_BPMN_TRIES', 3), 'timeout' => env('PM4_HORIZON_SUPERVISOR_BPMN_TIMEOUT', 3600), - 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 3000)) * 0.001, + 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 1000)) * 0.001, 'minProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MIN_PROCESSES', 1), 'maxProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MAX_PROCESSES', 1), ], @@ -170,7 +170,7 @@ 'balance' => env('PM4_HORIZON_SUPERVISOR_BPMN_BALANCE', 'false'), 'tries' => env('PM4_HORIZON_SUPERVISOR_BPMN_TRIES', 3), 'timeout' => env('PM4_HORIZON_SUPERVISOR_BPMN_TIMEOUT', 3600), - 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 3000)) * 0.001, + 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 1000)) * 0.001, 'minProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MIN_PROCESSES', 1), 'maxProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MAX_PROCESSES', 1), ], @@ -192,7 +192,7 @@ 'balance' => env('PM4_HORIZON_SUPERVISOR_BPMN_BALANCE', 'false'), 'tries' => env('PM4_HORIZON_SUPERVISOR_BPMN_TRIES', 3), 'timeout' => env('PM4_HORIZON_SUPERVISOR_BPMN_TIMEOUT', 3600), - 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 3000)) * 0.001, + 'sleep' => intval(env('BPMN_QUEUE_INTERVAL', 1000)) * 0.001, 'minProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MIN_PROCESSES', 1), 'maxProcesses' => env('PM4_HORIZON_SUPERVISOR_BPMN_MAX_PROCESSES', 1), ], From 29ee3f4b749abcd48c12da4bad2da5cc3e6d49ea Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 16 May 2025 21:55:22 -0400 Subject: [PATCH 51/53] Add MessageEventCaught event class for broadcasting message events in ProcessMaker --- ProcessMaker/Events/MessageEventCaught.php | 73 ++++++++++++++++++++++ ProcessMaker/Events/MessageEventThrown.php | 11 ++-- ProcessMaker/Listeners/BpmnSubscriber.php | 55 +++++++++++++++- ProcessMaker/Managers/DataManager.php | 2 +- routes/channels.php | 16 +++++ 5 files changed, 148 insertions(+), 9 deletions(-) create mode 100644 ProcessMaker/Events/MessageEventCaught.php diff --git a/ProcessMaker/Events/MessageEventCaught.php b/ProcessMaker/Events/MessageEventCaught.php new file mode 100644 index 0000000000..1eb2ae3bac --- /dev/null +++ b/ProcessMaker/Events/MessageEventCaught.php @@ -0,0 +1,73 @@ + + */ + public function broadcastOn(): array + { + $channels = [ + new PrivateChannel('ProcessMaker.Models.ProcessRequest.' . $this->processRequest->getKey()), + ]; + $hasParent = $this->processRequest->parent_request_id; + if ($hasParent) { + $channels[] = new PrivateChannel('ProcessMaker.Models.ProcessRequest.' . $this->processRequest->parent_request_id . '.SubProcesses'); + } + return $channels; + } + + /** + * Set the event name + * + * @return string + */ + public function broadcastAs() + { + return 'MessageEventCaught'; + } + + /** + * Get the data to broadcast. + * + * @return array + */ + public function broadcastWith(): array + { + return [ + 'event' => [ + 'id' => $this->message->getId(), + 'name' => $this->message->getName(), + ], + 'element' => [ + 'id' => $this->node->getId(), + 'name' => $this->node->getName(), + ], + 'data' => (object) $this->message->getData($this->processRequest), + ]; + } +} diff --git a/ProcessMaker/Events/MessageEventThrown.php b/ProcessMaker/Events/MessageEventThrown.php index 894ad06b8a..7416deb04a 100644 --- a/ProcessMaker/Events/MessageEventThrown.php +++ b/ProcessMaker/Events/MessageEventThrown.php @@ -2,18 +2,14 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; use ProcessMaker\Models\Message; use ProcessMaker\Models\ProcessRequest; use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface; -use ProcessMaker\Nayra\Contracts\Bpmn\MessageEventDefinitionInterface; class MessageEventThrown implements ShouldBroadcastNow { @@ -35,9 +31,14 @@ public function __construct( */ public function broadcastOn(): array { - return [ + $channels = [ new PrivateChannel('ProcessMaker.Models.ProcessRequest.' . $this->processRequest->getKey()), ]; + $hasParent = $this->processRequest->parent_request_id; + if ($hasParent) { + $channels[] = new PrivateChannel('ProcessMaker.Models.ProcessRequest.' . $this->processRequest->parent_request_id . '.SubProcesses'); + } + return $channels; } /** diff --git a/ProcessMaker/Listeners/BpmnSubscriber.php b/ProcessMaker/Listeners/BpmnSubscriber.php index 176086f2bc..0a862a0bca 100644 --- a/ProcessMaker/Listeners/BpmnSubscriber.php +++ b/ProcessMaker/Listeners/BpmnSubscriber.php @@ -8,11 +8,13 @@ use Illuminate\Support\Facades\Notification; use ProcessMaker\Events\ActivityAssigned; use ProcessMaker\Events\ActivityCompleted; +use ProcessMaker\Events\MessageEventCaught; use ProcessMaker\Events\MessageEventThrown; use ProcessMaker\Events\ProcessCompleted; use ProcessMaker\Facades\Metrics; use ProcessMaker\Facades\WorkflowManager; use ProcessMaker\Jobs\TerminateRequestEndEvent; +use ProcessMaker\Managers\DataManager; use ProcessMaker\Models\Comment; use ProcessMaker\Models\FormalExpression; use ProcessMaker\Models\Message; @@ -24,6 +26,7 @@ use ProcessMaker\Nayra\Bpmn\Events\ProcessInstanceCompletedEvent; use ProcessMaker\Nayra\Bpmn\Events\ProcessInstanceCreatedEvent; use ProcessMaker\Nayra\Contracts\Bpmn\ActivityInterface; +use ProcessMaker\Nayra\Contracts\Bpmn\CatchEventInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ConditionalEventDefinitionInterface; use ProcessMaker\Nayra\Contracts\Bpmn\EntityInterface; use ProcessMaker\Nayra\Contracts\Bpmn\ErrorInterface; @@ -252,6 +255,21 @@ public function onIntermediateCatchEventActivated(IntermediateCatchEventInterfac foreach ($event->getEventDefinitions() as $eventDefinition) { foreach ($messages as $interface => $message) { if (is_subclass_of($eventDefinition, $interface)) { + $bpmnMessage = $eventDefinition->getPayload(); + if ($bpmnMessage) { + event(new MessageEventCaught($token->getInstance(), $token->getOwnerElement(), $bpmnMessage)); + devtools( + '▶︎ MessageEventCaught', + $bpmnMessage->getName() ?? '(null)', + $bpmnMessage->getId() ?? '(null)', + [ + 'Payload' => json_encode( + (object) $bpmnMessage->getData($token->getInstance()), + JSON_PRETTY_PRINT + ) + ] + ); + } $comment = new Comment([ 'user_id' => null, 'commentable_type' => ProcessRequest::class, @@ -338,6 +356,29 @@ public function onMessageEventDefinition(ThrowEventInterface $node, TokenInterfa ); } + public function onMessageEventCaught(CatchEventInterface $node, TokenInterface $token) + { + foreach ($node->getEventDefinitions() as $eventDefinition) { + if ($eventDefinition instanceof MessageEventDefinitionInterface) { + $bpmnMessage = $eventDefinition->getPayload(); + if ($bpmnMessage) { + event(new MessageEventCaught($token->getInstance(), $token->getOwnerElement(), $bpmnMessage)); + devtools( + '▶︎ MessageEventCaught', + $bpmnMessage->getName() ?? '(null)', + $bpmnMessage->getId() ?? '(null)', + [ + 'Payload' => json_encode( + (object) $bpmnMessage->getData($token->getInstance()), + JSON_PRETTY_PRINT + ) + ] + ); + } + } + } + } + /** * Subscription. * @@ -363,18 +404,21 @@ public function subscribe($events) $events->listen(TerminateEventDefinitionInterface::EVENT_THROW_EVENT_DEFINITION, static::class . '@onTerminateEndEvent'); $events->listen(MessageEventDefinitionInterface::EVENT_THROW_EVENT_DEFINITION, static::class . '@onMessageEventDefinition'); + $events->listen(IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH, static::class . '@onMessageEventCaught'); // Log devtools events for local and testing environments if (App::environment('local') || App::environment('testing')) { $events->listen('*', function ($event, $args) { $hasBackslash = strpos($event, '\\') !== false; if (!$hasBackslash && count($args) > 0) { + $token = isset($args[1]) && ($args[1] instanceof ProcessRequestToken) ? $args[1] : null; $payload = $args[0]; if ( $payload instanceof ActivityCompletedEvent || $payload instanceof ActivityActivatedEvent || $payload instanceof ActivityClosedEvent ) { + $token = $payload->token; $payload = $payload->activity; } @@ -382,13 +426,18 @@ public function subscribe($events) $element = $payload->getBpmnElement(); $document = $payload->getOwnerDocument(); $xml = $element ? $document->saveXML($element) : ''; + $details = [ + 'Node' => $xml + ]; + if ($token) { + $dm = new DataManager(); + $details['Data'] = json_encode((object) $dm->getData($token), JSON_PRETTY_PRINT); + } devtools( $event, $payload->getName() ?? '(null)', $payload->getId() ?? '(null)', - [ - 'Node' => $xml, - ] + $details ); } } diff --git a/ProcessMaker/Managers/DataManager.php b/ProcessMaker/Managers/DataManager.php index b3566d7509..167584603e 100644 --- a/ProcessMaker/Managers/DataManager.php +++ b/ProcessMaker/Managers/DataManager.php @@ -127,7 +127,7 @@ private function loadTokenData(array $data = [], ProcessRequestToken $token = nu } // Magic Variable: _user - $data = $this->loadUserData($data, $token); + $data = $this->loadUserData($data ?? [], $token); // Magic Variable: _request $request = $token->getInstance() ?: $token->processRequest; diff --git a/routes/channels.php b/routes/channels.php index eb10a61a18..b3fdd35369 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -33,6 +33,22 @@ || $request->process?->manager_id === $user->id; }); +Broadcast::channel('ProcessMaker.Models.ProcessRequest.{id}.SubProcesses', function ($user, $id) { + if ($id === 'undefined' || $user === 'undefined') { + return; + } + + if ($user->is_administrator) { + return true; + } + + $request = ProcessRequest::find($id); + + return $request->user_id === $user->id + || !empty($request->participants()->where('users.id', $user->getKey())->first()) + || $request->process?->manager_id === $user->id; +}); + Broadcast::channel('ProcessMaker.Models.ProcessRequestToken.{id}', function ($user, $id) { if ($user->is_administrator) { return true; From c794d46cedb50b7d68dfdc01e2631d3e4fd06503 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Thu, 22 May 2025 13:29:05 -0400 Subject: [PATCH 52/53] FOUR-24476: Review Clicked Links in Email are not working as expected --- ProcessMaker/Events/BaseEmailEvent.php | 83 +++++ ProcessMaker/Events/EmailComplaint.php | 50 +-- ProcessMaker/Events/EmailDelivered.php | 49 +-- ProcessMaker/Events/EmailLinkClicked.php | 50 +-- ProcessMaker/Events/EmailSent.php | 50 +-- ProcessMaker/Events/EmailViewed.php | 55 +-- tests/Feature/Events/EmailEventTest.php | 433 +++++++++++++++++++++++ 7 files changed, 660 insertions(+), 110 deletions(-) create mode 100644 ProcessMaker/Events/BaseEmailEvent.php create mode 100644 tests/Feature/Events/EmailEventTest.php diff --git a/ProcessMaker/Events/BaseEmailEvent.php b/ProcessMaker/Events/BaseEmailEvent.php new file mode 100644 index 0000000000..02e284a255 --- /dev/null +++ b/ProcessMaker/Events/BaseEmailEvent.php @@ -0,0 +1,83 @@ +sent_email; + $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); + $messageEventId = $tracker->getHeader($this->getMessageEventIdHeader()); + $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + + // Log the email event for debugging + Log::debug($this->getEventType() . ' email event', [ + 'email_id' => $emailIdentifier, + 'message_event_id' => $messageEventId, + 'request_id' => $requestIdentifier, + ]); + + if ($requestIdentifier && $messageEventId) { + $request = ProcessRequest::where('id', $requestIdentifier)->first(); + if ($request) { + $data = [ + 'email_id' => $emailIdentifier, + ]; + WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); + } else { + Log::warning($this->getEventType() . ' but process request not found', [ + 'request_id' => $requestIdentifier, + ]); + } + } else { + Log::warning($this->getEventType() . ' but missing required headers', [ + 'email_id' => $emailIdentifier, + 'message_event_id' => $messageEventId, + 'request_id' => $requestIdentifier, + ]); + } + } catch (\Exception $e) { + Log::error('Error handling ' . $this->getEventType() . ' event', [ + 'error' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + ]); + } + } +} diff --git a/ProcessMaker/Events/EmailComplaint.php b/ProcessMaker/Events/EmailComplaint.php index 78cba13008..9ae74f0a79 100644 --- a/ProcessMaker/Events/EmailComplaint.php +++ b/ProcessMaker/Events/EmailComplaint.php @@ -2,32 +2,40 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; use jdavidbakr\MailTracker\Events\ComplaintMessageEvent; -use ProcessMaker\Facades\WorkflowManager; -use ProcessMaker\Models\ProcessRequest; -class EmailComplaint +/** + * Class EmailComplaint + * + * This event handler is triggered when a ProcessMaker email receives a complaint. + * It extracts the necessary data from the email headers and triggers the appropriate message event. + */ +class EmailComplaint extends BaseEmailEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - + /** + * Handle the email complaint event + * + * @param ComplaintMessageEvent $event The complaint message event from MailTracker + * @return void + */ public function handle(ComplaintMessageEvent $event) { - $tracker = $event->sent_email; - $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); - $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); - $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + $this->processEmailEvent($event); + } + + /** + * @inheritdoc + */ + protected function getEventType(): string + { + return 'Complaint'; + } - if ($requestIdentifier && $messageEventId) { - $request = ProcessRequest::where('id', $requestIdentifier)->first(); - if ($request) { - $data = [ - 'email_id' => $emailIdentifier, - ]; - WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); - } - } + /** + * @inheritdoc + */ + protected function getMessageEventIdHeader(): string + { + return 'X-ProcessMaker-Complaint-Message-Event-ID'; } } diff --git a/ProcessMaker/Events/EmailDelivered.php b/ProcessMaker/Events/EmailDelivered.php index 4aed1c1fd9..8ea95fde4d 100644 --- a/ProcessMaker/Events/EmailDelivered.php +++ b/ProcessMaker/Events/EmailDelivered.php @@ -2,33 +2,40 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; use jdavidbakr\MailTracker\Events\EmailDeliveredEvent; -use ProcessMaker\Facades\WorkflowManager; -use ProcessMaker\Models\ProcessRequest; -class EmailDelivered +/** + * Class EmailDelivered + * + * This event handler is triggered when a ProcessMaker email is delivered to a recipient. + * It extracts the necessary data from the email headers and triggers the appropriate message event. + */ +class EmailDelivered extends BaseEmailEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - + /** + * Handle the email delivered event + * + * @param EmailDeliveredEvent $event The email delivered event from MailTracker + * @return void + */ public function handle(EmailDeliveredEvent $event) { - $tracker = $event->sent_email; - $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); - $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); - $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + $this->processEmailEvent($event); + } - if ($requestIdentifier && $messageEventId) { - $request = ProcessRequest::where('id', $requestIdentifier)->first(); - if ($request) { - $data = [ - 'email_id' => $emailIdentifier, - ]; - WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); - } - } + /** + * @inheritdoc + */ + protected function getEventType(): string + { + return 'Delivered'; } + /** + * @inheritdoc + */ + protected function getMessageEventIdHeader(): string + { + return 'X-ProcessMaker-Delivered-Message-Event-ID'; + } } diff --git a/ProcessMaker/Events/EmailLinkClicked.php b/ProcessMaker/Events/EmailLinkClicked.php index 9881bb397a..640ce2568e 100644 --- a/ProcessMaker/Events/EmailLinkClicked.php +++ b/ProcessMaker/Events/EmailLinkClicked.php @@ -2,32 +2,40 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; use jdavidbakr\MailTracker\Events\LinkClickedEvent; -use ProcessMaker\Facades\WorkflowManager; -use ProcessMaker\Models\ProcessRequest; -class EmailLinkClicked +/** + * Class EmailLinkClicked + * + * This event handler is triggered when a link in a ProcessMaker email is clicked. + * It extracts the necessary data from the email headers and triggers the appropriate message event. + */ +class EmailLinkClicked extends BaseEmailEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - + /** + * Handle the link clicked event + * + * @param LinkClickedEvent $event The link clicked event from MailTracker + * @return void + */ public function handle(LinkClickedEvent $event) { - $tracker = $event->sent_email; - $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); - $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); - $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + $this->processEmailEvent($event); + } + + /** + * @inheritdoc + */ + protected function getEventType(): string + { + return 'Link clicked'; + } - if ($requestIdentifier && $messageEventId) { - $request = ProcessRequest::where('id', $requestIdentifier)->first(); - if ($request) { - $data = [ - 'email_id' => $emailIdentifier, - ]; - WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); - } - } + /** + * @inheritdoc + */ + protected function getMessageEventIdHeader(): string + { + return 'X-ProcessMaker-Link-Clicked-Message-Event-ID'; } } diff --git a/ProcessMaker/Events/EmailSent.php b/ProcessMaker/Events/EmailSent.php index 5189a9a9bb..a993329962 100644 --- a/ProcessMaker/Events/EmailSent.php +++ b/ProcessMaker/Events/EmailSent.php @@ -2,32 +2,40 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; use jdavidbakr\MailTracker\Events\EmailSentEvent; -use ProcessMaker\Facades\WorkflowManager; -use ProcessMaker\Models\ProcessRequest; -class EmailSent +/** + * Class EmailSent + * + * This event handler is triggered when a ProcessMaker email is sent. + * It extracts the necessary data from the email headers and triggers the appropriate message event. + */ +class EmailSent extends BaseEmailEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - + /** + * Handle the email sent event + * + * @param EmailSentEvent $event The email sent event from MailTracker + * @return void + */ public function handle(EmailSentEvent $event) { - $tracker = $event->sent_email; - $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); - $messageEventId = $tracker->getHeader('X-ProcessMaker-Sent-Message-Event-ID'); - $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + $this->processEmailEvent($event); + } + + /** + * @inheritdoc + */ + protected function getEventType(): string + { + return 'Sent'; + } - if ($requestIdentifier && $messageEventId) { - $request = ProcessRequest::where('id', $requestIdentifier)->first(); - if ($request) { - $data = [ - 'email_id' => $emailIdentifier, - ]; - WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); - } - } + /** + * @inheritdoc + */ + protected function getMessageEventIdHeader(): string + { + return 'X-ProcessMaker-Sent-Message-Event-ID'; } } diff --git a/ProcessMaker/Events/EmailViewed.php b/ProcessMaker/Events/EmailViewed.php index 91e109dd65..6e258facea 100644 --- a/ProcessMaker/Events/EmailViewed.php +++ b/ProcessMaker/Events/EmailViewed.php @@ -2,37 +2,40 @@ namespace ProcessMaker\Events; -use Illuminate\Broadcasting\Channel; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Broadcasting\PresenceChannel; -use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Support\Facades\Log; use jdavidbakr\MailTracker\Events\ViewEmailEvent; -use ProcessMaker\Facades\WorkflowManager; -use ProcessMaker\Models\ProcessRequest; -class EmailViewed +/** + * Class EmailViewed + * + * This event handler is triggered when a ProcessMaker email is viewed by a recipient. + * It extracts the necessary data from the email headers and triggers the appropriate message event. + */ +class EmailViewed extends BaseEmailEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - + /** + * Handle the email viewed event + * + * @param ViewEmailEvent $event The view email event from MailTracker + * @return void + */ public function handle(ViewEmailEvent $event) { - $tracker = $event->sent_email; - $emailIdentifier = $tracker->getHeader('X-ProcessMaker-Email-ID'); - $messageEventId = $tracker->getHeader('X-ProcessMaker-Viewed-Message-Event-ID'); - $requestIdentifier = $tracker->getHeader('X-ProcessMaker-Request-ID'); + $this->processEmailEvent($event); + } + + /** + * @inheritdoc + */ + protected function getEventType(): string + { + return 'Viewed'; + } - if ($requestIdentifier && $messageEventId) { - $request = ProcessRequest::where('id', $requestIdentifier)->first(); - if ($request) { - $data = [ - 'email_id' => $emailIdentifier, - ]; - WorkflowManager::triggerMessageEvent($request, $messageEventId, $data); - } - } + /** + * @inheritdoc + */ + protected function getMessageEventIdHeader(): string + { + return 'X-ProcessMaker-Viewed-Message-Event-ID'; } } diff --git a/tests/Feature/Events/EmailEventTest.php b/tests/Feature/Events/EmailEventTest.php new file mode 100644 index 0000000000..1a2819b487 --- /dev/null +++ b/tests/Feature/Events/EmailEventTest.php @@ -0,0 +1,433 @@ +request = ProcessRequest::factory()->create([ + 'id' => $this->requestId, + 'status' => 'ACTIVE', + ]); + } + + /** + * Test each email event handler individually + */ + public function testEmailSentHandling() + { + $this->runEventTest( + EmailSent::class, + EmailSentEvent::class, + 'X-ProcessMaker-Sent-Message-Event-ID' + ); + } + + /** + * Test EmailDelivered event handling + */ + public function testEmailDeliveredHandling() + { + $this->runEventTest( + EmailDelivered::class, + EmailDeliveredEvent::class, + 'X-ProcessMaker-Delivered-Message-Event-ID' + ); + } + + /** + * Test EmailComplaint event handling + */ + public function testEmailComplaintHandling() + { + $this->runEventTest( + EmailComplaint::class, + ComplaintMessageEvent::class, + 'X-ProcessMaker-Complaint-Message-Event-ID' + ); + } + + /** + * Test EmailViewed event handling + */ + public function testEmailViewedHandling() + { + $this->runEventTest( + EmailViewed::class, + ViewEmailEvent::class, + 'X-ProcessMaker-Viewed-Message-Event-ID' + ); + } + + /** + * Test EmailLinkClicked event handling + */ + public function testEmailLinkClickedHandling() + { + $this->runEventTest( + EmailLinkClicked::class, + LinkClickedEvent::class, + 'X-ProcessMaker-Link-Clicked-Message-Event-ID' + ); + } + + /** + * Common test runner for all event types + */ + private function runEventTest(string $handlerClass, string $eventClass, string $messageEventIdHeader) + { + // Create the event handler + $handler = new $handlerClass(); + + // Set expectations for the WorkflowManager facade + WorkflowManager::shouldReceive('triggerMessageEvent') + ->once() + ->with(Mockery::type(ProcessRequest::class), $this->messageEventId, ['email_id' => $this->emailId]) + ->andReturnTrue(); + + // Create an event mock with appropriate tracker + $trackerMock = $this->createTrackerMock($messageEventIdHeader); + $eventMock = Mockery::mock($eventClass); + $eventMock->sent_email = $trackerMock; + + // Call the handler + $handler->handle($eventMock); + } + + /** + * Test email event header validation for EmailSent + */ + public function testEmailSentHeaderMatch() + { + $this->runHeaderTest( + EmailSent::class, + EmailSentEvent::class, + 'X-ProcessMaker-Sent-Message-Event-ID' + ); + } + + /** + * Test email event header validation for EmailDelivered + */ + public function testEmailDeliveredHeaderMatch() + { + $this->runHeaderTest( + EmailDelivered::class, + EmailDeliveredEvent::class, + 'X-ProcessMaker-Delivered-Message-Event-ID' + ); + } + + /** + * Test email event header validation for EmailComplaint + */ + public function testEmailComplaintHeaderMatch() + { + $this->runHeaderTest( + EmailComplaint::class, + ComplaintMessageEvent::class, + 'X-ProcessMaker-Complaint-Message-Event-ID' + ); + } + + /** + * Test email event header validation for EmailViewed + */ + public function testEmailViewedHeaderMatch() + { + $this->runHeaderTest( + EmailViewed::class, + ViewEmailEvent::class, + 'X-ProcessMaker-Viewed-Message-Event-ID' + ); + } + + /** + * Test email event header validation for EmailLinkClicked + */ + public function testEmailLinkClickedHeaderMatch() + { + $this->runHeaderTest( + EmailLinkClicked::class, + LinkClickedEvent::class, + 'X-ProcessMaker-Link-Clicked-Message-Event-ID' + ); + } + + /** + * Common header test runner for all event types + */ + private function runHeaderTest(string $handlerClass, string $eventClass, string $messageEventIdHeader) + { + // Create the event handler + $handler = new $handlerClass(); + + // Create a special tracker mock that will only accept exact header names + $trackerMock = Mockery::mock(SentEmail::class); + + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Email-ID') + ->once() + ->andReturn($this->emailId); + + $trackerMock->shouldReceive('getHeader') + ->with($messageEventIdHeader) + ->once() + ->andReturn($this->messageEventId); + + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Request-ID') + ->once() + ->andReturn($this->requestId); + + // Create event mock + $eventMock = Mockery::mock($eventClass); + $eventMock->sent_email = $trackerMock; + + // Call the handler + $handler->handle($eventMock); + } + + /** + * Test missing process request handling for EmailSent + */ + public function testEmailSentNoProcessRequest() + { + $this->runMissingRequestTest( + EmailSent::class, + EmailSentEvent::class, + 'X-ProcessMaker-Sent-Message-Event-ID' + ); + } + + /** + * Test missing process request handling for EmailDelivered + */ + public function testEmailDeliveredNoProcessRequest() + { + $this->runMissingRequestTest( + EmailDelivered::class, + EmailDeliveredEvent::class, + 'X-ProcessMaker-Delivered-Message-Event-ID' + ); + } + + /** + * Test missing process request handling for EmailComplaint + */ + public function testEmailComplaintNoProcessRequest() + { + $this->runMissingRequestTest( + EmailComplaint::class, + ComplaintMessageEvent::class, + 'X-ProcessMaker-Complaint-Message-Event-ID' + ); + } + + /** + * Test missing process request handling for EmailViewed + */ + public function testEmailViewedNoProcessRequest() + { + $this->runMissingRequestTest( + EmailViewed::class, + ViewEmailEvent::class, + 'X-ProcessMaker-Viewed-Message-Event-ID' + ); + } + + /** + * Test missing process request handling for EmailLinkClicked + */ + public function testEmailLinkClickedNoProcessRequest() + { + $this->runMissingRequestTest( + EmailLinkClicked::class, + LinkClickedEvent::class, + 'X-ProcessMaker-Link-Clicked-Message-Event-ID' + ); + } + + /** + * Common test runner for missing process request scenarios + */ + private function runMissingRequestTest(string $handlerClass, string $eventClass, string $messageEventIdHeader) + { + // Delete the process request to simulate it not being found + $this->request->delete(); + + // Create the event handler + $handler = new $handlerClass(); + + // WorkflowManager should NOT be called when request isn't found + WorkflowManager::shouldReceive('triggerMessageEvent')->never(); + + // Create event mock with normal tracker + $trackerMock = $this->createTrackerMock($messageEventIdHeader); + $eventMock = Mockery::mock($eventClass); + $eventMock->sent_email = $trackerMock; + + // Call the handler - should not error when no request found + $handler->handle($eventMock); + } + + /** + * Test missing headers handling for EmailSent + */ + public function testEmailSentMissingHeaders() + { + $this->runMissingHeadersTest( + EmailSent::class, + EmailSentEvent::class, + 'X-ProcessMaker-Sent-Message-Event-ID' + ); + } + + /** + * Test missing headers handling for EmailDelivered + */ + public function testEmailDeliveredMissingHeaders() + { + $this->runMissingHeadersTest( + EmailDelivered::class, + EmailDeliveredEvent::class, + 'X-ProcessMaker-Delivered-Message-Event-ID' + ); + } + + /** + * Test missing headers handling for EmailComplaint + */ + public function testEmailComplaintMissingHeaders() + { + $this->runMissingHeadersTest( + EmailComplaint::class, + ComplaintMessageEvent::class, + 'X-ProcessMaker-Complaint-Message-Event-ID' + ); + } + + /** + * Test missing headers handling for EmailViewed + */ + public function testEmailViewedMissingHeaders() + { + $this->runMissingHeadersTest( + EmailViewed::class, + ViewEmailEvent::class, + 'X-ProcessMaker-Viewed-Message-Event-ID' + ); + } + + /** + * Test missing headers handling for EmailLinkClicked + */ + public function testEmailLinkClickedMissingHeaders() + { + $this->runMissingHeadersTest( + EmailLinkClicked::class, + LinkClickedEvent::class, + 'X-ProcessMaker-Link-Clicked-Message-Event-ID' + ); + } + + /** + * Common test runner for missing headers scenarios + */ + private function runMissingHeadersTest(string $handlerClass, string $eventClass, string $messageEventIdHeader) + { + // Create the event handler + $handler = new $handlerClass(); + + // WorkflowManager should NOT be called when headers missing + WorkflowManager::shouldReceive('triggerMessageEvent')->never(); + + // Create tracker mock with missing header + $trackerMock = Mockery::mock(SentEmail::class); + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Email-ID') + ->andReturn($this->emailId); + $trackerMock->shouldReceive('getHeader') + ->with($messageEventIdHeader) + ->andReturn(null); // Missing header! + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Request-ID') + ->andReturn($this->requestId); + + // Create event mock + $eventMock = Mockery::mock($eventClass); + $eventMock->sent_email = $trackerMock; + + // Call the handler - should not error when header missing + $handler->handle($eventMock); + } + + /** + * Helper method to create a tracker mock with standard headers + */ + protected function createTrackerMock(string $messageEventIdHeader) + { + $trackerMock = Mockery::mock(SentEmail::class); + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Email-ID') + ->andReturn($this->emailId); + $trackerMock->shouldReceive('getHeader') + ->with($messageEventIdHeader) + ->andReturn($this->messageEventId); + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Request-ID') + ->andReturn($this->requestId); + + return $trackerMock; + } + + /** + * Clean up after each test + */ + protected function tearDown(): void + { + parent::tearDown(); + Mockery::close(); + } +} From 06c60d6f0172e19d6f422a85de6c60a41ab8426c Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Fri, 23 May 2025 11:21:22 -0400 Subject: [PATCH 53/53] fix CR --- ProcessMaker/Events/BaseEmailEvent.php | 13 ++++--- tests/Feature/Events/EmailEventTest.php | 47 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/ProcessMaker/Events/BaseEmailEvent.php b/ProcessMaker/Events/BaseEmailEvent.php index 02e284a255..d70747ed32 100644 --- a/ProcessMaker/Events/BaseEmailEvent.php +++ b/ProcessMaker/Events/BaseEmailEvent.php @@ -67,11 +67,14 @@ public function processEmailEvent($event) ]); } } else { - Log::warning($this->getEventType() . ' but missing required headers', [ - 'email_id' => $emailIdentifier, - 'message_event_id' => $messageEventId, - 'request_id' => $requestIdentifier, - ]); + // Only log a warning if email tracking was explicitly enabled for this email + if ($emailIdentifier) { + Log::warning($this->getEventType() . ' but missing required headers', [ + 'email_id' => $emailIdentifier, + 'message_event_id' => $messageEventId, + 'request_id' => $requestIdentifier, + ]); + } } } catch (\Exception $e) { Log::error('Error handling ' . $this->getEventType() . ' event', [ diff --git a/tests/Feature/Events/EmailEventTest.php b/tests/Feature/Events/EmailEventTest.php index 1a2819b487..79a37a1e9a 100644 --- a/tests/Feature/Events/EmailEventTest.php +++ b/tests/Feature/Events/EmailEventTest.php @@ -3,6 +3,7 @@ namespace Tests\Feature\Events; use Illuminate\Support\Facades\Event; +use Illuminate\Support\Facades\Log; use jdavidbakr\MailTracker\Events\ComplaintMessageEvent; use jdavidbakr\MailTracker\Events\EmailDeliveredEvent; use jdavidbakr\MailTracker\Events\EmailSentEvent; @@ -422,6 +423,52 @@ protected function createTrackerMock(string $messageEventIdHeader) return $trackerMock; } + /** + * Test that emails without tracking enabled don't generate warning logs + */ + public function testEmailWithoutTrackingEnabled() + { + // Mock the Log facade using Laravel's built-in support + Log::shouldReceive('debug') + ->withAnyArgs() + ->atLeast(0); + + Log::shouldReceive('error') + ->withAnyArgs() + ->atLeast(0); + + // The important part - we should not see warnings about missing headers + // when no tracking headers are present + Log::shouldReceive('warning') + ->with(Mockery::pattern('/.*missing required headers.*/'), Mockery::any()) + ->never(); + + // Create an event handler (using EmailSent as an example) + $handler = new EmailSent(); + + // Create tracker mock with no tracking headers + $trackerMock = Mockery::mock(SentEmail::class); + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Email-ID') + ->andReturn(null); // No email ID header = tracking not enabled + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Sent-Message-Event-ID') + ->andReturn(null); + $trackerMock->shouldReceive('getHeader') + ->with('X-ProcessMaker-Request-ID') + ->andReturn(null); + + // Create event mock + $eventMock = Mockery::mock(EmailSentEvent::class); + $eventMock->sent_email = $trackerMock; + + // WorkflowManager should NOT be called when tracking not enabled + WorkflowManager::shouldReceive('triggerMessageEvent')->never(); + + // Call the handler - this should not throw an exception + $handler->handle($eventMock); + } + /** * Clean up after each test */