diff --git a/packagerepo/backend/workflows/auth_login.backup.backup.json b/packagerepo/backend/workflows/auth_login.backup.backup.json deleted file mode 100644 index d2fdfe8fc..000000000 --- a/packagerepo/backend/workflows/auth_login.backup.backup.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "name": "Authenticate User", - "active": false, - "nodes": [ - { - "id": "parse_body", - "name": "Parse Body", - "type": "packagerepo.parse_json", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "input": "$request.body", - "out": "credentials" - } - } - }, - { - "id": "validate_fields", - "name": "Validate Fields", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "condition": "$credentials.username == null || $credentials.password == null", - "then": "error_invalid_request", - "else": "verify_password" - } - } - }, - { - "id": "verify_password", - "name": "Verify Password", - "type": "packagerepo.auth_verify_password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "username": "$credentials.username", - "password": "$credentials.password", - "out": "user" - } - } - }, - { - "id": "check_verified", - "name": "Check Verified", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$user == null", - "then": "error_unauthorized", - "else": "generate_token" - } - } - }, - { - "id": "generate_token", - "name": "Generate Token", - "type": "packagerepo.auth_generate_jwt", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "subject": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400, - "out": "token" - } - } - }, - { - "id": "respond_success", - "name": "Respond Success", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "body": { - "ok": true, - "token": "$token", - "username": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400 - }, - "status": 200 - } - } - }, - { - "id": "error_invalid_request", - "name": "Error Invalid Request", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "message": "Missing username or password", - "status": 400 - } - } - }, - { - "id": "error_unauthorized", - "name": "Error Unauthorized", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Invalid username or password", - "status": 401 - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Login and generate JWT token" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/auth_login.backup.json b/packagerepo/backend/workflows/auth_login.backup.json deleted file mode 100644 index eb813981b..000000000 --- a/packagerepo/backend/workflows/auth_login.backup.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "name": "Authenticate User", - "active": false, - "nodes": [ - { - "id": "parse_body", - "name": "Parse Body", - "type": "packagerepo.parse_json", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Parse Body", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "input": "$request.body", - "out": "credentials" - } - } - } - }, - { - "id": "validate_fields", - "name": "Validate Fields", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Fields", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "condition": "$credentials.username == null || $credentials.password == null", - "then": "error_invalid_request", - "else": "verify_password" - } - } - } - }, - { - "id": "verify_password", - "name": "Verify Password", - "type": "packagerepo.auth_verify_password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Verify Password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "username": "$credentials.username", - "password": "$credentials.password", - "out": "user" - } - } - } - }, - { - "id": "check_verified", - "name": "Check Verified", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check Verified", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$user == null", - "then": "error_unauthorized", - "else": "generate_token" - } - } - } - }, - { - "id": "generate_token", - "name": "Generate Token", - "type": "packagerepo.auth_generate_jwt", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Generate Token", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "subject": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400, - "out": "token" - } - } - } - }, - { - "id": "respond_success", - "name": "Respond Success", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Respond Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "body": { - "ok": true, - "token": "$token", - "username": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400 - }, - "status": 200 - } - } - } - }, - { - "id": "error_invalid_request", - "name": "Error Invalid Request", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Error Invalid Request", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "message": "Missing username or password", - "status": 400 - } - } - } - }, - { - "id": "error_unauthorized", - "name": "Error Unauthorized", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Error Unauthorized", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Invalid username or password", - "status": 401 - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/auth_login.json b/packagerepo/backend/workflows/auth_login.json index eb813981b..0c17c442d 100644 --- a/packagerepo/backend/workflows/auth_login.json +++ b/packagerepo/backend/workflows/auth_login.json @@ -19,9 +19,17 @@ 100 ], "parameters": { + "name": "Parse Body", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "input": "$request.body", - "out": "credentials" + "parameters": { + "input": "$request.body", + "out": "credentials" + } } } } @@ -43,10 +51,18 @@ 100 ], "parameters": { + "name": "Validate Fields", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "condition": "$credentials.username == null || $credentials.password == null", - "then": "error_invalid_request", - "else": "verify_password" + "parameters": { + "condition": "$credentials.username == null || $credentials.password == null", + "then": "error_invalid_request", + "else": "verify_password" + } } } } @@ -68,10 +84,18 @@ 100 ], "parameters": { + "name": "Verify Password", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "username": "$credentials.username", - "password": "$credentials.password", - "out": "user" + "parameters": { + "username": "$credentials.username", + "password": "$credentials.password", + "out": "user" + } } } } @@ -93,10 +117,18 @@ 300 ], "parameters": { + "name": "Check Verified", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "condition": "$user == null", - "then": "error_unauthorized", - "else": "generate_token" + "parameters": { + "condition": "$user == null", + "then": "error_unauthorized", + "else": "generate_token" + } } } } @@ -118,11 +150,19 @@ 300 ], "parameters": { + "name": "Generate Token", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "subject": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400, - "out": "token" + "parameters": { + "subject": "$user.username", + "scopes": "$user.scopes", + "expires_in": 86400, + "out": "token" + } } } } @@ -144,15 +184,23 @@ 300 ], "parameters": { + "name": "Respond Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "body": { - "ok": true, - "token": "$token", - "username": "$user.username", - "scopes": "$user.scopes", - "expires_in": 86400 - }, - "status": 200 + "parameters": { + "body": { + "ok": true, + "token": "$token", + "username": "$user.username", + "scopes": "$user.scopes", + "expires_in": 86400 + }, + "status": 200 + } } } } @@ -174,9 +222,17 @@ 500 ], "parameters": { + "name": "Error Invalid Request", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "message": "Missing username or password", - "status": 400 + "parameters": { + "message": "Missing username or password", + "status": 400 + } } } } @@ -198,9 +254,17 @@ 500 ], "parameters": { + "name": "Error Unauthorized", + "typeVersion": 1, + "position": [ + 400, + 500 + ], "parameters": { - "message": "Invalid username or password", - "status": 401 + "parameters": { + "message": "Invalid username or password", + "status": 401 + } } } } diff --git a/packagerepo/backend/workflows/download_artifact.backup.backup.json b/packagerepo/backend/workflows/download_artifact.backup.backup.json deleted file mode 100644 index a8d691462..000000000 --- a/packagerepo/backend/workflows/download_artifact.backup.backup.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "name": "Download Artifact", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - }, - { - "id": "get_meta", - "name": "Get Meta", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "metadata" - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$metadata == null", - "then": "error_not_found", - "else": "read_blob" - } - } - }, - { - "id": "read_blob", - "name": "Read Blob", - "type": "packagerepo.blob_get", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "digest": "$metadata.digest", - "out": "blob_data" - } - } - }, - { - "id": "check_blob_exists", - "name": "Check Blob Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "condition": "$blob_data == null", - "then": "error_blob_missing", - "else": "respond_blob" - } - } - }, - { - "id": "respond_blob", - "name": "Respond Blob", - "type": "packagerepo.respond_blob", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "data": "$blob_data", - "headers": { - "Content-Type": "application/octet-stream", - "Content-Digest": "sha-256=$metadata.digest", - "Content-Length": "$metadata.size" - }, - "status": 200 - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Artifact not found", - "status": 404 - } - } - }, - { - "id": "error_blob_missing", - "name": "Error Blob Missing", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "parameters": { - "message": "Artifact blob data missing", - "status": 500 - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Download a package artifact blob" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/download_artifact.backup.json b/packagerepo/backend/workflows/download_artifact.backup.json deleted file mode 100644 index 81249e0d1..000000000 --- a/packagerepo/backend/workflows/download_artifact.backup.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "name": "Download Artifact", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Parse Path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" - } - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Normalize", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - } - }, - { - "id": "get_meta", - "name": "Get Meta", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Get Meta", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "metadata" - } - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check Exists", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$metadata == null", - "then": "error_not_found", - "else": "read_blob" - } - } - } - }, - { - "id": "read_blob", - "name": "Read Blob", - "type": "packagerepo.blob_get", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Read Blob", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "digest": "$metadata.digest", - "out": "blob_data" - } - } - } - }, - { - "id": "check_blob_exists", - "name": "Check Blob Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Check Blob Exists", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "condition": "$blob_data == null", - "then": "error_blob_missing", - "else": "respond_blob" - } - } - } - }, - { - "id": "respond_blob", - "name": "Respond Blob", - "type": "packagerepo.respond_blob", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Respond Blob", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "data": "$blob_data", - "headers": { - "Content-Type": "application/octet-stream", - "Content-Digest": "sha-256=$metadata.digest", - "Content-Length": "$metadata.size" - }, - "status": 200 - } - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Error Not Found", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Artifact not found", - "status": 404 - } - } - } - }, - { - "id": "error_blob_missing", - "name": "Error Blob Missing", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Error Blob Missing", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "parameters": { - "message": "Artifact blob data missing", - "status": 500 - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/download_artifact.json b/packagerepo/backend/workflows/download_artifact.json index 81249e0d1..2ebc2b93e 100644 --- a/packagerepo/backend/workflows/download_artifact.json +++ b/packagerepo/backend/workflows/download_artifact.json @@ -19,10 +19,18 @@ 100 ], "parameters": { + "name": "Parse Path", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" + "parameters": { + "path": "$request.path", + "pattern": "/v1/:namespace/:name/:version/:variant/blob", + "out": "entity" + } } } } @@ -44,9 +52,17 @@ 100 ], "parameters": { + "name": "Normalize", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "entity": "$entity", - "out": "normalized" + "parameters": { + "entity": "$entity", + "out": "normalized" + } } } } @@ -68,9 +84,17 @@ 100 ], "parameters": { + "name": "Get Meta", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "metadata" + "parameters": { + "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", + "out": "metadata" + } } } } @@ -92,10 +116,18 @@ 300 ], "parameters": { + "name": "Check Exists", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "condition": "$metadata == null", - "then": "error_not_found", - "else": "read_blob" + "parameters": { + "condition": "$metadata == null", + "then": "error_not_found", + "else": "read_blob" + } } } } @@ -117,9 +149,17 @@ 300 ], "parameters": { + "name": "Read Blob", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "digest": "$metadata.digest", - "out": "blob_data" + "parameters": { + "digest": "$metadata.digest", + "out": "blob_data" + } } } } @@ -141,10 +181,18 @@ 300 ], "parameters": { + "name": "Check Blob Exists", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "condition": "$blob_data == null", - "then": "error_blob_missing", - "else": "respond_blob" + "parameters": { + "condition": "$blob_data == null", + "then": "error_blob_missing", + "else": "respond_blob" + } } } } @@ -166,14 +214,22 @@ 500 ], "parameters": { + "name": "Respond Blob", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "data": "$blob_data", - "headers": { - "Content-Type": "application/octet-stream", - "Content-Digest": "sha-256=$metadata.digest", - "Content-Length": "$metadata.size" - }, - "status": 200 + "parameters": { + "data": "$blob_data", + "headers": { + "Content-Type": "application/octet-stream", + "Content-Digest": "sha-256=$metadata.digest", + "Content-Length": "$metadata.size" + }, + "status": 200 + } } } } @@ -195,9 +251,17 @@ 500 ], "parameters": { + "name": "Error Not Found", + "typeVersion": 1, + "position": [ + 400, + 500 + ], "parameters": { - "message": "Artifact not found", - "status": 404 + "parameters": { + "message": "Artifact not found", + "status": 404 + } } } } @@ -219,9 +283,17 @@ 500 ], "parameters": { + "name": "Error Blob Missing", + "typeVersion": 1, + "position": [ + 700, + 500 + ], "parameters": { - "message": "Artifact blob data missing", - "status": 500 + "parameters": { + "message": "Artifact blob data missing", + "status": 500 + } } } } diff --git a/packagerepo/backend/workflows/list_versions.backup.backup.json b/packagerepo/backend/workflows/list_versions.backup.backup.json deleted file mode 100644 index 20c7340a2..000000000 --- a/packagerepo/backend/workflows/list_versions.backup.backup.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "name": "List Package Versions", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/versions", - "out": "entity" - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - }, - { - "id": "query_index", - "name": "Query Index", - "type": "packagerepo.index_query", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$versions == null", - "then": "error_not_found", - "else": "enrich_versions" - } - } - }, - { - "id": "enrich_versions", - "name": "Enrich Versions", - "type": "packagerepo.enrich_version_list", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$versions", - "out": "enriched" - } - } - }, - { - "id": "respond_json", - "name": "Respond Json", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$enriched" - }, - "status": 200 - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "message": "Package not found", - "status": 404 - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List all versions of a package" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/list_versions.backup.json b/packagerepo/backend/workflows/list_versions.backup.json deleted file mode 100644 index 89719028e..000000000 --- a/packagerepo/backend/workflows/list_versions.backup.json +++ /dev/null @@ -1,192 +0,0 @@ -{ - "name": "List Package Versions", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Parse Path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/versions", - "out": "entity" - } - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Normalize", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - } - }, - { - "id": "query_index", - "name": "Query Index", - "type": "packagerepo.index_query", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Query Index", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" - } - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check Exists", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$versions == null", - "then": "error_not_found", - "else": "enrich_versions" - } - } - } - }, - { - "id": "enrich_versions", - "name": "Enrich Versions", - "type": "packagerepo.enrich_version_list", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Enrich Versions", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$versions", - "out": "enriched" - } - } - } - }, - { - "id": "respond_json", - "name": "Respond Json", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Respond Json", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$enriched" - }, - "status": 200 - } - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Error Not Found", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "message": "Package not found", - "status": 404 - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/list_versions.json b/packagerepo/backend/workflows/list_versions.json index 89719028e..8c4430191 100644 --- a/packagerepo/backend/workflows/list_versions.json +++ b/packagerepo/backend/workflows/list_versions.json @@ -19,10 +19,18 @@ 100 ], "parameters": { + "name": "Parse Path", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/versions", - "out": "entity" + "parameters": { + "path": "$request.path", + "pattern": "/v1/:namespace/:name/versions", + "out": "entity" + } } } } @@ -44,9 +52,17 @@ 100 ], "parameters": { + "name": "Normalize", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "entity": "$entity", - "out": "normalized" + "parameters": { + "entity": "$entity", + "out": "normalized" + } } } } @@ -68,9 +84,17 @@ 100 ], "parameters": { + "name": "Query Index", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" + "parameters": { + "key": "$entity.namespace/$entity.name", + "out": "versions" + } } } } @@ -92,10 +116,18 @@ 300 ], "parameters": { + "name": "Check Exists", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "condition": "$versions == null", - "then": "error_not_found", - "else": "enrich_versions" + "parameters": { + "condition": "$versions == null", + "then": "error_not_found", + "else": "enrich_versions" + } } } } @@ -117,11 +149,19 @@ 300 ], "parameters": { + "name": "Enrich Versions", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$versions", - "out": "enriched" + "parameters": { + "namespace": "$entity.namespace", + "name": "$entity.name", + "versions": "$versions", + "out": "enriched" + } } } } @@ -143,13 +183,21 @@ 300 ], "parameters": { + "name": "Respond Json", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "versions": "$enriched" - }, - "status": 200 + "parameters": { + "body": { + "namespace": "$entity.namespace", + "name": "$entity.name", + "versions": "$enriched" + }, + "status": 200 + } } } } @@ -171,9 +219,17 @@ 500 ], "parameters": { + "name": "Error Not Found", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "message": "Package not found", - "status": 404 + "parameters": { + "message": "Package not found", + "status": 404 + } } } } diff --git a/packagerepo/backend/workflows/publish_artifact.backup.backup.json b/packagerepo/backend/workflows/publish_artifact.backup.backup.json deleted file mode 100644 index 87f8928bf..000000000 --- a/packagerepo/backend/workflows/publish_artifact.backup.backup.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "name": "Publish Artifact", - "active": false, - "nodes": [ - { - "id": "verify_auth", - "name": "Verify Auth", - "type": "packagerepo.auth_verify_jwt", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "token": "$request.headers.Authorization", - "out": "principal" - } - } - }, - { - "id": "check_write_scope", - "name": "Check Write Scope", - "type": "packagerepo.auth_check_scopes", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "principal": "$principal", - "required_scopes": [ - "write" - ] - } - } - }, - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - }, - { - "id": "validate", - "name": "Validate", - "type": "packagerepo.validate_entity", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "entity": "$normalized" - } - } - }, - { - "id": "compute_digest", - "name": "Compute Digest", - "type": "string.sha256", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "input": "$request.body", - "out": "digest" - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "existing" - } - } - }, - { - "id": "if_exists", - "name": "If Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "condition": "$existing != null", - "then": "error_exists", - "else": "write_blob" - } - } - }, - { - "id": "write_blob", - "name": "Write Blob", - "type": "packagerepo.blob_put", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "parameters": { - "digest": "$digest", - "data": "$request.body" - } - } - }, - { - "id": "write_meta", - "name": "Write Meta", - "type": "packagerepo.kv_put", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "value": { - "digest": "$digest", - "size": "$request.content_length", - "uploaded_at": "$timestamp", - "uploaded_by": "$principal.sub" - } - } - } - }, - { - "id": "update_index", - "name": "Update Index", - "type": "packagerepo.index_upsert", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "entry": { - "version": "$entity.version", - "variant": "$entity.variant", - "digest": "$digest" - } - } - } - }, - { - "id": "success", - "name": "Success", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "parameters": { - "body": { - "ok": true, - "digest": "$digest" - }, - "status": 201 - } - } - }, - { - "id": "error_exists", - "name": "Error Exists", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "parameters": { - "message": "Artifact already exists", - "status": 409 - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Upload and store a package artifact" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/publish_artifact.backup.json b/packagerepo/backend/workflows/publish_artifact.backup.json deleted file mode 100644 index 3b1e02b36..000000000 --- a/packagerepo/backend/workflows/publish_artifact.backup.json +++ /dev/null @@ -1,343 +0,0 @@ -{ - "name": "Publish Artifact", - "active": false, - "nodes": [ - { - "id": "verify_auth", - "name": "Verify Auth", - "type": "packagerepo.auth_verify_jwt", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Verify Auth", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "token": "$request.headers.Authorization", - "out": "principal" - } - } - } - }, - { - "id": "check_write_scope", - "name": "Check Write Scope", - "type": "packagerepo.auth_check_scopes", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Check Write Scope", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "principal": "$principal", - "required_scopes": [ - "write" - ] - } - } - } - }, - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Parse Path", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" - } - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Normalize", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - } - }, - { - "id": "validate", - "name": "Validate", - "type": "packagerepo.validate_entity", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Validate", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "entity": "$normalized" - } - } - } - }, - { - "id": "compute_digest", - "name": "Compute Digest", - "type": "string.sha256", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Compute Digest", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "input": "$request.body", - "out": "digest" - } - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Check Exists", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "existing" - } - } - } - }, - { - "id": "if_exists", - "name": "If Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "If Exists", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "condition": "$existing != null", - "then": "error_exists", - "else": "write_blob" - } - } - } - }, - { - "id": "write_blob", - "name": "Write Blob", - "type": "packagerepo.blob_put", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Write Blob", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "parameters": { - "digest": "$digest", - "data": "$request.body" - } - } - } - }, - { - "id": "write_meta", - "name": "Write Meta", - "type": "packagerepo.kv_put", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Write Meta", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "value": { - "digest": "$digest", - "size": "$request.content_length", - "uploaded_at": "$timestamp", - "uploaded_by": "$principal.sub" - } - } - } - } - }, - { - "id": "update_index", - "name": "Update Index", - "type": "packagerepo.index_upsert", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Update Index", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "entry": { - "version": "$entity.version", - "variant": "$entity.variant", - "digest": "$digest" - } - } - } - } - }, - { - "id": "success", - "name": "Success", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Success", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "parameters": { - "body": { - "ok": true, - "digest": "$digest" - }, - "status": 201 - } - } - } - }, - { - "id": "error_exists", - "name": "Error Exists", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Error Exists", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "parameters": { - "message": "Artifact already exists", - "status": 409 - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/publish_artifact.json b/packagerepo/backend/workflows/publish_artifact.json index 3b1e02b36..c1d14ae01 100644 --- a/packagerepo/backend/workflows/publish_artifact.json +++ b/packagerepo/backend/workflows/publish_artifact.json @@ -19,9 +19,17 @@ 100 ], "parameters": { + "name": "Verify Auth", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "token": "$request.headers.Authorization", - "out": "principal" + "parameters": { + "token": "$request.headers.Authorization", + "out": "principal" + } } } } @@ -43,11 +51,19 @@ 100 ], "parameters": { + "name": "Check Write Scope", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "principal": "$principal", - "required_scopes": [ - "write" - ] + "parameters": { + "principal": "$principal", + "required_scopes": [ + "write" + ] + } } } } @@ -69,10 +85,18 @@ 100 ], "parameters": { + "name": "Parse Path", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/:version/:variant/blob", - "out": "entity" + "parameters": { + "path": "$request.path", + "pattern": "/v1/:namespace/:name/:version/:variant/blob", + "out": "entity" + } } } } @@ -94,9 +118,17 @@ 300 ], "parameters": { + "name": "Normalize", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "entity": "$entity", - "out": "normalized" + "parameters": { + "entity": "$entity", + "out": "normalized" + } } } } @@ -118,8 +150,16 @@ 300 ], "parameters": { + "name": "Validate", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "entity": "$normalized" + "parameters": { + "entity": "$normalized" + } } } } @@ -141,9 +181,17 @@ 300 ], "parameters": { + "name": "Compute Digest", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "input": "$request.body", - "out": "digest" + "parameters": { + "input": "$request.body", + "out": "digest" + } } } } @@ -165,9 +213,17 @@ 500 ], "parameters": { + "name": "Check Exists", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "out": "existing" + "parameters": { + "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", + "out": "existing" + } } } } @@ -189,10 +245,18 @@ 500 ], "parameters": { + "name": "If Exists", + "typeVersion": 1, + "position": [ + 400, + 500 + ], "parameters": { - "condition": "$existing != null", - "then": "error_exists", - "else": "write_blob" + "parameters": { + "condition": "$existing != null", + "then": "error_exists", + "else": "write_blob" + } } } } @@ -214,9 +278,17 @@ 500 ], "parameters": { + "name": "Write Blob", + "typeVersion": 1, + "position": [ + 700, + 500 + ], "parameters": { - "digest": "$digest", - "data": "$request.body" + "parameters": { + "digest": "$digest", + "data": "$request.body" + } } } } @@ -238,13 +310,21 @@ 700 ], "parameters": { + "name": "Write Meta", + "typeVersion": 1, + "position": [ + 100, + 700 + ], "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", - "value": { - "digest": "$digest", - "size": "$request.content_length", - "uploaded_at": "$timestamp", - "uploaded_by": "$principal.sub" + "parameters": { + "key": "artifact/$entity.namespace/$entity.name/$entity.version/$entity.variant", + "value": { + "digest": "$digest", + "size": "$request.content_length", + "uploaded_at": "$timestamp", + "uploaded_by": "$principal.sub" + } } } } @@ -267,12 +347,20 @@ 700 ], "parameters": { + "name": "Update Index", + "typeVersion": 1, + "position": [ + 400, + 700 + ], "parameters": { - "key": "$entity.namespace/$entity.name", - "entry": { - "version": "$entity.version", - "variant": "$entity.variant", - "digest": "$digest" + "parameters": { + "key": "$entity.namespace/$entity.name", + "entry": { + "version": "$entity.version", + "variant": "$entity.variant", + "digest": "$digest" + } } } } @@ -295,12 +383,20 @@ 700 ], "parameters": { + "name": "Success", + "typeVersion": 1, + "position": [ + 700, + 700 + ], "parameters": { - "body": { - "ok": true, - "digest": "$digest" - }, - "status": 201 + "parameters": { + "body": { + "ok": true, + "digest": "$digest" + }, + "status": 201 + } } } } @@ -322,9 +418,17 @@ 900 ], "parameters": { + "name": "Error Exists", + "typeVersion": 1, + "position": [ + 100, + 900 + ], "parameters": { - "message": "Artifact already exists", - "status": 409 + "parameters": { + "message": "Artifact already exists", + "status": 409 + } } } } diff --git a/packagerepo/backend/workflows/resolve_latest.backup.backup.json b/packagerepo/backend/workflows/resolve_latest.backup.backup.json deleted file mode 100644 index af03f9f5a..000000000 --- a/packagerepo/backend/workflows/resolve_latest.backup.backup.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "name": "Resolve Latest Version", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/latest", - "out": "entity" - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - }, - { - "id": "query_index", - "name": "Query Index", - "type": "packagerepo.index_query", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$versions == null || $versions.length == 0", - "then": "error_not_found", - "else": "find_latest" - } - } - }, - { - "id": "find_latest", - "name": "Find Latest", - "type": "packagerepo.resolve_latest_version", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "versions": "$versions", - "out": "latest" - } - } - }, - { - "id": "get_meta", - "name": "Get Meta", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$latest.version/$latest.variant", - "out": "metadata" - } - } - }, - { - "id": "respond_json", - "name": "Respond Json", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "version": "$latest.version", - "variant": "$latest.variant", - "digest": "$latest.digest", - "size": "$metadata.size", - "uploaded_at": "$metadata.uploaded_at" - }, - "status": 200 - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Package not found", - "status": 404 - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Get the latest version of a package" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/resolve_latest.backup.json b/packagerepo/backend/workflows/resolve_latest.backup.json deleted file mode 100644 index 6f6713cc3..000000000 --- a/packagerepo/backend/workflows/resolve_latest.backup.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "name": "Resolve Latest Version", - "active": false, - "nodes": [ - { - "id": "parse_path", - "name": "Parse Path", - "type": "packagerepo.parse_path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Parse Path", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/latest", - "out": "entity" - } - } - } - }, - { - "id": "normalize", - "name": "Normalize", - "type": "packagerepo.normalize_entity", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Normalize", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "entity": "$entity", - "out": "normalized" - } - } - } - }, - { - "id": "query_index", - "name": "Query Index", - "type": "packagerepo.index_query", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Query Index", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" - } - } - } - }, - { - "id": "check_exists", - "name": "Check Exists", - "type": "logic.if", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check Exists", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "condition": "$versions == null || $versions.length == 0", - "then": "error_not_found", - "else": "find_latest" - } - } - } - }, - { - "id": "find_latest", - "name": "Find Latest", - "type": "packagerepo.resolve_latest_version", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Find Latest", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "versions": "$versions", - "out": "latest" - } - } - } - }, - { - "id": "get_meta", - "name": "Get Meta", - "type": "packagerepo.kv_get", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Get Meta", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$latest.version/$latest.variant", - "out": "metadata" - } - } - } - }, - { - "id": "respond_json", - "name": "Respond Json", - "type": "packagerepo.respond_json", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Respond Json", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "version": "$latest.version", - "variant": "$latest.variant", - "digest": "$latest.digest", - "size": "$metadata.size", - "uploaded_at": "$metadata.uploaded_at" - }, - "status": 200 - } - } - } - }, - { - "id": "error_not_found", - "name": "Error Not Found", - "type": "packagerepo.respond_error", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Error Not Found", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "parameters": { - "message": "Package not found", - "status": 404 - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/resolve_latest.json b/packagerepo/backend/workflows/resolve_latest.json index 6f6713cc3..002ef7754 100644 --- a/packagerepo/backend/workflows/resolve_latest.json +++ b/packagerepo/backend/workflows/resolve_latest.json @@ -19,10 +19,18 @@ 100 ], "parameters": { + "name": "Parse Path", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "path": "$request.path", - "pattern": "/v1/:namespace/:name/latest", - "out": "entity" + "parameters": { + "path": "$request.path", + "pattern": "/v1/:namespace/:name/latest", + "out": "entity" + } } } } @@ -44,9 +52,17 @@ 100 ], "parameters": { + "name": "Normalize", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "entity": "$entity", - "out": "normalized" + "parameters": { + "entity": "$entity", + "out": "normalized" + } } } } @@ -68,9 +84,17 @@ 100 ], "parameters": { + "name": "Query Index", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "key": "$entity.namespace/$entity.name", - "out": "versions" + "parameters": { + "key": "$entity.namespace/$entity.name", + "out": "versions" + } } } } @@ -92,10 +116,18 @@ 300 ], "parameters": { + "name": "Check Exists", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "condition": "$versions == null || $versions.length == 0", - "then": "error_not_found", - "else": "find_latest" + "parameters": { + "condition": "$versions == null || $versions.length == 0", + "then": "error_not_found", + "else": "find_latest" + } } } } @@ -117,9 +149,17 @@ 300 ], "parameters": { + "name": "Find Latest", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "versions": "$versions", - "out": "latest" + "parameters": { + "versions": "$versions", + "out": "latest" + } } } } @@ -141,9 +181,17 @@ 300 ], "parameters": { + "name": "Get Meta", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "key": "artifact/$entity.namespace/$entity.name/$latest.version/$latest.variant", - "out": "metadata" + "parameters": { + "key": "artifact/$entity.namespace/$entity.name/$latest.version/$latest.variant", + "out": "metadata" + } } } } @@ -165,17 +213,25 @@ 500 ], "parameters": { + "name": "Respond Json", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "body": { - "namespace": "$entity.namespace", - "name": "$entity.name", - "version": "$latest.version", - "variant": "$latest.variant", - "digest": "$latest.digest", - "size": "$metadata.size", - "uploaded_at": "$metadata.uploaded_at" - }, - "status": 200 + "parameters": { + "body": { + "namespace": "$entity.namespace", + "name": "$entity.name", + "version": "$latest.version", + "variant": "$latest.variant", + "digest": "$latest.digest", + "size": "$metadata.size", + "uploaded_at": "$metadata.uploaded_at" + }, + "status": 200 + } } } } @@ -197,9 +253,17 @@ 500 ], "parameters": { + "name": "Error Not Found", + "typeVersion": 1, + "position": [ + 400, + 500 + ], "parameters": { - "message": "Package not found", - "status": 404 + "parameters": { + "message": "Package not found", + "status": 404 + } } } } diff --git a/packagerepo/backend/workflows/server.backup.backup.json b/packagerepo/backend/workflows/server.backup.backup.json deleted file mode 100644 index 2349490ee..000000000 --- a/packagerepo/backend/workflows/server.backup.backup.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "name": "Package Repository Server", - "active": false, - "nodes": [ - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "name": "packagerepo", - "config": { - "MAX_CONTENT_LENGTH": 2147483648 - } - } - } - }, - { - "id": "register_publish", - "name": "Register Publish", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "path": "/v1/////blob", - "methods": [ - "PUT" - ], - "workflow": "publish_artifact", - "endpoint": "publish_artifact" - } - } - }, - { - "id": "register_download", - "name": "Register Download", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "path": "/v1/////blob", - "methods": [ - "GET" - ], - "workflow": "download_artifact", - "endpoint": "download_artifact" - } - } - }, - { - "id": "register_latest", - "name": "Register Latest", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "path": "/v1///latest", - "methods": [ - "GET" - ], - "workflow": "resolve_latest", - "endpoint": "resolve_latest" - } - } - }, - { - "id": "register_versions", - "name": "Register Versions", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "path": "/v1///versions", - "methods": [ - "GET" - ], - "workflow": "list_versions", - "endpoint": "list_versions" - } - } - }, - { - "id": "register_login", - "name": "Register Login", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "path": "/auth/login", - "methods": [ - "POST" - ], - "workflow": "auth_login", - "endpoint": "auth_login" - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "host": "0.0.0.0", - "port": 8080, - "debug": false - } - } - } - ], - "connections": { - "Create App": { - "main": { - "0": [ - { - "node": "Register Publish", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Publish": { - "main": { - "0": [ - { - "node": "Register Download", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Download": { - "main": { - "0": [ - { - "node": "Register Latest", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Latest": { - "main": { - "0": [ - { - "node": "Register Versions", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Versions": { - "main": { - "0": [ - { - "node": "Register Login", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Login": { - "main": { - "0": [ - { - "node": "Start Server", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": { - "description": "Complete Flask server defined as a workflow" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/server.backup.json b/packagerepo/backend/workflows/server.backup.json deleted file mode 100644 index 9fc6b3c22..000000000 --- a/packagerepo/backend/workflows/server.backup.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "name": "Package Repository Server", - "active": false, - "nodes": [ - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create App", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "parameters": { - "name": "packagerepo", - "config": { - "MAX_CONTENT_LENGTH": 2147483648 - } - } - } - } - }, - { - "id": "register_publish", - "name": "Register Publish", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Register Publish", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "parameters": { - "path": "/v1/////blob", - "methods": [ - "PUT" - ], - "workflow": "publish_artifact", - "endpoint": "publish_artifact" - } - } - } - }, - { - "id": "register_download", - "name": "Register Download", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Register Download", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "parameters": { - "path": "/v1/////blob", - "methods": [ - "GET" - ], - "workflow": "download_artifact", - "endpoint": "download_artifact" - } - } - } - }, - { - "id": "register_latest", - "name": "Register Latest", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Register Latest", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "parameters": { - "path": "/v1///latest", - "methods": [ - "GET" - ], - "workflow": "resolve_latest", - "endpoint": "resolve_latest" - } - } - } - }, - { - "id": "register_versions", - "name": "Register Versions", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Register Versions", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "parameters": { - "path": "/v1///versions", - "methods": [ - "GET" - ], - "workflow": "list_versions", - "endpoint": "list_versions" - } - } - } - }, - { - "id": "register_login", - "name": "Register Login", - "type": "web.register_route", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Register Login", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "parameters": { - "path": "/auth/login", - "methods": [ - "POST" - ], - "workflow": "auth_login", - "endpoint": "auth_login" - } - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Start Server", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "parameters": { - "host": "0.0.0.0", - "port": 8080, - "debug": false - } - } - } - } - ], - "connections": { - "Create App": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Publish": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Download": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Latest": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Versions": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Login": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packagerepo/backend/workflows/server.json b/packagerepo/backend/workflows/server.json index 9fc6b3c22..74cffc0f3 100644 --- a/packagerepo/backend/workflows/server.json +++ b/packagerepo/backend/workflows/server.json @@ -19,10 +19,18 @@ 100 ], "parameters": { + "name": "Create App", + "typeVersion": 1, + "position": [ + 100, + 100 + ], "parameters": { - "name": "packagerepo", - "config": { - "MAX_CONTENT_LENGTH": 2147483648 + "parameters": { + "name": "packagerepo", + "config": { + "MAX_CONTENT_LENGTH": 2147483648 + } } } } @@ -45,13 +53,21 @@ 100 ], "parameters": { + "name": "Register Publish", + "typeVersion": 1, + "position": [ + 400, + 100 + ], "parameters": { - "path": "/v1/////blob", - "methods": [ - "PUT" - ], - "workflow": "publish_artifact", - "endpoint": "publish_artifact" + "parameters": { + "path": "/v1/////blob", + "methods": [ + "PUT" + ], + "workflow": "publish_artifact", + "endpoint": "publish_artifact" + } } } } @@ -73,13 +89,21 @@ 100 ], "parameters": { + "name": "Register Download", + "typeVersion": 1, + "position": [ + 700, + 100 + ], "parameters": { - "path": "/v1/////blob", - "methods": [ - "GET" - ], - "workflow": "download_artifact", - "endpoint": "download_artifact" + "parameters": { + "path": "/v1/////blob", + "methods": [ + "GET" + ], + "workflow": "download_artifact", + "endpoint": "download_artifact" + } } } } @@ -101,13 +125,21 @@ 300 ], "parameters": { + "name": "Register Latest", + "typeVersion": 1, + "position": [ + 100, + 300 + ], "parameters": { - "path": "/v1///latest", - "methods": [ - "GET" - ], - "workflow": "resolve_latest", - "endpoint": "resolve_latest" + "parameters": { + "path": "/v1///latest", + "methods": [ + "GET" + ], + "workflow": "resolve_latest", + "endpoint": "resolve_latest" + } } } } @@ -129,13 +161,21 @@ 300 ], "parameters": { + "name": "Register Versions", + "typeVersion": 1, + "position": [ + 400, + 300 + ], "parameters": { - "path": "/v1///versions", - "methods": [ - "GET" - ], - "workflow": "list_versions", - "endpoint": "list_versions" + "parameters": { + "path": "/v1///versions", + "methods": [ + "GET" + ], + "workflow": "list_versions", + "endpoint": "list_versions" + } } } } @@ -157,13 +197,21 @@ 300 ], "parameters": { + "name": "Register Login", + "typeVersion": 1, + "position": [ + 700, + 300 + ], "parameters": { - "path": "/auth/login", - "methods": [ - "POST" - ], - "workflow": "auth_login", - "endpoint": "auth_login" + "parameters": { + "path": "/auth/login", + "methods": [ + "POST" + ], + "workflow": "auth_login", + "endpoint": "auth_login" + } } } } @@ -185,10 +233,18 @@ 500 ], "parameters": { + "name": "Start Server", + "typeVersion": 1, + "position": [ + 100, + 500 + ], "parameters": { - "host": "0.0.0.0", - "port": 8080, - "debug": false + "parameters": { + "host": "0.0.0.0", + "port": 8080, + "debug": false + } } } } diff --git a/packages/audit_log/workflow/filters.backup.backup.jsonscript b/packages/audit_log/workflow/filters.backup.backup.jsonscript deleted file mode 100644 index bcbfe516f..000000000 --- a/packages/audit_log/workflow/filters.backup.backup.jsonscript +++ /dev/null @@ -1,112 +0,0 @@ -{ - "name": "Filter Audit Logs", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "tenantId": "{{ $context.tenantId }}", - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "userId": "{{ $json.userId }}", - "timestamp": { - "$gte": "{{ $json.startDate || new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString() }}", - "$lte": "{{ $json.endDate || new Date().toISOString() }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $steps.build_filter.output }}", - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== undefined && value !== null && (typeof value !== 'string' || value.length > 0)) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - }, - { - "id": "fetch_filtered", - "name": "Fetch Filtered", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "timestamp": -1 - }, - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "output": "results", - "operation": "database_read", - "entity": "AuditLog" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "filters": "{{ $json }}", - "count": "{{ $steps.fetch_filtered.output.length }}", - "results": "{{ $steps.fetch_filtered.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Advanced filtering of audit logs by action, entity, user, and date range" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/filters.backup.jsonscript b/packages/audit_log/workflow/filters.backup.jsonscript deleted file mode 100644 index 2ad62113b..000000000 --- a/packages/audit_log/workflow/filters.backup.jsonscript +++ /dev/null @@ -1,150 +0,0 @@ -{ - "name": "Filter Audit Logs", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "tenantId": "{{ $context.tenantId }}", - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "userId": "{{ $json.userId }}", - "timestamp": { - "$gte": "{{ $json.startDate || new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString() }}", - "$lte": "{{ $json.endDate || new Date().toISOString() }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Clean Filter", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $steps.build_filter.output }}", - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== undefined && value !== null && (typeof value !== 'string' || value.length > 0)) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_filtered", - "name": "Fetch Filtered", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Fetch Filtered", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "timestamp": -1 - }, - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "output": "results", - "operation": "database_read", - "entity": "AuditLog" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "filters": "{{ $json }}", - "count": "{{ $steps.fetch_filtered.output.length }}", - "results": "{{ $steps.fetch_filtered.output }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/filters.json b/packages/audit_log/workflow/filters.json new file mode 100644 index 000000000..5e02585e1 --- /dev/null +++ b/packages/audit_log/workflow/filters.json @@ -0,0 +1,190 @@ +{ + "name": "Filter Audit Logs", + "active": false, + "nodes": [ + { + "id": "validate_tenant", + "name": "Validate Tenant", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required", + "errorMessage": "tenantId is required" + } + } + } + }, + { + "id": "build_filter", + "name": "Build Filter", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": { + "tenantId": "{{ $context.tenantId }}", + "action": "{{ $json.action }}", + "entity": "{{ $json.entity }}", + "userId": "{{ $json.userId }}", + "timestamp": { + "$gte": "{{ $json.startDate || new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString() }}", + "$lte": "{{ $json.endDate || new Date().toISOString() }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "clean_filter", + "name": "Clean Filter", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Clean Filter", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Clean Filter", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $steps.build_filter.output }}", + "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== undefined && value !== null && (typeof value !== 'string' || value.length > 0)) acc[key] = value; return acc; }, {}) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_filtered", + "name": "Fetch Filtered", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Filtered", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Filtered", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": "{{ $steps.clean_filter.output }}", + "sort": { + "timestamp": -1 + }, + "limit": "{{ Math.min($json.limit || 100, 500) }}", + "output": "results", + "operation": "database_read", + "entity": "AuditLog" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "filters": "{{ $json }}", + "count": "{{ $steps.fetch_filtered.output.length }}", + "results": "{{ $steps.fetch_filtered.output }}" + } + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/audit_log/workflow/filters.jsonscript b/packages/audit_log/workflow/filters.jsonscript deleted file mode 100644 index 2ad62113b..000000000 --- a/packages/audit_log/workflow/filters.jsonscript +++ /dev/null @@ -1,150 +0,0 @@ -{ - "name": "Filter Audit Logs", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "tenantId": "{{ $context.tenantId }}", - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "userId": "{{ $json.userId }}", - "timestamp": { - "$gte": "{{ $json.startDate || new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString() }}", - "$lte": "{{ $json.endDate || new Date().toISOString() }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Clean Filter", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $steps.build_filter.output }}", - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== undefined && value !== null && (typeof value !== 'string' || value.length > 0)) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_filtered", - "name": "Fetch Filtered", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Fetch Filtered", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "timestamp": -1 - }, - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "output": "results", - "operation": "database_read", - "entity": "AuditLog" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "filters": "{{ $json }}", - "count": "{{ $steps.fetch_filtered.output.length }}", - "results": "{{ $steps.fetch_filtered.output }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/formatting.backup.backup.jsonscript b/packages/audit_log/workflow/formatting.backup.backup.jsonscript deleted file mode 100644 index 55253750a..000000000 --- a/packages/audit_log/workflow/formatting.backup.backup.jsonscript +++ /dev/null @@ -1,114 +0,0 @@ -{ - "name": "Format Audit Log Entry", - "active": false, - "nodes": [ - { - "id": "extract_log_id", - "name": "Extract Log Id", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": "{{ $json.id }}", - "operation": "transform_data" - } - }, - { - "id": "fetch_user_details", - "name": "Fetch User Details", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "output": "user", - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "format_timestamp", - "name": "Format Timestamp", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.timestamp }}", - "output": { - "iso": "{{ new Date($json.timestamp).toISOString() }}", - "formatted": "{{ new Date($json.timestamp).toLocaleString('en-US') }}", - "relative": "{{ Math.floor((Date.now() - new Date($json.timestamp).getTime()) / 1000) }} seconds ago" - }, - "operation": "transform_data" - } - }, - { - "id": "format_entry", - "name": "Format Entry", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "id": "{{ $json.id }}", - "user": { - "id": "{{ $steps.fetch_user_details.output.id }}", - "email": "{{ $steps.fetch_user_details.output.email }}", - "displayName": "{{ $steps.fetch_user_details.output.displayName }}" - }, - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "entityId": "{{ $json.entityId }}", - "changes": "{{ $json.changes }}", - "timestamp": "{{ $steps.format_timestamp.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}" - }, - "operation": "transform_data" - } - }, - { - "id": "return_formatted", - "name": "Return Formatted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": "{{ $steps.format_entry.output }}", - "action": "emit_event", - "event": "audit_formatted" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Format audit log entries with user and entity details for display" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/formatting.backup.jsonscript b/packages/audit_log/workflow/formatting.backup.jsonscript deleted file mode 100644 index 761ad67e1..000000000 --- a/packages/audit_log/workflow/formatting.backup.jsonscript +++ /dev/null @@ -1,152 +0,0 @@ -{ - "name": "Format Audit Log Entry", - "active": false, - "nodes": [ - { - "id": "extract_log_id", - "name": "Extract Log Id", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Extract Log Id", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": "{{ $json.id }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_user_details", - "name": "Fetch User Details", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User Details", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "output": "user", - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "format_timestamp", - "name": "Format Timestamp", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Format Timestamp", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.timestamp }}", - "output": { - "iso": "{{ new Date($json.timestamp).toISOString() }}", - "formatted": "{{ new Date($json.timestamp).toLocaleString('en-US') }}", - "relative": "{{ Math.floor((Date.now() - new Date($json.timestamp).getTime()) / 1000) }} seconds ago" - }, - "operation": "transform_data" - } - } - }, - { - "id": "format_entry", - "name": "Format Entry", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Entry", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "id": "{{ $json.id }}", - "user": { - "id": "{{ $steps.fetch_user_details.output.id }}", - "email": "{{ $steps.fetch_user_details.output.email }}", - "displayName": "{{ $steps.fetch_user_details.output.displayName }}" - }, - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "entityId": "{{ $json.entityId }}", - "changes": "{{ $json.changes }}", - "timestamp": "{{ $steps.format_timestamp.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_formatted", - "name": "Return Formatted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Formatted", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": "{{ $steps.format_entry.output }}", - "action": "emit_event", - "event": "audit_formatted" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/formatting.json b/packages/audit_log/workflow/formatting.json new file mode 100644 index 000000000..0c75bba29 --- /dev/null +++ b/packages/audit_log/workflow/formatting.json @@ -0,0 +1,192 @@ +{ + "name": "Format Audit Log Entry", + "active": false, + "nodes": [ + { + "id": "extract_log_id", + "name": "Extract Log Id", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Extract Log Id", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Extract Log Id", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": "{{ $json.id }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_user_details", + "name": "Fetch User Details", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Fetch User Details", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Fetch User Details", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "output": "user", + "operation": "database_read", + "entity": "User" + } + } + } + }, + { + "id": "format_timestamp", + "name": "Format Timestamp", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Format Timestamp", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Format Timestamp", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.timestamp }}", + "output": { + "iso": "{{ new Date($json.timestamp).toISOString() }}", + "formatted": "{{ new Date($json.timestamp).toLocaleString('en-US') }}", + "relative": "{{ Math.floor((Date.now() - new Date($json.timestamp).getTime()) / 1000) }} seconds ago" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "format_entry", + "name": "Format Entry", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Format Entry", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Format Entry", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "id": "{{ $json.id }}", + "user": { + "id": "{{ $steps.fetch_user_details.output.id }}", + "email": "{{ $steps.fetch_user_details.output.email }}", + "displayName": "{{ $steps.fetch_user_details.output.displayName }}" + }, + "action": "{{ $json.action }}", + "entity": "{{ $json.entity }}", + "entityId": "{{ $json.entityId }}", + "changes": "{{ $json.changes }}", + "timestamp": "{{ $steps.format_timestamp.output }}", + "ipAddress": "{{ $json.ipAddress }}", + "userAgent": "{{ $json.userAgent }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_formatted", + "name": "Return Formatted", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Formatted", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Formatted", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": "{{ $steps.format_entry.output }}", + "action": "emit_event", + "event": "audit_formatted" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/audit_log/workflow/formatting.jsonscript b/packages/audit_log/workflow/formatting.jsonscript deleted file mode 100644 index 761ad67e1..000000000 --- a/packages/audit_log/workflow/formatting.jsonscript +++ /dev/null @@ -1,152 +0,0 @@ -{ - "name": "Format Audit Log Entry", - "active": false, - "nodes": [ - { - "id": "extract_log_id", - "name": "Extract Log Id", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Extract Log Id", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": "{{ $json.id }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_user_details", - "name": "Fetch User Details", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User Details", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "output": "user", - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "format_timestamp", - "name": "Format Timestamp", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Format Timestamp", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.timestamp }}", - "output": { - "iso": "{{ new Date($json.timestamp).toISOString() }}", - "formatted": "{{ new Date($json.timestamp).toLocaleString('en-US') }}", - "relative": "{{ Math.floor((Date.now() - new Date($json.timestamp).getTime()) / 1000) }} seconds ago" - }, - "operation": "transform_data" - } - } - }, - { - "id": "format_entry", - "name": "Format Entry", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Entry", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "id": "{{ $json.id }}", - "user": { - "id": "{{ $steps.fetch_user_details.output.id }}", - "email": "{{ $steps.fetch_user_details.output.email }}", - "displayName": "{{ $steps.fetch_user_details.output.displayName }}" - }, - "action": "{{ $json.action }}", - "entity": "{{ $json.entity }}", - "entityId": "{{ $json.entityId }}", - "changes": "{{ $json.changes }}", - "timestamp": "{{ $steps.format_timestamp.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_formatted", - "name": "Return Formatted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Formatted", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": "{{ $steps.format_entry.output }}", - "action": "emit_event", - "event": "audit_formatted" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/init.backup.backup.jsonscript b/packages/audit_log/workflow/init.backup.backup.jsonscript deleted file mode 100644 index 2bf43c06c..000000000 --- a/packages/audit_log/workflow/init.backup.backup.jsonscript +++ /dev/null @@ -1,131 +0,0 @@ -{ - "name": "Load Audit Logs", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required for multi-tenant safety" - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 100) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_logs", - "name": "Fetch Logs", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "timestamp": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "output": "logs", - "operation": "database_read", - "entity": "AuditLog" - } - }, - { - "id": "fetch_count", - "name": "Fetch Count", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "output": "totalCount", - "operation": "database_count", - "entity": "AuditLog" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "input": "{{ $steps.fetch_logs.output }}", - "output": { - "logs": "{{ $steps.fetch_logs.output }}", - "pagination": { - "total": "{{ $steps.fetch_count.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "hasMore": "{{ $steps.fetch_count.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Load and paginate audit logs with tenant filtering" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/init.json b/packages/audit_log/workflow/init.json new file mode 100644 index 000000000..63ce42e87 --- /dev/null +++ b/packages/audit_log/workflow/init.json @@ -0,0 +1,225 @@ +{ + "name": "Load Audit Logs", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required", + "errorMessage": "tenantId is required for multi-tenant safety" + } + } + } + }, + { + "id": "extract_pagination", + "name": "Extract Pagination", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": { + "limit": "{{ Math.min($json.limit || 100, 500) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 100) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_logs", + "name": "Fetch Logs", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Logs", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Logs", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}" + }, + "sort": { + "timestamp": -1 + }, + "limit": "{{ $steps.extract_pagination.output.limit }}", + "offset": "{{ $steps.extract_pagination.output.offset }}", + "output": "logs", + "operation": "database_read", + "entity": "AuditLog" + } + } + } + }, + { + "id": "fetch_count", + "name": "Fetch Count", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Count", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Count", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}" + }, + "output": "totalCount", + "operation": "database_count", + "entity": "AuditLog" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "input": "{{ $steps.fetch_logs.output }}", + "output": { + "logs": "{{ $steps.fetch_logs.output }}", + "pagination": { + "total": "{{ $steps.fetch_count.output }}", + "limit": "{{ $steps.extract_pagination.output.limit }}", + "offset": "{{ $steps.extract_pagination.output.offset }}", + "hasMore": "{{ $steps.fetch_count.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/audit_log/workflow/stats.backup.backup.jsonscript b/packages/audit_log/workflow/stats.backup.backup.jsonscript deleted file mode 100644 index 3883fd24a..000000000 --- a/packages/audit_log/workflow/stats.backup.backup.jsonscript +++ /dev/null @@ -1,137 +0,0 @@ -{ - "name": "Calculate Audit Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - }, - { - "id": "get_date_range", - "name": "Get Date Range", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "startDate": "{{ new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString() }}", - "endDate": "{{ new Date().toISOString() }}" - }, - "operation": "transform_data" - } - }, - { - "id": "count_by_action", - "name": "Count By Action", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "action", - "aggregations": { - "count": "count" - }, - "output": "actionStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - }, - { - "id": "count_by_entity", - "name": "Count By Entity", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "entity", - "aggregations": { - "count": "count" - }, - "output": "entityStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "dateRange": "{{ $steps.get_date_range.output }}", - "actionStatistics": "{{ $steps.count_by_action.output }}", - "entityStatistics": "{{ $steps.count_by_entity.output }}", - "totalEntries": "{{ $steps.count_by_action.output.reduce((sum, item) => sum + item.count, 0) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Calculate audit log statistics (action counts, user activity)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/stats.backup.jsonscript b/packages/audit_log/workflow/stats.backup.jsonscript deleted file mode 100644 index ff2f095a5..000000000 --- a/packages/audit_log/workflow/stats.backup.jsonscript +++ /dev/null @@ -1,183 +0,0 @@ -{ - "name": "Calculate Audit Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - } - }, - { - "id": "get_date_range", - "name": "Get Date Range", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Get Date Range", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "startDate": "{{ new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString() }}", - "endDate": "{{ new Date().toISOString() }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "count_by_action", - "name": "Count By Action", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Count By Action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "action", - "aggregations": { - "count": "count" - }, - "output": "actionStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - } - }, - { - "id": "count_by_entity", - "name": "Count By Entity", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count By Entity", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "entity", - "aggregations": { - "count": "count" - }, - "output": "entityStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "dateRange": "{{ $steps.get_date_range.output }}", - "actionStatistics": "{{ $steps.count_by_action.output }}", - "entityStatistics": "{{ $steps.count_by_entity.output }}", - "totalEntries": "{{ $steps.count_by_action.output.reduce((sum, item) => sum + item.count, 0) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/audit_log/workflow/stats.json b/packages/audit_log/workflow/stats.json new file mode 100644 index 000000000..a53a21080 --- /dev/null +++ b/packages/audit_log/workflow/stats.json @@ -0,0 +1,231 @@ +{ + "name": "Calculate Audit Statistics", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required", + "errorMessage": "tenantId is required" + } + } + } + }, + { + "id": "get_date_range", + "name": "Get Date Range", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Get Date Range", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Get Date Range", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "startDate": "{{ new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString() }}", + "endDate": "{{ new Date().toISOString() }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "count_by_action", + "name": "Count By Action", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Count By Action", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Count By Action", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}", + "timestamp": { + "$gte": "{{ $steps.get_date_range.output.startDate }}", + "$lte": "{{ $steps.get_date_range.output.endDate }}" + } + }, + "groupBy": "action", + "aggregations": { + "count": "count" + }, + "output": "actionStats", + "operation": "database_aggregate", + "entity": "AuditLog" + } + } + } + }, + { + "id": "count_by_entity", + "name": "Count By Entity", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count By Entity", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count By Entity", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}", + "timestamp": { + "$gte": "{{ $steps.get_date_range.output.startDate }}", + "$lte": "{{ $steps.get_date_range.output.endDate }}" + } + }, + "groupBy": "entity", + "aggregations": { + "count": "count" + }, + "output": "entityStats", + "operation": "database_aggregate", + "entity": "AuditLog" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": { + "dateRange": "{{ $steps.get_date_range.output }}", + "actionStatistics": "{{ $steps.count_by_action.output }}", + "entityStatistics": "{{ $steps.count_by_entity.output }}", + "totalEntries": "{{ $steps.count_by_action.output.reduce((sum, item) => sum + item.count, 0) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/audit_log/workflow/stats.jsonscript b/packages/audit_log/workflow/stats.jsonscript deleted file mode 100644 index ff2f095a5..000000000 --- a/packages/audit_log/workflow/stats.jsonscript +++ /dev/null @@ -1,183 +0,0 @@ -{ - "name": "Calculate Audit Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required" - } - } - }, - { - "id": "get_date_range", - "name": "Get Date Range", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Get Date Range", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "startDate": "{{ new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString() }}", - "endDate": "{{ new Date().toISOString() }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "count_by_action", - "name": "Count By Action", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Count By Action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "action", - "aggregations": { - "count": "count" - }, - "output": "actionStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - } - }, - { - "id": "count_by_entity", - "name": "Count By Entity", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count By Entity", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "timestamp": { - "$gte": "{{ $steps.get_date_range.output.startDate }}", - "$lte": "{{ $steps.get_date_range.output.endDate }}" - } - }, - "groupBy": "entity", - "aggregations": { - "count": "count" - }, - "output": "entityStats", - "operation": "database_aggregate", - "entity": "AuditLog" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "dateRange": "{{ $steps.get_date_range.output }}", - "actionStatistics": "{{ $steps.count_by_action.output }}", - "entityStatistics": "{{ $steps.count_by_entity.output }}", - "totalEntries": "{{ $steps.count_by_action.output.reduce((sum, item) => sum + item.count, 0) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-dashboard-data.backup.backup.jsonscript b/packages/dashboard/workflow/fetch-dashboard-data.backup.backup.jsonscript deleted file mode 100644 index 10404aa00..000000000 --- a/packages/dashboard/workflow/fetch-dashboard-data.backup.backup.jsonscript +++ /dev/null @@ -1,179 +0,0 @@ -{ - "name": "Fetch Dashboard Data", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_user_profile_parallel", - "name": "Fetch User Profile Parallel", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "fetch_user", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "fetch_unread_notifications", - "op": "database_count", - "entity": "Notification", - "params": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - } - } - }, - { - "id": "fetch_recent_activity", - "op": "database_read", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": 5 - } - } - ] - } - }, - { - "id": "fetch_statistics", - "name": "Fetch Statistics", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_posts", - "op": "database_count", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_threads", - "op": "database_count", - "entity": "ForumThread", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_media", - "op": "database_count", - "entity": "MediaAsset", - "params": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - } - ] - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "profile": { - "id": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.avatar }}" - }, - "notifications": { - "unread": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_unread_notifications.output }}" - }, - "statistics": { - "posts": "{{ $steps.fetch_statistics.tasks.count_posts.output }}", - "threads": "{{ $steps.fetch_statistics.tasks.count_threads.output }}", - "mediaUploads": "{{ $steps.fetch_statistics.tasks.count_media.output }}" - }, - "recentActivity": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_recent_activity.output }}" - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Fetch all dashboard data in parallel (profile, stats, recent activity, notifications)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-dashboard-data.backup.jsonscript b/packages/dashboard/workflow/fetch-dashboard-data.backup.jsonscript deleted file mode 100644 index d20fafcf3..000000000 --- a/packages/dashboard/workflow/fetch-dashboard-data.backup.jsonscript +++ /dev/null @@ -1,217 +0,0 @@ -{ - "name": "Fetch Dashboard Data", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_user_profile_parallel", - "name": "Fetch User Profile Parallel", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User Profile Parallel", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "fetch_user", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "fetch_unread_notifications", - "op": "database_count", - "entity": "Notification", - "params": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - } - } - }, - { - "id": "fetch_recent_activity", - "op": "database_read", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": 5 - } - } - ] - } - } - }, - { - "id": "fetch_statistics", - "name": "Fetch Statistics", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Statistics", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_posts", - "op": "database_count", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_threads", - "op": "database_count", - "entity": "ForumThread", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_media", - "op": "database_count", - "entity": "MediaAsset", - "params": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - } - ] - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "profile": { - "id": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.avatar }}" - }, - "notifications": { - "unread": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_unread_notifications.output }}" - }, - "statistics": { - "posts": "{{ $steps.fetch_statistics.tasks.count_posts.output }}", - "threads": "{{ $steps.fetch_statistics.tasks.count_threads.output }}", - "mediaUploads": "{{ $steps.fetch_statistics.tasks.count_media.output }}" - }, - "recentActivity": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_recent_activity.output }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-dashboard-data.json b/packages/dashboard/workflow/fetch-dashboard-data.json new file mode 100644 index 000000000..82abafab8 --- /dev/null +++ b/packages/dashboard/workflow/fetch-dashboard-data.json @@ -0,0 +1,257 @@ +{ + "name": "Fetch Dashboard Data", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "fetch_user_profile_parallel", + "name": "Fetch User Profile Parallel", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Fetch User Profile Parallel", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Fetch User Profile Parallel", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "operation": "parallel", + "tasks": [ + { + "id": "fetch_user", + "op": "database_read", + "entity": "User", + "params": { + "filter": { + "id": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + } + } + }, + { + "id": "fetch_unread_notifications", + "op": "database_count", + "entity": "Notification", + "params": { + "filter": { + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isRead": false + } + } + }, + { + "id": "fetch_recent_activity", + "op": "database_read", + "entity": "ForumPost", + "params": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "sort": { + "createdAt": -1 + }, + "limit": 5 + } + } + ] + } + } + } + }, + { + "id": "fetch_statistics", + "name": "Fetch Statistics", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Statistics", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Statistics", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "operation": "parallel", + "tasks": [ + { + "id": "count_posts", + "op": "database_count", + "entity": "ForumPost", + "params": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + } + } + }, + { + "id": "count_threads", + "op": "database_count", + "entity": "ForumThread", + "params": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + } + } + }, + { + "id": "count_media", + "op": "database_count", + "entity": "MediaAsset", + "params": { + "filter": { + "uploadedBy": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + } + } + } + ] + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "profile": { + "id": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.id }}", + "email": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.email }}", + "displayName": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.displayName }}", + "avatar": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.avatar }}" + }, + "notifications": { + "unread": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_unread_notifications.output }}" + }, + "statistics": { + "posts": "{{ $steps.fetch_statistics.tasks.count_posts.output }}", + "threads": "{{ $steps.fetch_statistics.tasks.count_threads.output }}", + "mediaUploads": "{{ $steps.fetch_statistics.tasks.count_media.output }}" + }, + "recentActivity": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_recent_activity.output }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/dashboard/workflow/fetch-dashboard-data.jsonscript b/packages/dashboard/workflow/fetch-dashboard-data.jsonscript deleted file mode 100644 index d20fafcf3..000000000 --- a/packages/dashboard/workflow/fetch-dashboard-data.jsonscript +++ /dev/null @@ -1,217 +0,0 @@ -{ - "name": "Fetch Dashboard Data", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_user_profile_parallel", - "name": "Fetch User Profile Parallel", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User Profile Parallel", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "fetch_user", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "fetch_unread_notifications", - "op": "database_count", - "entity": "Notification", - "params": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - } - } - }, - { - "id": "fetch_recent_activity", - "op": "database_read", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": 5 - } - } - ] - } - } - }, - { - "id": "fetch_statistics", - "name": "Fetch Statistics", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Statistics", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_posts", - "op": "database_count", - "entity": "ForumPost", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_threads", - "op": "database_count", - "entity": "ForumThread", - "params": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_media", - "op": "database_count", - "entity": "MediaAsset", - "params": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - } - } - } - ] - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "profile": { - "id": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_user.output.avatar }}" - }, - "notifications": { - "unread": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_unread_notifications.output }}" - }, - "statistics": { - "posts": "{{ $steps.fetch_statistics.tasks.count_posts.output }}", - "threads": "{{ $steps.fetch_statistics.tasks.count_threads.output }}", - "mediaUploads": "{{ $steps.fetch_statistics.tasks.count_media.output }}" - }, - "recentActivity": "{{ $steps.fetch_user_profile_parallel.tasks.fetch_recent_activity.output }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-comments.backup.backup.jsonscript b/packages/dashboard/workflow/fetch-user-comments.backup.backup.jsonscript deleted file mode 100644 index 00a97687c..000000000 --- a/packages/dashboard/workflow/fetch-user-comments.backup.backup.jsonscript +++ /dev/null @@ -1,145 +0,0 @@ -{ - "name": "Fetch User Comments", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 20) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_comments", - "name": "Fetch Comments", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "ForumPost" - } - }, - { - "id": "enrich_with_thread_info", - "name": "Enrich With Thread Info", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $steps.fetch_comments.output }}", - "output": "{{ $steps.fetch_comments.output.map(post => ({ ...post, threadUrl: '/forum/thread/' + post.threadId })) }}", - "operation": "transform_data" - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "comments": "{{ $steps.enrich_with_thread_info.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Fetch recent comments/posts from current user with pagination" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-comments.backup.jsonscript b/packages/dashboard/workflow/fetch-user-comments.backup.jsonscript deleted file mode 100644 index 715b82bbb..000000000 --- a/packages/dashboard/workflow/fetch-user-comments.backup.jsonscript +++ /dev/null @@ -1,199 +0,0 @@ -{ - "name": "Fetch User Comments", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Pagination", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 20) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "fetch_comments", - "name": "Fetch Comments", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Comments", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "ForumPost" - } - } - }, - { - "id": "enrich_with_thread_info", - "name": "Enrich With Thread Info", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Enrich With Thread Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $steps.fetch_comments.output }}", - "output": "{{ $steps.fetch_comments.output.map(post => ({ ...post, threadUrl: '/forum/thread/' + post.threadId })) }}", - "operation": "transform_data" - } - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Count Total", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "comments": "{{ $steps.enrich_with_thread_info.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-comments.json b/packages/dashboard/workflow/fetch-user-comments.json new file mode 100644 index 000000000..8a33c41c8 --- /dev/null +++ b/packages/dashboard/workflow/fetch-user-comments.json @@ -0,0 +1,255 @@ +{ + "name": "Fetch User Comments", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "extract_pagination", + "name": "Extract Pagination", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "limit": "{{ Math.min($json.limit || 20, 100) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 20) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_comments", + "name": "Fetch Comments", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Comments", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Comments", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isDeleted": false + }, + "sort": { + "createdAt": -1 + }, + "limit": "{{ $steps.extract_pagination.output.limit }}", + "offset": "{{ $steps.extract_pagination.output.offset }}", + "operation": "database_read", + "entity": "ForumPost" + } + } + } + }, + { + "id": "enrich_with_thread_info", + "name": "Enrich With Thread Info", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Enrich With Thread Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Enrich With Thread Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "input": "{{ $steps.fetch_comments.output }}", + "output": "{{ $steps.fetch_comments.output.map(post => ({ ...post, threadUrl: '/forum/thread/' + post.threadId })) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "count_total", + "name": "Count Total", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Count Total", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Count Total", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isDeleted": false + }, + "operation": "database_count", + "entity": "ForumPost" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "output": { + "comments": "{{ $steps.enrich_with_thread_info.output }}", + "pagination": { + "total": "{{ $steps.count_total.output }}", + "page": "{{ $json.page || 1 }}", + "limit": "{{ $steps.extract_pagination.output.limit }}", + "hasMore": "{{ $steps.count_total.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/dashboard/workflow/fetch-user-comments.jsonscript b/packages/dashboard/workflow/fetch-user-comments.jsonscript deleted file mode 100644 index 715b82bbb..000000000 --- a/packages/dashboard/workflow/fetch-user-comments.jsonscript +++ /dev/null @@ -1,199 +0,0 @@ -{ - "name": "Fetch User Comments", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Pagination", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 20) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "fetch_comments", - "name": "Fetch Comments", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Comments", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "ForumPost" - } - } - }, - { - "id": "enrich_with_thread_info", - "name": "Enrich With Thread Info", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Enrich With Thread Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $steps.fetch_comments.output }}", - "output": "{{ $steps.fetch_comments.output.map(post => ({ ...post, threadUrl: '/forum/thread/' + post.threadId })) }}", - "operation": "transform_data" - } - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Count Total", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "comments": "{{ $steps.enrich_with_thread_info.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-profile.backup.backup.jsonscript b/packages/dashboard/workflow/fetch-user-profile.backup.backup.jsonscript deleted file mode 100644 index adf4da415..000000000 --- a/packages/dashboard/workflow/fetch-user-profile.backup.backup.jsonscript +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "Fetch User Profile", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "fetch_preferences", - "name": "Fetch Preferences", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "UserPreferences" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user.output.avatar }}", - "bio": "{{ $steps.fetch_user.output.bio }}", - "createdAt": "{{ $steps.fetch_user.output.createdAt }}", - "lastLogin": "{{ $steps.fetch_user.output.lastLogin }}", - "preferences": "{{ $steps.fetch_preferences.output }}" - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Fetch current user profile information including name, email, avatar" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-profile.backup.jsonscript b/packages/dashboard/workflow/fetch-user-profile.json similarity index 50% rename from packages/dashboard/workflow/fetch-user-profile.backup.jsonscript rename to packages/dashboard/workflow/fetch-user-profile.json index 63f023fca..125ae4af4 100644 --- a/packages/dashboard/workflow/fetch-user-profile.backup.jsonscript +++ b/packages/dashboard/workflow/fetch-user-profile.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } } } }, @@ -68,12 +84,20 @@ 100 ], "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "UserPreferences" + "name": "Fetch Preferences", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "UserPreferences" + } } } }, @@ -94,17 +118,25 @@ 300 ], "parameters": { - "output": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user.output.avatar }}", - "bio": "{{ $steps.fetch_user.output.bio }}", - "createdAt": "{{ $steps.fetch_user.output.createdAt }}", - "lastLogin": "{{ $steps.fetch_user.output.lastLogin }}", - "preferences": "{{ $steps.fetch_preferences.output }}" - }, - "operation": "transform_data" + "name": "Format Response", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "id": "{{ $steps.fetch_user.output.id }}", + "email": "{{ $steps.fetch_user.output.email }}", + "displayName": "{{ $steps.fetch_user.output.displayName }}", + "avatar": "{{ $steps.fetch_user.output.avatar }}", + "bio": "{{ $steps.fetch_user.output.bio }}", + "createdAt": "{{ $steps.fetch_user.output.createdAt }}", + "lastLogin": "{{ $steps.fetch_user.output.lastLogin }}", + "preferences": "{{ $steps.fetch_preferences.output }}" + }, + "operation": "transform_data" + } } } }, @@ -125,9 +157,17 @@ 300 ], "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } } } } diff --git a/packages/dashboard/workflow/fetch-user-profile.jsonscript b/packages/dashboard/workflow/fetch-user-profile.jsonscript deleted file mode 100644 index 63f023fca..000000000 --- a/packages/dashboard/workflow/fetch-user-profile.jsonscript +++ /dev/null @@ -1,145 +0,0 @@ -{ - "name": "Fetch User Profile", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "fetch_preferences", - "name": "Fetch Preferences", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Preferences", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "UserPreferences" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "avatar": "{{ $steps.fetch_user.output.avatar }}", - "bio": "{{ $steps.fetch_user.output.bio }}", - "createdAt": "{{ $steps.fetch_user.output.createdAt }}", - "lastLogin": "{{ $steps.fetch_user.output.lastLogin }}", - "preferences": "{{ $steps.fetch_preferences.output }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-stats.backup.backup.jsonscript b/packages/dashboard/workflow/fetch-user-stats.backup.backup.jsonscript deleted file mode 100644 index c40022e3a..000000000 --- a/packages/dashboard/workflow/fetch-user-stats.backup.backup.jsonscript +++ /dev/null @@ -1,148 +0,0 @@ -{ - "name": "Fetch User Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "count_forum_posts", - "name": "Count Forum Posts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - }, - { - "id": "count_forum_threads", - "name": "Count Forum Threads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - }, - { - "id": "count_media_uploads", - "name": "Count Media Uploads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "MediaAsset" - } - }, - { - "id": "calculate_engagement", - "name": "Calculate Engagement", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "aggregations": { - "totalLikes": "sum(likes)", - "avgScore": "avg(score)" - }, - "operation": "database_aggregate", - "entity": "ForumPost" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "forumPosts": "{{ $steps.count_forum_posts.output }}", - "forumThreads": "{{ $steps.count_forum_threads.output }}", - "mediaUploads": "{{ $steps.count_media_uploads.output }}", - "engagement": { - "totalLikes": "{{ $steps.calculate_engagement.output.totalLikes || 0 }}", - "averageScore": "{{ $steps.calculate_engagement.output.avgScore || 0 }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Calculate and fetch user statistics (posts, comments, activity, etc)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-stats.backup.jsonscript b/packages/dashboard/workflow/fetch-user-stats.backup.jsonscript deleted file mode 100644 index bbd30d644..000000000 --- a/packages/dashboard/workflow/fetch-user-stats.backup.jsonscript +++ /dev/null @@ -1,202 +0,0 @@ -{ - "name": "Fetch User Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "count_forum_posts", - "name": "Count Forum Posts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Count Forum Posts", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - } - }, - { - "id": "count_forum_threads", - "name": "Count Forum Threads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Count Forum Threads", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - } - }, - { - "id": "count_media_uploads", - "name": "Count Media Uploads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count Media Uploads", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "MediaAsset" - } - } - }, - { - "id": "calculate_engagement", - "name": "Calculate Engagement", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Engagement", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "aggregations": { - "totalLikes": "sum(likes)", - "avgScore": "avg(score)" - }, - "operation": "database_aggregate", - "entity": "ForumPost" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "forumPosts": "{{ $steps.count_forum_posts.output }}", - "forumThreads": "{{ $steps.count_forum_threads.output }}", - "mediaUploads": "{{ $steps.count_media_uploads.output }}", - "engagement": { - "totalLikes": "{{ $steps.calculate_engagement.output.totalLikes || 0 }}", - "averageScore": "{{ $steps.calculate_engagement.output.avgScore || 0 }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/dashboard/workflow/fetch-user-stats.json b/packages/dashboard/workflow/fetch-user-stats.json new file mode 100644 index 000000000..0b1c92f11 --- /dev/null +++ b/packages/dashboard/workflow/fetch-user-stats.json @@ -0,0 +1,258 @@ +{ + "name": "Fetch User Statistics", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "count_forum_posts", + "name": "Count Forum Posts", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Count Forum Posts", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Count Forum Posts", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isDeleted": false + }, + "operation": "database_count", + "entity": "ForumPost" + } + } + } + }, + { + "id": "count_forum_threads", + "name": "Count Forum Threads", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Count Forum Threads", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Count Forum Threads", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_count", + "entity": "ForumThread" + } + } + } + }, + { + "id": "count_media_uploads", + "name": "Count Media Uploads", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count Media Uploads", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count Media Uploads", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "uploadedBy": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_count", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "calculate_engagement", + "name": "Calculate Engagement", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Engagement", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Engagement", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "authorId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isDeleted": false + }, + "aggregations": { + "totalLikes": "sum(likes)", + "avgScore": "avg(score)" + }, + "operation": "database_aggregate", + "entity": "ForumPost" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "output": { + "forumPosts": "{{ $steps.count_forum_posts.output }}", + "forumThreads": "{{ $steps.count_forum_threads.output }}", + "mediaUploads": "{{ $steps.count_media_uploads.output }}", + "engagement": { + "totalLikes": "{{ $steps.calculate_engagement.output.totalLikes || 0 }}", + "averageScore": "{{ $steps.calculate_engagement.output.avgScore || 0 }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/dashboard/workflow/fetch-user-stats.jsonscript b/packages/dashboard/workflow/fetch-user-stats.jsonscript deleted file mode 100644 index bbd30d644..000000000 --- a/packages/dashboard/workflow/fetch-user-stats.jsonscript +++ /dev/null @@ -1,202 +0,0 @@ -{ - "name": "Fetch User Statistics", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "count_forum_posts", - "name": "Count Forum Posts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Count Forum Posts", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "operation": "database_count", - "entity": "ForumPost" - } - } - }, - { - "id": "count_forum_threads", - "name": "Count Forum Threads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Count Forum Threads", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - } - }, - { - "id": "count_media_uploads", - "name": "Count Media Uploads", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count Media Uploads", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "uploadedBy": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "MediaAsset" - } - } - }, - { - "id": "calculate_engagement", - "name": "Calculate Engagement", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Engagement", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "authorId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isDeleted": false - }, - "aggregations": { - "totalLikes": "sum(likes)", - "avgScore": "avg(score)" - }, - "operation": "database_aggregate", - "entity": "ForumPost" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "forumPosts": "{{ $steps.count_forum_posts.output }}", - "forumThreads": "{{ $steps.count_forum_threads.output }}", - "mediaUploads": "{{ $steps.count_media_uploads.output }}", - "engagement": { - "totalLikes": "{{ $steps.calculate_engagement.output.totalLikes || 0 }}", - "averageScore": "{{ $steps.calculate_engagement.output.avgScore || 0 }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/fetch-data.backup.backup.jsonscript b/packages/data_table/workflow/fetch-data.backup.backup.jsonscript deleted file mode 100644 index eec18f590..000000000 --- a/packages/data_table/workflow/fetch-data.backup.backup.jsonscript +++ /dev/null @@ -1,236 +0,0 @@ -{ - "name": "Fetch Data for Table", - "active": false, - "nodes": [ - { - "id": "validate_tenant_critical", - "name": "Validate Tenant Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is REQUIRED for multi-tenant safety - data leak prevention" - } - }, - { - "id": "validate_user_critical", - "name": "Validate User Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required", - "errorMessage": "userId is REQUIRED for row-level ACL" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "entity": "required|string", - "sortBy": "string", - "sortOrder": "string", - "limit": "number|max:500", - "page": "number|min:1" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "entity": "{{ $json.entity }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder === 'asc' ? 1 : -1 }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "searchTerm": "{{ $json.search || null }}", - "filters": "{{ $json.filters || {} }}" - }, - "operation": "transform_data" - } - }, - { - "id": "apply_user_acl", - "name": "Apply User Acl", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 || $build_filter.output.filters.userId === $context.user.id }}", - "operation": "condition" - } - }, - { - "id": "fetch_data", - "name": "Fetch Data", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "http_request", - "url": "{{ '/api/v1/' + $context.tenantId + '/' + $steps.extract_params.output.entity }}", - "method": "GET", - "queryParameters": { - "tenantId": "{{ $context.tenantId }}", - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "filters": "{{ JSON.stringify($steps.build_filter.output.filters) }}" - }, - "headers": { - "Authorization": "{{ 'Bearer ' + $context.token }}" - } - } - }, - { - "id": "validate_response", - "name": "Validate Response", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "condition": "{{ $steps.fetch_data.output.status === 200 }}", - "operation": "condition" - } - }, - { - "id": "parse_response", - "name": "Parse Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "input": "{{ $steps.fetch_data.output.body }}", - "output": { - "data": "{{ $steps.fetch_data.output.body.data }}", - "total": "{{ $steps.fetch_data.output.body.total }}" - }, - "operation": "transform_data" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "output": { - "data": "{{ $steps.parse_response.output.data }}", - "pagination": { - "total": "{{ $steps.parse_response.output.total }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.parse_response.output.total / $steps.extract_params.output.limit) }}" - }, - "sorting": { - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder === 1 ? 'asc' : 'desc' }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Fetch data with multi-tenant filtering, sorting, and pagination - CRITICAL for security" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/fetch-data.backup.jsonscript b/packages/data_table/workflow/fetch-data.backup.jsonscript deleted file mode 100644 index d87c5c3aa..000000000 --- a/packages/data_table/workflow/fetch-data.backup.jsonscript +++ /dev/null @@ -1,330 +0,0 @@ -{ - "name": "Fetch Data for Table", - "active": false, - "nodes": [ - { - "id": "validate_tenant_critical", - "name": "Validate Tenant Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant Critical", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is REQUIRED for multi-tenant safety - data leak prevention" - } - } - }, - { - "id": "validate_user_critical", - "name": "Validate User Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User Critical", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required", - "errorMessage": "userId is REQUIRED for row-level ACL" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "entity": "required|string", - "sortBy": "string", - "sortOrder": "string", - "limit": "number|max:500", - "page": "number|min:1" - } - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "entity": "{{ $json.entity }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder === 'asc' ? 1 : -1 }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "searchTerm": "{{ $json.search || null }}", - "filters": "{{ $json.filters || {} }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "apply_user_acl", - "name": "Apply User Acl", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Apply User Acl", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 || $build_filter.output.filters.userId === $context.user.id }}", - "operation": "condition" - } - } - }, - { - "id": "fetch_data", - "name": "Fetch Data", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Fetch Data", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "http_request", - "url": "{{ '/api/v1/' + $context.tenantId + '/' + $steps.extract_params.output.entity }}", - "method": "GET", - "queryParameters": { - "tenantId": "{{ $context.tenantId }}", - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "filters": "{{ JSON.stringify($steps.build_filter.output.filters) }}" - }, - "headers": { - "Authorization": "{{ 'Bearer ' + $context.token }}" - } - } - } - }, - { - "id": "validate_response", - "name": "Validate Response", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Validate Response", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "condition": "{{ $steps.fetch_data.output.status === 200 }}", - "operation": "condition" - } - } - }, - { - "id": "parse_response", - "name": "Parse Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Parse Response", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "input": "{{ $steps.fetch_data.output.body }}", - "output": { - "data": "{{ $steps.fetch_data.output.body.data }}", - "total": "{{ $steps.fetch_data.output.body.total }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "output": { - "data": "{{ $steps.parse_response.output.data }}", - "pagination": { - "total": "{{ $steps.parse_response.output.total }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.parse_response.output.total / $steps.extract_params.output.limit) }}" - }, - "sorting": { - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder === 1 ? 'asc' : 'desc' }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/fetch-data.json b/packages/data_table/workflow/fetch-data.json new file mode 100644 index 000000000..3bb62e2c4 --- /dev/null +++ b/packages/data_table/workflow/fetch-data.json @@ -0,0 +1,426 @@ +{ + "name": "Fetch Data for Table", + "active": false, + "nodes": [ + { + "id": "validate_tenant_critical", + "name": "Validate Tenant Critical", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant Critical", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant Critical", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required", + "errorMessage": "tenantId is REQUIRED for multi-tenant safety - data leak prevention" + } + } + } + }, + { + "id": "validate_user_critical", + "name": "Validate User Critical", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User Critical", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User Critical", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required", + "errorMessage": "userId is REQUIRED for row-level ACL" + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "entity": "required|string", + "sortBy": "string", + "sortOrder": "string", + "limit": "number|max:500", + "page": "number|min:1" + } + } + } + } + }, + { + "id": "extract_params", + "name": "Extract Params", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "entity": "{{ $json.entity }}", + "sortBy": "{{ $json.sortBy || 'createdAt' }}", + "sortOrder": "{{ $json.sortOrder === 'asc' ? 1 : -1 }}", + "limit": "{{ Math.min($json.limit || 50, 500) }}", + "page": "{{ $json.page || 1 }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "calculate_offset", + "name": "Calculate Offset", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "build_filter", + "name": "Build Filter", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "output": { + "tenantId": "{{ $context.tenantId }}", + "searchTerm": "{{ $json.search || null }}", + "filters": "{{ $json.filters || {} }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "apply_user_acl", + "name": "Apply User Acl", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Apply User Acl", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Apply User Acl", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "condition": "{{ $context.user.level >= 3 || $build_filter.output.filters.userId === $context.user.id }}", + "operation": "condition" + } + } + } + }, + { + "id": "fetch_data", + "name": "Fetch Data", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Fetch Data", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Fetch Data", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "operation": "http_request", + "url": "{{ '/api/v1/' + $context.tenantId + '/' + $steps.extract_params.output.entity }}", + "method": "GET", + "queryParameters": { + "tenantId": "{{ $context.tenantId }}", + "sortBy": "{{ $steps.extract_params.output.sortBy }}", + "sortOrder": "{{ $steps.extract_params.output.sortOrder }}", + "limit": "{{ $steps.extract_params.output.limit }}", + "offset": "{{ $steps.calculate_offset.output }}", + "filters": "{{ JSON.stringify($steps.build_filter.output.filters) }}" + }, + "headers": { + "Authorization": "{{ 'Bearer ' + $context.token }}" + } + } + } + } + }, + { + "id": "validate_response", + "name": "Validate Response", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Validate Response", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Validate Response", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "condition": "{{ $steps.fetch_data.output.status === 200 }}", + "operation": "condition" + } + } + } + }, + { + "id": "parse_response", + "name": "Parse Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "name": "Parse Response", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "name": "Parse Response", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "input": "{{ $steps.fetch_data.output.body }}", + "output": { + "data": "{{ $steps.fetch_data.output.body.data }}", + "total": "{{ $steps.fetch_data.output.body.total }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "output": { + "data": "{{ $steps.parse_response.output.data }}", + "pagination": { + "total": "{{ $steps.parse_response.output.total }}", + "page": "{{ $steps.extract_params.output.page }}", + "limit": "{{ $steps.extract_params.output.limit }}", + "totalPages": "{{ Math.ceil($steps.parse_response.output.total / $steps.extract_params.output.limit) }}" + }, + "sorting": { + "sortBy": "{{ $steps.extract_params.output.sortBy }}", + "sortOrder": "{{ $steps.extract_params.output.sortOrder === 1 ? 'asc' : 'desc' }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/data_table/workflow/fetch-data.jsonscript b/packages/data_table/workflow/fetch-data.jsonscript deleted file mode 100644 index d87c5c3aa..000000000 --- a/packages/data_table/workflow/fetch-data.jsonscript +++ /dev/null @@ -1,330 +0,0 @@ -{ - "name": "Fetch Data for Table", - "active": false, - "nodes": [ - { - "id": "validate_tenant_critical", - "name": "Validate Tenant Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant Critical", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is REQUIRED for multi-tenant safety - data leak prevention" - } - } - }, - { - "id": "validate_user_critical", - "name": "Validate User Critical", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User Critical", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required", - "errorMessage": "userId is REQUIRED for row-level ACL" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "entity": "required|string", - "sortBy": "string", - "sortOrder": "string", - "limit": "number|max:500", - "page": "number|min:1" - } - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "entity": "{{ $json.entity }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder === 'asc' ? 1 : -1 }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "searchTerm": "{{ $json.search || null }}", - "filters": "{{ $json.filters || {} }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "apply_user_acl", - "name": "Apply User Acl", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Apply User Acl", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 || $build_filter.output.filters.userId === $context.user.id }}", - "operation": "condition" - } - } - }, - { - "id": "fetch_data", - "name": "Fetch Data", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Fetch Data", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "http_request", - "url": "{{ '/api/v1/' + $context.tenantId + '/' + $steps.extract_params.output.entity }}", - "method": "GET", - "queryParameters": { - "tenantId": "{{ $context.tenantId }}", - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "filters": "{{ JSON.stringify($steps.build_filter.output.filters) }}" - }, - "headers": { - "Authorization": "{{ 'Bearer ' + $context.token }}" - } - } - } - }, - { - "id": "validate_response", - "name": "Validate Response", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Validate Response", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "condition": "{{ $steps.fetch_data.output.status === 200 }}", - "operation": "condition" - } - } - }, - { - "id": "parse_response", - "name": "Parse Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Parse Response", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "input": "{{ $steps.fetch_data.output.body }}", - "output": { - "data": "{{ $steps.fetch_data.output.body.data }}", - "total": "{{ $steps.fetch_data.output.body.total }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "output": { - "data": "{{ $steps.parse_response.output.data }}", - "pagination": { - "total": "{{ $steps.parse_response.output.total }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.parse_response.output.total / $steps.extract_params.output.limit) }}" - }, - "sorting": { - "sortBy": "{{ $steps.extract_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_params.output.sortOrder === 1 ? 'asc' : 'desc' }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/filtering.backup.backup.jsonscript b/packages/data_table/workflow/filtering.backup.backup.jsonscript deleted file mode 100644 index 4e34ed1cf..000000000 --- a/packages/data_table/workflow/filtering.backup.backup.jsonscript +++ /dev/null @@ -1,128 +0,0 @@ -{ - "name": "Handle Data Table Filtering", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_filters", - "name": "Extract Filters", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "status": "{{ $json.filters.status || null }}", - "searchTerm": "{{ $json.filters.search || '' }}", - "dateFrom": "{{ $json.filters.dateFrom || null }}", - "dateTo": "{{ $json.filters.dateTo || null }}" - }, - "operation": "transform_data" - } - }, - { - "id": "apply_status_filter", - "name": "Apply Status Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.status !== null }}", - "operation": "condition" - } - }, - { - "id": "apply_search_filter", - "name": "Apply Search Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.searchTerm.length > 0 }}", - "operation": "condition" - } - }, - { - "id": "apply_date_filter", - "name": "Apply Date Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.dateFrom !== null || $steps.extract_filters.output.dateTo !== null }}", - "operation": "condition" - } - }, - { - "id": "filter_data", - "name": "Filter Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.filter(item => { let match = true; if ($steps.extract_filters.output.status && item.status !== $steps.extract_filters.output.status) match = false; if ($steps.extract_filters.output.searchTerm && !JSON.stringify(item).toLowerCase().includes($steps.extract_filters.output.searchTerm.toLowerCase())) match = false; if ($steps.extract_filters.output.dateFrom && new Date(item.createdAt) < new Date($steps.extract_filters.output.dateFrom)) match = false; if ($steps.extract_filters.output.dateTo && new Date(item.createdAt) > new Date($steps.extract_filters.output.dateTo)) match = false; return match; }) }}", - "operation": "transform_data" - } - }, - { - "id": "return_filtered", - "name": "Return Filtered", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "filters": "{{ $steps.extract_filters.output }}", - "data": "{{ $steps.filter_data.output }}" - }, - "action": "emit_event", - "event": "data_filtered" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Apply filters to data while maintaining multi-tenant safety" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/filtering.backup.jsonscript b/packages/data_table/workflow/filtering.backup.jsonscript deleted file mode 100644 index 54b6b49bb..000000000 --- a/packages/data_table/workflow/filtering.backup.jsonscript +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "Handle Data Table Filtering", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_filters", - "name": "Extract Filters", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Filters", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "status": "{{ $json.filters.status || null }}", - "searchTerm": "{{ $json.filters.search || '' }}", - "dateFrom": "{{ $json.filters.dateFrom || null }}", - "dateTo": "{{ $json.filters.dateTo || null }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "apply_status_filter", - "name": "Apply Status Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Apply Status Filter", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.status !== null }}", - "operation": "condition" - } - } - }, - { - "id": "apply_search_filter", - "name": "Apply Search Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Apply Search Filter", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.searchTerm.length > 0 }}", - "operation": "condition" - } - } - }, - { - "id": "apply_date_filter", - "name": "Apply Date Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Apply Date Filter", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.dateFrom !== null || $steps.extract_filters.output.dateTo !== null }}", - "operation": "condition" - } - } - }, - { - "id": "filter_data", - "name": "Filter Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Filter Data", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.filter(item => { let match = true; if ($steps.extract_filters.output.status && item.status !== $steps.extract_filters.output.status) match = false; if ($steps.extract_filters.output.searchTerm && !JSON.stringify(item).toLowerCase().includes($steps.extract_filters.output.searchTerm.toLowerCase())) match = false; if ($steps.extract_filters.output.dateFrom && new Date(item.createdAt) < new Date($steps.extract_filters.output.dateFrom)) match = false; if ($steps.extract_filters.output.dateTo && new Date(item.createdAt) > new Date($steps.extract_filters.output.dateTo)) match = false; return match; }) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_filtered", - "name": "Return Filtered", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Filtered", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "filters": "{{ $steps.extract_filters.output }}", - "data": "{{ $steps.filter_data.output }}" - }, - "action": "emit_event", - "event": "data_filtered" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/filtering.json b/packages/data_table/workflow/filtering.json new file mode 100644 index 000000000..6c826eb46 --- /dev/null +++ b/packages/data_table/workflow/filtering.json @@ -0,0 +1,238 @@ +{ + "name": "Handle Data Table Filtering", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "extract_filters", + "name": "Extract Filters", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Filters", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Filters", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": { + "status": "{{ $json.filters.status || null }}", + "searchTerm": "{{ $json.filters.search || '' }}", + "dateFrom": "{{ $json.filters.dateFrom || null }}", + "dateTo": "{{ $json.filters.dateTo || null }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "apply_status_filter", + "name": "Apply Status Filter", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Apply Status Filter", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Apply Status Filter", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.extract_filters.output.status !== null }}", + "operation": "condition" + } + } + } + }, + { + "id": "apply_search_filter", + "name": "Apply Search Filter", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Apply Search Filter", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Apply Search Filter", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.extract_filters.output.searchTerm.length > 0 }}", + "operation": "condition" + } + } + } + }, + { + "id": "apply_date_filter", + "name": "Apply Date Filter", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Apply Date Filter", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Apply Date Filter", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "condition": "{{ $steps.extract_filters.output.dateFrom !== null || $steps.extract_filters.output.dateTo !== null }}", + "operation": "condition" + } + } + } + }, + { + "id": "filter_data", + "name": "Filter Data", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Filter Data", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Filter Data", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "input": "{{ $json.data }}", + "output": "{{ $json.data.filter(item => { let match = true; if ($steps.extract_filters.output.status && item.status !== $steps.extract_filters.output.status) match = false; if ($steps.extract_filters.output.searchTerm && !JSON.stringify(item).toLowerCase().includes($steps.extract_filters.output.searchTerm.toLowerCase())) match = false; if ($steps.extract_filters.output.dateFrom && new Date(item.createdAt) < new Date($steps.extract_filters.output.dateFrom)) match = false; if ($steps.extract_filters.output.dateTo && new Date(item.createdAt) > new Date($steps.extract_filters.output.dateTo)) match = false; return match; }) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "return_filtered", + "name": "Return Filtered", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Filtered", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Filtered", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "filters": "{{ $steps.extract_filters.output }}", + "data": "{{ $steps.filter_data.output }}" + }, + "action": "emit_event", + "event": "data_filtered" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/data_table/workflow/filtering.jsonscript b/packages/data_table/workflow/filtering.jsonscript deleted file mode 100644 index 54b6b49bb..000000000 --- a/packages/data_table/workflow/filtering.jsonscript +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "Handle Data Table Filtering", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_filters", - "name": "Extract Filters", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Filters", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "status": "{{ $json.filters.status || null }}", - "searchTerm": "{{ $json.filters.search || '' }}", - "dateFrom": "{{ $json.filters.dateFrom || null }}", - "dateTo": "{{ $json.filters.dateTo || null }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "apply_status_filter", - "name": "Apply Status Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Apply Status Filter", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.status !== null }}", - "operation": "condition" - } - } - }, - { - "id": "apply_search_filter", - "name": "Apply Search Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Apply Search Filter", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.searchTerm.length > 0 }}", - "operation": "condition" - } - } - }, - { - "id": "apply_date_filter", - "name": "Apply Date Filter", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Apply Date Filter", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.extract_filters.output.dateFrom !== null || $steps.extract_filters.output.dateTo !== null }}", - "operation": "condition" - } - } - }, - { - "id": "filter_data", - "name": "Filter Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Filter Data", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.filter(item => { let match = true; if ($steps.extract_filters.output.status && item.status !== $steps.extract_filters.output.status) match = false; if ($steps.extract_filters.output.searchTerm && !JSON.stringify(item).toLowerCase().includes($steps.extract_filters.output.searchTerm.toLowerCase())) match = false; if ($steps.extract_filters.output.dateFrom && new Date(item.createdAt) < new Date($steps.extract_filters.output.dateFrom)) match = false; if ($steps.extract_filters.output.dateTo && new Date(item.createdAt) > new Date($steps.extract_filters.output.dateTo)) match = false; return match; }) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_filtered", - "name": "Return Filtered", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Filtered", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "filters": "{{ $steps.extract_filters.output }}", - "data": "{{ $steps.filter_data.output }}" - }, - "action": "emit_event", - "event": "data_filtered" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/pagination.backup.backup.jsonscript b/packages/data_table/workflow/pagination.backup.backup.jsonscript deleted file mode 100644 index 1a9c6c543..000000000 --- a/packages/data_table/workflow/pagination.backup.backup.jsonscript +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "Handle Data Table Pagination", - "active": false, - "nodes": [ - { - "id": "extract_pagination_params", - "name": "Extract Pagination Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "page": "{{ Math.max($json.page || 1, 1) }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_pagination_params.output.page - 1) * $steps.extract_pagination_params.output.limit }}", - "operation": "transform_data" - } - }, - { - "id": "slice_data", - "name": "Slice Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.slice($steps.calculate_offset.output, $steps.calculate_offset.output + $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - }, - { - "id": "calculate_total_pages", - "name": "Calculate Total Pages", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ Math.ceil($json.data.length / $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - }, - { - "id": "return_paginated", - "name": "Return Paginated", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "data": "{{ $steps.slice_data.output }}", - "pagination": { - "page": "{{ $steps.extract_pagination_params.output.page }}", - "limit": "{{ $steps.extract_pagination_params.output.limit }}", - "total": "{{ $json.data.length }}", - "totalPages": "{{ $steps.calculate_total_pages.output }}", - "hasMore": "{{ $steps.extract_pagination_params.output.page < $steps.calculate_total_pages.output }}" - } - }, - "action": "emit_event", - "event": "data_paginated" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Apply pagination logic to data results" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/pagination.backup.jsonscript b/packages/data_table/workflow/pagination.backup.jsonscript deleted file mode 100644 index ef495373b..000000000 --- a/packages/data_table/workflow/pagination.backup.jsonscript +++ /dev/null @@ -1,141 +0,0 @@ -{ - "name": "Handle Data Table Pagination", - "active": false, - "nodes": [ - { - "id": "extract_pagination_params", - "name": "Extract Pagination Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Extract Pagination Params", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "page": "{{ Math.max($json.page || 1, 1) }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_pagination_params.output.page - 1) * $steps.extract_pagination_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "slice_data", - "name": "Slice Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Slice Data", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.slice($steps.calculate_offset.output, $steps.calculate_offset.output + $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - } - }, - { - "id": "calculate_total_pages", - "name": "Calculate Total Pages", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Calculate Total Pages", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ Math.ceil($json.data.length / $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_paginated", - "name": "Return Paginated", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Paginated", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "data": "{{ $steps.slice_data.output }}", - "pagination": { - "page": "{{ $steps.extract_pagination_params.output.page }}", - "limit": "{{ $steps.extract_pagination_params.output.limit }}", - "total": "{{ $json.data.length }}", - "totalPages": "{{ $steps.calculate_total_pages.output }}", - "hasMore": "{{ $steps.extract_pagination_params.output.page < $steps.calculate_total_pages.output }}" - } - }, - "action": "emit_event", - "event": "data_paginated" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/pagination.json b/packages/data_table/workflow/pagination.json new file mode 100644 index 000000000..4f8de394e --- /dev/null +++ b/packages/data_table/workflow/pagination.json @@ -0,0 +1,181 @@ +{ + "name": "Handle Data Table Pagination", + "active": false, + "nodes": [ + { + "id": "extract_pagination_params", + "name": "Extract Pagination Params", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Extract Pagination Params", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Extract Pagination Params", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": { + "page": "{{ Math.max($json.page || 1, 1) }}", + "limit": "{{ Math.min($json.limit || 50, 500) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "calculate_offset", + "name": "Calculate Offset", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": "{{ ($steps.extract_pagination_params.output.page - 1) * $steps.extract_pagination_params.output.limit }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "slice_data", + "name": "Slice Data", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Slice Data", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Slice Data", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.data }}", + "output": "{{ $json.data.slice($steps.calculate_offset.output, $steps.calculate_offset.output + $steps.extract_pagination_params.output.limit) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "calculate_total_pages", + "name": "Calculate Total Pages", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Calculate Total Pages", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Calculate Total Pages", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": "{{ Math.ceil($json.data.length / $steps.extract_pagination_params.output.limit) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "return_paginated", + "name": "Return Paginated", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Paginated", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Return Paginated", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "data": "{{ $steps.slice_data.output }}", + "pagination": { + "page": "{{ $steps.extract_pagination_params.output.page }}", + "limit": "{{ $steps.extract_pagination_params.output.limit }}", + "total": "{{ $json.data.length }}", + "totalPages": "{{ $steps.calculate_total_pages.output }}", + "hasMore": "{{ $steps.extract_pagination_params.output.page < $steps.calculate_total_pages.output }}" + } + }, + "action": "emit_event", + "event": "data_paginated" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/data_table/workflow/pagination.jsonscript b/packages/data_table/workflow/pagination.jsonscript deleted file mode 100644 index ef495373b..000000000 --- a/packages/data_table/workflow/pagination.jsonscript +++ /dev/null @@ -1,141 +0,0 @@ -{ - "name": "Handle Data Table Pagination", - "active": false, - "nodes": [ - { - "id": "extract_pagination_params", - "name": "Extract Pagination Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Extract Pagination Params", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "page": "{{ Math.max($json.page || 1, 1) }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_pagination_params.output.page - 1) * $steps.extract_pagination_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "slice_data", - "name": "Slice Data", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Slice Data", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.slice($steps.calculate_offset.output, $steps.calculate_offset.output + $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - } - }, - { - "id": "calculate_total_pages", - "name": "Calculate Total Pages", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Calculate Total Pages", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ Math.ceil($json.data.length / $steps.extract_pagination_params.output.limit) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_paginated", - "name": "Return Paginated", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Paginated", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "data": "{{ $steps.slice_data.output }}", - "pagination": { - "page": "{{ $steps.extract_pagination_params.output.page }}", - "limit": "{{ $steps.extract_pagination_params.output.limit }}", - "total": "{{ $json.data.length }}", - "totalPages": "{{ $steps.calculate_total_pages.output }}", - "hasMore": "{{ $steps.extract_pagination_params.output.page < $steps.calculate_total_pages.output }}" - } - }, - "action": "emit_event", - "event": "data_paginated" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/sorting.backup.backup.jsonscript b/packages/data_table/workflow/sorting.backup.backup.jsonscript deleted file mode 100644 index 3c204e828..000000000 --- a/packages/data_table/workflow/sorting.backup.backup.jsonscript +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "Handle Data Table Sorting", - "active": false, - "nodes": [ - { - "id": "extract_sort_params", - "name": "Extract Sort Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}" - }, - "operation": "transform_data" - } - }, - { - "id": "validate_sort_fields", - "name": "Validate Sort Fields", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ ['id', 'name', 'email', 'createdAt', 'updatedAt', 'status'].includes($steps.extract_sort_params.output.sortBy) }}", - "operation": "condition" - } - }, - { - "id": "apply_sort", - "name": "Apply Sort", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.sort((a, b) => { const aVal = a[$steps.extract_sort_params.output.sortBy]; const bVal = b[$steps.extract_sort_params.output.sortBy]; if ($steps.extract_sort_params.output.sortOrder === 'asc') return aVal > bVal ? 1 : -1; return aVal < bVal ? 1 : -1; }) }}", - "operation": "transform_data" - } - }, - { - "id": "return_sorted", - "name": "Return Sorted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "sortBy": "{{ $steps.extract_sort_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_sort_params.output.sortOrder }}", - "data": "{{ $steps.apply_sort.output }}" - }, - "action": "emit_event", - "event": "data_sorted" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Transform data based on sorting parameters" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/data_table/workflow/sorting.backup.jsonscript b/packages/data_table/workflow/sorting.json similarity index 50% rename from packages/data_table/workflow/sorting.backup.jsonscript rename to packages/data_table/workflow/sorting.json index 3014087b0..da3911c82 100644 --- a/packages/data_table/workflow/sorting.backup.jsonscript +++ b/packages/data_table/workflow/sorting.json @@ -19,12 +19,20 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "output": { - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}" - }, - "operation": "transform_data" + "name": "Extract Sort Params", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "output": { + "sortBy": "{{ $json.sortBy || 'createdAt' }}", + "sortOrder": "{{ $json.sortOrder || 'desc' }}" + }, + "operation": "transform_data" + } } } }, @@ -45,8 +53,16 @@ 100 ], "parameters": { - "condition": "{{ ['id', 'name', 'email', 'createdAt', 'updatedAt', 'status'].includes($steps.extract_sort_params.output.sortBy) }}", - "operation": "condition" + "name": "Validate Sort Fields", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "condition": "{{ ['id', 'name', 'email', 'createdAt', 'updatedAt', 'status'].includes($steps.extract_sort_params.output.sortBy) }}", + "operation": "condition" + } } } }, @@ -67,9 +83,17 @@ 100 ], "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.sort((a, b) => { const aVal = a[$steps.extract_sort_params.output.sortBy]; const bVal = b[$steps.extract_sort_params.output.sortBy]; if ($steps.extract_sort_params.output.sortOrder === 'asc') return aVal > bVal ? 1 : -1; return aVal < bVal ? 1 : -1; }) }}", - "operation": "transform_data" + "name": "Apply Sort", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.data }}", + "output": "{{ $json.data.sort((a, b) => { const aVal = a[$steps.extract_sort_params.output.sortBy]; const bVal = b[$steps.extract_sort_params.output.sortBy]; if ($steps.extract_sort_params.output.sortOrder === 'asc') return aVal > bVal ? 1 : -1; return aVal < bVal ? 1 : -1; }) }}", + "operation": "transform_data" + } } } }, @@ -90,13 +114,21 @@ 300 ], "parameters": { - "data": { - "sortBy": "{{ $steps.extract_sort_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_sort_params.output.sortOrder }}", - "data": "{{ $steps.apply_sort.output }}" - }, - "action": "emit_event", - "event": "data_sorted" + "name": "Return Sorted", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "data": { + "sortBy": "{{ $steps.extract_sort_params.output.sortBy }}", + "sortOrder": "{{ $steps.extract_sort_params.output.sortOrder }}", + "data": "{{ $steps.apply_sort.output }}" + }, + "action": "emit_event", + "event": "data_sorted" + } } } } diff --git a/packages/data_table/workflow/sorting.jsonscript b/packages/data_table/workflow/sorting.jsonscript deleted file mode 100644 index 3014087b0..000000000 --- a/packages/data_table/workflow/sorting.jsonscript +++ /dev/null @@ -1,114 +0,0 @@ -{ - "name": "Handle Data Table Sorting", - "active": false, - "nodes": [ - { - "id": "extract_sort_params", - "name": "Extract Sort Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Extract Sort Params", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "output": { - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "validate_sort_fields", - "name": "Validate Sort Fields", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Sort Fields", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ ['id', 'name', 'email', 'createdAt', 'updatedAt', 'status'].includes($steps.extract_sort_params.output.sortBy) }}", - "operation": "condition" - } - } - }, - { - "id": "apply_sort", - "name": "Apply Sort", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Apply Sort", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.data }}", - "output": "{{ $json.data.sort((a, b) => { const aVal = a[$steps.extract_sort_params.output.sortBy]; const bVal = b[$steps.extract_sort_params.output.sortBy]; if ($steps.extract_sort_params.output.sortOrder === 'asc') return aVal > bVal ? 1 : -1; return aVal < bVal ? 1 : -1; }) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_sorted", - "name": "Return Sorted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Return Sorted", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "sortBy": "{{ $steps.extract_sort_params.output.sortBy }}", - "sortOrder": "{{ $steps.extract_sort_params.output.sortOrder }}", - "data": "{{ $steps.apply_sort.output }}" - }, - "action": "emit_event", - "event": "data_sorted" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/create-post.backup.backup.jsonscript b/packages/forum_forge/workflow/create-post.backup.backup.jsonscript deleted file mode 100644 index f40357091..000000000 --- a/packages/forum_forge/workflow/create-post.backup.backup.jsonscript +++ /dev/null @@ -1,161 +0,0 @@ -{ - "name": "Create Forum Post", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "content": "required|string|minLength:3|maxLength:5000" - } - } - }, - { - "id": "check_thread_exists", - "name": "Check Thread Exists", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.threadId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumThread" - } - }, - { - "id": "check_thread_locked", - "name": "Check Thread Locked", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.check_thread_exists.output.isLocked !== true }}", - "operation": "condition" - } - }, - { - "id": "create_post", - "name": "Create Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}", - "content": "{{ $json.content }}", - "editedAt": null, - "isDeleted": false, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumPost" - } - }, - { - "id": "increment_thread_count", - "name": "Increment Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.threadId }}" - }, - "data": { - "postCount": "{{ $steps.check_thread_exists.output.postCount + 1 }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumThread" - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "postId": "{{ $steps.create_post.output.id }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "post_created", - "channel": "{{ 'forum:thread:' + $json.threadId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_post.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Create a new post (reply) in a forum thread" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/create-post.backup.jsonscript b/packages/forum_forge/workflow/create-post.backup.jsonscript deleted file mode 100644 index aa8d0e45f..000000000 --- a/packages/forum_forge/workflow/create-post.backup.jsonscript +++ /dev/null @@ -1,223 +0,0 @@ -{ - "name": "Create Forum Post", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "content": "required|string|minLength:3|maxLength:5000" - } - } - } - }, - { - "id": "check_thread_exists", - "name": "Check Thread Exists", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Thread Exists", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.threadId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumThread" - } - } - }, - { - "id": "check_thread_locked", - "name": "Check Thread Locked", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check Thread Locked", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.check_thread_exists.output.isLocked !== true }}", - "operation": "condition" - } - } - }, - { - "id": "create_post", - "name": "Create Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Post", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}", - "content": "{{ $json.content }}", - "editedAt": null, - "isDeleted": false, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumPost" - } - } - }, - { - "id": "increment_thread_count", - "name": "Increment Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Increment Thread Count", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.threadId }}" - }, - "data": { - "postCount": "{{ $steps.check_thread_exists.output.postCount + 1 }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumThread" - } - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Event", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "postId": "{{ $steps.create_post.output.id }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "post_created", - "channel": "{{ 'forum:thread:' + $json.threadId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_post.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/create-post.jsonscript b/packages/forum_forge/workflow/create-post.json similarity index 50% rename from packages/forum_forge/workflow/create-post.jsonscript rename to packages/forum_forge/workflow/create-post.json index aa8d0e45f..e5dfd2ab6 100644 --- a/packages/forum_forge/workflow/create-post.jsonscript +++ b/packages/forum_forge/workflow/create-post.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,10 +50,18 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "content": "required|string|minLength:3|maxLength:5000" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "content": "required|string|minLength:3|maxLength:5000" + } } } } @@ -67,12 +83,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.threadId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumThread" + "name": "Check Thread Exists", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.threadId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "ForumThread" + } } } }, @@ -93,8 +117,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.check_thread_exists.output.isLocked !== true }}", - "operation": "condition" + "name": "Check Thread Locked", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.check_thread_exists.output.isLocked !== true }}", + "operation": "condition" + } } } }, @@ -115,17 +147,25 @@ 300 ], "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}", - "content": "{{ $json.content }}", - "editedAt": null, - "isDeleted": false, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumPost" + "name": "Create Post", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "tenantId": "{{ $context.tenantId }}", + "threadId": "{{ $json.threadId }}", + "authorId": "{{ $context.user.id }}", + "content": "{{ $json.content }}", + "editedAt": null, + "isDeleted": false, + "createdAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "ForumPost" + } } } }, @@ -146,15 +186,23 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $json.threadId }}" - }, - "data": { - "postCount": "{{ $steps.check_thread_exists.output.postCount + 1 }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumThread" + "name": "Increment Thread Count", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.threadId }}" + }, + "data": { + "postCount": "{{ $steps.check_thread_exists.output.postCount + 1 }}", + "updatedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "ForumThread" + } } } }, @@ -175,14 +223,22 @@ 500 ], "parameters": { - "data": { - "postId": "{{ $steps.create_post.output.id }}", - "threadId": "{{ $json.threadId }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "post_created", - "channel": "{{ 'forum:thread:' + $json.threadId }}" + "name": "Emit Event", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "postId": "{{ $steps.create_post.output.id }}", + "threadId": "{{ $json.threadId }}", + "authorId": "{{ $context.user.id }}" + }, + "action": "emit_event", + "event": "post_created", + "channel": "{{ 'forum:thread:' + $json.threadId }}" + } } } }, @@ -203,9 +259,17 @@ 500 ], "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_post.output }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": "{{ $steps.create_post.output }}" + } } } } diff --git a/packages/forum_forge/workflow/create-thread.backup.backup.jsonscript b/packages/forum_forge/workflow/create-thread.backup.backup.jsonscript deleted file mode 100644 index 1c0caa7ee..000000000 --- a/packages/forum_forge/workflow/create-thread.backup.backup.jsonscript +++ /dev/null @@ -1,142 +0,0 @@ -{ - "name": "Create Forum Thread", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.tenantId !== undefined }}", - "operation": "condition" - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.id !== undefined }}", - "operation": "condition" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "categoryId": "required|string", - "title": "required|string|minLength:3|maxLength:200", - "content": "required|string|minLength:10|maxLength:5000" - } - } - }, - { - "id": "generate_slug", - "name": "Generate Slug", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ $json.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') }}", - "operation": "transform_data" - } - }, - { - "id": "create_thread", - "name": "Create Thread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $json.categoryId }}", - "authorId": "{{ $context.user.id }}", - "title": "{{ $json.title }}", - "slug": "{{ $steps.generate_slug.output }}", - "content": "{{ $json.content }}", - "viewCount": 0, - "postCount": 1, - "isLocked": false, - "isPinned": false, - "createdAt": "{{ new Date().toISOString() }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumThread" - } - }, - { - "id": "emit_created", - "name": "Emit Created", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "threadId": "{{ $steps.create_thread.output.id }}", - "title": "{{ $json.title }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "thread_created", - "channel": "{{ 'forum:' + $context.tenantId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_thread.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Create a new forum thread with validation and slug generation" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/create-thread.backup.jsonscript b/packages/forum_forge/workflow/create-thread.backup.jsonscript deleted file mode 100644 index d25650e6b..000000000 --- a/packages/forum_forge/workflow/create-thread.backup.jsonscript +++ /dev/null @@ -1,196 +0,0 @@ -{ - "name": "Create Forum Thread", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.tenantId !== undefined }}", - "operation": "condition" - } - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.id !== undefined }}", - "operation": "condition" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "categoryId": "required|string", - "title": "required|string|minLength:3|maxLength:200", - "content": "required|string|minLength:10|maxLength:5000" - } - } - } - }, - { - "id": "generate_slug", - "name": "Generate Slug", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Generate Slug", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ $json.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') }}", - "operation": "transform_data" - } - } - }, - { - "id": "create_thread", - "name": "Create Thread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Thread", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $json.categoryId }}", - "authorId": "{{ $context.user.id }}", - "title": "{{ $json.title }}", - "slug": "{{ $steps.generate_slug.output }}", - "content": "{{ $json.content }}", - "viewCount": 0, - "postCount": 1, - "isLocked": false, - "isPinned": false, - "createdAt": "{{ new Date().toISOString() }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumThread" - } - } - }, - { - "id": "emit_created", - "name": "Emit Created", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit Created", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "threadId": "{{ $steps.create_thread.output.id }}", - "title": "{{ $json.title }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "thread_created", - "channel": "{{ 'forum:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_thread.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/create-thread.json b/packages/forum_forge/workflow/create-thread.json new file mode 100644 index 000000000..6ccb79371 --- /dev/null +++ b/packages/forum_forge/workflow/create-thread.json @@ -0,0 +1,252 @@ +{ + "name": "Create Forum Thread", + "active": false, + "nodes": [ + { + "id": "validate_tenant", + "name": "Validate Tenant", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "condition": "{{ $context.tenantId !== undefined }}", + "operation": "condition" + } + } + } + }, + { + "id": "validate_user", + "name": "Validate User", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "condition": "{{ $context.user.id !== undefined }}", + "operation": "condition" + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "categoryId": "required|string", + "title": "required|string|minLength:3|maxLength:200", + "content": "required|string|minLength:10|maxLength:5000" + } + } + } + } + }, + { + "id": "generate_slug", + "name": "Generate Slug", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Generate Slug", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Generate Slug", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": "{{ $json.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "create_thread", + "name": "Create Thread", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Create Thread", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Create Thread", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "tenantId": "{{ $context.tenantId }}", + "categoryId": "{{ $json.categoryId }}", + "authorId": "{{ $context.user.id }}", + "title": "{{ $json.title }}", + "slug": "{{ $steps.generate_slug.output }}", + "content": "{{ $json.content }}", + "viewCount": 0, + "postCount": 1, + "isLocked": false, + "isPinned": false, + "createdAt": "{{ new Date().toISOString() }}", + "updatedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "ForumThread" + } + } + } + }, + { + "id": "emit_created", + "name": "Emit Created", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Emit Created", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Emit Created", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "threadId": "{{ $steps.create_thread.output.id }}", + "title": "{{ $json.title }}", + "authorId": "{{ $context.user.id }}" + }, + "action": "emit_event", + "event": "thread_created", + "channel": "{{ 'forum:' + $context.tenantId }}" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": "{{ $steps.create_thread.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/forum_forge/workflow/create-thread.jsonscript b/packages/forum_forge/workflow/create-thread.jsonscript deleted file mode 100644 index d25650e6b..000000000 --- a/packages/forum_forge/workflow/create-thread.jsonscript +++ /dev/null @@ -1,196 +0,0 @@ -{ - "name": "Create Forum Thread", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.tenantId !== undefined }}", - "operation": "condition" - } - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.id !== undefined }}", - "operation": "condition" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "categoryId": "required|string", - "title": "required|string|minLength:3|maxLength:200", - "content": "required|string|minLength:10|maxLength:5000" - } - } - } - }, - { - "id": "generate_slug", - "name": "Generate Slug", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Generate Slug", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": "{{ $json.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') }}", - "operation": "transform_data" - } - } - }, - { - "id": "create_thread", - "name": "Create Thread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Thread", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $json.categoryId }}", - "authorId": "{{ $context.user.id }}", - "title": "{{ $json.title }}", - "slug": "{{ $steps.generate_slug.output }}", - "content": "{{ $json.content }}", - "viewCount": 0, - "postCount": 1, - "isLocked": false, - "isPinned": false, - "createdAt": "{{ new Date().toISOString() }}", - "updatedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "ForumThread" - } - } - }, - { - "id": "emit_created", - "name": "Emit Created", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit Created", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "threadId": "{{ $steps.create_thread.output.id }}", - "title": "{{ $json.title }}", - "authorId": "{{ $context.user.id }}" - }, - "action": "emit_event", - "event": "thread_created", - "channel": "{{ 'forum:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": "{{ $steps.create_thread.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/delete-post.backup.backup.jsonscript b/packages/forum_forge/workflow/delete-post.backup.backup.jsonscript deleted file mode 100644 index 5703be4e0..000000000 --- a/packages/forum_forge/workflow/delete-post.backup.backup.jsonscript +++ /dev/null @@ -1,158 +0,0 @@ -{ - "name": "Delete Forum Post", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_post", - "name": "Fetch Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.postId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumPost" - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_post.output.authorId === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "soft_delete_post", - "name": "Soft Delete Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.postId }}" - }, - "data": { - "isDeleted": true, - "deletedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumPost" - } - }, - { - "id": "decrement_thread_count", - "name": "Decrement Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "operation": "database_read", - "entity": "ForumThread" - } - }, - { - "id": "update_thread_count", - "name": "Update Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "data": { - "postCount": "{{ Math.max($steps.decrement_thread_count.output.postCount - 1, 0) }}" - }, - "operation": "database_update", - "entity": "ForumThread" - } - }, - { - "id": "emit_deleted", - "name": "Emit Deleted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "postId": "{{ $json.postId }}" - }, - "action": "emit_event", - "event": "post_deleted", - "channel": "{{ 'forum:thread:' + $steps.fetch_post.output.threadId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Post deleted successfully" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Delete or soft-delete a forum post with authorization checks" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/delete-post.backup.jsonscript b/packages/forum_forge/workflow/delete-post.json similarity index 52% rename from packages/forum_forge/workflow/delete-post.backup.jsonscript rename to packages/forum_forge/workflow/delete-post.json index 2b85c07f4..a68c7829d 100644 --- a/packages/forum_forge/workflow/delete-post.backup.jsonscript +++ b/packages/forum_forge/workflow/delete-post.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.postId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumPost" + "name": "Fetch Post", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.postId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "ForumPost" + } } } }, @@ -68,8 +84,16 @@ 100 ], "parameters": { - "condition": "{{ $steps.fetch_post.output.authorId === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" + "name": "Check Authorization", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.fetch_post.output.authorId === $context.user.id || $context.user.level >= 3 }}", + "operation": "condition" + } } } }, @@ -90,15 +114,23 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $json.postId }}" - }, - "data": { - "isDeleted": true, - "deletedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumPost" + "name": "Soft Delete Post", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.postId }}" + }, + "data": { + "isDeleted": true, + "deletedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "ForumPost" + } } } }, @@ -119,11 +151,19 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "operation": "database_read", - "entity": "ForumThread" + "name": "Decrement Thread Count", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $steps.fetch_post.output.threadId }}" + }, + "operation": "database_read", + "entity": "ForumThread" + } } } }, @@ -144,14 +184,22 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "data": { - "postCount": "{{ Math.max($steps.decrement_thread_count.output.postCount - 1, 0) }}" - }, - "operation": "database_update", - "entity": "ForumThread" + "name": "Update Thread Count", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $steps.fetch_post.output.threadId }}" + }, + "data": { + "postCount": "{{ Math.max($steps.decrement_thread_count.output.postCount - 1, 0) }}" + }, + "operation": "database_update", + "entity": "ForumThread" + } } } }, @@ -172,12 +220,20 @@ 500 ], "parameters": { - "data": { - "postId": "{{ $json.postId }}" - }, - "action": "emit_event", - "event": "post_deleted", - "channel": "{{ 'forum:thread:' + $steps.fetch_post.output.threadId }}" + "name": "Emit Deleted", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "postId": "{{ $json.postId }}" + }, + "action": "emit_event", + "event": "post_deleted", + "channel": "{{ 'forum:thread:' + $steps.fetch_post.output.threadId }}" + } } } }, @@ -198,10 +254,18 @@ 500 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Post deleted successfully" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Post deleted successfully" + } } } } diff --git a/packages/forum_forge/workflow/delete-post.jsonscript b/packages/forum_forge/workflow/delete-post.jsonscript deleted file mode 100644 index 2b85c07f4..000000000 --- a/packages/forum_forge/workflow/delete-post.jsonscript +++ /dev/null @@ -1,220 +0,0 @@ -{ - "name": "Delete Forum Post", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_post", - "name": "Fetch Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch Post", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.postId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "ForumPost" - } - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Authorization", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_post.output.authorId === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" - } - } - }, - { - "id": "soft_delete_post", - "name": "Soft Delete Post", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Soft Delete Post", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.postId }}" - }, - "data": { - "isDeleted": true, - "deletedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "ForumPost" - } - } - }, - { - "id": "decrement_thread_count", - "name": "Decrement Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Decrement Thread Count", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "operation": "database_read", - "entity": "ForumThread" - } - } - }, - { - "id": "update_thread_count", - "name": "Update Thread Count", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Update Thread Count", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_post.output.threadId }}" - }, - "data": { - "postCount": "{{ Math.max($steps.decrement_thread_count.output.postCount - 1, 0) }}" - }, - "operation": "database_update", - "entity": "ForumThread" - } - } - }, - { - "id": "emit_deleted", - "name": "Emit Deleted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Deleted", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "postId": "{{ $json.postId }}" - }, - "action": "emit_event", - "event": "post_deleted", - "channel": "{{ 'forum:thread:' + $steps.fetch_post.output.threadId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Post deleted successfully" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/list-threads.backup.backup.jsonscript b/packages/forum_forge/workflow/list-threads.backup.backup.jsonscript deleted file mode 100644 index 19ff8b99e..000000000 --- a/packages/forum_forge/workflow/list-threads.backup.backup.jsonscript +++ /dev/null @@ -1,145 +0,0 @@ -{ - "name": "List Forum Threads", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "categoryId": "{{ $json.categoryId }}", - "sortBy": "{{ $json.sortBy || 'updatedAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - }, - { - "id": "fetch_threads", - "name": "Fetch Threads", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "operation": "database_read", - "entity": "ForumThread" - } - }, - { - "id": "fetch_total", - "name": "Fetch Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "threads": "{{ $steps.fetch_threads.output }}", - "pagination": { - "total": "{{ $steps.fetch_total.output }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.fetch_total.output / $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List forum threads in a category with pagination and sorting" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/list-threads.backup.jsonscript b/packages/forum_forge/workflow/list-threads.backup.jsonscript deleted file mode 100644 index 0da919f17..000000000 --- a/packages/forum_forge/workflow/list-threads.backup.jsonscript +++ /dev/null @@ -1,199 +0,0 @@ -{ - "name": "List Forum Threads", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "categoryId": "{{ $json.categoryId }}", - "sortBy": "{{ $json.sortBy || 'updatedAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_threads", - "name": "Fetch Threads", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Fetch Threads", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "operation": "database_read", - "entity": "ForumThread" - } - } - }, - { - "id": "fetch_total", - "name": "Fetch Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Fetch Total", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "threads": "{{ $steps.fetch_threads.output }}", - "pagination": { - "total": "{{ $steps.fetch_total.output }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.fetch_total.output / $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/forum_forge/workflow/list-threads.json b/packages/forum_forge/workflow/list-threads.json new file mode 100644 index 000000000..994c1f1eb --- /dev/null +++ b/packages/forum_forge/workflow/list-threads.json @@ -0,0 +1,255 @@ +{ + "name": "List Forum Threads", + "active": false, + "nodes": [ + { + "id": "validate_tenant", + "name": "Validate Tenant", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Tenant", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "extract_params", + "name": "Extract Params", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "categoryId": "{{ $json.categoryId }}", + "sortBy": "{{ $json.sortBy || 'updatedAt' }}", + "sortOrder": "{{ $json.sortOrder || 'desc' }}", + "limit": "{{ Math.min($json.limit || 20, 100) }}", + "page": "{{ $json.page || 1 }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "calculate_offset", + "name": "Calculate Offset", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Calculate Offset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_threads", + "name": "Fetch Threads", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Threads", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Fetch Threads", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}", + "categoryId": "{{ $steps.extract_params.output.categoryId }}" + }, + "sort": { + "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" + }, + "limit": "{{ $steps.extract_params.output.limit }}", + "offset": "{{ $steps.calculate_offset.output }}", + "operation": "database_read", + "entity": "ForumThread" + } + } + } + }, + { + "id": "fetch_total", + "name": "Fetch Total", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Fetch Total", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Fetch Total", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "tenantId": "{{ $context.tenantId }}", + "categoryId": "{{ $steps.extract_params.output.categoryId }}" + }, + "operation": "database_count", + "entity": "ForumThread" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "output": { + "threads": "{{ $steps.fetch_threads.output }}", + "pagination": { + "total": "{{ $steps.fetch_total.output }}", + "page": "{{ $steps.extract_params.output.page }}", + "limit": "{{ $steps.extract_params.output.limit }}", + "totalPages": "{{ Math.ceil($steps.fetch_total.output / $steps.extract_params.output.limit) }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/forum_forge/workflow/list-threads.jsonscript b/packages/forum_forge/workflow/list-threads.jsonscript deleted file mode 100644 index 0da919f17..000000000 --- a/packages/forum_forge/workflow/list-threads.jsonscript +++ /dev/null @@ -1,199 +0,0 @@ -{ - "name": "List Forum Threads", - "active": false, - "nodes": [ - { - "id": "validate_tenant", - "name": "Validate Tenant", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Tenant", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "categoryId": "{{ $json.categoryId }}", - "sortBy": "{{ $json.sortBy || 'updatedAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 20, 100) }}", - "page": "{{ $json.page || 1 }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "calculate_offset", - "name": "Calculate Offset", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Calculate Offset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": "{{ ($steps.extract_params.output.page - 1) * $steps.extract_params.output.limit }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_threads", - "name": "Fetch Threads", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Fetch Threads", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.calculate_offset.output }}", - "operation": "database_read", - "entity": "ForumThread" - } - } - }, - { - "id": "fetch_total", - "name": "Fetch Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Fetch Total", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "categoryId": "{{ $steps.extract_params.output.categoryId }}" - }, - "operation": "database_count", - "entity": "ForumThread" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "output": { - "threads": "{{ $steps.fetch_threads.output }}", - "pagination": { - "total": "{{ $steps.fetch_total.output }}", - "page": "{{ $steps.extract_params.output.page }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "totalPages": "{{ Math.ceil($steps.fetch_total.output / $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/handle-command.backup.backup.jsonscript b/packages/irc_webchat/workflow/handle-command.backup.backup.jsonscript deleted file mode 100644 index ec4c9f988..000000000 --- a/packages/irc_webchat/workflow/handle-command.backup.backup.jsonscript +++ /dev/null @@ -1,120 +0,0 @@ -{ - "name": "Handle IRC Commands", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "parse_command", - "name": "Parse Command", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "command": "{{ $json.message.split(' ')[0].substring(1).toLowerCase() }}", - "args": "{{ $json.message.split(' ').slice(1) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "handle_help", - "name": "Handle Help", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'help' }}", - "operation": "condition" - } - }, - { - "id": "handle_users", - "name": "Handle Users", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'users' }}", - "operation": "condition" - } - }, - { - "id": "handle_me", - "name": "Handle Me", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'me' }}", - "operation": "condition" - } - }, - { - "id": "handle_kick", - "name": "Handle Kick", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'kick' && $context.user.level >= 2 }}", - "operation": "condition" - } - }, - { - "id": "handle_ban", - "name": "Handle Ban", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'ban' && $context.user.level >= 3 }}", - "operation": "condition" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Process IRC commands (/help, /users, /me, /clear, /kick, /ban)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/handle-command.backup.jsonscript b/packages/irc_webchat/workflow/handle-command.json similarity index 57% rename from packages/irc_webchat/workflow/handle-command.backup.jsonscript rename to packages/irc_webchat/workflow/handle-command.json index 325bbcb59..ebb146fd6 100644 --- a/packages/irc_webchat/workflow/handle-command.backup.jsonscript +++ b/packages/irc_webchat/workflow/handle-command.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,11 +50,19 @@ 100 ], "parameters": { - "output": { - "command": "{{ $json.message.split(' ')[0].substring(1).toLowerCase() }}", - "args": "{{ $json.message.split(' ').slice(1) }}" - }, - "operation": "transform_data" + "name": "Parse Command", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "command": "{{ $json.message.split(' ')[0].substring(1).toLowerCase() }}", + "args": "{{ $json.message.split(' ').slice(1) }}" + }, + "operation": "transform_data" + } } } }, @@ -67,8 +83,16 @@ 100 ], "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'help' }}", - "operation": "condition" + "name": "Handle Help", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.parse_command.output.command === 'help' }}", + "operation": "condition" + } } } }, @@ -89,8 +113,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'users' }}", - "operation": "condition" + "name": "Handle Users", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.parse_command.output.command === 'users' }}", + "operation": "condition" + } } } }, @@ -111,8 +143,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'me' }}", - "operation": "condition" + "name": "Handle Me", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "condition": "{{ $steps.parse_command.output.command === 'me' }}", + "operation": "condition" + } } } }, @@ -133,8 +173,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'kick' && $context.user.level >= 2 }}", - "operation": "condition" + "name": "Handle Kick", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "condition": "{{ $steps.parse_command.output.command === 'kick' && $context.user.level >= 2 }}", + "operation": "condition" + } } } }, @@ -155,8 +203,16 @@ 500 ], "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'ban' && $context.user.level >= 3 }}", - "operation": "condition" + "name": "Handle Ban", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "condition": "{{ $steps.parse_command.output.command === 'ban' && $context.user.level >= 3 }}", + "operation": "condition" + } } } } diff --git a/packages/irc_webchat/workflow/handle-command.jsonscript b/packages/irc_webchat/workflow/handle-command.jsonscript deleted file mode 100644 index 325bbcb59..000000000 --- a/packages/irc_webchat/workflow/handle-command.jsonscript +++ /dev/null @@ -1,174 +0,0 @@ -{ - "name": "Handle IRC Commands", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "parse_command", - "name": "Parse Command", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Parse Command", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "command": "{{ $json.message.split(' ')[0].substring(1).toLowerCase() }}", - "args": "{{ $json.message.split(' ').slice(1) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "handle_help", - "name": "Handle Help", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Handle Help", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'help' }}", - "operation": "condition" - } - } - }, - { - "id": "handle_users", - "name": "Handle Users", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Handle Users", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'users' }}", - "operation": "condition" - } - } - }, - { - "id": "handle_me", - "name": "Handle Me", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Handle Me", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'me' }}", - "operation": "condition" - } - } - }, - { - "id": "handle_kick", - "name": "Handle Kick", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Handle Kick", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'kick' && $context.user.level >= 2 }}", - "operation": "condition" - } - } - }, - { - "id": "handle_ban", - "name": "Handle Ban", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Handle Ban", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $steps.parse_command.output.command === 'ban' && $context.user.level >= 3 }}", - "operation": "condition" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/join-channel.backup.backup.jsonscript b/packages/irc_webchat/workflow/join-channel.backup.backup.jsonscript deleted file mode 100644 index 02befe40b..000000000 --- a/packages/irc_webchat/workflow/join-channel.backup.backup.jsonscript +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "Join IRC Channel", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_channel", - "name": "Fetch Channel", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "IRCChannel" - } - }, - { - "id": "check_channel_mode", - "name": "Check Channel Mode", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_channel.output.mode === 'public' || ($context.user.level >= 2 && $steps.fetch_channel.output.mode === 'private') }}", - "operation": "condition" - } - }, - { - "id": "create_membership", - "name": "Create Membership", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "joinedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMembership" - } - }, - { - "id": "emit_join", - "name": "Emit Join", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "userId": "{{ $context.user.id }}", - "channelId": "{{ $json.channelId }}" - }, - "action": "emit_event", - "event": "user_joined", - "channel": "{{ 'irc:' + $json.channelId }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Add user to IRC channel with membership tracking" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/join-channel.backup.jsonscript b/packages/irc_webchat/workflow/join-channel.backup.jsonscript deleted file mode 100644 index 772068be4..000000000 --- a/packages/irc_webchat/workflow/join-channel.backup.jsonscript +++ /dev/null @@ -1,141 +0,0 @@ -{ - "name": "Join IRC Channel", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_channel", - "name": "Fetch Channel", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch Channel", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "IRCChannel" - } - } - }, - { - "id": "check_channel_mode", - "name": "Check Channel Mode", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Channel Mode", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_channel.output.mode === 'public' || ($context.user.level >= 2 && $steps.fetch_channel.output.mode === 'private') }}", - "operation": "condition" - } - } - }, - { - "id": "create_membership", - "name": "Create Membership", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Membership", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "joinedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMembership" - } - } - }, - { - "id": "emit_join", - "name": "Emit Join", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Emit Join", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "userId": "{{ $context.user.id }}", - "channelId": "{{ $json.channelId }}" - }, - "action": "emit_event", - "event": "user_joined", - "channel": "{{ 'irc:' + $json.channelId }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/join-channel.jsonscript b/packages/irc_webchat/workflow/join-channel.json similarity index 53% rename from packages/irc_webchat/workflow/join-channel.jsonscript rename to packages/irc_webchat/workflow/join-channel.json index 772068be4..0d96a457e 100644 --- a/packages/irc_webchat/workflow/join-channel.jsonscript +++ b/packages/irc_webchat/workflow/join-channel.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "IRCChannel" + "name": "Fetch Channel", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.channelId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "IRCChannel" + } } } }, @@ -68,8 +84,16 @@ 100 ], "parameters": { - "condition": "{{ $steps.fetch_channel.output.mode === 'public' || ($context.user.level >= 2 && $steps.fetch_channel.output.mode === 'private') }}", - "operation": "condition" + "name": "Check Channel Mode", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.fetch_channel.output.mode === 'public' || ($context.user.level >= 2 && $steps.fetch_channel.output.mode === 'private') }}", + "operation": "condition" + } } } }, @@ -90,13 +114,21 @@ 300 ], "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "joinedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMembership" + "name": "Create Membership", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "data": { + "channelId": "{{ $json.channelId }}", + "userId": "{{ $context.user.id }}", + "joinedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "IRCMembership" + } } } }, @@ -117,13 +149,21 @@ 300 ], "parameters": { - "data": { - "userId": "{{ $context.user.id }}", - "channelId": "{{ $json.channelId }}" - }, - "action": "emit_event", - "event": "user_joined", - "channel": "{{ 'irc:' + $json.channelId }}" + "name": "Emit Join", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "userId": "{{ $context.user.id }}", + "channelId": "{{ $json.channelId }}" + }, + "action": "emit_event", + "event": "user_joined", + "channel": "{{ 'irc:' + $json.channelId }}" + } } } } diff --git a/packages/irc_webchat/workflow/list-channels.backup.backup.jsonscript b/packages/irc_webchat/workflow/list-channels.backup.backup.jsonscript deleted file mode 100644 index 8e6254d99..000000000 --- a/packages/irc_webchat/workflow/list-channels.backup.backup.jsonscript +++ /dev/null @@ -1,104 +0,0 @@ -{ - "name": "List IRC Channels", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "includePrivate": "{{ $context.user.level >= 2 }}", - "includeSecret": "{{ $context.user.level >= 3 }}" - }, - "operation": "transform_data" - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "mode": { - "$in": "{{ [$steps.extract_params.output.includeSecret ? 'secret' : null, $steps.extract_params.output.includePrivate ? 'private' : null, 'public'].filter(x => x) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_channels", - "name": "Fetch Channels", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": "{{ $steps.build_filter.output }}", - "sort": { - "createdAt": -1 - }, - "operation": "database_read", - "entity": "IRCChannel" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "channels": "{{ $steps.fetch_channels.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List IRC channels with mode filtering (public/private/secret)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/list-channels.backup.jsonscript b/packages/irc_webchat/workflow/list-channels.json similarity index 54% rename from packages/irc_webchat/workflow/list-channels.backup.jsonscript rename to packages/irc_webchat/workflow/list-channels.json index 13d0e29be..183c02307 100644 --- a/packages/irc_webchat/workflow/list-channels.backup.jsonscript +++ b/packages/irc_webchat/workflow/list-channels.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,11 +50,19 @@ 100 ], "parameters": { - "output": { - "includePrivate": "{{ $context.user.level >= 2 }}", - "includeSecret": "{{ $context.user.level >= 3 }}" - }, - "operation": "transform_data" + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "includePrivate": "{{ $context.user.level >= 2 }}", + "includeSecret": "{{ $context.user.level >= 3 }}" + }, + "operation": "transform_data" + } } } }, @@ -67,13 +83,21 @@ 100 ], "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "mode": { - "$in": "{{ [$steps.extract_params.output.includeSecret ? 'secret' : null, $steps.extract_params.output.includePrivate ? 'private' : null, 'public'].filter(x => x) }}" - } - }, - "operation": "transform_data" + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "output": { + "tenantId": "{{ $context.tenantId }}", + "mode": { + "$in": "{{ [$steps.extract_params.output.includeSecret ? 'secret' : null, $steps.extract_params.output.includePrivate ? 'private' : null, 'public'].filter(x => x) }}" + } + }, + "operation": "transform_data" + } } } }, @@ -94,12 +118,20 @@ 300 ], "parameters": { - "filter": "{{ $steps.build_filter.output }}", - "sort": { - "createdAt": -1 - }, - "operation": "database_read", - "entity": "IRCChannel" + "name": "Fetch Channels", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": "{{ $steps.build_filter.output }}", + "sort": { + "createdAt": -1 + }, + "operation": "database_read", + "entity": "IRCChannel" + } } } }, @@ -120,10 +152,18 @@ 300 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "channels": "{{ $steps.fetch_channels.output }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "channels": "{{ $steps.fetch_channels.output }}" + } } } } diff --git a/packages/irc_webchat/workflow/list-channels.jsonscript b/packages/irc_webchat/workflow/list-channels.jsonscript deleted file mode 100644 index 13d0e29be..000000000 --- a/packages/irc_webchat/workflow/list-channels.jsonscript +++ /dev/null @@ -1,142 +0,0 @@ -{ - "name": "List IRC Channels", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "includePrivate": "{{ $context.user.level >= 2 }}", - "includeSecret": "{{ $context.user.level >= 3 }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "mode": { - "$in": "{{ [$steps.extract_params.output.includeSecret ? 'secret' : null, $steps.extract_params.output.includePrivate ? 'private' : null, 'public'].filter(x => x) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "fetch_channels", - "name": "Fetch Channels", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Fetch Channels", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": "{{ $steps.build_filter.output }}", - "sort": { - "createdAt": -1 - }, - "operation": "database_read", - "entity": "IRCChannel" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "channels": "{{ $steps.fetch_channels.output }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/send-message.backup.backup.jsonscript b/packages/irc_webchat/workflow/send-message.backup.backup.jsonscript deleted file mode 100644 index 05c066d0a..000000000 --- a/packages/irc_webchat/workflow/send-message.backup.backup.jsonscript +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "Send IRC Message", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "apply_slowmode", - "name": "Apply Slowmode", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ 'irc:' + $context.user.id + ':' + $json.channelId }}", - "limit": 1, - "window": 2000 - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "message": "required|string|minLength:1|maxLength:500" - } - } - }, - { - "id": "create_message", - "name": "Create Message", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "message": "{{ $json.message }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMessage" - } - }, - { - "id": "emit_message", - "name": "Emit Message", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "messageId": "{{ $steps.create_message.output.id }}", - "userId": "{{ $context.user.id }}", - "message": "{{ $json.message }}" - }, - "action": "emit_event", - "event": "message_sent", - "channel": "{{ 'irc:' + $json.channelId }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Send message to IRC channel with slowmode rate limiting" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/irc_webchat/workflow/send-message.backup.jsonscript b/packages/irc_webchat/workflow/send-message.json similarity index 52% rename from packages/irc_webchat/workflow/send-message.backup.jsonscript rename to packages/irc_webchat/workflow/send-message.json index c1362e59d..60637df1a 100644 --- a/packages/irc_webchat/workflow/send-message.backup.jsonscript +++ b/packages/irc_webchat/workflow/send-message.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,10 +50,18 @@ 100 ], "parameters": { - "operation": "rate_limit", - "key": "{{ 'irc:' + $context.user.id + ':' + $json.channelId }}", - "limit": 1, - "window": 2000 + "name": "Apply Slowmode", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "operation": "rate_limit", + "key": "{{ 'irc:' + $context.user.id + ':' + $json.channelId }}", + "limit": 1, + "window": 2000 + } } } }, @@ -66,10 +82,18 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "message": "required|string|minLength:1|maxLength:500" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "message": "required|string|minLength:1|maxLength:500" + } } } } @@ -91,15 +115,23 @@ 300 ], "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "message": "{{ $json.message }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMessage" + "name": "Create Message", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "data": { + "channelId": "{{ $json.channelId }}", + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "message": "{{ $json.message }}", + "createdAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "IRCMessage" + } } } }, @@ -120,14 +152,22 @@ 300 ], "parameters": { - "data": { - "messageId": "{{ $steps.create_message.output.id }}", - "userId": "{{ $context.user.id }}", - "message": "{{ $json.message }}" - }, - "action": "emit_event", - "event": "message_sent", - "channel": "{{ 'irc:' + $json.channelId }}" + "name": "Emit Message", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "messageId": "{{ $steps.create_message.output.id }}", + "userId": "{{ $context.user.id }}", + "message": "{{ $json.message }}" + }, + "action": "emit_event", + "event": "message_sent", + "channel": "{{ 'irc:' + $json.channelId }}" + } } } } diff --git a/packages/irc_webchat/workflow/send-message.jsonscript b/packages/irc_webchat/workflow/send-message.jsonscript deleted file mode 100644 index c1362e59d..000000000 --- a/packages/irc_webchat/workflow/send-message.jsonscript +++ /dev/null @@ -1,145 +0,0 @@ -{ - "name": "Send IRC Message", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "apply_slowmode", - "name": "Apply Slowmode", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Apply Slowmode", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ 'irc:' + $context.user.id + ':' + $json.channelId }}", - "limit": 1, - "window": 2000 - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "message": "required|string|minLength:1|maxLength:500" - } - } - } - }, - { - "id": "create_message", - "name": "Create Message", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Message", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "message": "{{ $json.message }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "IRCMessage" - } - } - }, - { - "id": "emit_message", - "name": "Emit Message", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Emit Message", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "messageId": "{{ $steps.create_message.output.id }}", - "userId": "{{ $context.user.id }}", - "message": "{{ $json.message }}" - }, - "action": "emit_event", - "event": "message_sent", - "channel": "{{ 'irc:' + $json.channelId }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/delete-media.backup.backup.jsonscript b/packages/media_center/workflow/delete-media.backup.backup.jsonscript deleted file mode 100644 index ee2723a0a..000000000 --- a/packages/media_center/workflow/delete-media.backup.backup.jsonscript +++ /dev/null @@ -1,135 +0,0 @@ -{ - "name": "Delete Media Asset", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_asset.output.uploadedBy === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "delete_files", - "name": "Delete Files", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "delete_recursive", - "paths": [ - "{{ $steps.fetch_asset.output.path }}", - "{{ $steps.fetch_asset.output.path }}-thumbnail }}", - "{{ $steps.fetch_asset.output.path }}-optimized }}" - ] - } - }, - { - "id": "delete_asset_record", - "name": "Delete Asset Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "operation": "database_delete", - "entity": "MediaAsset" - } - }, - { - "id": "emit_deleted", - "name": "Emit Deleted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}" - }, - "action": "emit_event", - "event": "media_deleted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Media asset deleted successfully" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Delete media asset with authorization and file cleanup" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/delete-media.backup.jsonscript b/packages/media_center/workflow/delete-media.json similarity index 54% rename from packages/media_center/workflow/delete-media.backup.jsonscript rename to packages/media_center/workflow/delete-media.json index d8a529070..1f92f4342 100644 --- a/packages/media_center/workflow/delete-media.backup.jsonscript +++ b/packages/media_center/workflow/delete-media.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" + "name": "Fetch Asset", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "MediaAsset" + } } } }, @@ -68,8 +84,16 @@ 100 ], "parameters": { - "condition": "{{ $steps.fetch_asset.output.uploadedBy === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" + "name": "Check Authorization", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.fetch_asset.output.uploadedBy === $context.user.id || $context.user.level >= 3 }}", + "operation": "condition" + } } } }, @@ -90,12 +114,20 @@ 300 ], "parameters": { - "operation": "delete_recursive", - "paths": [ - "{{ $steps.fetch_asset.output.path }}", - "{{ $steps.fetch_asset.output.path }}-thumbnail }}", - "{{ $steps.fetch_asset.output.path }}-optimized }}" - ] + "name": "Delete Files", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "operation": "delete_recursive", + "paths": [ + "{{ $steps.fetch_asset.output.path }}", + "{{ $steps.fetch_asset.output.path }}-thumbnail }}", + "{{ $steps.fetch_asset.output.path }}-optimized }}" + ] + } } } }, @@ -116,11 +148,19 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "operation": "database_delete", - "entity": "MediaAsset" + "name": "Delete Asset Record", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}" + }, + "operation": "database_delete", + "entity": "MediaAsset" + } } } }, @@ -141,12 +181,20 @@ 300 ], "parameters": { - "data": { - "assetId": "{{ $json.assetId }}" - }, - "action": "emit_event", - "event": "media_deleted", - "channel": "{{ 'media:' + $context.tenantId }}" + "name": "Emit Deleted", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "assetId": "{{ $json.assetId }}" + }, + "action": "emit_event", + "event": "media_deleted", + "channel": "{{ 'media:' + $context.tenantId }}" + } } } }, @@ -167,10 +215,18 @@ 500 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Media asset deleted successfully" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Media asset deleted successfully" + } } } } diff --git a/packages/media_center/workflow/delete-media.jsonscript b/packages/media_center/workflow/delete-media.jsonscript deleted file mode 100644 index d8a529070..000000000 --- a/packages/media_center/workflow/delete-media.jsonscript +++ /dev/null @@ -1,189 +0,0 @@ -{ - "name": "Delete Media Asset", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch Asset", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Authorization", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.fetch_asset.output.uploadedBy === $context.user.id || $context.user.level >= 3 }}", - "operation": "condition" - } - } - }, - { - "id": "delete_files", - "name": "Delete Files", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Delete Files", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "delete_recursive", - "paths": [ - "{{ $steps.fetch_asset.output.path }}", - "{{ $steps.fetch_asset.output.path }}-thumbnail }}", - "{{ $steps.fetch_asset.output.path }}-optimized }}" - ] - } - } - }, - { - "id": "delete_asset_record", - "name": "Delete Asset Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Delete Asset Record", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "operation": "database_delete", - "entity": "MediaAsset" - } - } - }, - { - "id": "emit_deleted", - "name": "Emit Deleted", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit Deleted", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}" - }, - "action": "emit_event", - "event": "media_deleted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Media asset deleted successfully" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-image-metadata.backup.backup.jsonscript b/packages/media_center/workflow/extract-image-metadata.backup.backup.jsonscript deleted file mode 100644 index 4824a2a91..000000000 --- a/packages/media_center/workflow/extract-image-metadata.backup.backup.jsonscript +++ /dev/null @@ -1,171 +0,0 @@ -{ - "name": "Extract Image Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - }, - { - "id": "extract_image_info", - "name": "Extract Image Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "width": true, - "height": true, - "format": true, - "colorSpace": true, - "hasAlpha": true, - "exif": true - }, - "operation": "analyze_image", - "filePath": "{{ $json.filePath }}" - } - }, - { - "id": "calculate_dimensions", - "name": "Calculate Dimensions", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "width": "{{ $steps.extract_image_info.output.width }}", - "height": "{{ $steps.extract_image_info.output.height }}", - "aspectRatio": "{{ $steps.extract_image_info.output.width / $steps.extract_image_info.output.height }}", - "format": "{{ $steps.extract_image_info.output.format }}" - }, - "operation": "transform_data" - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "dimensions": "{{ $steps.calculate_dimensions.output }}", - "format": "{{ $steps.extract_image_info.output.format }}", - "colorSpace": "{{ $steps.extract_image_info.output.colorSpace }}", - "hasAlpha": "{{ $steps.extract_image_info.output.hasAlpha }}", - "exif": "{{ $steps.extract_image_info.output.exif }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "metadata": "{{ $steps.calculate_dimensions.output }}" - }, - "action": "emit_event", - "event": "image_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Extract metadata (dimensions, format, EXIF) from uploaded images" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-image-metadata.backup.jsonscript b/packages/media_center/workflow/extract-image-metadata.backup.jsonscript deleted file mode 100644 index 5648bdc0a..000000000 --- a/packages/media_center/workflow/extract-image-metadata.backup.jsonscript +++ /dev/null @@ -1,233 +0,0 @@ -{ - "name": "Extract Image Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Asset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "extract_image_info", - "name": "Extract Image Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Image Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "width": true, - "height": true, - "format": true, - "colorSpace": true, - "hasAlpha": true, - "exif": true - }, - "operation": "analyze_image", - "filePath": "{{ $json.filePath }}" - } - } - }, - { - "id": "calculate_dimensions", - "name": "Calculate Dimensions", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Dimensions", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "width": "{{ $steps.extract_image_info.output.width }}", - "height": "{{ $steps.extract_image_info.output.height }}", - "aspectRatio": "{{ $steps.extract_image_info.output.width / $steps.extract_image_info.output.height }}", - "format": "{{ $steps.extract_image_info.output.format }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Update Asset Metadata", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "dimensions": "{{ $steps.calculate_dimensions.output }}", - "format": "{{ $steps.extract_image_info.output.format }}", - "colorSpace": "{{ $steps.extract_image_info.output.colorSpace }}", - "hasAlpha": "{{ $steps.extract_image_info.output.hasAlpha }}", - "exif": "{{ $steps.extract_image_info.output.exif }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Complete", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "metadata": "{{ $steps.calculate_dimensions.output }}" - }, - "action": "emit_event", - "event": "image_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-image-metadata.json b/packages/media_center/workflow/extract-image-metadata.json new file mode 100644 index 000000000..867095ce1 --- /dev/null +++ b/packages/media_center/workflow/extract-image-metadata.json @@ -0,0 +1,297 @@ +{ + "name": "Extract Image Metadata", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "assetId": "required|string", + "filePath": "required|string" + } + } + } + } + }, + { + "id": "fetch_asset", + "name": "Fetch Asset", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Asset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Asset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "extract_image_info", + "name": "Extract Image Info", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Image Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Image Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "width": true, + "height": true, + "format": true, + "colorSpace": true, + "hasAlpha": true, + "exif": true + }, + "operation": "analyze_image", + "filePath": "{{ $json.filePath }}" + } + } + } + }, + { + "id": "calculate_dimensions", + "name": "Calculate Dimensions", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Dimensions", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Calculate Dimensions", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": { + "width": "{{ $steps.extract_image_info.output.width }}", + "height": "{{ $steps.extract_image_info.output.height }}", + "aspectRatio": "{{ $steps.extract_image_info.output.width / $steps.extract_image_info.output.height }}", + "format": "{{ $steps.extract_image_info.output.format }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "update_asset_metadata", + "name": "Update Asset Metadata", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Update Asset Metadata", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Update Asset Metadata", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}" + }, + "data": { + "metadata": { + "dimensions": "{{ $steps.calculate_dimensions.output }}", + "format": "{{ $steps.extract_image_info.output.format }}", + "colorSpace": "{{ $steps.extract_image_info.output.colorSpace }}", + "hasAlpha": "{{ $steps.extract_image_info.output.hasAlpha }}", + "exif": "{{ $steps.extract_image_info.output.exif }}" + }, + "extractedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "emit_complete", + "name": "Emit Complete", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Complete", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Complete", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "assetId": "{{ $json.assetId }}", + "metadata": "{{ $steps.calculate_dimensions.output }}" + }, + "action": "emit_event", + "event": "image_metadata_extracted", + "channel": "{{ 'media:' + $context.tenantId }}" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.update_asset_metadata.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/media_center/workflow/extract-image-metadata.jsonscript b/packages/media_center/workflow/extract-image-metadata.jsonscript deleted file mode 100644 index 5648bdc0a..000000000 --- a/packages/media_center/workflow/extract-image-metadata.jsonscript +++ /dev/null @@ -1,233 +0,0 @@ -{ - "name": "Extract Image Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Asset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "extract_image_info", - "name": "Extract Image Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Image Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "width": true, - "height": true, - "format": true, - "colorSpace": true, - "hasAlpha": true, - "exif": true - }, - "operation": "analyze_image", - "filePath": "{{ $json.filePath }}" - } - } - }, - { - "id": "calculate_dimensions", - "name": "Calculate Dimensions", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Calculate Dimensions", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "width": "{{ $steps.extract_image_info.output.width }}", - "height": "{{ $steps.extract_image_info.output.height }}", - "aspectRatio": "{{ $steps.extract_image_info.output.width / $steps.extract_image_info.output.height }}", - "format": "{{ $steps.extract_image_info.output.format }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Update Asset Metadata", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "dimensions": "{{ $steps.calculate_dimensions.output }}", - "format": "{{ $steps.extract_image_info.output.format }}", - "colorSpace": "{{ $steps.extract_image_info.output.colorSpace }}", - "hasAlpha": "{{ $steps.extract_image_info.output.hasAlpha }}", - "exif": "{{ $steps.extract_image_info.output.exif }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Complete", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "metadata": "{{ $steps.calculate_dimensions.output }}" - }, - "action": "emit_event", - "event": "image_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-video-metadata.backup.backup.jsonscript b/packages/media_center/workflow/extract-video-metadata.backup.backup.jsonscript deleted file mode 100644 index c9e9ff679..000000000 --- a/packages/media_center/workflow/extract-video-metadata.backup.backup.jsonscript +++ /dev/null @@ -1,176 +0,0 @@ -{ - "name": "Extract Video Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - }, - { - "id": "extract_video_info", - "name": "Extract Video Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "duration": true, - "bitrate": true, - "codec": true, - "videoCodec": true, - "audioCodec": true, - "width": true, - "height": true, - "fps": true - }, - "operation": "analyze_video", - "filePath": "{{ $json.filePath }}" - } - }, - { - "id": "format_duration", - "name": "Format Duration", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "seconds": "{{ $steps.extract_video_info.output.duration }}", - "formatted": "{{ Math.floor($steps.extract_video_info.output.duration / 3600) }}:{{ Math.floor(($steps.extract_video_info.output.duration % 3600) / 60).toString().padStart(2, '0') }}:{{ ($steps.extract_video_info.output.duration % 60).toString().padStart(2, '0') }}" - }, - "operation": "transform_data" - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "duration": "{{ $steps.format_duration.output }}", - "bitrate": "{{ $steps.extract_video_info.output.bitrate }}", - "codec": "{{ $steps.extract_video_info.output.codec }}", - "videoCodec": "{{ $steps.extract_video_info.output.videoCodec }}", - "audioCodec": "{{ $steps.extract_video_info.output.audioCodec }}", - "resolution": { - "width": "{{ $steps.extract_video_info.output.width }}", - "height": "{{ $steps.extract_video_info.output.height }}" - }, - "fps": "{{ $steps.extract_video_info.output.fps }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "duration": "{{ $steps.format_duration.output.formatted }}" - }, - "action": "emit_event", - "event": "video_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Extract metadata (duration, codec, bitrate) from uploaded videos" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-video-metadata.backup.jsonscript b/packages/media_center/workflow/extract-video-metadata.backup.jsonscript deleted file mode 100644 index fd4dc85dc..000000000 --- a/packages/media_center/workflow/extract-video-metadata.backup.jsonscript +++ /dev/null @@ -1,238 +0,0 @@ -{ - "name": "Extract Video Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Asset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "extract_video_info", - "name": "Extract Video Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Video Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "duration": true, - "bitrate": true, - "codec": true, - "videoCodec": true, - "audioCodec": true, - "width": true, - "height": true, - "fps": true - }, - "operation": "analyze_video", - "filePath": "{{ $json.filePath }}" - } - } - }, - { - "id": "format_duration", - "name": "Format Duration", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Duration", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "seconds": "{{ $steps.extract_video_info.output.duration }}", - "formatted": "{{ Math.floor($steps.extract_video_info.output.duration / 3600) }}:{{ Math.floor(($steps.extract_video_info.output.duration % 3600) / 60).toString().padStart(2, '0') }}:{{ ($steps.extract_video_info.output.duration % 60).toString().padStart(2, '0') }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Update Asset Metadata", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "duration": "{{ $steps.format_duration.output }}", - "bitrate": "{{ $steps.extract_video_info.output.bitrate }}", - "codec": "{{ $steps.extract_video_info.output.codec }}", - "videoCodec": "{{ $steps.extract_video_info.output.videoCodec }}", - "audioCodec": "{{ $steps.extract_video_info.output.audioCodec }}", - "resolution": { - "width": "{{ $steps.extract_video_info.output.width }}", - "height": "{{ $steps.extract_video_info.output.height }}" - }, - "fps": "{{ $steps.extract_video_info.output.fps }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Complete", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "duration": "{{ $steps.format_duration.output.formatted }}" - }, - "action": "emit_event", - "event": "video_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/extract-video-metadata.json b/packages/media_center/workflow/extract-video-metadata.json new file mode 100644 index 000000000..d3faec12f --- /dev/null +++ b/packages/media_center/workflow/extract-video-metadata.json @@ -0,0 +1,302 @@ +{ + "name": "Extract Video Metadata", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "assetId": "required|string", + "filePath": "required|string" + } + } + } + } + }, + { + "id": "fetch_asset", + "name": "Fetch Asset", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Asset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Asset", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "extract_video_info", + "name": "Extract Video Info", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Video Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Extract Video Info", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "duration": true, + "bitrate": true, + "codec": true, + "videoCodec": true, + "audioCodec": true, + "width": true, + "height": true, + "fps": true + }, + "operation": "analyze_video", + "filePath": "{{ $json.filePath }}" + } + } + } + }, + { + "id": "format_duration", + "name": "Format Duration", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Duration", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Duration", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": { + "seconds": "{{ $steps.extract_video_info.output.duration }}", + "formatted": "{{ Math.floor($steps.extract_video_info.output.duration / 3600) }}:{{ Math.floor(($steps.extract_video_info.output.duration % 3600) / 60).toString().padStart(2, '0') }}:{{ ($steps.extract_video_info.output.duration % 60).toString().padStart(2, '0') }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "update_asset_metadata", + "name": "Update Asset Metadata", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Update Asset Metadata", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Update Asset Metadata", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.assetId }}" + }, + "data": { + "metadata": { + "duration": "{{ $steps.format_duration.output }}", + "bitrate": "{{ $steps.extract_video_info.output.bitrate }}", + "codec": "{{ $steps.extract_video_info.output.codec }}", + "videoCodec": "{{ $steps.extract_video_info.output.videoCodec }}", + "audioCodec": "{{ $steps.extract_video_info.output.audioCodec }}", + "resolution": { + "width": "{{ $steps.extract_video_info.output.width }}", + "height": "{{ $steps.extract_video_info.output.height }}" + }, + "fps": "{{ $steps.extract_video_info.output.fps }}" + }, + "extractedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "emit_complete", + "name": "Emit Complete", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Complete", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Complete", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "assetId": "{{ $json.assetId }}", + "duration": "{{ $steps.format_duration.output.formatted }}" + }, + "action": "emit_event", + "event": "video_metadata_extracted", + "channel": "{{ 'media:' + $context.tenantId }}" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.update_asset_metadata.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/media_center/workflow/extract-video-metadata.jsonscript b/packages/media_center/workflow/extract-video-metadata.jsonscript deleted file mode 100644 index fd4dc85dc..000000000 --- a/packages/media_center/workflow/extract-video-metadata.jsonscript +++ /dev/null @@ -1,238 +0,0 @@ -{ - "name": "Extract Video Metadata", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "assetId": "required|string", - "filePath": "required|string" - } - } - } - }, - { - "id": "fetch_asset", - "name": "Fetch Asset", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Asset", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "extract_video_info", - "name": "Extract Video Info", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Extract Video Info", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "duration": true, - "bitrate": true, - "codec": true, - "videoCodec": true, - "audioCodec": true, - "width": true, - "height": true, - "fps": true - }, - "operation": "analyze_video", - "filePath": "{{ $json.filePath }}" - } - } - }, - { - "id": "format_duration", - "name": "Format Duration", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Duration", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "seconds": "{{ $steps.extract_video_info.output.duration }}", - "formatted": "{{ Math.floor($steps.extract_video_info.output.duration / 3600) }}:{{ Math.floor(($steps.extract_video_info.output.duration % 3600) / 60).toString().padStart(2, '0') }}:{{ ($steps.extract_video_info.output.duration % 60).toString().padStart(2, '0') }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "update_asset_metadata", - "name": "Update Asset Metadata", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Update Asset Metadata", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.assetId }}" - }, - "data": { - "metadata": { - "duration": "{{ $steps.format_duration.output }}", - "bitrate": "{{ $steps.extract_video_info.output.bitrate }}", - "codec": "{{ $steps.extract_video_info.output.codec }}", - "videoCodec": "{{ $steps.extract_video_info.output.videoCodec }}", - "audioCodec": "{{ $steps.extract_video_info.output.audioCodec }}", - "resolution": { - "width": "{{ $steps.extract_video_info.output.width }}", - "height": "{{ $steps.extract_video_info.output.height }}" - }, - "fps": "{{ $steps.extract_video_info.output.fps }}" - }, - "extractedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "MediaAsset" - } - } - }, - { - "id": "emit_complete", - "name": "Emit Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Complete", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "assetId": "{{ $json.assetId }}", - "duration": "{{ $steps.format_duration.output.formatted }}" - }, - "action": "emit_event", - "event": "video_metadata_extracted", - "channel": "{{ 'media:' + $context.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_asset_metadata.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/list-user-media.backup.backup.jsonscript b/packages/media_center/workflow/list-user-media.backup.backup.jsonscript deleted file mode 100644 index 2d3535717..000000000 --- a/packages/media_center/workflow/list-user-media.backup.backup.jsonscript +++ /dev/null @@ -1,172 +0,0 @@ -{ - "name": "List User Media", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "type": "{{ $json.type || null }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "uploadedBy": "{{ $context.user.id }}", - "type": "{{ $steps.extract_params.output.type }}" - }, - "operation": "transform_data" - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== null && value !== undefined) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - }, - { - "id": "fetch_media", - "name": "Fetch Media", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.extract_params.output.offset }}", - "operation": "database_read", - "entity": "MediaAsset" - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "operation": "database_count", - "entity": "MediaAsset" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "output": { - "assets": "{{ $steps.fetch_media.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_params.output.offset + $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List all media assets for current user with filtering and sorting" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/list-user-media.backup.jsonscript b/packages/media_center/workflow/list-user-media.backup.jsonscript deleted file mode 100644 index adb381352..000000000 --- a/packages/media_center/workflow/list-user-media.backup.jsonscript +++ /dev/null @@ -1,242 +0,0 @@ -{ - "name": "List User Media", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "type": "{{ $json.type || null }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "uploadedBy": "{{ $context.user.id }}", - "type": "{{ $steps.extract_params.output.type }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Clean Filter", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== null && value !== undefined) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_media", - "name": "Fetch Media", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Fetch Media", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.extract_params.output.offset }}", - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Count Total", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "operation": "database_count", - "entity": "MediaAsset" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "output": { - "assets": "{{ $steps.fetch_media.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_params.output.offset + $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/media_center/workflow/list-user-media.json b/packages/media_center/workflow/list-user-media.json new file mode 100644 index 000000000..9c47ce49c --- /dev/null +++ b/packages/media_center/workflow/list-user-media.json @@ -0,0 +1,314 @@ +{ + "name": "List User Media", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "validate_user", + "name": "Validate User", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "extract_params", + "name": "Extract Params", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Extract Params", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "output": { + "type": "{{ $json.type || null }}", + "sortBy": "{{ $json.sortBy || 'createdAt' }}", + "sortOrder": "{{ $json.sortOrder || 'desc' }}", + "limit": "{{ Math.min($json.limit || 50, 500) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "build_filter", + "name": "Build Filter", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Build Filter", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "output": { + "tenantId": "{{ $context.tenantId }}", + "uploadedBy": "{{ $context.user.id }}", + "type": "{{ $steps.extract_params.output.type }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "clean_filter", + "name": "Clean Filter", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Clean Filter", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Clean Filter", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== null && value !== undefined) acc[key] = value; return acc; }, {}) }}", + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_media", + "name": "Fetch Media", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Fetch Media", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Fetch Media", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "filter": "{{ $steps.clean_filter.output }}", + "sort": { + "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" + }, + "limit": "{{ $steps.extract_params.output.limit }}", + "offset": "{{ $steps.extract_params.output.offset }}", + "operation": "database_read", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "count_total", + "name": "Count Total", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Count Total", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Count Total", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "filter": "{{ $steps.clean_filter.output }}", + "operation": "database_count", + "entity": "MediaAsset" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "output": { + "assets": "{{ $steps.fetch_media.output }}", + "pagination": { + "total": "{{ $steps.count_total.output }}", + "page": "{{ $json.page || 1 }}", + "limit": "{{ $steps.extract_params.output.limit }}", + "hasMore": "{{ $steps.count_total.output > ($steps.extract_params.output.offset + $steps.extract_params.output.limit) }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/media_center/workflow/list-user-media.jsonscript b/packages/media_center/workflow/list-user-media.jsonscript deleted file mode 100644 index adb381352..000000000 --- a/packages/media_center/workflow/list-user-media.jsonscript +++ /dev/null @@ -1,242 +0,0 @@ -{ - "name": "List User Media", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_params", - "name": "Extract Params", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Extract Params", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "type": "{{ $json.type || null }}", - "sortBy": "{{ $json.sortBy || 'createdAt' }}", - "sortOrder": "{{ $json.sortOrder || 'desc' }}", - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "build_filter", - "name": "Build Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Build Filter", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "output": { - "tenantId": "{{ $context.tenantId }}", - "uploadedBy": "{{ $context.user.id }}", - "type": "{{ $steps.extract_params.output.type }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "clean_filter", - "name": "Clean Filter", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Clean Filter", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ Object.entries($steps.build_filter.output).reduce((acc, [key, value]) => { if (value !== null && value !== undefined) acc[key] = value; return acc; }, {}) }}", - "operation": "transform_data" - } - } - }, - { - "id": "fetch_media", - "name": "Fetch Media", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Fetch Media", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "sort": { - "{{ $steps.extract_params.output.sortBy }}": "{{ $steps.extract_params.output.sortOrder === 'asc' ? 1 : -1 }}" - }, - "limit": "{{ $steps.extract_params.output.limit }}", - "offset": "{{ $steps.extract_params.output.offset }}", - "operation": "database_read", - "entity": "MediaAsset" - } - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Count Total", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "filter": "{{ $steps.clean_filter.output }}", - "operation": "database_count", - "entity": "MediaAsset" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "output": { - "assets": "{{ $steps.fetch_media.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_params.output.limit }}", - "hasMore": "{{ $steps.count_total.output > ($steps.extract_params.output.offset + $steps.extract_params.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/cleanup-expired.backup.backup.jsonscript b/packages/notification_center/workflow/cleanup-expired.backup.backup.jsonscript deleted file mode 100644 index d82511914..000000000 --- a/packages/notification_center/workflow/cleanup-expired.backup.backup.jsonscript +++ /dev/null @@ -1,147 +0,0 @@ -{ - "name": "Cleanup Expired Notifications", - "active": false, - "nodes": [ - { - "id": "get_current_time", - "name": "Get Current Time", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "output": "{{ new Date().toISOString() }}", - "operation": "transform_data" - } - }, - { - "id": "find_expired", - "name": "Find Expired", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" - } - }, - { - "id": "delete_expired", - "name": "Delete Expired", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" - } - }, - { - "id": "find_old_read", - "name": "Find Old Read", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" - } - }, - { - "id": "delete_old_read", - "name": "Delete Old Read", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" - } - }, - { - "id": "emit_cleanup_complete", - "name": "Emit Cleanup Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "expiredCount": "{{ $steps.find_expired.output.length }}", - "oldReadCount": "{{ $steps.find_old_read.output.length }}", - "timestamp": "{{ $steps.get_current_time.output }}" - }, - "action": "emit_event", - "event": "cleanup_complete", - "channel": "admin" - } - }, - { - "id": "return_summary", - "name": "Return Summary", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "log", - "level": "info", - "message": "Cleanup complete: {{ $steps.find_expired.output.length }} expired, {{ $steps.find_old_read.output.length }} old read notifications deleted" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Delete expired notifications and cleanup old read notifications" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/cleanup-expired.backup.jsonscript b/packages/notification_center/workflow/cleanup-expired.json similarity index 50% rename from packages/notification_center/workflow/cleanup-expired.backup.jsonscript rename to packages/notification_center/workflow/cleanup-expired.json index 328ef6c4a..229c5ba9b 100644 --- a/packages/notification_center/workflow/cleanup-expired.backup.jsonscript +++ b/packages/notification_center/workflow/cleanup-expired.json @@ -19,8 +19,16 @@ 100 ], "parameters": { - "output": "{{ new Date().toISOString() }}", - "operation": "transform_data" + "name": "Get Current Time", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "output": "{{ new Date().toISOString() }}", + "operation": "transform_data" + } } } }, @@ -41,14 +49,22 @@ 100 ], "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" + "name": "Find Expired", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "expiresAt": { + "$lt": "{{ $steps.get_current_time.output }}" + } + }, + "limit": 10000, + "operation": "database_read", + "entity": "Notification" + } } } }, @@ -69,13 +85,21 @@ 100 ], "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" + "name": "Delete Expired", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "expiresAt": { + "$lt": "{{ $steps.get_current_time.output }}" + } + }, + "operation": "database_delete_many", + "entity": "Notification" + } } } }, @@ -96,15 +120,23 @@ 300 ], "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" + "name": "Find Old Read", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "isRead": true, + "readAt": { + "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" + } + }, + "limit": 10000, + "operation": "database_read", + "entity": "Notification" + } } } }, @@ -125,14 +157,22 @@ 300 ], "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" + "name": "Delete Old Read", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "isRead": true, + "readAt": { + "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" + } + }, + "operation": "database_delete_many", + "entity": "Notification" + } } } }, @@ -153,14 +193,22 @@ 300 ], "parameters": { - "data": { - "expiredCount": "{{ $steps.find_expired.output.length }}", - "oldReadCount": "{{ $steps.find_old_read.output.length }}", - "timestamp": "{{ $steps.get_current_time.output }}" - }, - "action": "emit_event", - "event": "cleanup_complete", - "channel": "admin" + "name": "Emit Cleanup Complete", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "expiredCount": "{{ $steps.find_expired.output.length }}", + "oldReadCount": "{{ $steps.find_old_read.output.length }}", + "timestamp": "{{ $steps.get_current_time.output }}" + }, + "action": "emit_event", + "event": "cleanup_complete", + "channel": "admin" + } } } }, @@ -181,9 +229,17 @@ 500 ], "parameters": { - "action": "log", - "level": "info", - "message": "Cleanup complete: {{ $steps.find_expired.output.length }} expired, {{ $steps.find_old_read.output.length }} old read notifications deleted" + "name": "Return Summary", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "log", + "level": "info", + "message": "Cleanup complete: {{ $steps.find_expired.output.length }} expired, {{ $steps.find_old_read.output.length }} old read notifications deleted" + } } } } diff --git a/packages/notification_center/workflow/cleanup-expired.jsonscript b/packages/notification_center/workflow/cleanup-expired.jsonscript deleted file mode 100644 index 328ef6c4a..000000000 --- a/packages/notification_center/workflow/cleanup-expired.jsonscript +++ /dev/null @@ -1,201 +0,0 @@ -{ - "name": "Cleanup Expired Notifications", - "active": false, - "nodes": [ - { - "id": "get_current_time", - "name": "Get Current Time", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Get Current Time", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "output": "{{ new Date().toISOString() }}", - "operation": "transform_data" - } - } - }, - { - "id": "find_expired", - "name": "Find Expired", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Find Expired", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" - } - } - }, - { - "id": "delete_expired", - "name": "Delete Expired", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Delete Expired", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "expiresAt": { - "$lt": "{{ $steps.get_current_time.output }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" - } - } - }, - { - "id": "find_old_read", - "name": "Find Old Read", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Find Old Read", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "limit": 10000, - "operation": "database_read", - "entity": "Notification" - } - } - }, - { - "id": "delete_old_read", - "name": "Delete Old Read", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Delete Old Read", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "isRead": true, - "readAt": { - "$lt": "{{ new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString() }}" - } - }, - "operation": "database_delete_many", - "entity": "Notification" - } - } - }, - { - "id": "emit_cleanup_complete", - "name": "Emit Cleanup Complete", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit Cleanup Complete", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "expiredCount": "{{ $steps.find_expired.output.length }}", - "oldReadCount": "{{ $steps.find_old_read.output.length }}", - "timestamp": "{{ $steps.get_current_time.output }}" - }, - "action": "emit_event", - "event": "cleanup_complete", - "channel": "admin" - } - } - }, - { - "id": "return_summary", - "name": "Return Summary", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Summary", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "log", - "level": "info", - "message": "Cleanup complete: {{ $steps.find_expired.output.length }} expired, {{ $steps.find_old_read.output.length }} old read notifications deleted" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/dispatch.backup.backup.jsonscript b/packages/notification_center/workflow/dispatch.backup.backup.jsonscript deleted file mode 100644 index e76cec28d..000000000 --- a/packages/notification_center/workflow/dispatch.backup.backup.jsonscript +++ /dev/null @@ -1,254 +0,0 @@ -{ - "name": "Dispatch Notification", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "userId": "required|string", - "type": "required|string", - "title": "required|string|maxLength:200", - "message": "required|string|maxLength:1000", - "channels": "required|array" - } - } - }, - { - "id": "fetch_user_preferences", - "name": "Fetch User Preferences", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "NotificationPreference" - } - }, - { - "id": "create_notification_record", - "name": "Create Notification Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "userId": "{{ $json.userId }}", - "type": "{{ $json.type }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "isRead": false, - "metadata": "{{ $json.metadata || {} }}", - "createdAt": "{{ new Date().toISOString() }}", - "expiresAt": "{{ new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Notification" - } - }, - { - "id": "dispatch_in_app", - "name": "Dispatch In App", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $json.channels.includes('in_app') && $steps.fetch_user_preferences.output.enableInApp !== false }}", - "operation": "condition" - } - }, - { - "id": "emit_in_app_notification", - "name": "Emit In App Notification", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "type": "{{ $json.type }}" - }, - "action": "emit_event", - "event": "notification_received", - "channel": "{{ 'user:' + $json.userId }}" - } - }, - { - "id": "check_email_rate_limit", - "name": "Check Email Rate Limit", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $json.channels.includes('email') && $steps.fetch_user_preferences.output.enableEmail !== false }}", - "operation": "condition" - } - }, - { - "id": "apply_email_rate_limit", - "name": "Apply Email Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ 'email:' + $json.userId }}", - "limit": 10, - "window": 3600000 - } - }, - { - "id": "fetch_user_email", - "name": "Fetch User Email", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "send_email", - "name": "Send Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "operation": "email_send", - "to": "{{ $steps.fetch_user_email.output.email }}", - "subject": "{{ $json.title }}", - "body": "{{ $json.message }}", - "template": "{{ $json.emailTemplate || 'default' }}" - } - }, - { - "id": "dispatch_push", - "name": "Dispatch Push", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "condition": "{{ $json.channels.includes('push') && $steps.fetch_user_preferences.output.enablePush !== false }}", - "operation": "condition" - } - }, - { - "id": "send_push_notification", - "name": "Send Push Notification", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "operation": "http_request", - "url": "https://fcm.googleapis.com/fcm/send", - "method": "POST", - "headers": { - "Authorization": "{{ 'Bearer ' + $env.FCM_KEY }}" - }, - "body": { - "to": "{{ $steps.fetch_user_email.output.fcmToken }}", - "notification": { - "title": "{{ $json.title }}", - "body": "{{ $json.message }}" - } - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "action": "http_response", - "status": 202, - "body": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "message": "Notification dispatched successfully" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Send notification via configured channels (in-app, email, push, webhook) with rate limiting" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/dispatch.backup.jsonscript b/packages/notification_center/workflow/dispatch.backup.jsonscript deleted file mode 100644 index 33c2be01d..000000000 --- a/packages/notification_center/workflow/dispatch.backup.jsonscript +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "Dispatch Notification", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "userId": "required|string", - "type": "required|string", - "title": "required|string|maxLength:200", - "message": "required|string|maxLength:1000", - "channels": "required|array" - } - } - } - }, - { - "id": "fetch_user_preferences", - "name": "Fetch User Preferences", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch User Preferences", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "NotificationPreference" - } - } - }, - { - "id": "create_notification_record", - "name": "Create Notification Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Notification Record", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "userId": "{{ $json.userId }}", - "type": "{{ $json.type }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "isRead": false, - "metadata": "{{ $json.metadata || {} }}", - "createdAt": "{{ new Date().toISOString() }}", - "expiresAt": "{{ new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Notification" - } - } - }, - { - "id": "dispatch_in_app", - "name": "Dispatch In App", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Dispatch In App", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $json.channels.includes('in_app') && $steps.fetch_user_preferences.output.enableInApp !== false }}", - "operation": "condition" - } - } - }, - { - "id": "emit_in_app_notification", - "name": "Emit In App Notification", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit In App Notification", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "type": "{{ $json.type }}" - }, - "action": "emit_event", - "event": "notification_received", - "channel": "{{ 'user:' + $json.userId }}" - } - } - }, - { - "id": "check_email_rate_limit", - "name": "Check Email Rate Limit", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Check Email Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $json.channels.includes('email') && $steps.fetch_user_preferences.output.enableEmail !== false }}", - "operation": "condition" - } - } - }, - { - "id": "apply_email_rate_limit", - "name": "Apply Email Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Apply Email Rate Limit", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ 'email:' + $json.userId }}", - "limit": 10, - "window": 3600000 - } - } - }, - { - "id": "fetch_user_email", - "name": "Fetch User Email", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Fetch User Email", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "send_email", - "name": "Send Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Send Email", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "operation": "email_send", - "to": "{{ $steps.fetch_user_email.output.email }}", - "subject": "{{ $json.title }}", - "body": "{{ $json.message }}", - "template": "{{ $json.emailTemplate || 'default' }}" - } - } - }, - { - "id": "dispatch_push", - "name": "Dispatch Push", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Dispatch Push", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "condition": "{{ $json.channels.includes('push') && $steps.fetch_user_preferences.output.enablePush !== false }}", - "operation": "condition" - } - } - }, - { - "id": "send_push_notification", - "name": "Send Push Notification", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Send Push Notification", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "operation": "http_request", - "url": "https://fcm.googleapis.com/fcm/send", - "method": "POST", - "headers": { - "Authorization": "{{ 'Bearer ' + $env.FCM_KEY }}" - }, - "body": { - "to": "{{ $steps.fetch_user_email.output.fcmToken }}", - "notification": { - "title": "{{ $json.title }}", - "body": "{{ $json.message }}" - } - } - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "action": "http_response", - "status": 202, - "body": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "message": "Notification dispatched successfully" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/dispatch.json b/packages/notification_center/workflow/dispatch.json new file mode 100644 index 000000000..d83f81502 --- /dev/null +++ b/packages/notification_center/workflow/dispatch.json @@ -0,0 +1,460 @@ +{ + "name": "Dispatch Notification", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "userId": "required|string", + "type": "required|string", + "title": "required|string|maxLength:200", + "message": "required|string|maxLength:1000", + "channels": "required|array" + } + } + } + } + }, + { + "id": "fetch_user_preferences", + "name": "Fetch User Preferences", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch User Preferences", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch User Preferences", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "userId": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "NotificationPreference" + } + } + } + }, + { + "id": "create_notification_record", + "name": "Create Notification Record", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Create Notification Record", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Create Notification Record", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "data": { + "tenantId": "{{ $context.tenantId }}", + "userId": "{{ $json.userId }}", + "type": "{{ $json.type }}", + "title": "{{ $json.title }}", + "message": "{{ $json.message }}", + "isRead": false, + "metadata": "{{ $json.metadata || {} }}", + "createdAt": "{{ new Date().toISOString() }}", + "expiresAt": "{{ new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString() }}" + }, + "operation": "database_create", + "entity": "Notification" + } + } + } + }, + { + "id": "dispatch_in_app", + "name": "Dispatch In App", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Dispatch In App", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Dispatch In App", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "condition": "{{ $json.channels.includes('in_app') && $steps.fetch_user_preferences.output.enableInApp !== false }}", + "operation": "condition" + } + } + } + }, + { + "id": "emit_in_app_notification", + "name": "Emit In App Notification", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Emit In App Notification", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Emit In App Notification", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "notificationId": "{{ $steps.create_notification_record.output.id }}", + "title": "{{ $json.title }}", + "message": "{{ $json.message }}", + "type": "{{ $json.type }}" + }, + "action": "emit_event", + "event": "notification_received", + "channel": "{{ 'user:' + $json.userId }}" + } + } + } + }, + { + "id": "check_email_rate_limit", + "name": "Check Email Rate Limit", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Check Email Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Check Email Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "condition": "{{ $json.channels.includes('email') && $steps.fetch_user_preferences.output.enableEmail !== false }}", + "operation": "condition" + } + } + } + }, + { + "id": "apply_email_rate_limit", + "name": "Apply Email Rate Limit", + "type": "metabuilder.rateLimit", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Apply Email Rate Limit", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Apply Email Rate Limit", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "operation": "rate_limit", + "key": "{{ 'email:' + $json.userId }}", + "limit": 10, + "window": 3600000 + } + } + } + }, + { + "id": "fetch_user_email", + "name": "Fetch User Email", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Fetch User Email", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "name": "Fetch User Email", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "filter": { + "id": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } + } + } + }, + { + "id": "send_email", + "name": "Send Email", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "name": "Send Email", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "name": "Send Email", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "operation": "email_send", + "to": "{{ $steps.fetch_user_email.output.email }}", + "subject": "{{ $json.title }}", + "body": "{{ $json.message }}", + "template": "{{ $json.emailTemplate || 'default' }}" + } + } + } + }, + { + "id": "dispatch_push", + "name": "Dispatch Push", + "type": "metabuilder.condition", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "name": "Dispatch Push", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "name": "Dispatch Push", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "condition": "{{ $json.channels.includes('push') && $steps.fetch_user_preferences.output.enablePush !== false }}", + "operation": "condition" + } + } + } + }, + { + "id": "send_push_notification", + "name": "Send Push Notification", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "name": "Send Push Notification", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "name": "Send Push Notification", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "operation": "http_request", + "url": "https://fcm.googleapis.com/fcm/send", + "method": "POST", + "headers": { + "Authorization": "{{ 'Bearer ' + $env.FCM_KEY }}" + }, + "body": { + "to": "{{ $steps.fetch_user_email.output.fcmToken }}", + "notification": { + "title": "{{ $json.title }}", + "body": "{{ $json.message }}" + } + } + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 900 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 900 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 900 + ], + "parameters": { + "action": "http_response", + "status": 202, + "body": { + "notificationId": "{{ $steps.create_notification_record.output.id }}", + "message": "Notification dispatched successfully" + } + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/notification_center/workflow/dispatch.jsonscript b/packages/notification_center/workflow/dispatch.jsonscript deleted file mode 100644 index 33c2be01d..000000000 --- a/packages/notification_center/workflow/dispatch.jsonscript +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "Dispatch Notification", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "userId": "required|string", - "type": "required|string", - "title": "required|string|maxLength:200", - "message": "required|string|maxLength:1000", - "channels": "required|array" - } - } - } - }, - { - "id": "fetch_user_preferences", - "name": "Fetch User Preferences", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch User Preferences", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "NotificationPreference" - } - } - }, - { - "id": "create_notification_record", - "name": "Create Notification Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Notification Record", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "userId": "{{ $json.userId }}", - "type": "{{ $json.type }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "isRead": false, - "metadata": "{{ $json.metadata || {} }}", - "createdAt": "{{ new Date().toISOString() }}", - "expiresAt": "{{ new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Notification" - } - } - }, - { - "id": "dispatch_in_app", - "name": "Dispatch In App", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Dispatch In App", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $json.channels.includes('in_app') && $steps.fetch_user_preferences.output.enableInApp !== false }}", - "operation": "condition" - } - } - }, - { - "id": "emit_in_app_notification", - "name": "Emit In App Notification", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit In App Notification", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "title": "{{ $json.title }}", - "message": "{{ $json.message }}", - "type": "{{ $json.type }}" - }, - "action": "emit_event", - "event": "notification_received", - "channel": "{{ 'user:' + $json.userId }}" - } - } - }, - { - "id": "check_email_rate_limit", - "name": "Check Email Rate Limit", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Check Email Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $json.channels.includes('email') && $steps.fetch_user_preferences.output.enableEmail !== false }}", - "operation": "condition" - } - } - }, - { - "id": "apply_email_rate_limit", - "name": "Apply Email Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Apply Email Rate Limit", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ 'email:' + $json.userId }}", - "limit": 10, - "window": 3600000 - } - } - }, - { - "id": "fetch_user_email", - "name": "Fetch User Email", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Fetch User Email", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "send_email", - "name": "Send Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Send Email", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "operation": "email_send", - "to": "{{ $steps.fetch_user_email.output.email }}", - "subject": "{{ $json.title }}", - "body": "{{ $json.message }}", - "template": "{{ $json.emailTemplate || 'default' }}" - } - } - }, - { - "id": "dispatch_push", - "name": "Dispatch Push", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Dispatch Push", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "condition": "{{ $json.channels.includes('push') && $steps.fetch_user_preferences.output.enablePush !== false }}", - "operation": "condition" - } - } - }, - { - "id": "send_push_notification", - "name": "Send Push Notification", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Send Push Notification", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "operation": "http_request", - "url": "https://fcm.googleapis.com/fcm/send", - "method": "POST", - "headers": { - "Authorization": "{{ 'Bearer ' + $env.FCM_KEY }}" - }, - "body": { - "to": "{{ $steps.fetch_user_email.output.fcmToken }}", - "notification": { - "title": "{{ $json.title }}", - "body": "{{ $json.message }}" - } - } - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "action": "http_response", - "status": 202, - "body": { - "notificationId": "{{ $steps.create_notification_record.output.id }}", - "message": "Notification dispatched successfully" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/list-unread.backup.backup.jsonscript b/packages/notification_center/workflow/list-unread.backup.backup.jsonscript deleted file mode 100644 index b2ca4120b..000000000 --- a/packages/notification_center/workflow/list-unread.backup.backup.jsonscript +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "List Unread Notifications", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 50, 200) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_unread", - "name": "Fetch Unread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "Notification" - } - }, - { - "id": "count_unread", - "name": "Count Unread", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "operation": "database_count", - "entity": "Notification" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "notifications": "{{ $steps.fetch_unread.output }}", - "unreadCount": "{{ $steps.count_unread.output }}", - "pagination": { - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_unread.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Fetch all unread notifications for current user with pagination" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/list-unread.backup.jsonscript b/packages/notification_center/workflow/list-unread.backup.jsonscript deleted file mode 100644 index 2d0455c20..000000000 --- a/packages/notification_center/workflow/list-unread.backup.jsonscript +++ /dev/null @@ -1,176 +0,0 @@ -{ - "name": "List Unread Notifications", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Pagination", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 50, 200) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "fetch_unread", - "name": "Fetch Unread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Unread", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "Notification" - } - } - }, - { - "id": "count_unread", - "name": "Count Unread", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count Unread", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "operation": "database_count", - "entity": "Notification" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "notifications": "{{ $steps.fetch_unread.output }}", - "unreadCount": "{{ $steps.count_unread.output }}", - "pagination": { - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_unread.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/list-unread.json b/packages/notification_center/workflow/list-unread.json new file mode 100644 index 000000000..da1d3b93d --- /dev/null +++ b/packages/notification_center/workflow/list-unread.json @@ -0,0 +1,224 @@ +{ + "name": "List Unread Notifications", + "active": false, + "nodes": [ + { + "id": "validate_context", + "name": "Validate Context", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } + } + } + }, + { + "id": "extract_pagination", + "name": "Extract Pagination", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Extract Pagination", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "output": { + "limit": "{{ Math.min($json.limit || 50, 200) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "fetch_unread", + "name": "Fetch Unread", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Unread", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Fetch Unread", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isRead": false + }, + "sort": { + "createdAt": -1 + }, + "limit": "{{ $steps.extract_pagination.output.limit }}", + "offset": "{{ $steps.extract_pagination.output.offset }}", + "operation": "database_read", + "entity": "Notification" + } + } + } + }, + { + "id": "count_unread", + "name": "Count Unread", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count Unread", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Count Unread", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "isRead": false + }, + "operation": "database_count", + "entity": "Notification" + } + } + } + }, + { + "id": "format_response", + "name": "Format Response", + "type": "metabuilder.transform", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Format Response", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": { + "notifications": "{{ $steps.fetch_unread.output }}", + "unreadCount": "{{ $steps.count_unread.output }}", + "pagination": { + "page": "{{ $json.page || 1 }}", + "limit": "{{ $steps.extract_pagination.output.limit }}", + "hasMore": "{{ $steps.count_unread.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" + } + }, + "operation": "transform_data" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.format_response.output }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/notification_center/workflow/list-unread.jsonscript b/packages/notification_center/workflow/list-unread.jsonscript deleted file mode 100644 index 2d0455c20..000000000 --- a/packages/notification_center/workflow/list-unread.jsonscript +++ /dev/null @@ -1,176 +0,0 @@ -{ - "name": "List Unread Notifications", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Pagination", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 50, 200) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - } - }, - { - "id": "fetch_unread", - "name": "Fetch Unread", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Unread", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "Notification" - } - } - }, - { - "id": "count_unread", - "name": "Count Unread", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Count Unread", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "isRead": false - }, - "operation": "database_count", - "entity": "Notification" - } - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Format Response", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "notifications": "{{ $steps.fetch_unread.output }}", - "unreadCount": "{{ $steps.count_unread.output }}", - "pagination": { - "page": "{{ $json.page || 1 }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "hasMore": "{{ $steps.count_unread.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" - } - }, - "operation": "transform_data" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/mark-as-read.backup.backup.jsonscript b/packages/notification_center/workflow/mark-as-read.backup.backup.jsonscript deleted file mode 100644 index 12e0a5bf1..000000000 --- a/packages/notification_center/workflow/mark-as-read.backup.backup.jsonscript +++ /dev/null @@ -1,145 +0,0 @@ -{ - "name": "Mark Notification as Read", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "check_bulk_vs_single", - "name": "Check Bulk Vs Single", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ Array.isArray($json.notificationIds) }}", - "operation": "condition" - } - }, - { - "id": "mark_single", - "name": "Mark Single", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.notificationId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "Notification" - } - }, - { - "id": "mark_bulk", - "name": "Mark Bulk", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": { - "$in": "{{ $json.notificationIds }}" - }, - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update_many", - "entity": "Notification" - } - }, - { - "id": "emit_read_event", - "name": "Emit Read Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "notificationIds": "{{ Array.isArray($json.notificationIds) ? $json.notificationIds : [$json.notificationId] }}" - }, - "action": "emit_event", - "event": "notification_read", - "channel": "{{ 'user:' + $context.user.id }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Notification(s) marked as read" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Mark single or multiple notifications as read by user" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/notification_center/workflow/mark-as-read.backup.jsonscript b/packages/notification_center/workflow/mark-as-read.json similarity index 51% rename from packages/notification_center/workflow/mark-as-read.backup.jsonscript rename to packages/notification_center/workflow/mark-as-read.json index 8f081be9b..4904ccb22 100644 --- a/packages/notification_center/workflow/mark-as-read.backup.jsonscript +++ b/packages/notification_center/workflow/mark-as-read.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,9 +50,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -65,8 +81,16 @@ 100 ], "parameters": { - "condition": "{{ Array.isArray($json.notificationIds) }}", - "operation": "condition" + "name": "Check Bulk Vs Single", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ Array.isArray($json.notificationIds) }}", + "operation": "condition" + } } } }, @@ -87,17 +111,25 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $json.notificationId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "Notification" + "name": "Mark Single", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.notificationId }}", + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "data": { + "isRead": true, + "readAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "Notification" + } } } }, @@ -118,19 +150,27 @@ 300 ], "parameters": { - "filter": { - "id": { - "$in": "{{ $json.notificationIds }}" + "name": "Mark Bulk", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "filter": { + "id": { + "$in": "{{ $json.notificationIds }}" + }, + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" }, - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update_many", - "entity": "Notification" + "data": { + "isRead": true, + "readAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update_many", + "entity": "Notification" + } } } }, @@ -151,12 +191,20 @@ 300 ], "parameters": { - "data": { - "notificationIds": "{{ Array.isArray($json.notificationIds) ? $json.notificationIds : [$json.notificationId] }}" - }, - "action": "emit_event", - "event": "notification_read", - "channel": "{{ 'user:' + $context.user.id }}" + "name": "Emit Read Event", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "notificationIds": "{{ Array.isArray($json.notificationIds) ? $json.notificationIds : [$json.notificationId] }}" + }, + "action": "emit_event", + "event": "notification_read", + "channel": "{{ 'user:' + $context.user.id }}" + } } } }, @@ -177,10 +225,18 @@ 500 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Notification(s) marked as read" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Notification(s) marked as read" + } } } } diff --git a/packages/notification_center/workflow/mark-as-read.jsonscript b/packages/notification_center/workflow/mark-as-read.jsonscript deleted file mode 100644 index 8f081be9b..000000000 --- a/packages/notification_center/workflow/mark-as-read.jsonscript +++ /dev/null @@ -1,199 +0,0 @@ -{ - "name": "Mark Notification as Read", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_user", - "name": "Validate User", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "check_bulk_vs_single", - "name": "Check Bulk Vs Single", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Bulk Vs Single", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ Array.isArray($json.notificationIds) }}", - "operation": "condition" - } - } - }, - { - "id": "mark_single", - "name": "Mark Single", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Mark Single", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.notificationId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "Notification" - } - } - }, - { - "id": "mark_bulk", - "name": "Mark Bulk", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Mark Bulk", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": { - "$in": "{{ $json.notificationIds }}" - }, - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "data": { - "isRead": true, - "readAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update_many", - "entity": "Notification" - } - } - }, - { - "id": "emit_read_event", - "name": "Emit Read Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Emit Read Event", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "notificationIds": "{{ Array.isArray($json.notificationIds) ? $json.notificationIds : [$json.notificationId] }}" - }, - "action": "emit_event", - "event": "notification_read", - "channel": "{{ 'user:' + $context.user.id }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Notification(s) marked as read" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/scene-transition.backup.backup.jsonscript b/packages/stream_cast/workflow/scene-transition.backup.backup.jsonscript deleted file mode 100644 index f6fb614bc..000000000 --- a/packages/stream_cast/workflow/scene-transition.backup.backup.jsonscript +++ /dev/null @@ -1,122 +0,0 @@ -{ - "name": "Handle Scene Transition", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 2 }}", - "operation": "condition" - } - }, - { - "id": "fetch_channel", - "name": "Fetch Channel", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "StreamChannel" - } - }, - { - "id": "update_active_scene", - "name": "Update Active Scene", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}" - }, - "data": { - "activeSceneId": "{{ $json.sceneId }}", - "sceneChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "StreamChannel" - } - }, - { - "id": "emit_scene_change", - "name": "Emit Scene Change", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "sceneId": "{{ $json.sceneId }}", - "transitionTime": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "scene_changed", - "channel": "{{ 'stream:' + $json.channelId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Scene updated" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Update stream scene and broadcast to viewers" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/scene-transition.backup.jsonscript b/packages/stream_cast/workflow/scene-transition.json similarity index 54% rename from packages/stream_cast/workflow/scene-transition.backup.jsonscript rename to packages/stream_cast/workflow/scene-transition.json index 04eeea3fa..971a1e5a3 100644 --- a/packages/stream_cast/workflow/scene-transition.backup.jsonscript +++ b/packages/stream_cast/workflow/scene-transition.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,8 +50,16 @@ 100 ], "parameters": { - "condition": "{{ $context.user.level >= 2 }}", - "operation": "condition" + "name": "Check Authorization", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "condition": "{{ $context.user.level >= 2 }}", + "operation": "condition" + } } } }, @@ -64,12 +80,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "StreamChannel" + "name": "Fetch Channel", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.channelId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "StreamChannel" + } } } }, @@ -90,15 +114,23 @@ 300 ], "parameters": { - "filter": { - "id": "{{ $json.channelId }}" - }, - "data": { - "activeSceneId": "{{ $json.sceneId }}", - "sceneChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "StreamChannel" + "name": "Update Active Scene", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "filter": { + "id": "{{ $json.channelId }}" + }, + "data": { + "activeSceneId": "{{ $json.sceneId }}", + "sceneChangedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "StreamChannel" + } } } }, @@ -119,13 +151,21 @@ 300 ], "parameters": { - "data": { - "sceneId": "{{ $json.sceneId }}", - "transitionTime": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "scene_changed", - "channel": "{{ 'stream:' + $json.channelId }}" + "name": "Emit Scene Change", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "sceneId": "{{ $json.sceneId }}", + "transitionTime": "{{ new Date().toISOString() }}" + }, + "action": "emit_event", + "event": "scene_changed", + "channel": "{{ 'stream:' + $json.channelId }}" + } } } }, @@ -146,10 +186,18 @@ 300 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Scene updated" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Scene updated" + } } } } diff --git a/packages/stream_cast/workflow/scene-transition.jsonscript b/packages/stream_cast/workflow/scene-transition.jsonscript deleted file mode 100644 index 04eeea3fa..000000000 --- a/packages/stream_cast/workflow/scene-transition.jsonscript +++ /dev/null @@ -1,168 +0,0 @@ -{ - "name": "Handle Scene Transition", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "check_authorization", - "name": "Check Authorization", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Check Authorization", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 2 }}", - "operation": "condition" - } - } - }, - { - "id": "fetch_channel", - "name": "Fetch Channel", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch Channel", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "StreamChannel" - } - } - }, - { - "id": "update_active_scene", - "name": "Update Active Scene", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Update Active Scene", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}" - }, - "data": { - "activeSceneId": "{{ $json.sceneId }}", - "sceneChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "StreamChannel" - } - } - }, - { - "id": "emit_scene_change", - "name": "Emit Scene Change", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Emit Scene Change", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "sceneId": "{{ $json.sceneId }}", - "transitionTime": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "scene_changed", - "channel": "{{ 'stream:' + $json.channelId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Scene updated" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/stream-subscribe.backup.backup.jsonscript b/packages/stream_cast/workflow/stream-subscribe.backup.backup.jsonscript deleted file mode 100644 index 7aa6ba214..000000000 --- a/packages/stream_cast/workflow/stream-subscribe.backup.backup.jsonscript +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "Subscribe to Stream", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_channel", - "name": "Fetch Channel", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "StreamChannel" - } - }, - { - "id": "create_subscription", - "name": "Create Subscription", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "subscribedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "StreamSubscription" - } - }, - { - "id": "setup_sse", - "name": "Setup Sse", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "sse_stream", - "channel": "{{ 'stream:' + $json.channelId }}", - "onConnect": "{{ { subscriptionId: $steps.create_subscription.output.id } }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Subscribe user to stream updates via SSE" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/stream-subscribe.jsonscript b/packages/stream_cast/workflow/stream-subscribe.json similarity index 53% rename from packages/stream_cast/workflow/stream-subscribe.jsonscript rename to packages/stream_cast/workflow/stream-subscribe.json index 47862c35e..866fdf9d4 100644 --- a/packages/stream_cast/workflow/stream-subscribe.jsonscript +++ b/packages/stream_cast/workflow/stream-subscribe.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.channelId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "StreamChannel" + "name": "Fetch Channel", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.channelId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "StreamChannel" + } } } }, @@ -68,14 +84,22 @@ 100 ], "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "subscribedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "StreamSubscription" + "name": "Create Subscription", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "data": { + "channelId": "{{ $json.channelId }}", + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}", + "subscribedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "StreamSubscription" + } } } }, @@ -96,9 +120,17 @@ 300 ], "parameters": { - "action": "sse_stream", - "channel": "{{ 'stream:' + $json.channelId }}", - "onConnect": "{{ { subscriptionId: $steps.create_subscription.output.id } }}" + "name": "Setup Sse", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "action": "sse_stream", + "channel": "{{ 'stream:' + $json.channelId }}", + "onConnect": "{{ { subscriptionId: $steps.create_subscription.output.id } }}" + } } } } diff --git a/packages/stream_cast/workflow/stream-unsubscribe.backup.backup.jsonscript b/packages/stream_cast/workflow/stream-unsubscribe.backup.backup.jsonscript deleted file mode 100644 index 86c600d8a..000000000 --- a/packages/stream_cast/workflow/stream-unsubscribe.backup.backup.jsonscript +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "Unsubscribe from Stream", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "delete_subscription", - "name": "Delete Subscription", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_delete", - "entity": "StreamSubscription" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Unsubscribed successfully" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Remove user stream subscription" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/stream-unsubscribe.backup.jsonscript b/packages/stream_cast/workflow/stream-unsubscribe.json similarity index 58% rename from packages/stream_cast/workflow/stream-unsubscribe.backup.jsonscript rename to packages/stream_cast/workflow/stream-unsubscribe.json index 0e03a6827..9181b6aef 100644 --- a/packages/stream_cast/workflow/stream-unsubscribe.backup.jsonscript +++ b/packages/stream_cast/workflow/stream-unsubscribe.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,13 +50,21 @@ 100 ], "parameters": { - "filter": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_delete", - "entity": "StreamSubscription" + "name": "Delete Subscription", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "channelId": "{{ $json.channelId }}", + "userId": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_delete", + "entity": "StreamSubscription" + } } } }, @@ -69,10 +85,18 @@ 100 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Unsubscribed successfully" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Unsubscribed successfully" + } } } } diff --git a/packages/stream_cast/workflow/stream-unsubscribe.jsonscript b/packages/stream_cast/workflow/stream-unsubscribe.jsonscript deleted file mode 100644 index 0e03a6827..000000000 --- a/packages/stream_cast/workflow/stream-unsubscribe.jsonscript +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "Unsubscribe from Stream", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "delete_subscription", - "name": "Delete Subscription", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Delete Subscription", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_delete", - "entity": "StreamSubscription" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Unsubscribed successfully" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/viewer-count-update.backup.backup.jsonscript b/packages/stream_cast/workflow/viewer-count-update.backup.backup.jsonscript deleted file mode 100644 index 4a7fa2403..000000000 --- a/packages/stream_cast/workflow/viewer-count-update.backup.backup.jsonscript +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "Update Viewer Count", - "active": false, - "nodes": [ - { - "id": "fetch_active_streams", - "name": "Fetch Active Streams", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "filter": { - "isLive": true - }, - "operation": "database_read", - "entity": "StreamChannel" - } - }, - { - "id": "update_viewer_counts", - "name": "Update Viewer Counts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_viewers", - "op": "database_count", - "entity": "StreamSubscription", - "params": { - "filter": { - "channelId": "{{ $steps.fetch_active_streams.output.id }}" - } - } - }, - { - "id": "fetch_channel_stats", - "op": "database_read", - "entity": "StreamChannel", - "params": { - "filter": { - "id": "{{ $steps.fetch_active_streams.output.id }}" - } - } - } - ] - } - }, - { - "id": "broadcast_counts", - "name": "Broadcast Counts", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "viewerCount": "{{ $steps.update_viewer_counts.tasks.count_viewers.output }}", - "liveTime": "{{ new Date() - new Date($steps.update_viewer_counts.tasks.fetch_channel_stats.output.startedAt) }}" - }, - "action": "emit_event", - "event": "viewer_count_updated", - "channel": "{{ 'stream:' + $steps.fetch_active_streams.output.id }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Update and broadcast current viewer count" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/viewer-count-update.backup.jsonscript b/packages/stream_cast/workflow/viewer-count-update.backup.jsonscript deleted file mode 100644 index 231540c23..000000000 --- a/packages/stream_cast/workflow/viewer-count-update.backup.jsonscript +++ /dev/null @@ -1,111 +0,0 @@ -{ - "name": "Update Viewer Count", - "active": false, - "nodes": [ - { - "id": "fetch_active_streams", - "name": "Fetch Active Streams", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Fetch Active Streams", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "filter": { - "isLive": true - }, - "operation": "database_read", - "entity": "StreamChannel" - } - } - }, - { - "id": "update_viewer_counts", - "name": "Update Viewer Counts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Update Viewer Counts", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_viewers", - "op": "database_count", - "entity": "StreamSubscription", - "params": { - "filter": { - "channelId": "{{ $steps.fetch_active_streams.output.id }}" - } - } - }, - { - "id": "fetch_channel_stats", - "op": "database_read", - "entity": "StreamChannel", - "params": { - "filter": { - "id": "{{ $steps.fetch_active_streams.output.id }}" - } - } - } - ] - } - } - }, - { - "id": "broadcast_counts", - "name": "Broadcast Counts", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Broadcast Counts", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "viewerCount": "{{ $steps.update_viewer_counts.tasks.count_viewers.output }}", - "liveTime": "{{ new Date() - new Date($steps.update_viewer_counts.tasks.fetch_channel_stats.output.startedAt) }}" - }, - "action": "emit_event", - "event": "viewer_count_updated", - "channel": "{{ 'stream:' + $steps.fetch_active_streams.output.id }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/stream_cast/workflow/viewer-count-update.json b/packages/stream_cast/workflow/viewer-count-update.json new file mode 100644 index 000000000..43f8d6b7a --- /dev/null +++ b/packages/stream_cast/workflow/viewer-count-update.json @@ -0,0 +1,135 @@ +{ + "name": "Update Viewer Count", + "active": false, + "nodes": [ + { + "id": "fetch_active_streams", + "name": "Fetch Active Streams", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Fetch Active Streams", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Fetch Active Streams", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "filter": { + "isLive": true + }, + "operation": "database_read", + "entity": "StreamChannel" + } + } + } + }, + { + "id": "update_viewer_counts", + "name": "Update Viewer Counts", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Update Viewer Counts", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Update Viewer Counts", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "operation": "parallel", + "tasks": [ + { + "id": "count_viewers", + "op": "database_count", + "entity": "StreamSubscription", + "params": { + "filter": { + "channelId": "{{ $steps.fetch_active_streams.output.id }}" + } + } + }, + { + "id": "fetch_channel_stats", + "op": "database_read", + "entity": "StreamChannel", + "params": { + "filter": { + "id": "{{ $steps.fetch_active_streams.output.id }}" + } + } + } + ] + } + } + } + }, + { + "id": "broadcast_counts", + "name": "Broadcast Counts", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Broadcast Counts", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Broadcast Counts", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "data": { + "viewerCount": "{{ $steps.update_viewer_counts.tasks.count_viewers.output }}", + "liveTime": "{{ new Date() - new Date($steps.update_viewer_counts.tasks.fetch_channel_stats.output.startedAt) }}" + }, + "action": "emit_event", + "event": "viewer_count_updated", + "channel": "{{ 'stream:' + $steps.fetch_active_streams.output.id }}" + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/stream_cast/workflow/viewer-count-update.jsonscript b/packages/stream_cast/workflow/viewer-count-update.jsonscript deleted file mode 100644 index 231540c23..000000000 --- a/packages/stream_cast/workflow/viewer-count-update.jsonscript +++ /dev/null @@ -1,111 +0,0 @@ -{ - "name": "Update Viewer Count", - "active": false, - "nodes": [ - { - "id": "fetch_active_streams", - "name": "Fetch Active Streams", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Fetch Active Streams", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "filter": { - "isLive": true - }, - "operation": "database_read", - "entity": "StreamChannel" - } - } - }, - { - "id": "update_viewer_counts", - "name": "Update Viewer Counts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Update Viewer Counts", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "parallel", - "tasks": [ - { - "id": "count_viewers", - "op": "database_count", - "entity": "StreamSubscription", - "params": { - "filter": { - "channelId": "{{ $steps.fetch_active_streams.output.id }}" - } - } - }, - { - "id": "fetch_channel_stats", - "op": "database_read", - "entity": "StreamChannel", - "params": { - "filter": { - "id": "{{ $steps.fetch_active_streams.output.id }}" - } - } - } - ] - } - } - }, - { - "id": "broadcast_counts", - "name": "Broadcast Counts", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Broadcast Counts", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "viewerCount": "{{ $steps.update_viewer_counts.tasks.count_viewers.output }}", - "liveTime": "{{ new Date() - new Date($steps.update_viewer_counts.tasks.fetch_channel_stats.output.startedAt) }}" - }, - "action": "emit_event", - "event": "viewer_count_updated", - "channel": "{{ 'stream:' + $steps.fetch_active_streams.output.id }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/login-workflow.backup.backup.jsonscript b/packages/ui_auth/workflow/login-workflow.backup.backup.jsonscript deleted file mode 100644 index 8d854be57..000000000 --- a/packages/ui_auth/workflow/login-workflow.backup.backup.jsonscript +++ /dev/null @@ -1,233 +0,0 @@ -{ - "name": "Login Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 5, - "window": 60000, - "errorMessage": "Too many login attempts. Please try again in a few minutes." - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email", - "password": "required|string|minLength:6" - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "check_user_exists", - "name": "Check User Exists", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" - } - }, - { - "id": "verify_password", - "name": "Verify Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" - } - }, - { - "id": "check_password_valid", - "name": "Check Password Valid", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "condition": "{{ $steps.verify_password.output === true }}", - "operation": "condition" - } - }, - { - "id": "check_account_active", - "name": "Check Account Active", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output.isActive !== false }}", - "operation": "condition" - } - }, - { - "id": "generate_session", - "name": "Generate Session", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "generate_jwt", - "payload": { - "userId": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "level": "{{ $steps.fetch_user.output.level }}" - }, - "secret": "{{ $env.JWT_SECRET }}", - "expiresIn": "24h" - } - }, - { - "id": "create_session_record", - "name": "Create Session Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "token": "{{ $steps.generate_session.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}", - "expiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Session" - } - }, - { - "id": "update_last_login", - "name": "Update Last Login", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_user.output.id }}" - }, - "data": { - "lastLogin": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" - } - }, - { - "id": "emit_login_event", - "name": "Emit Login Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "user_login", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "token": "{{ $steps.generate_session.output }}", - "user": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "User login with email/password, rate limiting, and session creation" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/login-workflow.backup.jsonscript b/packages/ui_auth/workflow/login-workflow.backup.jsonscript deleted file mode 100644 index 05bbe94fb..000000000 --- a/packages/ui_auth/workflow/login-workflow.backup.jsonscript +++ /dev/null @@ -1,327 +0,0 @@ -{ - "name": "Login Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Apply Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 5, - "window": 60000, - "errorMessage": "Too many login attempts. Please try again in a few minutes." - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email", - "password": "required|string|minLength:6" - } - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch User", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "check_user_exists", - "name": "Check User Exists", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check User Exists", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" - } - } - }, - { - "id": "verify_password", - "name": "Verify Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Verify Password", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" - } - } - }, - { - "id": "check_password_valid", - "name": "Check Password Valid", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Check Password Valid", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "condition": "{{ $steps.verify_password.output === true }}", - "operation": "condition" - } - } - }, - { - "id": "check_account_active", - "name": "Check Account Active", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Check Account Active", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output.isActive !== false }}", - "operation": "condition" - } - } - }, - { - "id": "generate_session", - "name": "Generate Session", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Generate Session", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "generate_jwt", - "payload": { - "userId": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "level": "{{ $steps.fetch_user.output.level }}" - }, - "secret": "{{ $env.JWT_SECRET }}", - "expiresIn": "24h" - } - } - }, - { - "id": "create_session_record", - "name": "Create Session Record", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Create Session Record", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "token": "{{ $steps.generate_session.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}", - "expiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Session" - } - } - }, - { - "id": "update_last_login", - "name": "Update Last Login", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Update Last Login", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "filter": { - "id": "{{ $steps.fetch_user.output.id }}" - }, - "data": { - "lastLogin": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" - } - } - }, - { - "id": "emit_login_event", - "name": "Emit Login Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Emit Login Event", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "user_login", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "token": "{{ $steps.generate_session.output }}", - "user": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}" - } - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/login-workflow.jsonscript b/packages/ui_auth/workflow/login-workflow.json similarity index 50% rename from packages/ui_auth/workflow/login-workflow.jsonscript rename to packages/ui_auth/workflow/login-workflow.json index 05bbe94fb..ab264480c 100644 --- a/packages/ui_auth/workflow/login-workflow.jsonscript +++ b/packages/ui_auth/workflow/login-workflow.json @@ -19,11 +19,19 @@ 100 ], "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 5, - "window": 60000, - "errorMessage": "Too many login attempts. Please try again in a few minutes." + "name": "Apply Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "operation": "rate_limit", + "key": "{{ $json.email }}", + "limit": 5, + "window": 60000, + "errorMessage": "Too many login attempts. Please try again in a few minutes." + } } } }, @@ -44,11 +52,19 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email", - "password": "required|string|minLength:6" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "email": "required|email", + "password": "required|string|minLength:6" + } } } } @@ -70,11 +86,19 @@ 100 ], "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "email": "{{ $json.email }}" + }, + "operation": "database_read", + "entity": "User" + } } } }, @@ -95,8 +119,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" + "name": "Check User Exists", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.fetch_user.output !== null }}", + "operation": "condition" + } } } }, @@ -117,9 +149,17 @@ 300 ], "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" + "name": "Verify Password", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "input": "{{ $json.password }}", + "operation": "bcrypt_compare", + "hash": "{{ $steps.fetch_user.output.passwordHash }}" + } } } }, @@ -140,8 +180,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.verify_password.output === true }}", - "operation": "condition" + "name": "Check Password Valid", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "condition": "{{ $steps.verify_password.output === true }}", + "operation": "condition" + } } } }, @@ -162,8 +210,16 @@ 500 ], "parameters": { - "condition": "{{ $steps.fetch_user.output.isActive !== false }}", - "operation": "condition" + "name": "Check Account Active", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "condition": "{{ $steps.fetch_user.output.isActive !== false }}", + "operation": "condition" + } } } }, @@ -184,15 +240,23 @@ 500 ], "parameters": { - "operation": "generate_jwt", - "payload": { - "userId": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "level": "{{ $steps.fetch_user.output.level }}" - }, - "secret": "{{ $env.JWT_SECRET }}", - "expiresIn": "24h" + "name": "Generate Session", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "operation": "generate_jwt", + "payload": { + "userId": "{{ $steps.fetch_user.output.id }}", + "email": "{{ $steps.fetch_user.output.email }}", + "tenantId": "{{ $steps.fetch_user.output.tenantId }}", + "level": "{{ $steps.fetch_user.output.level }}" + }, + "secret": "{{ $env.JWT_SECRET }}", + "expiresIn": "24h" + } } } }, @@ -213,16 +277,24 @@ 500 ], "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "token": "{{ $steps.generate_session.output }}", - "ipAddress": "{{ $json.ipAddress }}", - "userAgent": "{{ $json.userAgent }}", - "expiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "Session" + "name": "Create Session Record", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "data": { + "userId": "{{ $steps.fetch_user.output.id }}", + "tenantId": "{{ $steps.fetch_user.output.tenantId }}", + "token": "{{ $steps.generate_session.output }}", + "ipAddress": "{{ $json.ipAddress }}", + "userAgent": "{{ $json.userAgent }}", + "expiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}" + }, + "operation": "database_create", + "entity": "Session" + } } } }, @@ -243,14 +315,22 @@ 700 ], "parameters": { - "filter": { - "id": "{{ $steps.fetch_user.output.id }}" - }, - "data": { - "lastLogin": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" + "name": "Update Last Login", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "filter": { + "id": "{{ $steps.fetch_user.output.id }}" + }, + "data": { + "lastLogin": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "User" + } } } }, @@ -271,14 +351,22 @@ 700 ], "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "user_login", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" + "name": "Emit Login Event", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "data": { + "userId": "{{ $steps.fetch_user.output.id }}", + "tenantId": "{{ $steps.fetch_user.output.tenantId }}", + "timestamp": "{{ new Date().toISOString() }}" + }, + "action": "emit_event", + "event": "user_login", + "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" + } } } }, @@ -299,15 +387,23 @@ 700 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "token": "{{ $steps.generate_session.output }}", - "user": { - "id": "{{ $steps.fetch_user.output.id }}", - "email": "{{ $steps.fetch_user.output.email }}", - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "tenantId": "{{ $steps.fetch_user.output.tenantId }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 700 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "token": "{{ $steps.generate_session.output }}", + "user": { + "id": "{{ $steps.fetch_user.output.id }}", + "email": "{{ $steps.fetch_user.output.email }}", + "displayName": "{{ $steps.fetch_user.output.displayName }}", + "tenantId": "{{ $steps.fetch_user.output.tenantId }}" + } } } } diff --git a/packages/ui_auth/workflow/password-change-workflow.backup.backup.jsonscript b/packages/ui_auth/workflow/password-change-workflow.backup.backup.jsonscript deleted file mode 100644 index 6ea6dd4eb..000000000 --- a/packages/ui_auth/workflow/password-change-workflow.backup.backup.jsonscript +++ /dev/null @@ -1,210 +0,0 @@ -{ - "name": "Password Change Workflow", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "currentPassword": "required|string", - "newPassword": "required|string|minLength:8|different:currentPassword", - "confirmPassword": "required|string|same:newPassword" - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "verify_current_password", - "name": "Verify Current Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $json.currentPassword }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" - } - }, - { - "id": "check_password_correct", - "name": "Check Password Correct", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.verify_current_password.output === true }}", - "operation": "condition" - } - }, - { - "id": "hash_new_password", - "name": "Hash New Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $json.newPassword }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - }, - { - "id": "update_password", - "name": "Update Password", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}" - }, - "data": { - "passwordHash": "{{ $steps.hash_new_password.output }}", - "passwordChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" - } - }, - { - "id": "invalidate_sessions", - "name": "Invalidate Sessions", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "id": { - "$ne": "{{ $context.sessionId }}" - } - }, - "operation": "database_delete_many", - "entity": "Session" - } - }, - { - "id": "send_confirmation_email", - "name": "Send Confirmation Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "operation": "email_send", - "to": "{{ $steps.fetch_user.output.email }}", - "subject": "Your password has been changed", - "template": "password_changed" - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "data": { - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "password_changed", - "channel": "{{ 'user:' + $context.user.id }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Password changed successfully. All other sessions have been invalidated for security." - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Change password for authenticated user with old password verification" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/password-change-workflow.backup.jsonscript b/packages/ui_auth/workflow/password-change-workflow.json similarity index 51% rename from packages/ui_auth/workflow/password-change-workflow.backup.jsonscript rename to packages/ui_auth/workflow/password-change-workflow.json index 8eb4579b4..47cba2b06 100644 --- a/packages/ui_auth/workflow/password-change-workflow.backup.jsonscript +++ b/packages/ui_auth/workflow/password-change-workflow.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.user.id }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,12 +50,20 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "currentPassword": "required|string", - "newPassword": "required|string|minLength:8|different:currentPassword", - "confirmPassword": "required|string|same:newPassword" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "currentPassword": "required|string", + "newPassword": "required|string|minLength:8|different:currentPassword", + "confirmPassword": "required|string|same:newPassword" + } } } } @@ -69,12 +85,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $context.user.id }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } } } }, @@ -95,9 +119,17 @@ 300 ], "parameters": { - "input": "{{ $json.currentPassword }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" + "name": "Verify Current Password", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "input": "{{ $json.currentPassword }}", + "operation": "bcrypt_compare", + "hash": "{{ $steps.fetch_user.output.passwordHash }}" + } } } }, @@ -118,8 +150,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.verify_current_password.output === true }}", - "operation": "condition" + "name": "Check Password Correct", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "condition": "{{ $steps.verify_current_password.output === true }}", + "operation": "condition" + } } } }, @@ -140,9 +180,17 @@ 300 ], "parameters": { - "input": "{{ $json.newPassword }}", - "operation": "bcrypt_hash", - "rounds": 12 + "name": "Hash New Password", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "input": "{{ $json.newPassword }}", + "operation": "bcrypt_hash", + "rounds": 12 + } } } }, @@ -163,15 +211,23 @@ 500 ], "parameters": { - "filter": { - "id": "{{ $context.user.id }}" - }, - "data": { - "passwordHash": "{{ $steps.hash_new_password.output }}", - "passwordChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" + "name": "Update Password", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "filter": { + "id": "{{ $context.user.id }}" + }, + "data": { + "passwordHash": "{{ $steps.hash_new_password.output }}", + "passwordChangedAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_update", + "entity": "User" + } } } }, @@ -192,14 +248,22 @@ 500 ], "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "id": { - "$ne": "{{ $context.sessionId }}" - } - }, - "operation": "database_delete_many", - "entity": "Session" + "name": "Invalidate Sessions", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "filter": { + "userId": "{{ $context.user.id }}", + "id": { + "$ne": "{{ $context.sessionId }}" + } + }, + "operation": "database_delete_many", + "entity": "Session" + } } } }, @@ -220,14 +284,22 @@ 500 ], "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "operation": "email_send", - "to": "{{ $steps.fetch_user.output.email }}", - "subject": "Your password has been changed", - "template": "password_changed" + "name": "Send Confirmation Email", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "data": { + "displayName": "{{ $steps.fetch_user.output.displayName }}", + "timestamp": "{{ new Date().toISOString() }}" + }, + "operation": "email_send", + "to": "{{ $steps.fetch_user.output.email }}", + "subject": "Your password has been changed", + "template": "password_changed" + } } } }, @@ -248,12 +320,20 @@ 700 ], "parameters": { - "data": { - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "password_changed", - "channel": "{{ 'user:' + $context.user.id }}" + "name": "Emit Event", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "data": { + "timestamp": "{{ new Date().toISOString() }}" + }, + "action": "emit_event", + "event": "password_changed", + "channel": "{{ 'user:' + $context.user.id }}" + } } } }, @@ -274,10 +354,18 @@ 700 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Password changed successfully. All other sessions have been invalidated for security." + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "Password changed successfully. All other sessions have been invalidated for security." + } } } } diff --git a/packages/ui_auth/workflow/password-change-workflow.jsonscript b/packages/ui_auth/workflow/password-change-workflow.jsonscript deleted file mode 100644 index 8eb4579b4..000000000 --- a/packages/ui_auth/workflow/password-change-workflow.jsonscript +++ /dev/null @@ -1,296 +0,0 @@ -{ - "name": "Password Change Workflow", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.user.id }}", - "operation": "validate", - "validator": "required" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "currentPassword": "required|string", - "newPassword": "required|string|minLength:8|different:currentPassword", - "confirmPassword": "required|string|same:newPassword" - } - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch User", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "verify_current_password", - "name": "Verify Current Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Verify Current Password", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $json.currentPassword }}", - "operation": "bcrypt_compare", - "hash": "{{ $steps.fetch_user.output.passwordHash }}" - } - } - }, - { - "id": "check_password_correct", - "name": "Check Password Correct", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Check Password Correct", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "condition": "{{ $steps.verify_current_password.output === true }}", - "operation": "condition" - } - } - }, - { - "id": "hash_new_password", - "name": "Hash New Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Hash New Password", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $json.newPassword }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - } - }, - { - "id": "update_password", - "name": "Update Password", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Update Password", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "filter": { - "id": "{{ $context.user.id }}" - }, - "data": { - "passwordHash": "{{ $steps.hash_new_password.output }}", - "passwordChangedAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_update", - "entity": "User" - } - } - }, - { - "id": "invalidate_sessions", - "name": "Invalidate Sessions", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Invalidate Sessions", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "filter": { - "userId": "{{ $context.user.id }}", - "id": { - "$ne": "{{ $context.sessionId }}" - } - }, - "operation": "database_delete_many", - "entity": "Session" - } - } - }, - { - "id": "send_confirmation_email", - "name": "Send Confirmation Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Send Confirmation Email", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "timestamp": "{{ new Date().toISOString() }}" - }, - "operation": "email_send", - "to": "{{ $steps.fetch_user.output.email }}", - "subject": "Your password has been changed", - "template": "password_changed" - } - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Emit Event", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "data": { - "timestamp": "{{ new Date().toISOString() }}" - }, - "action": "emit_event", - "event": "password_changed", - "channel": "{{ 'user:' + $context.user.id }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Password changed successfully. All other sessions have been invalidated for security." - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/password-reset-workflow.backup.backup.jsonscript b/packages/ui_auth/workflow/password-reset-workflow.backup.backup.jsonscript deleted file mode 100644 index 4b67fd7c0..000000000 --- a/packages/ui_auth/workflow/password-reset-workflow.backup.backup.jsonscript +++ /dev/null @@ -1,185 +0,0 @@ -{ - "name": "Password Reset Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 - } - }, - { - "id": "validate_email", - "name": "Validate Email", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email" - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "check_user_exists", - "name": "Check User Exists", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" - } - }, - { - "id": "generate_reset_token", - "name": "Generate Reset Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "operation": "generate_random_token", - "length": 32 - } - }, - { - "id": "hash_reset_token", - "name": "Hash Reset Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $steps.generate_reset_token.output }}", - "operation": "sha256" - } - }, - { - "id": "create_reset_request", - "name": "Create Reset Request", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "token": "{{ $steps.hash_reset_token.output }}", - "expiresAt": "{{ new Date(Date.now() + 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "PasswordResetToken" - } - }, - { - "id": "send_reset_email", - "name": "Send Reset Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "resetLink": "{{ $env.APP_URL }}/auth/reset-password/{{ $steps.generate_reset_token.output }}", - "expiresIn": "1 hour" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Reset your password", - "template": "password_reset" - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}" - }, - "action": "emit_event", - "event": "password_reset_requested", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "If an account exists with that email, a password reset link has been sent." - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Initiate password reset via email with secure token" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/password-reset-workflow.backup.jsonscript b/packages/ui_auth/workflow/password-reset-workflow.json similarity index 53% rename from packages/ui_auth/workflow/password-reset-workflow.backup.jsonscript rename to packages/ui_auth/workflow/password-reset-workflow.json index f912318f4..c6b386d2b 100644 --- a/packages/ui_auth/workflow/password-reset-workflow.backup.jsonscript +++ b/packages/ui_auth/workflow/password-reset-workflow.json @@ -19,10 +19,18 @@ 100 ], "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 + "name": "Apply Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "operation": "rate_limit", + "key": "{{ $json.email }}", + "limit": 3, + "window": 3600000 + } } } }, @@ -43,10 +51,18 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email" + "name": "Validate Email", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "email": "required|email" + } } } } @@ -68,11 +84,19 @@ 100 ], "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "email": "{{ $json.email }}" + }, + "operation": "database_read", + "entity": "User" + } } } }, @@ -93,8 +117,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" + "name": "Check User Exists", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.fetch_user.output !== null }}", + "operation": "condition" + } } } }, @@ -115,8 +147,16 @@ 300 ], "parameters": { - "operation": "generate_random_token", - "length": 32 + "name": "Generate Reset Token", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "operation": "generate_random_token", + "length": 32 + } } } }, @@ -137,8 +177,16 @@ 300 ], "parameters": { - "input": "{{ $steps.generate_reset_token.output }}", - "operation": "sha256" + "name": "Hash Reset Token", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "input": "{{ $steps.generate_reset_token.output }}", + "operation": "sha256" + } } } }, @@ -159,13 +207,21 @@ 500 ], "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "token": "{{ $steps.hash_reset_token.output }}", - "expiresAt": "{{ new Date(Date.now() + 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "PasswordResetToken" + "name": "Create Reset Request", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "userId": "{{ $steps.fetch_user.output.id }}", + "token": "{{ $steps.hash_reset_token.output }}", + "expiresAt": "{{ new Date(Date.now() + 60 * 60 * 1000).toISOString() }}" + }, + "operation": "database_create", + "entity": "PasswordResetToken" + } } } }, @@ -186,15 +242,23 @@ 500 ], "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "resetLink": "{{ $env.APP_URL }}/auth/reset-password/{{ $steps.generate_reset_token.output }}", - "expiresIn": "1 hour" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Reset your password", - "template": "password_reset" + "name": "Send Reset Email", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "data": { + "displayName": "{{ $steps.fetch_user.output.displayName }}", + "resetLink": "{{ $env.APP_URL }}/auth/reset-password/{{ $steps.generate_reset_token.output }}", + "expiresIn": "1 hour" + }, + "operation": "email_send", + "to": "{{ $json.email }}", + "subject": "Reset your password", + "template": "password_reset" + } } } }, @@ -215,12 +279,20 @@ 500 ], "parameters": { - "data": { - "email": "{{ $json.email }}" - }, - "action": "emit_event", - "event": "password_reset_requested", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" + "name": "Emit Event", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "data": { + "email": "{{ $json.email }}" + }, + "action": "emit_event", + "event": "password_reset_requested", + "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" + } } } }, @@ -241,10 +313,18 @@ 700 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "If an account exists with that email, a password reset link has been sent." + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "message": "If an account exists with that email, a password reset link has been sent." + } } } } diff --git a/packages/ui_auth/workflow/password-reset-workflow.jsonscript b/packages/ui_auth/workflow/password-reset-workflow.jsonscript deleted file mode 100644 index f912318f4..000000000 --- a/packages/ui_auth/workflow/password-reset-workflow.jsonscript +++ /dev/null @@ -1,263 +0,0 @@ -{ - "name": "Password Reset Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Apply Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 - } - } - }, - { - "id": "validate_email", - "name": "Validate Email", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Email", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email" - } - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Fetch User", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "email": "{{ $json.email }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "check_user_exists", - "name": "Check User Exists", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Check User Exists", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.fetch_user.output !== null }}", - "operation": "condition" - } - } - }, - { - "id": "generate_reset_token", - "name": "Generate Reset Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Generate Reset Token", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "operation": "generate_random_token", - "length": 32 - } - } - }, - { - "id": "hash_reset_token", - "name": "Hash Reset Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Hash Reset Token", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "input": "{{ $steps.generate_reset_token.output }}", - "operation": "sha256" - } - } - }, - { - "id": "create_reset_request", - "name": "Create Reset Request", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Create Reset Request", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.fetch_user.output.id }}", - "token": "{{ $steps.hash_reset_token.output }}", - "expiresAt": "{{ new Date(Date.now() + 60 * 60 * 1000).toISOString() }}" - }, - "operation": "database_create", - "entity": "PasswordResetToken" - } - } - }, - { - "id": "send_reset_email", - "name": "Send Reset Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Send Reset Email", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "data": { - "displayName": "{{ $steps.fetch_user.output.displayName }}", - "resetLink": "{{ $env.APP_URL }}/auth/reset-password/{{ $steps.generate_reset_token.output }}", - "expiresIn": "1 hour" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Reset your password", - "template": "password_reset" - } - } - }, - { - "id": "emit_event", - "name": "Emit Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Emit Event", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}" - }, - "action": "emit_event", - "event": "password_reset_requested", - "channel": "{{ 'user:' + $steps.fetch_user.output.id }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "If an account exists with that email, a password reset link has been sent." - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/register-workflow.backup.backup.jsonscript b/packages/ui_auth/workflow/register-workflow.backup.backup.jsonscript deleted file mode 100644 index 30b3208f0..000000000 --- a/packages/ui_auth/workflow/register-workflow.backup.backup.jsonscript +++ /dev/null @@ -1,168 +0,0 @@ -{ - "name": "Register Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "password": "required|string|minLength:8|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)/", - "displayName": "required|string|minLength:2|maxLength:100" - } - } - }, - { - "id": "hash_password", - "name": "Hash Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - }, - { - "id": "generate_verification_token", - "name": "Generate Verification Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "generate_random_token", - "length": 32 - } - }, - { - "id": "create_user", - "name": "Create User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "displayName": "{{ $json.displayName }}", - "tenantId": "{{ $json.tenantId }}", - "level": 0, - "isActive": false, - "isEmailVerified": false, - "verificationToken": "{{ $steps.generate_verification_token.output }}", - "verificationTokenExpiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}", - "firstLogin": true, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "User" - } - }, - { - "id": "send_verification_email", - "name": "Send Verification Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "displayName": "{{ $json.displayName }}", - "verificationLink": "{{ $env.APP_URL }}/auth/verify/{{ $steps.generate_verification_token.output }}" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Verify your email address", - "template": "email_verification" - } - }, - { - "id": "emit_register_event", - "name": "Emit Register Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}" - }, - "action": "emit_event", - "event": "user_registered", - "channel": "{{ 'tenant:' + $json.tenantId }}" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "message": "Registration successful. Please verify your email address.", - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "User registration with validation, password hashing, and email verification" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/register-workflow.backup.jsonscript b/packages/ui_auth/workflow/register-workflow.backup.jsonscript deleted file mode 100644 index 5899076c9..000000000 --- a/packages/ui_auth/workflow/register-workflow.backup.jsonscript +++ /dev/null @@ -1,230 +0,0 @@ -{ - "name": "Register Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Apply Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "password": "required|string|minLength:8|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)/", - "displayName": "required|string|minLength:2|maxLength:100" - } - } - } - }, - { - "id": "hash_password", - "name": "Hash Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Hash Password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - } - }, - { - "id": "generate_verification_token", - "name": "Generate Verification Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Generate Verification Token", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "generate_random_token", - "length": 32 - } - } - }, - { - "id": "create_user", - "name": "Create User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create User", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "displayName": "{{ $json.displayName }}", - "tenantId": "{{ $json.tenantId }}", - "level": 0, - "isActive": false, - "isEmailVerified": false, - "verificationToken": "{{ $steps.generate_verification_token.output }}", - "verificationTokenExpiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}", - "firstLogin": true, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "User" - } - } - }, - { - "id": "send_verification_email", - "name": "Send Verification Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Send Verification Email", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "displayName": "{{ $json.displayName }}", - "verificationLink": "{{ $env.APP_URL }}/auth/verify/{{ $steps.generate_verification_token.output }}" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Verify your email address", - "template": "email_verification" - } - } - }, - { - "id": "emit_register_event", - "name": "Emit Register Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Register Event", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}" - }, - "action": "emit_event", - "event": "user_registered", - "channel": "{{ 'tenant:' + $json.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "message": "Registration successful. Please verify your email address.", - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_auth/workflow/register-workflow.json b/packages/ui_auth/workflow/register-workflow.json new file mode 100644 index 000000000..d100502fb --- /dev/null +++ b/packages/ui_auth/workflow/register-workflow.json @@ -0,0 +1,294 @@ +{ + "name": "Register Workflow", + "active": false, + "nodes": [ + { + "id": "apply_rate_limit", + "name": "Apply Rate Limit", + "type": "metabuilder.rateLimit", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Apply Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "name": "Apply Rate Limit", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "operation": "rate_limit", + "key": "{{ $json.email }}", + "limit": 3, + "window": 3600000 + } + } + } + }, + { + "id": "validate_input", + "name": "Validate Input", + "type": "metabuilder.validate", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "email": "required|email|unique:User", + "password": "required|string|minLength:8|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)/", + "displayName": "required|string|minLength:2|maxLength:100" + } + } + } + } + }, + { + "id": "hash_password", + "name": "Hash Password", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Hash Password", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Hash Password", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.password }}", + "operation": "bcrypt_hash", + "rounds": 12 + } + } + } + }, + { + "id": "generate_verification_token", + "name": "Generate Verification Token", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Generate Verification Token", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "name": "Generate Verification Token", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "operation": "generate_random_token", + "length": 32 + } + } + } + }, + { + "id": "create_user", + "name": "Create User", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Create User", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "name": "Create User", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "email": "{{ $json.email }}", + "passwordHash": "{{ $steps.hash_password.output }}", + "displayName": "{{ $json.displayName }}", + "tenantId": "{{ $json.tenantId }}", + "level": 0, + "isActive": false, + "isEmailVerified": false, + "verificationToken": "{{ $steps.generate_verification_token.output }}", + "verificationTokenExpiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}", + "firstLogin": true, + "createdAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "User" + } + } + } + }, + { + "id": "send_verification_email", + "name": "Send Verification Email", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Send Verification Email", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Send Verification Email", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "displayName": "{{ $json.displayName }}", + "verificationLink": "{{ $env.APP_URL }}/auth/verify/{{ $steps.generate_verification_token.output }}" + }, + "operation": "email_send", + "to": "{{ $json.email }}", + "subject": "Verify your email address", + "template": "email_verification" + } + } + } + }, + { + "id": "emit_register_event", + "name": "Emit Register Event", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Register Event", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "name": "Emit Register Event", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "data": { + "userId": "{{ $steps.create_user.output.id }}", + "email": "{{ $json.email }}", + "displayName": "{{ $json.displayName }}" + }, + "action": "emit_event", + "event": "user_registered", + "channel": "{{ 'tenant:' + $json.tenantId }}" + } + } + } + }, + { + "id": "return_success", + "name": "Return Success", + "type": "metabuilder.action", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "name": "Return Success", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": { + "message": "Registration successful. Please verify your email address.", + "userId": "{{ $steps.create_user.output.id }}", + "email": "{{ $json.email }}" + } + } + } + } + } + ], + "connections": {}, + "staticData": {}, + "meta": {}, + "settings": { + "timezone": "UTC", + "executionTimeout": 3600, + "saveExecutionProgress": true, + "saveDataErrorExecution": "all", + "saveDataSuccessExecution": "all" + } +} diff --git a/packages/ui_auth/workflow/register-workflow.jsonscript b/packages/ui_auth/workflow/register-workflow.jsonscript deleted file mode 100644 index 5899076c9..000000000 --- a/packages/ui_auth/workflow/register-workflow.jsonscript +++ /dev/null @@ -1,230 +0,0 @@ -{ - "name": "Register Workflow", - "active": false, - "nodes": [ - { - "id": "apply_rate_limit", - "name": "Apply Rate Limit", - "type": "metabuilder.rateLimit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Apply Rate Limit", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "rate_limit", - "key": "{{ $json.email }}", - "limit": 3, - "window": 3600000 - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "password": "required|string|minLength:8|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)/", - "displayName": "required|string|minLength:2|maxLength:100" - } - } - } - }, - { - "id": "hash_password", - "name": "Hash Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Hash Password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.password }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - } - }, - { - "id": "generate_verification_token", - "name": "Generate Verification Token", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Generate Verification Token", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "generate_random_token", - "length": 32 - } - } - }, - { - "id": "create_user", - "name": "Create User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create User", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "displayName": "{{ $json.displayName }}", - "tenantId": "{{ $json.tenantId }}", - "level": 0, - "isActive": false, - "isEmailVerified": false, - "verificationToken": "{{ $steps.generate_verification_token.output }}", - "verificationTokenExpiresAt": "{{ new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }}", - "firstLogin": true, - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "User" - } - } - }, - { - "id": "send_verification_email", - "name": "Send Verification Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Send Verification Email", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "displayName": "{{ $json.displayName }}", - "verificationLink": "{{ $env.APP_URL }}/auth/verify/{{ $steps.generate_verification_token.output }}" - }, - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Verify your email address", - "template": "email_verification" - } - } - }, - { - "id": "emit_register_event", - "name": "Emit Register Event", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Emit Register Event", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "data": { - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}" - }, - "action": "emit_event", - "event": "user_registered", - "channel": "{{ 'tenant:' + $json.tenantId }}" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "message": "Registration successful. Please verify your email address.", - "userId": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/export-script.backup.jsonscript b/packages/ui_json_script_editor/workflow/export-script.backup.jsonscript deleted file mode 100644 index 73e443322..000000000 --- a/packages/ui_json_script_editor/workflow/export-script.backup.jsonscript +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": "2.2.0", - "name": "Export JSON Script", - "description": "Download JSON Script as file", - "trigger": { - "type": "http", - "method": "GET", - "path": "/json-editor/scripts/:scriptId/export" - }, - "nodes": [ - { - "id": "validate_context", - "type": "operation", - "op": "validate", - "input": "{{ $context.tenantId }}", - "validator": "required" - }, - { - "id": "fetch_script", - "type": "operation", - "op": "database_read", - "entity": "JSONScript", - "params": { - "filter": { - "id": "{{ $json.scriptId }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "prepare_export", - "type": "operation", - "op": "transform_data", - "output": { - "name": "{{ $steps.fetch_script.output.name }}.jsonscript", - "content": "{{ $steps.fetch_script.output.script }}", - "contentType": "application/json" - } - }, - { - "id": "return_file", - "type": "action", - "action": "http_response", - "status": 200, - "headers": { - "Content-Type": "application/json", - "Content-Disposition": "attachment; filename={{ $steps.prepare_export.output.name }}" - }, - "body": "{{ $steps.prepare_export.output.content }}" - } - ] -} diff --git a/packages/stream_cast/workflow/stream-subscribe.backup.jsonscript b/packages/ui_json_script_editor/workflow/export-script.json similarity index 62% rename from packages/stream_cast/workflow/stream-subscribe.backup.jsonscript rename to packages/ui_json_script_editor/workflow/export-script.json index 47862c35e..411aa0f43 100644 --- a/packages/stream_cast/workflow/stream-subscribe.backup.jsonscript +++ b/packages/ui_json_script_editor/workflow/export-script.json @@ -1,5 +1,5 @@ { - "name": "Subscribe to Stream", + "name": "Export JSON Script", "active": false, "nodes": [ { @@ -19,15 +19,15 @@ 100 ], "parameters": { - "input": "{{ $context.user.id }}", + "input": "{{ $context.tenantId }}", "operation": "validate", "validator": "required" } } }, { - "id": "fetch_channel", - "name": "Fetch Channel", + "id": "fetch_script", + "name": "Fetch Script", "type": "metabuilder.database", "typeVersion": 1, "position": [ @@ -35,7 +35,7 @@ 100 ], "parameters": { - "name": "Fetch Channel", + "name": "Fetch Script", "typeVersion": 1, "position": [ 400, @@ -43,45 +43,43 @@ ], "parameters": { "filter": { - "id": "{{ $json.channelId }}", + "id": "{{ $json.scriptId }}", "tenantId": "{{ $context.tenantId }}" }, "operation": "database_read", - "entity": "StreamChannel" + "entity": "JSONScript" } } }, { - "id": "create_subscription", - "name": "Create Subscription", - "type": "metabuilder.database", + "id": "prepare_export", + "name": "Prepare Export", + "type": "metabuilder.transform", "typeVersion": 1, "position": [ 700, 100 ], "parameters": { - "name": "Create Subscription", + "name": "Prepare Export", "typeVersion": 1, "position": [ 700, 100 ], "parameters": { - "data": { - "channelId": "{{ $json.channelId }}", - "userId": "{{ $context.user.id }}", - "tenantId": "{{ $context.tenantId }}", - "subscribedAt": "{{ new Date().toISOString() }}" + "output": { + "name": "{{ $steps.fetch_script.output.name }}.jsonscript", + "content": "{{ $steps.fetch_script.output.script }}", + "contentType": "application/json" }, - "operation": "database_create", - "entity": "StreamSubscription" + "operation": "transform_data" } } }, { - "id": "setup_sse", - "name": "Setup Sse", + "id": "return_file", + "name": "Return File", "type": "metabuilder.action", "typeVersion": 1, "position": [ @@ -89,16 +87,20 @@ 300 ], "parameters": { - "name": "Setup Sse", + "name": "Return File", "typeVersion": 1, "position": [ 100, 300 ], "parameters": { - "action": "sse_stream", - "channel": "{{ 'stream:' + $json.channelId }}", - "onConnect": "{{ { subscriptionId: $steps.create_subscription.output.id } }}" + "action": "http_response", + "status": 200, + "headers": { + "Content-Type": "application/json", + "Content-Disposition": "attachment; filename={{ $steps.prepare_export.output.name }}" + }, + "body": "{{ $steps.prepare_export.output.content }}" } } } diff --git a/packages/ui_json_script_editor/workflow/export-script.jsonscript b/packages/ui_json_script_editor/workflow/export-script.jsonscript deleted file mode 100644 index d2dd73358..000000000 --- a/packages/ui_json_script_editor/workflow/export-script.jsonscript +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "Export JSON Script", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "fetch_script", - "name": "Fetch Script", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.scriptId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "JSONScript" - } - }, - { - "id": "prepare_export", - "name": "Prepare Export", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "output": { - "name": "{{ $steps.fetch_script.output.name }}.jsonscript", - "content": "{{ $steps.fetch_script.output.script }}", - "contentType": "application/json" - }, - "operation": "transform_data" - } - }, - { - "id": "return_file", - "name": "Return File", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "headers": { - "Content-Type": "application/json", - "Content-Disposition": "attachment; filename={{ $steps.prepare_export.output.name }}" - }, - "body": "{{ $steps.prepare_export.output.content }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Download JSON Script as file" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/import-script.backup.backup.jsonscript b/packages/ui_json_script_editor/workflow/import-script.backup.backup.jsonscript deleted file mode 100644 index ff53c56f0..000000000 --- a/packages/ui_json_script_editor/workflow/import-script.backup.backup.jsonscript +++ /dev/null @@ -1,115 +0,0 @@ -{ - "name": "Import JSON Script", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "parse_script", - "name": "Parse Script", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.fileContent }}", - "output": "{{ JSON.parse($json.fileContent) }}", - "operation": "transform_data" - } - }, - { - "id": "validate_format", - "name": "Validate Format", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ $steps.parse_script.output.version === '2.2.0' }}", - "operation": "condition" - } - }, - { - "id": "create_script", - "name": "Create Script", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name || 'Imported Script' }}", - "script": "{{ JSON.stringify($steps.parse_script.output) }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "JSONScript" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script imported" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Parse and import JSON Script from file" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/import-script.jsonscript b/packages/ui_json_script_editor/workflow/import-script.json similarity index 54% rename from packages/ui_json_script_editor/workflow/import-script.jsonscript rename to packages/ui_json_script_editor/workflow/import-script.json index 28fbec358..6d0501807 100644 --- a/packages/ui_json_script_editor/workflow/import-script.jsonscript +++ b/packages/ui_json_script_editor/workflow/import-script.json @@ -19,9 +19,17 @@ 100 ], "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" + "name": "Validate Context", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $context.tenantId }}", + "operation": "validate", + "validator": "required" + } } } }, @@ -42,8 +50,16 @@ 100 ], "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" + "name": "Check Permission", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "condition": "{{ $context.user.level >= 3 }}", + "operation": "condition" + } } } }, @@ -64,9 +80,17 @@ 100 ], "parameters": { - "input": "{{ $json.fileContent }}", - "output": "{{ JSON.parse($json.fileContent) }}", - "operation": "transform_data" + "name": "Parse Script", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.fileContent }}", + "output": "{{ JSON.parse($json.fileContent) }}", + "operation": "transform_data" + } } } }, @@ -87,8 +111,16 @@ 300 ], "parameters": { - "condition": "{{ $steps.parse_script.output.version === '2.2.0' }}", - "operation": "condition" + "name": "Validate Format", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ $steps.parse_script.output.version === '2.2.0' }}", + "operation": "condition" + } } } }, @@ -109,15 +141,23 @@ 300 ], "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name || 'Imported Script' }}", - "script": "{{ JSON.stringify($steps.parse_script.output) }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "JSONScript" + "name": "Create Script", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "data": { + "tenantId": "{{ $context.tenantId }}", + "createdBy": "{{ $context.user.id }}", + "name": "{{ $json.name || 'Imported Script' }}", + "script": "{{ JSON.stringify($steps.parse_script.output) }}", + "createdAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "JSONScript" + } } } }, @@ -138,11 +178,19 @@ 300 ], "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script imported" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": { + "id": "{{ $steps.create_script.output.id }}", + "message": "Script imported" + } } } } diff --git a/packages/ui_json_script_editor/workflow/list-scripts.backup.jsonscript b/packages/ui_json_script_editor/workflow/list-scripts.backup.jsonscript deleted file mode 100644 index 413a68634..000000000 --- a/packages/ui_json_script_editor/workflow/list-scripts.backup.jsonscript +++ /dev/null @@ -1,74 +0,0 @@ -{ - "version": "2.2.0", - "name": "List JSON Scripts", - "description": "List saved JSON Scripts with pagination", - "trigger": { - "type": "http", - "method": "GET", - "path": "/json-editor/scripts" - }, - "nodes": [ - { - "id": "validate_context", - "type": "operation", - "op": "validate", - "input": "{{ $context.tenantId }}", - "validator": "required" - }, - { - "id": "extract_pagination", - "type": "operation", - "op": "transform_data", - "output": { - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - } - }, - { - "id": "fetch_scripts", - "type": "operation", - "op": "database_read", - "entity": "JSONScript", - "params": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}" - } - }, - { - "id": "count_total", - "type": "operation", - "op": "database_count", - "entity": "JSONScript", - "params": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "format_response", - "type": "operation", - "op": "transform_data", - "output": { - "scripts": "{{ $steps.fetch_scripts.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}" - } - } - }, - { - "id": "return_success", - "type": "action", - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - ] -} diff --git a/packages/audit_log/workflow/init.jsonscript b/packages/ui_json_script_editor/workflow/list-scripts.json similarity index 77% rename from packages/audit_log/workflow/init.jsonscript rename to packages/ui_json_script_editor/workflow/list-scripts.json index 93414de69..495fd092b 100644 --- a/packages/audit_log/workflow/init.jsonscript +++ b/packages/ui_json_script_editor/workflow/list-scripts.json @@ -1,5 +1,5 @@ { - "name": "Load Audit Logs", + "name": "List JSON Scripts", "active": false, "nodes": [ { @@ -21,8 +21,7 @@ "parameters": { "input": "{{ $context.tenantId }}", "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required for multi-tenant safety" + "validator": "required" } } }, @@ -43,18 +42,17 @@ 100 ], "parameters": { - "input": "{{ $json }}", "output": { - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 100) }}" + "limit": "{{ Math.min($json.limit || 50, 500) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" }, "operation": "transform_data" } } }, { - "id": "fetch_logs", - "name": "Fetch Logs", + "id": "fetch_scripts", + "name": "Fetch Scripts", "type": "metabuilder.database", "typeVersion": 1, "position": [ @@ -62,7 +60,7 @@ 100 ], "parameters": { - "name": "Fetch Logs", + "name": "Fetch Scripts", "typeVersion": 1, "position": [ 700, @@ -73,19 +71,18 @@ "tenantId": "{{ $context.tenantId }}" }, "sort": { - "timestamp": -1 + "createdAt": -1 }, "limit": "{{ $steps.extract_pagination.output.limit }}", "offset": "{{ $steps.extract_pagination.output.offset }}", - "output": "logs", "operation": "database_read", - "entity": "AuditLog" + "entity": "JSONScript" } } }, { - "id": "fetch_count", - "name": "Fetch Count", + "id": "count_total", + "name": "Count Total", "type": "metabuilder.operation", "typeVersion": 1, "position": [ @@ -93,7 +90,7 @@ 300 ], "parameters": { - "name": "Fetch Count", + "name": "Count Total", "typeVersion": 1, "position": [ 100, @@ -103,9 +100,8 @@ "filter": { "tenantId": "{{ $context.tenantId }}" }, - "output": "totalCount", "operation": "database_count", - "entity": "AuditLog" + "entity": "JSONScript" } } }, @@ -126,14 +122,11 @@ 300 ], "parameters": { - "input": "{{ $steps.fetch_logs.output }}", "output": { - "logs": "{{ $steps.fetch_logs.output }}", + "scripts": "{{ $steps.fetch_scripts.output }}", "pagination": { - "total": "{{ $steps.fetch_count.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "hasMore": "{{ $steps.fetch_count.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" + "total": "{{ $steps.count_total.output }}", + "limit": "{{ $steps.extract_pagination.output.limit }}" } }, "operation": "transform_data" diff --git a/packages/ui_json_script_editor/workflow/list-scripts.jsonscript b/packages/ui_json_script_editor/workflow/list-scripts.jsonscript deleted file mode 100644 index ad6468206..000000000 --- a/packages/ui_json_script_editor/workflow/list-scripts.jsonscript +++ /dev/null @@ -1,124 +0,0 @@ -{ - "name": "List JSON Scripts", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_scripts", - "name": "Fetch Scripts", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "JSONScript" - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "JSONScript" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "scripts": "{{ $steps.fetch_scripts.output }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List saved JSON Scripts with pagination" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/save-script.backup.backup.jsonscript b/packages/ui_json_script_editor/workflow/save-script.backup.backup.jsonscript deleted file mode 100644 index cbb397090..000000000 --- a/packages/ui_json_script_editor/workflow/save-script.backup.backup.jsonscript +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "Save JSON Script", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "name": "required|string", - "script": "required|string" - } - } - }, - { - "id": "create_script", - "name": "Create Script", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name }}", - "description": "{{ $json.description }}", - "script": "{{ $json.script }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "JSONScript" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script saved" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Save JSON Script with permission checks (god/supergod only)" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/save-script.backup.jsonscript b/packages/ui_json_script_editor/workflow/save-script.json similarity index 53% rename from packages/ui_json_script_editor/workflow/save-script.backup.jsonscript rename to packages/ui_json_script_editor/workflow/save-script.json index 513835c41..c8b23dc90 100644 --- a/packages/ui_json_script_editor/workflow/save-script.backup.jsonscript +++ b/packages/ui_json_script_editor/workflow/save-script.json @@ -19,8 +19,16 @@ 100 ], "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" + "name": "Check Permission", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "condition": "{{ $context.user.level >= 3 }}", + "operation": "condition" + } } } }, @@ -41,11 +49,19 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "name": "required|string", - "script": "required|string" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "name": "required|string", + "script": "required|string" + } } } } @@ -67,16 +83,24 @@ 100 ], "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name }}", - "description": "{{ $json.description }}", - "script": "{{ $json.script }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "JSONScript" + "name": "Create Script", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "data": { + "tenantId": "{{ $context.tenantId }}", + "createdBy": "{{ $context.user.id }}", + "name": "{{ $json.name }}", + "description": "{{ $json.description }}", + "script": "{{ $json.script }}", + "createdAt": "{{ new Date().toISOString() }}" + }, + "operation": "database_create", + "entity": "JSONScript" + } } } }, @@ -97,11 +121,19 @@ 300 ], "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script saved" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": { + "id": "{{ $steps.create_script.output.id }}", + "message": "Script saved" + } } } } diff --git a/packages/ui_json_script_editor/workflow/save-script.jsonscript b/packages/ui_json_script_editor/workflow/save-script.jsonscript deleted file mode 100644 index 513835c41..000000000 --- a/packages/ui_json_script_editor/workflow/save-script.jsonscript +++ /dev/null @@ -1,120 +0,0 @@ -{ - "name": "Save JSON Script", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Check Permission", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "name": "required|string", - "script": "required|string" - } - } - } - }, - { - "id": "create_script", - "name": "Create Script", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create Script", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name }}", - "description": "{{ $json.description }}", - "script": "{{ $json.script }}", - "createdAt": "{{ new Date().toISOString() }}" - }, - "operation": "database_create", - "entity": "JSONScript" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script saved" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/validate-script.backup.backup.jsonscript b/packages/ui_json_script_editor/workflow/validate-script.backup.backup.jsonscript deleted file mode 100644 index e6dac1f0e..000000000 --- a/packages/ui_json_script_editor/workflow/validate-script.backup.backup.jsonscript +++ /dev/null @@ -1,110 +0,0 @@ -{ - "name": "Validate JSON Script", - "active": false, - "nodes": [ - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "script": "required|string" - } - } - }, - { - "id": "parse_json", - "name": "Parse Json", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json.script }}", - "output": "{{ JSON.parse($json.script) }}", - "operation": "transform_data" - } - }, - { - "id": "validate_version", - "name": "Validate Version", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.parse_json.output.version === '2.2.0' }}", - "operation": "condition" - } - }, - { - "id": "validate_nodes", - "name": "Validate Nodes", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ Array.isArray($steps.parse_json.output.nodes) && $steps.parse_json.output.nodes.length > 0 }}", - "operation": "condition" - } - }, - { - "id": "validate_node_structure", - "name": "Validate Node Structure", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ $steps.parse_json.output.nodes.every(node => node.id && node.type) }}", - "operation": "transform_data" - } - }, - { - "id": "return_valid", - "name": "Return Valid", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "valid": true, - "message": "Script is valid" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Validate JSON Script v2.2.0 format and syntax" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/validate-script.backup.jsonscript b/packages/ui_json_script_editor/workflow/validate-script.backup.jsonscript deleted file mode 100644 index e9a2a810d..000000000 --- a/packages/ui_json_script_editor/workflow/validate-script.backup.jsonscript +++ /dev/null @@ -1,156 +0,0 @@ -{ - "name": "Validate JSON Script", - "active": false, - "nodes": [ - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Input", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "script": "required|string" - } - } - } - }, - { - "id": "parse_json", - "name": "Parse Json", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Parse Json", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json.script }}", - "output": "{{ JSON.parse($json.script) }}", - "operation": "transform_data" - } - } - }, - { - "id": "validate_version", - "name": "Validate Version", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Validate Version", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "condition": "{{ $steps.parse_json.output.version === '2.2.0' }}", - "operation": "condition" - } - } - }, - { - "id": "validate_nodes", - "name": "Validate Nodes", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Validate Nodes", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ Array.isArray($steps.parse_json.output.nodes) && $steps.parse_json.output.nodes.length > 0 }}", - "operation": "condition" - } - } - }, - { - "id": "validate_node_structure", - "name": "Validate Node Structure", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Validate Node Structure", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": "{{ $steps.parse_json.output.nodes.every(node => node.id && node.type) }}", - "operation": "transform_data" - } - } - }, - { - "id": "return_valid", - "name": "Return Valid", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Return Valid", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "valid": true, - "message": "Script is valid" - } - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/ui_json_script_editor/workflow/validate-script.jsonscript b/packages/ui_json_script_editor/workflow/validate-script.json similarity index 57% rename from packages/ui_json_script_editor/workflow/validate-script.jsonscript rename to packages/ui_json_script_editor/workflow/validate-script.json index e9a2a810d..fc631df30 100644 --- a/packages/ui_json_script_editor/workflow/validate-script.jsonscript +++ b/packages/ui_json_script_editor/workflow/validate-script.json @@ -19,10 +19,18 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "script": "required|string" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "script": "required|string" + } } } } @@ -44,9 +52,17 @@ 100 ], "parameters": { - "input": "{{ $json.script }}", - "output": "{{ JSON.parse($json.script) }}", - "operation": "transform_data" + "name": "Parse Json", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json.script }}", + "output": "{{ JSON.parse($json.script) }}", + "operation": "transform_data" + } } } }, @@ -67,8 +83,16 @@ 100 ], "parameters": { - "condition": "{{ $steps.parse_json.output.version === '2.2.0' }}", - "operation": "condition" + "name": "Validate Version", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "condition": "{{ $steps.parse_json.output.version === '2.2.0' }}", + "operation": "condition" + } } } }, @@ -89,8 +113,16 @@ 300 ], "parameters": { - "condition": "{{ Array.isArray($steps.parse_json.output.nodes) && $steps.parse_json.output.nodes.length > 0 }}", - "operation": "condition" + "name": "Validate Nodes", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "condition": "{{ Array.isArray($steps.parse_json.output.nodes) && $steps.parse_json.output.nodes.length > 0 }}", + "operation": "condition" + } } } }, @@ -111,8 +143,16 @@ 300 ], "parameters": { - "output": "{{ $steps.parse_json.output.nodes.every(node => node.id && node.type) }}", - "operation": "transform_data" + "name": "Validate Node Structure", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "output": "{{ $steps.parse_json.output.nodes.every(node => node.id && node.type) }}", + "operation": "transform_data" + } } } }, @@ -133,11 +173,19 @@ 300 ], "parameters": { - "action": "http_response", - "status": 200, - "body": { - "valid": true, - "message": "Script is valid" + "name": "Return Valid", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": { + "valid": true, + "message": "Script is valid" + } } } } diff --git a/packages/user_manager/workflow/create-user.backup.backup.jsonscript b/packages/user_manager/workflow/create-user.backup.backup.jsonscript deleted file mode 100644 index e09959f0c..000000000 --- a/packages/user_manager/workflow/create-user.backup.backup.jsonscript +++ /dev/null @@ -1,121 +0,0 @@ -{ - "name": "Create User", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "displayName": "required|string" - } - } - }, - { - "id": "hash_password", - "name": "Hash Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.password || $utils.generateSecurePassword() }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - }, - { - "id": "create_user", - "name": "Create User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "data": { - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "tenantId": "{{ $context.tenantId }}", - "level": "{{ $json.level || 0 }}", - "isActive": true - }, - "operation": "database_create", - "entity": "User" - } - }, - { - "id": "send_welcome_email", - "name": "Send Welcome Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Welcome", - "template": "user_welcome" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Create new user with email verification" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/user_manager/workflow/create-user.jsonscript b/packages/user_manager/workflow/create-user.json similarity index 53% rename from packages/user_manager/workflow/create-user.jsonscript rename to packages/user_manager/workflow/create-user.json index fe2c73d2b..c56658f68 100644 --- a/packages/user_manager/workflow/create-user.jsonscript +++ b/packages/user_manager/workflow/create-user.json @@ -19,8 +19,16 @@ 100 ], "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" + "name": "Check Permission", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "condition": "{{ $context.user.level >= 3 }}", + "operation": "condition" + } } } }, @@ -41,11 +49,19 @@ 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "displayName": "required|string" + "name": "Validate Input", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "input": "{{ $json }}", + "operation": "validate", + "rules": { + "email": "required|email|unique:User", + "displayName": "required|string" + } } } } @@ -67,9 +83,17 @@ 100 ], "parameters": { - "input": "{{ $json.password || $utils.generateSecurePassword() }}", - "operation": "bcrypt_hash", - "rounds": 12 + "name": "Hash Password", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "input": "{{ $json.password || $utils.generateSecurePassword() }}", + "operation": "bcrypt_hash", + "rounds": 12 + } } } }, @@ -90,16 +114,24 @@ 300 ], "parameters": { - "data": { - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "tenantId": "{{ $context.tenantId }}", - "level": "{{ $json.level || 0 }}", - "isActive": true - }, - "operation": "database_create", - "entity": "User" + "name": "Create User", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "data": { + "email": "{{ $json.email }}", + "displayName": "{{ $json.displayName }}", + "passwordHash": "{{ $steps.hash_password.output }}", + "tenantId": "{{ $context.tenantId }}", + "level": "{{ $json.level || 0 }}", + "isActive": true + }, + "operation": "database_create", + "entity": "User" + } } } }, @@ -120,10 +152,18 @@ 300 ], "parameters": { - "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Welcome", - "template": "user_welcome" + "name": "Send Welcome Email", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "operation": "email_send", + "to": "{{ $json.email }}", + "subject": "Welcome", + "template": "user_welcome" + } } } }, @@ -144,11 +184,19 @@ 300 ], "parameters": { - "action": "http_response", - "status": 201, - "body": { - "id": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "action": "http_response", + "status": 201, + "body": { + "id": "{{ $steps.create_user.output.id }}", + "email": "{{ $json.email }}" + } } } } diff --git a/packages/user_manager/workflow/delete-user.backup.jsonscript b/packages/user_manager/workflow/delete-user.backup.jsonscript deleted file mode 100644 index 8be58fcb0..000000000 --- a/packages/user_manager/workflow/delete-user.backup.jsonscript +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": "2.2.0", - "name": "Delete User", - "description": "Delete user with safeguard against deleting last admin", - "trigger": { - "type": "http", - "method": "DELETE", - "path": "/users/:userId" - }, - "nodes": [ - { - "id": "check_permission", - "type": "operation", - "op": "condition", - "condition": "{{ $context.user.level >= 3 }}" - }, - { - "id": "fetch_user", - "type": "operation", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "count_admins", - "type": "operation", - "op": "database_count", - "entity": "User", - "params": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "level": { - "$gte": 3 - } - } - } - }, - { - "id": "check_not_last_admin", - "type": "operation", - "op": "condition", - "condition": "{{ !($steps.fetch_user.output.level >= 3 && $steps.count_admins.output <= 1) }}" - }, - { - "id": "delete_user", - "type": "operation", - "op": "database_delete", - "entity": "User", - "params": { - "filter": { - "id": "{{ $json.userId }}" - } - } - }, - { - "id": "return_success", - "type": "action", - "action": "http_response", - "status": 200, - "body": { - "message": "User deleted" - } - } - ] -} diff --git a/packages/ui_json_script_editor/workflow/import-script.backup.jsonscript b/packages/user_manager/workflow/delete-user.json similarity index 64% rename from packages/ui_json_script_editor/workflow/import-script.backup.jsonscript rename to packages/user_manager/workflow/delete-user.json index 28fbec358..21ae59a7c 100644 --- a/packages/ui_json_script_editor/workflow/import-script.backup.jsonscript +++ b/packages/user_manager/workflow/delete-user.json @@ -1,44 +1,21 @@ { - "name": "Import JSON Script", + "name": "Delete User", "active": false, "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Validate Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - } - }, { "id": "check_permission", "name": "Check Permission", "type": "metabuilder.condition", "typeVersion": 1, "position": [ - 400, + 100, 100 ], "parameters": { "name": "Check Permission", "typeVersion": 1, "position": [ - 400, + 100, 100 ], "parameters": { @@ -48,31 +25,62 @@ } }, { - "id": "parse_script", - "name": "Parse Script", - "type": "metabuilder.transform", + "id": "fetch_user", + "name": "Fetch User", + "type": "metabuilder.database", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } + } + }, + { + "id": "count_admins", + "name": "Count Admins", + "type": "metabuilder.operation", "typeVersion": 1, "position": [ 700, 100 ], "parameters": { - "name": "Parse Script", + "name": "Count Admins", "typeVersion": 1, "position": [ 700, 100 ], "parameters": { - "input": "{{ $json.fileContent }}", - "output": "{{ JSON.parse($json.fileContent) }}", - "operation": "transform_data" + "filter": { + "tenantId": "{{ $context.tenantId }}", + "level": { + "$gte": 3 + } + }, + "operation": "database_count", + "entity": "User" } } }, { - "id": "validate_format", - "name": "Validate Format", + "id": "check_not_last_admin", + "name": "Check Not Last Admin", "type": "metabuilder.condition", "typeVersion": 1, "position": [ @@ -80,21 +88,21 @@ 300 ], "parameters": { - "name": "Validate Format", + "name": "Check Not Last Admin", "typeVersion": 1, "position": [ 100, 300 ], "parameters": { - "condition": "{{ $steps.parse_script.output.version === '2.2.0' }}", + "condition": "{{ !($steps.fetch_user.output.level >= 3 && $steps.count_admins.output <= 1) }}", "operation": "condition" } } }, { - "id": "create_script", - "name": "Create Script", + "id": "delete_user", + "name": "Delete User", "type": "metabuilder.database", "typeVersion": 1, "position": [ @@ -102,22 +110,18 @@ 300 ], "parameters": { - "name": "Create Script", + "name": "Delete User", "typeVersion": 1, "position": [ 400, 300 ], "parameters": { - "data": { - "tenantId": "{{ $context.tenantId }}", - "createdBy": "{{ $context.user.id }}", - "name": "{{ $json.name || 'Imported Script' }}", - "script": "{{ JSON.stringify($steps.parse_script.output) }}", - "createdAt": "{{ new Date().toISOString() }}" + "filter": { + "id": "{{ $json.userId }}" }, - "operation": "database_create", - "entity": "JSONScript" + "operation": "database_delete", + "entity": "User" } } }, @@ -139,10 +143,9 @@ ], "parameters": { "action": "http_response", - "status": 201, + "status": 200, "body": { - "id": "{{ $steps.create_script.output.id }}", - "message": "Script imported" + "message": "User deleted" } } } diff --git a/packages/user_manager/workflow/delete-user.jsonscript b/packages/user_manager/workflow/delete-user.jsonscript deleted file mode 100644 index 7a945cba5..000000000 --- a/packages/user_manager/workflow/delete-user.jsonscript +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "Delete User", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "count_admins", - "name": "Count Admins", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}", - "level": { - "$gte": 3 - } - }, - "operation": "database_count", - "entity": "User" - } - }, - { - "id": "check_not_last_admin", - "name": "Check Not Last Admin", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "condition": "{{ !($steps.fetch_user.output.level >= 3 && $steps.count_admins.output <= 1) }}", - "operation": "condition" - } - }, - { - "id": "delete_user", - "name": "Delete User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}" - }, - "operation": "database_delete", - "entity": "User" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "User deleted" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Delete user with safeguard against deleting last admin" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/user_manager/workflow/list-users.backup.jsonscript b/packages/user_manager/workflow/list-users.backup.jsonscript deleted file mode 100644 index 89ee0a586..000000000 --- a/packages/user_manager/workflow/list-users.backup.jsonscript +++ /dev/null @@ -1,75 +0,0 @@ -{ - "version": "2.2.0", - "name": "List Users", - "description": "List all users in tenant with pagination", - "trigger": { - "type": "http", - "method": "GET", - "path": "/users" - }, - "nodes": [ - { - "id": "validate_context", - "type": "operation", - "op": "validate", - "input": "{{ $context.tenantId }}", - "validator": "required" - }, - { - "id": "extract_pagination", - "type": "operation", - "op": "transform_data", - "output": { - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - } - }, - { - "id": "fetch_users", - "type": "operation", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}" - } - }, - { - "id": "count_total", - "type": "operation", - "op": "database_count", - "entity": "User", - "params": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "format_response", - "type": "operation", - "op": "transform_data", - "output": { - "users": "{{ $steps.fetch_users.output.map(u => ({ id: u.id, email: u.email, displayName: u.displayName, level: u.level, isActive: u.isActive, createdAt: u.createdAt })) }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "page": "{{ $json.page || 1 }}" - } - } - }, - { - "id": "return_success", - "type": "action", - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - ] -} diff --git a/packages/audit_log/workflow/init.backup.jsonscript b/packages/user_manager/workflow/list-users.json similarity index 77% rename from packages/audit_log/workflow/init.backup.jsonscript rename to packages/user_manager/workflow/list-users.json index 93414de69..6d4c60f50 100644 --- a/packages/audit_log/workflow/init.backup.jsonscript +++ b/packages/user_manager/workflow/list-users.json @@ -1,5 +1,5 @@ { - "name": "Load Audit Logs", + "name": "List Users", "active": false, "nodes": [ { @@ -21,8 +21,7 @@ "parameters": { "input": "{{ $context.tenantId }}", "operation": "validate", - "validator": "required", - "errorMessage": "tenantId is required for multi-tenant safety" + "validator": "required" } } }, @@ -43,18 +42,17 @@ 100 ], "parameters": { - "input": "{{ $json }}", "output": { - "limit": "{{ Math.min($json.limit || 100, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 100) }}" + "limit": "{{ Math.min($json.limit || 50, 500) }}", + "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" }, "operation": "transform_data" } } }, { - "id": "fetch_logs", - "name": "Fetch Logs", + "id": "fetch_users", + "name": "Fetch Users", "type": "metabuilder.database", "typeVersion": 1, "position": [ @@ -62,7 +60,7 @@ 100 ], "parameters": { - "name": "Fetch Logs", + "name": "Fetch Users", "typeVersion": 1, "position": [ 700, @@ -73,19 +71,18 @@ "tenantId": "{{ $context.tenantId }}" }, "sort": { - "timestamp": -1 + "createdAt": -1 }, "limit": "{{ $steps.extract_pagination.output.limit }}", "offset": "{{ $steps.extract_pagination.output.offset }}", - "output": "logs", "operation": "database_read", - "entity": "AuditLog" + "entity": "User" } } }, { - "id": "fetch_count", - "name": "Fetch Count", + "id": "count_total", + "name": "Count Total", "type": "metabuilder.operation", "typeVersion": 1, "position": [ @@ -93,7 +90,7 @@ 300 ], "parameters": { - "name": "Fetch Count", + "name": "Count Total", "typeVersion": 1, "position": [ 100, @@ -103,9 +100,8 @@ "filter": { "tenantId": "{{ $context.tenantId }}" }, - "output": "totalCount", "operation": "database_count", - "entity": "AuditLog" + "entity": "User" } } }, @@ -126,14 +122,12 @@ 300 ], "parameters": { - "input": "{{ $steps.fetch_logs.output }}", "output": { - "logs": "{{ $steps.fetch_logs.output }}", + "users": "{{ $steps.fetch_users.output.map(u => ({ id: u.id, email: u.email, displayName: u.displayName, level: u.level, isActive: u.isActive, createdAt: u.createdAt })) }}", "pagination": { - "total": "{{ $steps.fetch_count.output }}", + "total": "{{ $steps.count_total.output }}", "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "hasMore": "{{ $steps.fetch_count.output > ($steps.extract_pagination.output.offset + $steps.extract_pagination.output.limit) }}" + "page": "{{ $json.page || 1 }}" } }, "operation": "transform_data" diff --git a/packages/user_manager/workflow/list-users.jsonscript b/packages/user_manager/workflow/list-users.jsonscript deleted file mode 100644 index 83ab7301e..000000000 --- a/packages/user_manager/workflow/list-users.jsonscript +++ /dev/null @@ -1,125 +0,0 @@ -{ - "name": "List Users", - "active": false, - "nodes": [ - { - "id": "validate_context", - "name": "Validate Context", - "type": "metabuilder.validate", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "input": "{{ $context.tenantId }}", - "operation": "validate", - "validator": "required" - } - }, - { - "id": "extract_pagination", - "name": "Extract Pagination", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "output": { - "limit": "{{ Math.min($json.limit || 50, 500) }}", - "offset": "{{ ($json.page || 1 - 1) * ($json.limit || 50) }}" - }, - "operation": "transform_data" - } - }, - { - "id": "fetch_users", - "name": "Fetch Users", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "sort": { - "createdAt": -1 - }, - "limit": "{{ $steps.extract_pagination.output.limit }}", - "offset": "{{ $steps.extract_pagination.output.offset }}", - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "count_total", - "name": "Count Total", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "filter": { - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_count", - "entity": "User" - } - }, - { - "id": "format_response", - "name": "Format Response", - "type": "metabuilder.transform", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "output": { - "users": "{{ $steps.fetch_users.output.map(u => ({ id: u.id, email: u.email, displayName: u.displayName, level: u.level, isActive: u.isActive, createdAt: u.createdAt })) }}", - "pagination": { - "total": "{{ $steps.count_total.output }}", - "limit": "{{ $steps.extract_pagination.output.limit }}", - "page": "{{ $json.page || 1 }}" - } - }, - "operation": "transform_data" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.format_response.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "List all users in tenant with pagination" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/user_manager/workflow/reset-password.backup.jsonscript b/packages/user_manager/workflow/reset-password.backup.jsonscript deleted file mode 100644 index 2619e7305..000000000 --- a/packages/user_manager/workflow/reset-password.backup.jsonscript +++ /dev/null @@ -1,81 +0,0 @@ -{ - "version": "2.2.0", - "name": "Reset User Password", - "description": "Admin reset of user password with temporary password", - "trigger": { - "type": "http", - "method": "POST", - "path": "/users/:userId/reset-password" - }, - "nodes": [ - { - "id": "check_permission", - "type": "operation", - "op": "condition", - "condition": "{{ $context.user.level >= 3 }}" - }, - { - "id": "fetch_user", - "type": "operation", - "op": "database_read", - "entity": "User", - "params": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - } - } - }, - { - "id": "generate_temp_password", - "type": "operation", - "op": "crypto", - "operation": "generate_random_token", - "length": 16 - }, - { - "id": "hash_password", - "type": "operation", - "op": "crypto", - "operation": "bcrypt_hash", - "input": "{{ $steps.generate_temp_password.output }}", - "rounds": 12 - }, - { - "id": "update_user", - "type": "operation", - "op": "database_update", - "entity": "User", - "params": { - "filter": { - "id": "{{ $json.userId }}" - }, - "data": { - "passwordHash": "{{ $steps.hash_password.output }}", - "firstLogin": true, - "passwordChangedAt": null - } - } - }, - { - "id": "send_reset_email", - "type": "operation", - "op": "email_send", - "to": "{{ $steps.fetch_user.output.email }}", - "subject": "Your password has been reset", - "template": "password_reset_admin", - "data": { - "tempPassword": "{{ $steps.generate_temp_password.output }}" - } - }, - { - "id": "return_success", - "type": "action", - "action": "http_response", - "status": 200, - "body": { - "message": "Password reset. Temporary password sent to user email" - } - } - ] -} diff --git a/packages/user_manager/workflow/create-user.backup.jsonscript b/packages/user_manager/workflow/reset-password.json similarity index 61% rename from packages/user_manager/workflow/create-user.backup.jsonscript rename to packages/user_manager/workflow/reset-password.json index fe2c73d2b..11ba03848 100644 --- a/packages/user_manager/workflow/create-user.backup.jsonscript +++ b/packages/user_manager/workflow/reset-password.json @@ -1,5 +1,5 @@ { - "name": "Create User", + "name": "Reset User Password", "active": false, "nodes": [ { @@ -25,28 +25,50 @@ } }, { - "id": "validate_input", - "name": "Validate Input", - "type": "metabuilder.validate", + "id": "fetch_user", + "name": "Fetch User", + "type": "metabuilder.database", "typeVersion": 1, "position": [ 400, 100 ], "parameters": { - "name": "Validate Input", + "name": "Fetch User", "typeVersion": 1, "position": [ 400, 100 ], "parameters": { - "input": "{{ $json }}", - "operation": "validate", - "rules": { - "email": "required|email|unique:User", - "displayName": "required|string" - } + "filter": { + "id": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } + } + }, + { + "id": "generate_temp_password", + "name": "Generate Temp Password", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "name": "Generate Temp Password", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "operation": "generate_random_token", + "length": 16 } } }, @@ -55,75 +77,78 @@ "name": "Hash Password", "type": "metabuilder.operation", "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Hash Password", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "input": "{{ $json.password || $utils.generateSecurePassword() }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - } - }, - { - "id": "create_user", - "name": "Create User", - "type": "metabuilder.database", - "typeVersion": 1, "position": [ 100, 300 ], "parameters": { - "name": "Create User", + "name": "Hash Password", "typeVersion": 1, "position": [ 100, 300 ], "parameters": { - "data": { - "email": "{{ $json.email }}", - "displayName": "{{ $json.displayName }}", - "passwordHash": "{{ $steps.hash_password.output }}", - "tenantId": "{{ $context.tenantId }}", - "level": "{{ $json.level || 0 }}", - "isActive": true - }, - "operation": "database_create", - "entity": "User" + "input": "{{ $steps.generate_temp_password.output }}", + "operation": "bcrypt_hash", + "rounds": 12 } } }, { - "id": "send_welcome_email", - "name": "Send Welcome Email", - "type": "metabuilder.operation", + "id": "update_user", + "name": "Update User", + "type": "metabuilder.database", "typeVersion": 1, "position": [ 400, 300 ], "parameters": { - "name": "Send Welcome Email", + "name": "Update User", "typeVersion": 1, "position": [ 400, 300 ], "parameters": { + "filter": { + "id": "{{ $json.userId }}" + }, + "data": { + "passwordHash": "{{ $steps.hash_password.output }}", + "firstLogin": true, + "passwordChangedAt": null + }, + "operation": "database_update", + "entity": "User" + } + } + }, + { + "id": "send_reset_email", + "name": "Send Reset Email", + "type": "metabuilder.operation", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "name": "Send Reset Email", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "data": { + "tempPassword": "{{ $steps.generate_temp_password.output }}" + }, "operation": "email_send", - "to": "{{ $json.email }}", - "subject": "Welcome", - "template": "user_welcome" + "to": "{{ $steps.fetch_user.output.email }}", + "subject": "Your password has been reset", + "template": "password_reset_admin" } } }, @@ -133,22 +158,21 @@ "type": "metabuilder.action", "typeVersion": 1, "position": [ - 700, - 300 + 100, + 500 ], "parameters": { "name": "Return Success", "typeVersion": 1, "position": [ - 700, - 300 + 100, + 500 ], "parameters": { "action": "http_response", - "status": 201, + "status": 200, "body": { - "id": "{{ $steps.create_user.output.id }}", - "email": "{{ $json.email }}" + "message": "Password reset. Temporary password sent to user email" } } } diff --git a/packages/user_manager/workflow/reset-password.jsonscript b/packages/user_manager/workflow/reset-password.jsonscript deleted file mode 100644 index 83cd12a74..000000000 --- a/packages/user_manager/workflow/reset-password.jsonscript +++ /dev/null @@ -1,137 +0,0 @@ -{ - "name": "Reset User Password", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 }}", - "operation": "condition" - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "generate_temp_password", - "name": "Generate Temp Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "generate_random_token", - "length": 16 - } - }, - { - "id": "hash_password", - "name": "Hash Password", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "input": "{{ $steps.generate_temp_password.output }}", - "operation": "bcrypt_hash", - "rounds": 12 - } - }, - { - "id": "update_user", - "name": "Update User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}" - }, - "data": { - "passwordHash": "{{ $steps.hash_password.output }}", - "firstLogin": true, - "passwordChangedAt": null - }, - "operation": "database_update", - "entity": "User" - } - }, - { - "id": "send_reset_email", - "name": "Send Reset Email", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "data": { - "tempPassword": "{{ $steps.generate_temp_password.output }}" - }, - "operation": "email_send", - "to": "{{ $steps.fetch_user.output.email }}", - "subject": "Your password has been reset", - "template": "password_reset_admin" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": { - "message": "Password reset. Temporary password sent to user email" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Admin reset of user password with temporary password" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/user_manager/workflow/update-user.backup.backup.jsonscript b/packages/user_manager/workflow/update-user.backup.backup.jsonscript deleted file mode 100644 index 70662e3d5..000000000 --- a/packages/user_manager/workflow/update-user.backup.backup.jsonscript +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "Update User", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 || $context.user.id === $json.userId }}", - "operation": "condition" - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - }, - { - "id": "update_user", - "name": "Update User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}" - }, - "data": { - "displayName": "{{ $json.displayName || $steps.fetch_user.output.displayName }}", - "level": "{{ $context.user.level >= 3 ? ($json.level || $steps.fetch_user.output.level) : $steps.fetch_user.output.level }}", - "isActive": "{{ $json.isActive !== undefined ? $json.isActive : $steps.fetch_user.output.isActive }}" - }, - "operation": "database_update", - "entity": "User" - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_user.output }}" - } - } - ], - "connections": {}, - "staticData": {}, - "meta": { - "description": "Update user information with tenant safety checks" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/packages/user_manager/workflow/update-user.backup.jsonscript b/packages/user_manager/workflow/update-user.json similarity index 51% rename from packages/user_manager/workflow/update-user.backup.jsonscript rename to packages/user_manager/workflow/update-user.json index d2c1d3476..e0ddc4428 100644 --- a/packages/user_manager/workflow/update-user.backup.jsonscript +++ b/packages/user_manager/workflow/update-user.json @@ -19,8 +19,16 @@ 100 ], "parameters": { - "condition": "{{ $context.user.level >= 3 || $context.user.id === $json.userId }}", - "operation": "condition" + "name": "Check Permission", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "condition": "{{ $context.user.level >= 3 || $context.user.id === $json.userId }}", + "operation": "condition" + } } } }, @@ -41,12 +49,20 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" + "name": "Fetch User", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.userId }}", + "tenantId": "{{ $context.tenantId }}" + }, + "operation": "database_read", + "entity": "User" + } } } }, @@ -67,16 +83,24 @@ 100 ], "parameters": { - "filter": { - "id": "{{ $json.userId }}" - }, - "data": { - "displayName": "{{ $json.displayName || $steps.fetch_user.output.displayName }}", - "level": "{{ $context.user.level >= 3 ? ($json.level || $steps.fetch_user.output.level) : $steps.fetch_user.output.level }}", - "isActive": "{{ $json.isActive !== undefined ? $json.isActive : $steps.fetch_user.output.isActive }}" - }, - "operation": "database_update", - "entity": "User" + "name": "Update User", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "filter": { + "id": "{{ $json.userId }}" + }, + "data": { + "displayName": "{{ $json.displayName || $steps.fetch_user.output.displayName }}", + "level": "{{ $context.user.level >= 3 ? ($json.level || $steps.fetch_user.output.level) : $steps.fetch_user.output.level }}", + "isActive": "{{ $json.isActive !== undefined ? $json.isActive : $steps.fetch_user.output.isActive }}" + }, + "operation": "database_update", + "entity": "User" + } } } }, @@ -97,9 +121,17 @@ 300 ], "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_user.output }}" + "name": "Return Success", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "action": "http_response", + "status": 200, + "body": "{{ $steps.update_user.output }}" + } } } } diff --git a/packages/user_manager/workflow/update-user.jsonscript b/packages/user_manager/workflow/update-user.jsonscript deleted file mode 100644 index d2c1d3476..000000000 --- a/packages/user_manager/workflow/update-user.jsonscript +++ /dev/null @@ -1,117 +0,0 @@ -{ - "name": "Update User", - "active": false, - "nodes": [ - { - "id": "check_permission", - "name": "Check Permission", - "type": "metabuilder.condition", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Check Permission", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "condition": "{{ $context.user.level >= 3 || $context.user.id === $json.userId }}", - "operation": "condition" - } - } - }, - { - "id": "fetch_user", - "name": "Fetch User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Fetch User", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}", - "tenantId": "{{ $context.tenantId }}" - }, - "operation": "database_read", - "entity": "User" - } - } - }, - { - "id": "update_user", - "name": "Update User", - "type": "metabuilder.database", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Update User", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "filter": { - "id": "{{ $json.userId }}" - }, - "data": { - "displayName": "{{ $json.displayName || $steps.fetch_user.output.displayName }}", - "level": "{{ $context.user.level >= 3 ? ($json.level || $steps.fetch_user.output.level) : $steps.fetch_user.output.level }}", - "isActive": "{{ $json.isActive !== undefined ? $json.isActive : $steps.fetch_user.output.isActive }}" - }, - "operation": "database_update", - "entity": "User" - } - } - }, - { - "id": "return_success", - "name": "Return Success", - "type": "metabuilder.action", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Return Success", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "action": "http_response", - "status": 200, - "body": "{{ $steps.update_user.output }}" - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/cross-project-workflow.backup.backup.json b/workflow/examples/cross-project-workflow.backup.backup.json deleted file mode 100644 index cce551e0e..000000000 --- a/workflow/examples/cross-project-workflow.backup.backup.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "name": "cross-project-demo", - "active": false, - "nodes": [ - { - "id": "start", - "name": "Start", - "type": "metabuilder.trigger", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "manual" - }, - "notes": "Manual trigger to start the workflow", - "notesInFlow": false - }, - { - "id": "check-postgres", - "name": "Check Postgres", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "host": "localhost", - "port": 5432, - "database": "metabuilder", - "user": "postgres", - "operation": "postgres.checkConnection" - }, - "notes": "Verify database is accessible", - "notesInFlow": false - }, - { - "id": "list-containers", - "name": "List Containers", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "all": false, - "operation": "docker.listContainers" - }, - "notes": "Get running Docker containers", - "notesInFlow": false - }, - { - "id": "create-3d-model", - "name": "Create 3d Model", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "length": 100, - "width": 50, - "height": 25, - "outputPath": "/tmp/demo-box.step", - "operation": "cadquery.box" - }, - "notes": "Create a sample 3D box model", - "notesInFlow": false - }, - { - "id": "run-mojo-benchmark", - "name": "Run Mojo Benchmark", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "example": "life/benchmark.mojo", - "operation": "mojo.runExample" - }, - "notes": "Run Mojo performance example", - "notesInFlow": false - }, - { - "id": "aggregate-results", - "name": "Aggregate Results", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "expression": { - "database": { - "connected": "{{ $nodes['check-postgres'].success }}", - "version": "{{ $nodes['check-postgres'].version }}" - }, - "docker": { - "containerCount": "{{ $nodes['list-containers'].containers.length }}", - "containers": "{{ $nodes['list-containers'].containers }}" - }, - "cadquery": { - "modelCreated": "{{ $nodes['create-3d-model'].success }}", - "outputPath": "{{ $nodes['create-3d-model'].outputPath }}" - }, - "mojo": { - "benchmarkRan": "{{ $nodes['run-mojo-benchmark'].success }}", - "executionTime": "{{ $nodes['run-mojo-benchmark'].executionTime }}" - } - }, - "operation": "transform" - }, - "notes": "Combine all results into a summary", - "notesInFlow": false - }, - { - "id": "share-results", - "name": "Share Results", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "content": "{{ JSON.stringify($nodes['aggregate-results'].result, null, 2) }}", - "title": "Cross-Project Workflow Results", - "language": "json", - "expiresIn": "1d", - "operation": "pastebin.create" - }, - "notes": "Share results as a paste", - "notesInFlow": false - }, - { - "id": "send-notification", - "name": "Send Notification", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "from": "workflow@metabuilder.local", - "to": "admin@example.com", - "subject": "Cross-Project Workflow Complete", - "body": "Workflow completed successfully.\n\nResults: {{ $nodes['share-results'].url }}\n\nSummary:\n- Database: {{ $nodes['check-postgres'].success ? 'Connected' : 'Failed' }}\n- Docker Containers: {{ $nodes['list-containers'].containers.length }}\n- 3D Model: {{ $nodes['create-3d-model'].success ? 'Created' : 'Failed' }}\n- Mojo Benchmark: {{ $nodes['run-mojo-benchmark'].executionTime }}ms", - "operation": "smtp.sendEmail" - }, - "notes": "Email the results", - "notesInFlow": false - } - ], - "connections": { - "Start": { - "main": { - "0": [ - { - "node": "Check Postgres", - "type": "main", - "index": 0 - }, - { - "node": "List Containers", - "type": "main", - "index": 0 - }, - { - "node": "Create 3d Model", - "type": "main", - "index": 0 - }, - { - "node": "Run Mojo Benchmark", - "type": "main", - "index": 0 - } - ] - } - }, - "Check Postgres": { - "main": { - "0": [ - { - "node": "Aggregate Results", - "type": "main", - "index": 0 - } - ] - } - }, - "List Containers": { - "main": { - "0": [ - { - "node": "Aggregate Results", - "type": "main", - "index": 0 - } - ] - } - }, - "Create 3d Model": { - "main": { - "0": [ - { - "node": "Aggregate Results", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Mojo Benchmark": { - "main": { - "0": [ - { - "node": "Aggregate Results", - "type": "main", - "index": 0 - } - ] - } - }, - "Aggregate Results": { - "main": { - "0": [ - { - "node": "Share Results", - "type": "main", - "index": 0 - } - ] - } - }, - "Share Results": { - "main": { - "0": [ - { - "node": "Send Notification", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": { - "description": "Demonstrates integration between multiple MetaBuilder standalone projects", - "author": "MetaBuilder", - "created": "2026-01-21", - "tags": [ - "demo", - "cross-project", - "integration" - ], - "projects": [ - "postgres", - "docker", - "cadquery", - "mojo", - "pastebin", - "smtp" - ] - }, - "tags": [ - { - "name": "demo" - }, - { - "name": "cross-project" - }, - { - "name": "integration" - } - ], - "createdAt": "2026-01-21T00:00:00.000Z", - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/cross-project-workflow.backup.json b/workflow/examples/cross-project-workflow.backup.json deleted file mode 100644 index cf3206a28..000000000 --- a/workflow/examples/cross-project-workflow.backup.json +++ /dev/null @@ -1,314 +0,0 @@ -{ - "name": "cross-project-demo", - "active": false, - "nodes": [ - { - "id": "start", - "name": "Start", - "type": "metabuilder.trigger", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Start", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "manual" - }, - "notes": "Manual trigger to start the workflow", - "notesInFlow": false - } - }, - { - "id": "check-postgres", - "name": "Check Postgres", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Check Postgres", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "host": "localhost", - "port": 5432, - "database": "metabuilder", - "user": "postgres", - "operation": "postgres.checkConnection" - }, - "notes": "Verify database is accessible", - "notesInFlow": false - } - }, - { - "id": "list-containers", - "name": "List Containers", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "List Containers", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "all": false, - "operation": "docker.listContainers" - }, - "notes": "Get running Docker containers", - "notesInFlow": false - } - }, - { - "id": "create-3d-model", - "name": "Create 3d Model", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create 3d Model", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "length": 100, - "width": 50, - "height": 25, - "outputPath": "/tmp/demo-box.step", - "operation": "cadquery.box" - }, - "notes": "Create a sample 3D box model", - "notesInFlow": false - } - }, - { - "id": "run-mojo-benchmark", - "name": "Run Mojo Benchmark", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Run Mojo Benchmark", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "example": "life/benchmark.mojo", - "operation": "mojo.runExample" - }, - "notes": "Run Mojo performance example", - "notesInFlow": false - } - }, - { - "id": "aggregate-results", - "name": "Aggregate Results", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Aggregate Results", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "expression": { - "database": { - "connected": "{{ $nodes['check-postgres'].success }}", - "version": "{{ $nodes['check-postgres'].version }}" - }, - "docker": { - "containerCount": "{{ $nodes['list-containers'].containers.length }}", - "containers": "{{ $nodes['list-containers'].containers }}" - }, - "cadquery": { - "modelCreated": "{{ $nodes['create-3d-model'].success }}", - "outputPath": "{{ $nodes['create-3d-model'].outputPath }}" - }, - "mojo": { - "benchmarkRan": "{{ $nodes['run-mojo-benchmark'].success }}", - "executionTime": "{{ $nodes['run-mojo-benchmark'].executionTime }}" - } - }, - "operation": "transform" - }, - "notes": "Combine all results into a summary", - "notesInFlow": false - } - }, - { - "id": "share-results", - "name": "Share Results", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Share Results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "content": "{{ JSON.stringify($nodes['aggregate-results'].result, null, 2) }}", - "title": "Cross-Project Workflow Results", - "language": "json", - "expiresIn": "1d", - "operation": "pastebin.create" - }, - "notes": "Share results as a paste", - "notesInFlow": false - } - }, - { - "id": "send-notification", - "name": "Send Notification", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Send Notification", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "from": "workflow@metabuilder.local", - "to": "admin@example.com", - "subject": "Cross-Project Workflow Complete", - "body": "Workflow completed successfully.\n\nResults: {{ $nodes['share-results'].url }}\n\nSummary:\n- Database: {{ $nodes['check-postgres'].success ? 'Connected' : 'Failed' }}\n- Docker Containers: {{ $nodes['list-containers'].containers.length }}\n- 3D Model: {{ $nodes['create-3d-model'].success ? 'Created' : 'Failed' }}\n- Mojo Benchmark: {{ $nodes['run-mojo-benchmark'].executionTime }}ms", - "operation": "smtp.sendEmail" - }, - "notes": "Email the results", - "notesInFlow": false - } - } - ], - "connections": { - "Start": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Check Postgres": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "List Containers": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create 3d Model": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Mojo Benchmark": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Aggregate Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Share Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/cross-project-workflow.json b/workflow/examples/cross-project-workflow.json index cf3206a28..5a3823bdd 100644 --- a/workflow/examples/cross-project-workflow.json +++ b/workflow/examples/cross-project-workflow.json @@ -19,10 +19,18 @@ 100 ], "parameters": { - "operation": "manual" - }, - "notes": "Manual trigger to start the workflow", - "notesInFlow": false + "name": "Start", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "operation": "manual" + }, + "notes": "Manual trigger to start the workflow", + "notesInFlow": false + } } }, { @@ -42,14 +50,22 @@ 100 ], "parameters": { - "host": "localhost", - "port": 5432, - "database": "metabuilder", - "user": "postgres", - "operation": "postgres.checkConnection" - }, - "notes": "Verify database is accessible", - "notesInFlow": false + "name": "Check Postgres", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "host": "localhost", + "port": 5432, + "database": "metabuilder", + "user": "postgres", + "operation": "postgres.checkConnection" + }, + "notes": "Verify database is accessible", + "notesInFlow": false + } } }, { @@ -69,11 +85,19 @@ 100 ], "parameters": { - "all": false, - "operation": "docker.listContainers" - }, - "notes": "Get running Docker containers", - "notesInFlow": false + "name": "List Containers", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "all": false, + "operation": "docker.listContainers" + }, + "notes": "Get running Docker containers", + "notesInFlow": false + } } }, { @@ -93,14 +117,22 @@ 300 ], "parameters": { - "length": 100, - "width": 50, - "height": 25, - "outputPath": "/tmp/demo-box.step", - "operation": "cadquery.box" - }, - "notes": "Create a sample 3D box model", - "notesInFlow": false + "name": "Create 3d Model", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "length": 100, + "width": 50, + "height": 25, + "outputPath": "/tmp/demo-box.step", + "operation": "cadquery.box" + }, + "notes": "Create a sample 3D box model", + "notesInFlow": false + } } }, { @@ -120,11 +152,19 @@ 300 ], "parameters": { - "example": "life/benchmark.mojo", - "operation": "mojo.runExample" - }, - "notes": "Run Mojo performance example", - "notesInFlow": false + "name": "Run Mojo Benchmark", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "example": "life/benchmark.mojo", + "operation": "mojo.runExample" + }, + "notes": "Run Mojo performance example", + "notesInFlow": false + } } }, { @@ -144,28 +184,36 @@ 300 ], "parameters": { - "expression": { - "database": { - "connected": "{{ $nodes['check-postgres'].success }}", - "version": "{{ $nodes['check-postgres'].version }}" + "name": "Aggregate Results", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "expression": { + "database": { + "connected": "{{ $nodes['check-postgres'].success }}", + "version": "{{ $nodes['check-postgres'].version }}" + }, + "docker": { + "containerCount": "{{ $nodes['list-containers'].containers.length }}", + "containers": "{{ $nodes['list-containers'].containers }}" + }, + "cadquery": { + "modelCreated": "{{ $nodes['create-3d-model'].success }}", + "outputPath": "{{ $nodes['create-3d-model'].outputPath }}" + }, + "mojo": { + "benchmarkRan": "{{ $nodes['run-mojo-benchmark'].success }}", + "executionTime": "{{ $nodes['run-mojo-benchmark'].executionTime }}" + } }, - "docker": { - "containerCount": "{{ $nodes['list-containers'].containers.length }}", - "containers": "{{ $nodes['list-containers'].containers }}" - }, - "cadquery": { - "modelCreated": "{{ $nodes['create-3d-model'].success }}", - "outputPath": "{{ $nodes['create-3d-model'].outputPath }}" - }, - "mojo": { - "benchmarkRan": "{{ $nodes['run-mojo-benchmark'].success }}", - "executionTime": "{{ $nodes['run-mojo-benchmark'].executionTime }}" - } + "operation": "transform" }, - "operation": "transform" - }, - "notes": "Combine all results into a summary", - "notesInFlow": false + "notes": "Combine all results into a summary", + "notesInFlow": false + } } }, { @@ -185,14 +233,22 @@ 500 ], "parameters": { - "content": "{{ JSON.stringify($nodes['aggregate-results'].result, null, 2) }}", - "title": "Cross-Project Workflow Results", - "language": "json", - "expiresIn": "1d", - "operation": "pastebin.create" - }, - "notes": "Share results as a paste", - "notesInFlow": false + "name": "Share Results", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "content": "{{ JSON.stringify($nodes['aggregate-results'].result, null, 2) }}", + "title": "Cross-Project Workflow Results", + "language": "json", + "expiresIn": "1d", + "operation": "pastebin.create" + }, + "notes": "Share results as a paste", + "notesInFlow": false + } } }, { @@ -212,14 +268,22 @@ 500 ], "parameters": { - "from": "workflow@metabuilder.local", - "to": "admin@example.com", - "subject": "Cross-Project Workflow Complete", - "body": "Workflow completed successfully.\n\nResults: {{ $nodes['share-results'].url }}\n\nSummary:\n- Database: {{ $nodes['check-postgres'].success ? 'Connected' : 'Failed' }}\n- Docker Containers: {{ $nodes['list-containers'].containers.length }}\n- 3D Model: {{ $nodes['create-3d-model'].success ? 'Created' : 'Failed' }}\n- Mojo Benchmark: {{ $nodes['run-mojo-benchmark'].executionTime }}ms", - "operation": "smtp.sendEmail" - }, - "notes": "Email the results", - "notesInFlow": false + "name": "Send Notification", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "from": "workflow@metabuilder.local", + "to": "admin@example.com", + "subject": "Cross-Project Workflow Complete", + "body": "Workflow completed successfully.\n\nResults: {{ $nodes['share-results'].url }}\n\nSummary:\n- Database: {{ $nodes['check-postgres'].success ? 'Connected' : 'Failed' }}\n- Docker Containers: {{ $nodes['list-containers'].containers.length }}\n- 3D Model: {{ $nodes['create-3d-model'].success ? 'Created' : 'Failed' }}\n- Mojo Benchmark: {{ $nodes['run-mojo-benchmark'].executionTime }}ms", + "operation": "smtp.sendEmail" + }, + "notes": "Email the results", + "notesInFlow": false + } } } ], diff --git a/workflow/examples/python/backend_bootstrap/workflow.backup.backup.json b/workflow/examples/python/backend_bootstrap/workflow.backup.backup.json deleted file mode 100644 index de14bc4b7..000000000 --- a/workflow/examples/python/backend_bootstrap/workflow.backup.backup.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "name": "Backend Bootstrap", - "active": false, - "nodes": [ - { - "id": "load_messages", - "name": "Load Messages", - "type": "backend.load_messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Messages", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - }, - { - "id": "load_metadata", - "name": "Load Metadata", - "type": "backend.load_metadata", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Metadata", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - }, - { - "id": "load_prompt", - "name": "Load Prompt", - "type": "backend.load_prompt", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Load Prompt", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - }, - { - "id": "create_github", - "name": "Create Github", - "type": "backend.create_github", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create GitHub Client", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - }, - { - "id": "create_openai", - "name": "Create Openai", - "type": "backend.create_openai", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create OpenAI Client", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - }, - { - "id": "load_tools", - "name": "Load Tools", - "type": "backend.load_tools", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Load Tools", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - }, - { - "id": "build_tool_map", - "name": "Build Tool Map", - "type": "backend.build_tool_map", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Build Tool Map", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": {} - } - }, - { - "id": "load_plugins", - "name": "Load Plugins", - "type": "backend.load_plugins", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Load Plugins", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": {} - } - } - ], - "connections": { - "Load Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Metadata": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Prompt": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Github Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Openai Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Tools": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Build Tool Map": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/backend_bootstrap/workflow.backup.json b/workflow/examples/python/backend_bootstrap/workflow.backup.json deleted file mode 100644 index 9b0d9cd73..000000000 --- a/workflow/examples/python/backend_bootstrap/workflow.backup.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "name": "Backend Bootstrap", - "active": false, - "nodes": [ - { - "id": "load_messages", - "name": "Load Messages", - "type": "backend.load_messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Messages", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "load_metadata", - "name": "Load Metadata", - "type": "backend.load_metadata", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Metadata", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Metadata", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "load_prompt", - "name": "Load Prompt", - "type": "backend.load_prompt", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Load Prompt", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Load Prompt", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "create_github", - "name": "Create Github", - "type": "backend.create_github", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Github", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create GitHub Client", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "create_openai", - "name": "Create Openai", - "type": "backend.create_openai", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Openai", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create OpenAI Client", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "load_tools", - "name": "Load Tools", - "type": "backend.load_tools", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Load Tools", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Load Tools", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "build_tool_map", - "name": "Build Tool Map", - "type": "backend.build_tool_map", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Build Tool Map", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Build Tool Map", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "load_plugins", - "name": "Load Plugins", - "type": "backend.load_plugins", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Load Plugins", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Load Plugins", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": {} - } - } - } - ], - "connections": { - "Load Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Metadata": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Prompt": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Github Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Openai Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Tools": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Build Tool Map": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/backend_bootstrap/workflow.json b/workflow/examples/python/backend_bootstrap/workflow.json index 9b0d9cd73..b4a6abb1d 100644 --- a/workflow/examples/python/backend_bootstrap/workflow.json +++ b/workflow/examples/python/backend_bootstrap/workflow.json @@ -22,10 +22,18 @@ "name": "Load Messages", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Messages", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": {} + } } } }, @@ -49,10 +57,18 @@ "name": "Load Metadata", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Metadata", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + } } } }, @@ -76,10 +92,18 @@ "name": "Load Prompt", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Prompt", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": {} + } } } }, @@ -100,13 +124,21 @@ 300 ], "parameters": { - "name": "Create GitHub Client", + "name": "Create Github", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], - "parameters": {} + "parameters": { + "name": "Create GitHub Client", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + } } } }, @@ -127,13 +159,21 @@ 300 ], "parameters": { - "name": "Create OpenAI Client", + "name": "Create Openai", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], - "parameters": {} + "parameters": { + "name": "Create OpenAI Client", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + } } } }, @@ -157,10 +197,18 @@ "name": "Load Tools", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], - "parameters": {} + "parameters": { + "name": "Load Tools", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": {} + } } } }, @@ -184,10 +232,18 @@ "name": "Build Tool Map", "typeVersion": 1, "position": [ - 1800, - 50 + 100, + 500 ], - "parameters": {} + "parameters": { + "name": "Build Tool Map", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": {} + } } } }, @@ -211,10 +267,18 @@ "name": "Load Plugins", "typeVersion": 1, "position": [ - 2100, - 50 + 400, + 500 ], - "parameters": {} + "parameters": { + "name": "Load Plugins", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": {} + } } } } diff --git a/workflow/examples/python/blank/workflow.backup.backup.json b/workflow/examples/python/blank/workflow.backup.backup.json deleted file mode 100644 index 56f9644d7..000000000 --- a/workflow/examples/python/blank/workflow.backup.backup.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "Blank Canvas", - "active": false, - "nodes": [ - { - "id": "start", - "name": "Start", - "type": "core.start", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Start", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/blank/workflow.backup.json b/workflow/examples/python/blank/workflow.backup.json deleted file mode 100644 index 072776c73..000000000 --- a/workflow/examples/python/blank/workflow.backup.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "Blank Canvas", - "active": false, - "nodes": [ - { - "id": "start", - "name": "Start", - "type": "core.start", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Start", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Start", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - } - ], - "connections": {}, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/blank/workflow.json b/workflow/examples/python/blank/workflow.json index 072776c73..c63973f85 100644 --- a/workflow/examples/python/blank/workflow.json +++ b/workflow/examples/python/blank/workflow.json @@ -22,10 +22,18 @@ "name": "Start", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Start", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } } } } diff --git a/workflow/examples/python/conditional_logic_demo/workflow.backup.backup.json b/workflow/examples/python/conditional_logic_demo/workflow.backup.backup.json deleted file mode 100644 index 49a2cedb5..000000000 --- a/workflow/examples/python/conditional_logic_demo/workflow.backup.backup.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "name": "Conditional Logic Demo", - "active": false, - "nodes": [ - { - "id": "create_user_data", - "name": "Create User Data", - "type": "var.set", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create User Data", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "key": "user", - "value": { - "name": "Alice", - "age": 25, - "score": 85, - "role": "developer" - } - } - } - }, - { - "id": "extract_age", - "name": "Extract Age", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Age", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "object": "$user", - "key": "age" - } - } - }, - { - "id": "check_adult", - "name": "Check Adult", - "type": "logic.gte", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check If Adult", - "typeVersion": 1, - "position": [ - 600, - 100 - ], - "parameters": { - "a": "$age", - "b": 18 - } - } - }, - { - "id": "format_report", - "name": "Format Report", - "type": "string.format", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Final Report", - "typeVersion": 1, - "position": [ - 900, - 100 - ], - "parameters": { - "template": "User: {name}, Age: {age}, Adult: {is_adult}", - "variables": { - "name": "Alice", - "age": "$age", - "is_adult": "$is_adult" - } - } - } - } - ], - "connections": { - "Create User Data": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Extract Age": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Check If Adult": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/conditional_logic_demo/workflow.backup.json b/workflow/examples/python/conditional_logic_demo/workflow.backup.json deleted file mode 100644 index 50d0511ee..000000000 --- a/workflow/examples/python/conditional_logic_demo/workflow.backup.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "name": "Conditional Logic Demo", - "active": false, - "nodes": [ - { - "id": "create_user_data", - "name": "Create User Data", - "type": "var.set", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create User Data", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create User Data", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "key": "user", - "value": { - "name": "Alice", - "age": 25, - "score": 85, - "role": "developer" - } - } - } - } - }, - { - "id": "extract_age", - "name": "Extract Age", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Age", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Extract Age", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "object": "$user", - "key": "age" - } - } - } - }, - { - "id": "check_adult", - "name": "Check Adult", - "type": "logic.gte", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check Adult", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Check If Adult", - "typeVersion": 1, - "position": [ - 600, - 100 - ], - "parameters": { - "a": "$age", - "b": 18 - } - } - } - }, - { - "id": "format_report", - "name": "Format Report", - "type": "string.format", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Report", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Format Final Report", - "typeVersion": 1, - "position": [ - 900, - 100 - ], - "parameters": { - "template": "User: {name}, Age: {age}, Adult: {is_adult}", - "variables": { - "name": "Alice", - "age": "$age", - "is_adult": "$is_adult" - } - } - } - } - } - ], - "connections": { - "Create User Data": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Extract Age": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Check If Adult": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/conditional_logic_demo/workflow.json b/workflow/examples/python/conditional_logic_demo/workflow.json index 50d0511ee..19940241e 100644 --- a/workflow/examples/python/conditional_logic_demo/workflow.json +++ b/workflow/examples/python/conditional_logic_demo/workflow.json @@ -22,16 +22,24 @@ "name": "Create User Data", "typeVersion": 1, "position": [ - 0, + 100, 100 ], "parameters": { - "key": "user", - "value": { - "name": "Alice", - "age": 25, - "score": 85, - "role": "developer" + "name": "Create User Data", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "key": "user", + "value": { + "name": "Alice", + "age": 25, + "score": 85, + "role": "developer" + } } } } @@ -57,12 +65,20 @@ "name": "Extract Age", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "object": "$user", - "key": "age" + "name": "Extract Age", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "object": "$user", + "key": "age" + } } } } @@ -84,15 +100,23 @@ 100 ], "parameters": { - "name": "Check If Adult", + "name": "Check Adult", "typeVersion": 1, "position": [ - 600, + 700, 100 ], "parameters": { - "a": "$age", - "b": 18 + "name": "Check If Adult", + "typeVersion": 1, + "position": [ + 600, + 100 + ], + "parameters": { + "a": "$age", + "b": 18 + } } } } @@ -114,18 +138,26 @@ 300 ], "parameters": { - "name": "Format Final Report", + "name": "Format Report", "typeVersion": 1, "position": [ - 900, - 100 + 100, + 300 ], "parameters": { - "template": "User: {name}, Age: {age}, Adult: {is_adult}", - "variables": { - "name": "Alice", - "age": "$age", - "is_adult": "$is_adult" + "name": "Format Final Report", + "typeVersion": 1, + "position": [ + 900, + 100 + ], + "parameters": { + "template": "User: {name}, Age: {age}, Adult: {is_adult}", + "variables": { + "name": "Alice", + "age": "$age", + "is_adult": "$is_adult" + } } } } diff --git a/workflow/examples/python/contextual_iterative_loop/workflow.backup.backup.json b/workflow/examples/python/contextual_iterative_loop/workflow.backup.backup.json deleted file mode 100644 index 04ab6fd96..000000000 --- a/workflow/examples/python/contextual_iterative_loop/workflow.backup.backup.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "name": "meta.workflow_packages.contextual_iterative_loop.label", - "active": false, - "nodes": [ - { - "id": "list_files", - "name": "List Files", - "type": "tools.list_files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "." - } - } - }, - { - "id": "filter_python", - "name": "Filter Python", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" - } - } - }, - { - "id": "map_python", - "name": "Map Python", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Map Python", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$python_files", - "template": "PY: {item}" - } - } - }, - { - "id": "reduce_python", - "name": "Reduce Python", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "items": "$python_lines", - "separator": "\\n" - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_repo_summary", - "name": "Append Repo Summary", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$python_summary" - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "max_iterations": 5, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - } - ], - "connections": { - "List Files": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Map Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/contextual_iterative_loop/workflow.backup.json b/workflow/examples/python/contextual_iterative_loop/workflow.backup.json deleted file mode 100644 index 99947ec70..000000000 --- a/workflow/examples/python/contextual_iterative_loop/workflow.backup.json +++ /dev/null @@ -1,309 +0,0 @@ -{ - "name": "meta.workflow_packages.contextual_iterative_loop.label", - "active": false, - "nodes": [ - { - "id": "list_files", - "name": "List Files", - "type": "tools.list_files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "." - } - } - } - }, - { - "id": "filter_python", - "name": "Filter Python", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" - } - } - } - }, - { - "id": "map_python", - "name": "Map Python", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Map Python", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Map Python", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$python_files", - "template": "PY: {item}" - } - } - } - }, - { - "id": "reduce_python", - "name": "Reduce Python", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "items": "$python_lines", - "separator": "\\n" - } - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_repo_summary", - "name": "Append Repo Summary", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$python_summary" - } - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "max_iterations": 5, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - } - } - ], - "connections": { - "List Files": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Map Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/contextual_iterative_loop/workflow.json b/workflow/examples/python/contextual_iterative_loop/workflow.json index 99947ec70..b396c7b3a 100644 --- a/workflow/examples/python/contextual_iterative_loop/workflow.json +++ b/workflow/examples/python/contextual_iterative_loop/workflow.json @@ -22,11 +22,19 @@ "name": "List Files", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], "parameters": { - "path": "." + "name": "List Files", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "." + } } } } @@ -51,13 +59,21 @@ "name": "Filter Python", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" + "name": "Filter Python", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$repo_files", + "mode": "regex", + "pattern": "\\.py$" + } } } } @@ -82,12 +98,20 @@ "name": "Map Python", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "items": "$python_files", - "template": "PY: {item}" + "name": "Map Python", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$python_files", + "template": "PY: {item}" + } } } } @@ -112,12 +136,20 @@ "name": "Reduce Python", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], "parameters": { - "items": "$python_lines", - "separator": "\\n" + "name": "Reduce Python", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "items": "$python_lines", + "separator": "\\n" + } } } } @@ -142,10 +174,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + } } } }, @@ -169,12 +209,20 @@ "name": "Append Repo Summary", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], "parameters": { - "messages": "$messages", - "context": "$python_summary" + "name": "Append Repo Summary", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$python_summary" + } } } } @@ -199,11 +247,19 @@ "name": "Append User Instruction", "typeVersion": 1, "position": [ - 1800, - 50 + 100, + 500 ], "parameters": { - "messages": "$messages" + "name": "Append User Instruction", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } @@ -228,13 +284,21 @@ "name": "Main Loop", "typeVersion": 1, "position": [ - 2100, - 50 + 400, + 500 ], "parameters": { - "max_iterations": 5, - "stop_when": "$no_tool_calls", - "stop_on": "true" + "name": "Main Loop", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "max_iterations": 5, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } } } } diff --git a/workflow/examples/python/data_processing_demo/workflow.backup.backup.json b/workflow/examples/python/data_processing_demo/workflow.backup.backup.json deleted file mode 100644 index 06b17b3f9..000000000 --- a/workflow/examples/python/data_processing_demo/workflow.backup.backup.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "name": "Data Processing Demo", - "active": false, - "nodes": [ - { - "id": "create_sample_data", - "name": "Create Sample Data", - "type": "var.set", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create Sample Data", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "key": "numbers", - "value": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ] - } - } - }, - { - "id": "filter_even", - "name": "Filter Even", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Even Numbers", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$numbers", - "mode": "lambda", - "condition": "lambda x: x % 2 == 0" - } - } - }, - { - "id": "map_square", - "name": "Map Square", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Square Each Number", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$filtered_numbers", - "transform": "lambda x: x * x" - } - } - }, - { - "id": "reduce_sum", - "name": "Reduce Sum", - "type": "math.add", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Sum All Values", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "numbers": "$squared_numbers" - } - } - }, - { - "id": "check_threshold", - "name": "Check Threshold", - "type": "logic.gt", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Check If Sum > 50", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "a": "$sum", - "b": 50 - } - } - }, - { - "id": "branch_result", - "name": "Branch Result", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Branch On Result", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "condition": "$is_greater" - } - } - }, - { - "id": "format_success", - "name": "Format Success", - "type": "string.format", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Format Success Message", - "typeVersion": 1, - "position": [ - 1800, - 0 - ], - "parameters": { - "template": "Success! Sum is {sum}, which is greater than 50.", - "variables": { - "sum": "$sum" - } - } - } - }, - { - "id": "format_failure", - "name": "Format Failure", - "type": "string.format", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Format Failure Message", - "typeVersion": 1, - "position": [ - 1800, - 100 - ], - "parameters": { - "template": "Sum is {sum}, which is not greater than 50.", - "variables": { - "sum": "$sum" - } - } - } - }, - { - "id": "store_result", - "name": "Store Result", - "type": "var.set", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Store Final Result", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "key": "final_message", - "value": "$message" - } - } - } - ], - "connections": { - "Create Sample Data": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Even Numbers": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Square Each Number": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Sum All Values": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Check If Sum > 50": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Branch On Result": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Format Success Message": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Format Failure Message": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/data_processing_demo/workflow.backup.json b/workflow/examples/python/data_processing_demo/workflow.backup.json deleted file mode 100644 index bca347247..000000000 --- a/workflow/examples/python/data_processing_demo/workflow.backup.json +++ /dev/null @@ -1,389 +0,0 @@ -{ - "name": "Data Processing Demo", - "active": false, - "nodes": [ - { - "id": "create_sample_data", - "name": "Create Sample Data", - "type": "var.set", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create Sample Data", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Create Sample Data", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "key": "numbers", - "value": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ] - } - } - } - }, - { - "id": "filter_even", - "name": "Filter Even", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Even", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Even Numbers", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$numbers", - "mode": "lambda", - "condition": "lambda x: x % 2 == 0" - } - } - } - }, - { - "id": "map_square", - "name": "Map Square", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Map Square", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Square Each Number", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$filtered_numbers", - "transform": "lambda x: x * x" - } - } - } - }, - { - "id": "reduce_sum", - "name": "Reduce Sum", - "type": "math.add", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Reduce Sum", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Sum All Values", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "numbers": "$squared_numbers" - } - } - } - }, - { - "id": "check_threshold", - "name": "Check Threshold", - "type": "logic.gt", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Check Threshold", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Check If Sum > 50", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "a": "$sum", - "b": 50 - } - } - } - }, - { - "id": "branch_result", - "name": "Branch Result", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Branch Result", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Branch On Result", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "condition": "$is_greater" - } - } - } - }, - { - "id": "format_success", - "name": "Format Success", - "type": "string.format", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Format Success", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Format Success Message", - "typeVersion": 1, - "position": [ - 1800, - 0 - ], - "parameters": { - "template": "Success! Sum is {sum}, which is greater than 50.", - "variables": { - "sum": "$sum" - } - } - } - } - }, - { - "id": "format_failure", - "name": "Format Failure", - "type": "string.format", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Format Failure", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Format Failure Message", - "typeVersion": 1, - "position": [ - 1800, - 100 - ], - "parameters": { - "template": "Sum is {sum}, which is not greater than 50.", - "variables": { - "sum": "$sum" - } - } - } - } - }, - { - "id": "store_result", - "name": "Store Result", - "type": "var.set", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Store Result", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Store Final Result", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "key": "final_message", - "value": "$message" - } - } - } - } - ], - "connections": { - "Create Sample Data": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Even Numbers": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Square Each Number": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Sum All Values": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Check If Sum > 50": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Branch On Result": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Format Success Message": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Format Failure Message": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/data_processing_demo/workflow.json b/workflow/examples/python/data_processing_demo/workflow.json index bca347247..01895b518 100644 --- a/workflow/examples/python/data_processing_demo/workflow.json +++ b/workflow/examples/python/data_processing_demo/workflow.json @@ -22,23 +22,31 @@ "name": "Create Sample Data", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], "parameters": { - "key": "numbers", - "value": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ] + "name": "Create Sample Data", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "key": "numbers", + "value": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ] + } } } } @@ -60,16 +68,24 @@ 100 ], "parameters": { - "name": "Filter Even Numbers", + "name": "Filter Even", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "items": "$numbers", - "mode": "lambda", - "condition": "lambda x: x % 2 == 0" + "name": "Filter Even Numbers", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$numbers", + "mode": "lambda", + "condition": "lambda x: x % 2 == 0" + } } } } @@ -91,15 +107,23 @@ 100 ], "parameters": { - "name": "Square Each Number", + "name": "Map Square", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "items": "$filtered_numbers", - "transform": "lambda x: x * x" + "name": "Square Each Number", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$filtered_numbers", + "transform": "lambda x: x * x" + } } } } @@ -121,14 +145,22 @@ 300 ], "parameters": { - "name": "Sum All Values", + "name": "Reduce Sum", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], "parameters": { - "numbers": "$squared_numbers" + "name": "Sum All Values", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "numbers": "$squared_numbers" + } } } } @@ -150,15 +182,23 @@ 300 ], "parameters": { - "name": "Check If Sum > 50", + "name": "Check Threshold", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], "parameters": { - "a": "$sum", - "b": 50 + "name": "Check If Sum > 50", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "a": "$sum", + "b": 50 + } } } } @@ -180,14 +220,22 @@ 300 ], "parameters": { - "name": "Branch On Result", + "name": "Branch Result", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], "parameters": { - "condition": "$is_greater" + "name": "Branch On Result", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "condition": "$is_greater" + } } } } @@ -209,16 +257,24 @@ 500 ], "parameters": { - "name": "Format Success Message", + "name": "Format Success", "typeVersion": 1, "position": [ - 1800, - 0 + 100, + 500 ], "parameters": { - "template": "Success! Sum is {sum}, which is greater than 50.", - "variables": { - "sum": "$sum" + "name": "Format Success Message", + "typeVersion": 1, + "position": [ + 1800, + 0 + ], + "parameters": { + "template": "Success! Sum is {sum}, which is greater than 50.", + "variables": { + "sum": "$sum" + } } } } @@ -241,16 +297,24 @@ 500 ], "parameters": { - "name": "Format Failure Message", + "name": "Format Failure", "typeVersion": 1, "position": [ - 1800, - 100 + 400, + 500 ], "parameters": { - "template": "Sum is {sum}, which is not greater than 50.", - "variables": { - "sum": "$sum" + "name": "Format Failure Message", + "typeVersion": 1, + "position": [ + 1800, + 100 + ], + "parameters": { + "template": "Sum is {sum}, which is not greater than 50.", + "variables": { + "sum": "$sum" + } } } } @@ -273,15 +337,23 @@ 500 ], "parameters": { - "name": "Store Final Result", + "name": "Store Result", "typeVersion": 1, "position": [ - 2100, - 50 + 700, + 500 ], "parameters": { - "key": "final_message", - "value": "$message" + "name": "Store Final Result", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "key": "final_message", + "value": "$message" + } } } } diff --git a/workflow/examples/python/default_app_workflow/workflow.backup.backup.json b/workflow/examples/python/default_app_workflow/workflow.backup.backup.json deleted file mode 100644 index a812556f9..000000000 --- a/workflow/examples/python/default_app_workflow/workflow.backup.backup.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "name": "default_app_workflow", - "active": false, - "nodes": [ - { - "id": "load_messages", - "name": "Load Messages", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "load_messages" - }, - "notes": "Load initial messages from storage", - "notesInFlow": false - }, - { - "id": "load_metadata", - "name": "Load Metadata", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "load_metadata" - }, - "notes": "Load workflow metadata and configuration", - "notesInFlow": false - }, - { - "id": "load_prompts", - "name": "Load Prompts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "load_prompts" - }, - "notes": "Load prompt templates", - "notesInFlow": false - }, - { - "id": "create_github_client", - "name": "Create Github Client", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "create_github_client" - }, - "notes": "Initialize GitHub API client", - "notesInFlow": false - }, - { - "id": "create_openai_client", - "name": "Create Openai Client", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "operation": "create_openai_client" - }, - "notes": "Initialize OpenAI API client", - "notesInFlow": false - }, - { - "id": "load_tools", - "name": "Load Tools", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "operation": "load_tools" - }, - "notes": "Load available tool definitions", - "notesInFlow": false - }, - { - "id": "load_plugins", - "name": "Load Plugins", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "operation": "load_plugins" - }, - "notes": "Load and initialize plugins", - "notesInFlow": false - }, - { - "id": "seed_context", - "name": "Seed Context", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "seed_context" - }, - "notes": "Initialize execution context", - "notesInFlow": false - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "operation": "seed_messages" - }, - "notes": "Seed initial conversation messages", - "notesInFlow": false - }, - { - "id": "append_user_instructions", - "name": "Append User Instructions", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "operation": "append_message" - }, - "notes": "Append user instructions to messages", - "notesInFlow": false - }, - { - "id": "ai_loop", - "name": "Ai Loop", - "type": "metabuilder.loop", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "max_iterations": 10, - "when": "$no_tool_calls", - "nodes": [ - { - "id": "ai_request", - "type": "operation", - "op": "ai_request", - "description": "Make request to AI model" - }, - { - "id": "execute_tool_calls", - "type": "operation", - "op": "execute_tool_calls", - "description": "Execute any tool calls from AI response" - }, - { - "id": "append_results", - "type": "operation", - "op": "append_results", - "description": "Append tool results to conversation" - } - ] - } - } - ], - "connections": { - "Load Messages": { - "main": { - "0": [ - { - "node": "Load Metadata", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Metadata": { - "main": { - "0": [ - { - "node": "Load Prompts", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Prompts": { - "main": { - "0": [ - { - "node": "Create Github Client", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Github Client": { - "main": { - "0": [ - { - "node": "Create Openai Client", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Openai Client": { - "main": { - "0": [ - { - "node": "Load Tools", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Tools": { - "main": { - "0": [ - { - "node": "Load Plugins", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Plugins": { - "main": { - "0": [ - { - "node": "Seed Context", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Context": { - "main": { - "0": [ - { - "node": "Seed Messages", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "Append User Instructions", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instructions": { - "main": { - "0": [ - { - "node": "Ai Loop", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": { - "description": "Default application workflow with backend bootstrap and iterative AI loop" - }, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/default_app_workflow/workflow.backup.json b/workflow/examples/python/default_app_workflow/workflow.backup.json deleted file mode 100644 index 4b5a45b4c..000000000 --- a/workflow/examples/python/default_app_workflow/workflow.backup.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "name": "default_app_workflow", - "active": false, - "nodes": [ - { - "id": "load_messages", - "name": "Load Messages", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "operation": "load_messages" - }, - "notes": "Load initial messages from storage", - "notesInFlow": false - } - }, - { - "id": "load_metadata", - "name": "Load Metadata", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Metadata", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "operation": "load_metadata" - }, - "notes": "Load workflow metadata and configuration", - "notesInFlow": false - } - }, - { - "id": "load_prompts", - "name": "Load Prompts", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Load Prompts", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "operation": "load_prompts" - }, - "notes": "Load prompt templates", - "notesInFlow": false - } - }, - { - "id": "create_github_client", - "name": "Create Github Client", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Github Client", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "operation": "create_github_client" - }, - "notes": "Initialize GitHub API client", - "notesInFlow": false - } - }, - { - "id": "create_openai_client", - "name": "Create Openai Client", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Openai Client", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "operation": "create_openai_client" - }, - "notes": "Initialize OpenAI API client", - "notesInFlow": false - } - }, - { - "id": "load_tools", - "name": "Load Tools", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Load Tools", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "operation": "load_tools" - }, - "notes": "Load available tool definitions", - "notesInFlow": false - } - }, - { - "id": "load_plugins", - "name": "Load Plugins", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Load Plugins", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "operation": "load_plugins" - }, - "notes": "Load and initialize plugins", - "notesInFlow": false - } - }, - { - "id": "seed_context", - "name": "Seed Context", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Seed Context", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "operation": "seed_context" - }, - "notes": "Initialize execution context", - "notesInFlow": false - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "operation": "seed_messages" - }, - "notes": "Seed initial conversation messages", - "notesInFlow": false - } - }, - { - "id": "append_user_instructions", - "name": "Append User Instructions", - "type": "metabuilder.operation", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Append User Instructions", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "operation": "append_message" - }, - "notes": "Append user instructions to messages", - "notesInFlow": false - } - }, - { - "id": "ai_loop", - "name": "Ai Loop", - "type": "metabuilder.loop", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Ai Loop", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "max_iterations": 10, - "when": "$no_tool_calls", - "nodes": [ - { - "id": "ai_request", - "type": "operation", - "op": "ai_request", - "description": "Make request to AI model" - }, - { - "id": "execute_tool_calls", - "type": "operation", - "op": "execute_tool_calls", - "description": "Execute any tool calls from AI response" - }, - { - "id": "append_results", - "type": "operation", - "op": "append_results", - "description": "Append tool results to conversation" - } - ] - } - } - } - ], - "connections": { - "Load Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Metadata": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Prompts": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Github Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Openai Client": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Tools": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Plugins": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instructions": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/default_app_workflow/workflow.json b/workflow/examples/python/default_app_workflow/workflow.json index 4b5a45b4c..fe736e5de 100644 --- a/workflow/examples/python/default_app_workflow/workflow.json +++ b/workflow/examples/python/default_app_workflow/workflow.json @@ -19,10 +19,18 @@ 100 ], "parameters": { - "operation": "load_messages" - }, - "notes": "Load initial messages from storage", - "notesInFlow": false + "name": "Load Messages", + "typeVersion": 1, + "position": [ + 100, + 100 + ], + "parameters": { + "operation": "load_messages" + }, + "notes": "Load initial messages from storage", + "notesInFlow": false + } } }, { @@ -42,10 +50,18 @@ 100 ], "parameters": { - "operation": "load_metadata" - }, - "notes": "Load workflow metadata and configuration", - "notesInFlow": false + "name": "Load Metadata", + "typeVersion": 1, + "position": [ + 400, + 100 + ], + "parameters": { + "operation": "load_metadata" + }, + "notes": "Load workflow metadata and configuration", + "notesInFlow": false + } } }, { @@ -65,10 +81,18 @@ 100 ], "parameters": { - "operation": "load_prompts" - }, - "notes": "Load prompt templates", - "notesInFlow": false + "name": "Load Prompts", + "typeVersion": 1, + "position": [ + 700, + 100 + ], + "parameters": { + "operation": "load_prompts" + }, + "notes": "Load prompt templates", + "notesInFlow": false + } } }, { @@ -88,10 +112,18 @@ 300 ], "parameters": { - "operation": "create_github_client" - }, - "notes": "Initialize GitHub API client", - "notesInFlow": false + "name": "Create Github Client", + "typeVersion": 1, + "position": [ + 100, + 300 + ], + "parameters": { + "operation": "create_github_client" + }, + "notes": "Initialize GitHub API client", + "notesInFlow": false + } } }, { @@ -111,10 +143,18 @@ 300 ], "parameters": { - "operation": "create_openai_client" - }, - "notes": "Initialize OpenAI API client", - "notesInFlow": false + "name": "Create Openai Client", + "typeVersion": 1, + "position": [ + 400, + 300 + ], + "parameters": { + "operation": "create_openai_client" + }, + "notes": "Initialize OpenAI API client", + "notesInFlow": false + } } }, { @@ -134,10 +174,18 @@ 300 ], "parameters": { - "operation": "load_tools" - }, - "notes": "Load available tool definitions", - "notesInFlow": false + "name": "Load Tools", + "typeVersion": 1, + "position": [ + 700, + 300 + ], + "parameters": { + "operation": "load_tools" + }, + "notes": "Load available tool definitions", + "notesInFlow": false + } } }, { @@ -157,10 +205,18 @@ 500 ], "parameters": { - "operation": "load_plugins" - }, - "notes": "Load and initialize plugins", - "notesInFlow": false + "name": "Load Plugins", + "typeVersion": 1, + "position": [ + 100, + 500 + ], + "parameters": { + "operation": "load_plugins" + }, + "notes": "Load and initialize plugins", + "notesInFlow": false + } } }, { @@ -180,10 +236,18 @@ 500 ], "parameters": { - "operation": "seed_context" - }, - "notes": "Initialize execution context", - "notesInFlow": false + "name": "Seed Context", + "typeVersion": 1, + "position": [ + 400, + 500 + ], + "parameters": { + "operation": "seed_context" + }, + "notes": "Initialize execution context", + "notesInFlow": false + } } }, { @@ -203,10 +267,18 @@ 500 ], "parameters": { - "operation": "seed_messages" - }, - "notes": "Seed initial conversation messages", - "notesInFlow": false + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 700, + 500 + ], + "parameters": { + "operation": "seed_messages" + }, + "notes": "Seed initial conversation messages", + "notesInFlow": false + } } }, { @@ -226,10 +298,18 @@ 700 ], "parameters": { - "operation": "append_message" - }, - "notes": "Append user instructions to messages", - "notesInFlow": false + "name": "Append User Instructions", + "typeVersion": 1, + "position": [ + 100, + 700 + ], + "parameters": { + "operation": "append_message" + }, + "notes": "Append user instructions to messages", + "notesInFlow": false + } } }, { @@ -249,28 +329,36 @@ 700 ], "parameters": { - "max_iterations": 10, - "when": "$no_tool_calls", - "nodes": [ - { - "id": "ai_request", - "type": "operation", - "op": "ai_request", - "description": "Make request to AI model" - }, - { - "id": "execute_tool_calls", - "type": "operation", - "op": "execute_tool_calls", - "description": "Execute any tool calls from AI response" - }, - { - "id": "append_results", - "type": "operation", - "op": "append_results", - "description": "Append tool results to conversation" - } - ] + "name": "Ai Loop", + "typeVersion": 1, + "position": [ + 400, + 700 + ], + "parameters": { + "max_iterations": 10, + "when": "$no_tool_calls", + "nodes": [ + { + "id": "ai_request", + "type": "operation", + "op": "ai_request", + "description": "Make request to AI model" + }, + { + "id": "execute_tool_calls", + "type": "operation", + "op": "execute_tool_calls", + "description": "Execute any tool calls from AI response" + }, + { + "id": "append_results", + "type": "operation", + "op": "append_results", + "description": "Append tool results to conversation" + } + ] + } } } } diff --git a/workflow/examples/python/dict_plugins_test/workflow.backup.backup.json b/workflow/examples/python/dict_plugins_test/workflow.backup.backup.json deleted file mode 100644 index c104b6a6c..000000000 --- a/workflow/examples/python/dict_plugins_test/workflow.backup.backup.json +++ /dev/null @@ -1,410 +0,0 @@ -{ - "name": "Dict Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_get", - "name": "Test Get", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Get", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "object": { - "name": "Alice", - "age": 30 - }, - "key": "name" - } - } - }, - { - "id": "assert_get", - "name": "Assert Get", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Get Value", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_get.result", - "expected": "Alice", - "message": "dict.get should retrieve value" - } - } - }, - { - "id": "assert_get_found", - "name": "Assert Get Found", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Get Found", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "value": "$test_get.found", - "message": "dict.get should set found flag" - } - } - }, - { - "id": "test_set", - "name": "Test Set", - "type": "dict.set", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Set", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "object": { - "a": 1 - }, - "key": "b", - "value": 2 - } - } - }, - { - "id": "test_get_new_key", - "name": "Test Get New Key", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Get New Key", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "object": "$test_set.result", - "key": "b" - } - } - }, - { - "id": "assert_set", - "name": "Assert Set", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Set Value", - "typeVersion": 1, - "position": [ - 600, - 100 - ], - "parameters": { - "actual": "$test_get_new_key.result", - "expected": 2, - "message": "dict.set should add new key" - } - } - }, - { - "id": "test_keys", - "name": "Test Keys", - "type": "dict.keys", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Keys", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "object": { - "a": 1, - "b": 2, - "c": 3 - } - } - } - }, - { - "id": "assert_keys_length", - "name": "Assert Keys Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Keys Length", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "items": "$test_keys.result" - } - } - }, - { - "id": "assert_keys", - "name": "Assert Keys", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Keys Count", - "typeVersion": 1, - "position": [ - 600, - 200 - ], - "parameters": { - "actual": "$assert_keys_length.result", - "expected": 3, - "message": "dict.keys should return all keys" - } - } - }, - { - "id": "test_merge", - "name": "Test Merge", - "type": "dict.merge", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Merge", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "objects": [ - { - "a": 1 - }, - { - "b": 2 - }, - { - "c": 3 - } - ] - } - } - }, - { - "id": "test_merged_keys", - "name": "Test Merged Keys", - "type": "dict.keys", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Get Merged Keys", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "object": "$test_merge.result" - } - } - }, - { - "id": "assert_merge_length", - "name": "Assert Merge Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Merge Length", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "items": "$test_merged_keys.result" - } - } - }, - { - "id": "assert_merge", - "name": "Assert Merge", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Assert Merge", - "typeVersion": 1, - "position": [ - 900, - 300 - ], - "parameters": { - "actual": "$assert_merge_length.result", - "expected": 3, - "message": "dict.merge should merge dicts" - } - } - } - ], - "connections": { - "Test Get": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Set": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Get New Key": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Keys": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Keys Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Merge": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Get Merged Keys": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Merge Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/dict_plugins_test/workflow.backup.json b/workflow/examples/python/dict_plugins_test/workflow.backup.json deleted file mode 100644 index 16b4891a3..000000000 --- a/workflow/examples/python/dict_plugins_test/workflow.backup.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "name": "Dict Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_get", - "name": "Test Get", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Get", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Get", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "object": { - "name": "Alice", - "age": 30 - }, - "key": "name" - } - } - } - }, - { - "id": "assert_get", - "name": "Assert Get", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Get", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Get Value", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_get.result", - "expected": "Alice", - "message": "dict.get should retrieve value" - } - } - } - }, - { - "id": "assert_get_found", - "name": "Assert Get Found", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Get Found", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Get Found", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "value": "$test_get.found", - "message": "dict.get should set found flag" - } - } - } - }, - { - "id": "test_set", - "name": "Test Set", - "type": "dict.set", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Set", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Set", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "object": { - "a": 1 - }, - "key": "b", - "value": 2 - } - } - } - }, - { - "id": "test_get_new_key", - "name": "Test Get New Key", - "type": "dict.get", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Get New Key", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Get New Key", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "object": "$test_set.result", - "key": "b" - } - } - } - }, - { - "id": "assert_set", - "name": "Assert Set", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Set", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Set Value", - "typeVersion": 1, - "position": [ - 600, - 100 - ], - "parameters": { - "actual": "$test_get_new_key.result", - "expected": 2, - "message": "dict.set should add new key" - } - } - } - }, - { - "id": "test_keys", - "name": "Test Keys", - "type": "dict.keys", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Keys", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Keys", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "object": { - "a": 1, - "b": 2, - "c": 3 - } - } - } - } - }, - { - "id": "assert_keys_length", - "name": "Assert Keys Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Keys Length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Keys Length", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "items": "$test_keys.result" - } - } - } - }, - { - "id": "assert_keys", - "name": "Assert Keys", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Keys", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Keys Count", - "typeVersion": 1, - "position": [ - 600, - 200 - ], - "parameters": { - "actual": "$assert_keys_length.result", - "expected": 3, - "message": "dict.keys should return all keys" - } - } - } - }, - { - "id": "test_merge", - "name": "Test Merge", - "type": "dict.merge", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Merge", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Merge", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "objects": [ - { - "a": 1 - }, - { - "b": 2 - }, - { - "c": 3 - } - ] - } - } - } - }, - { - "id": "test_merged_keys", - "name": "Test Merged Keys", - "type": "dict.keys", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Merged Keys", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Get Merged Keys", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "object": "$test_merge.result" - } - } - } - }, - { - "id": "assert_merge_length", - "name": "Assert Merge Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Merge Length", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Merge Length", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "items": "$test_merged_keys.result" - } - } - } - }, - { - "id": "assert_merge", - "name": "Assert Merge", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Assert Merge", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Assert Merge", - "typeVersion": 1, - "position": [ - 900, - 300 - ], - "parameters": { - "actual": "$assert_merge_length.result", - "expected": 3, - "message": "dict.merge should merge dicts" - } - } - } - } - ], - "connections": { - "Test Get": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Set": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Get New Key": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Keys": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Keys Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Merge": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Get Merged Keys": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Merge Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/dict_plugins_test/workflow.json b/workflow/examples/python/dict_plugins_test/workflow.json index 16b4891a3..cb04700f7 100644 --- a/workflow/examples/python/dict_plugins_test/workflow.json +++ b/workflow/examples/python/dict_plugins_test/workflow.json @@ -22,15 +22,23 @@ "name": "Test Get", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], "parameters": { - "object": { - "name": "Alice", - "age": 30 - }, - "key": "name" + "name": "Test Get", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "object": { + "name": "Alice", + "age": 30 + }, + "key": "name" + } } } } @@ -52,16 +60,24 @@ 100 ], "parameters": { - "name": "Assert Get Value", + "name": "Assert Get", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], "parameters": { - "actual": "$test_get.result", - "expected": "Alice", - "message": "dict.get should retrieve value" + "name": "Assert Get Value", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_get.result", + "expected": "Alice", + "message": "dict.get should retrieve value" + } } } } @@ -86,12 +102,20 @@ "name": "Assert Get Found", "typeVersion": 1, "position": [ - 600, - 0 + 700, + 100 ], "parameters": { - "value": "$test_get.found", - "message": "dict.get should set found flag" + "name": "Assert Get Found", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "value": "$test_get.found", + "message": "dict.get should set found flag" + } } } } @@ -116,15 +140,23 @@ "name": "Test Set", "typeVersion": 1, "position": [ - 0, - 100 + 100, + 300 ], "parameters": { - "object": { - "a": 1 - }, - "key": "b", - "value": 2 + "name": "Test Set", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "object": { + "a": 1 + }, + "key": "b", + "value": 2 + } } } } @@ -149,12 +181,20 @@ "name": "Test Get New Key", "typeVersion": 1, "position": [ - 300, - 100 + 400, + 300 ], "parameters": { - "object": "$test_set.result", - "key": "b" + "name": "Test Get New Key", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "object": "$test_set.result", + "key": "b" + } } } } @@ -176,16 +216,24 @@ 300 ], "parameters": { - "name": "Assert Set Value", + "name": "Assert Set", "typeVersion": 1, "position": [ - 600, - 100 + 700, + 300 ], "parameters": { - "actual": "$test_get_new_key.result", - "expected": 2, - "message": "dict.set should add new key" + "name": "Assert Set Value", + "typeVersion": 1, + "position": [ + 600, + 100 + ], + "parameters": { + "actual": "$test_get_new_key.result", + "expected": 2, + "message": "dict.set should add new key" + } } } } @@ -210,14 +258,22 @@ "name": "Test Keys", "typeVersion": 1, "position": [ - 0, - 200 + 100, + 500 ], "parameters": { - "object": { - "a": 1, - "b": 2, - "c": 3 + "name": "Test Keys", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "object": { + "a": 1, + "b": 2, + "c": 3 + } } } } @@ -243,11 +299,19 @@ "name": "Assert Keys Length", "typeVersion": 1, "position": [ - 300, - 200 + 400, + 500 ], "parameters": { - "items": "$test_keys.result" + "name": "Assert Keys Length", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "items": "$test_keys.result" + } } } } @@ -269,16 +333,24 @@ 500 ], "parameters": { - "name": "Assert Keys Count", + "name": "Assert Keys", "typeVersion": 1, "position": [ - 600, - 200 + 700, + 500 ], "parameters": { - "actual": "$assert_keys_length.result", - "expected": 3, - "message": "dict.keys should return all keys" + "name": "Assert Keys Count", + "typeVersion": 1, + "position": [ + 600, + 200 + ], + "parameters": { + "actual": "$assert_keys_length.result", + "expected": 3, + "message": "dict.keys should return all keys" + } } } } @@ -303,21 +375,29 @@ "name": "Test Merge", "typeVersion": 1, "position": [ - 0, - 300 + 100, + 700 ], "parameters": { - "objects": [ - { - "a": 1 - }, - { - "b": 2 - }, - { - "c": 3 - } - ] + "name": "Test Merge", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "objects": [ + { + "a": 1 + }, + { + "b": 2 + }, + { + "c": 3 + } + ] + } } } } @@ -339,14 +419,22 @@ 700 ], "parameters": { - "name": "Get Merged Keys", + "name": "Test Merged Keys", "typeVersion": 1, "position": [ - 300, - 300 + 400, + 700 ], "parameters": { - "object": "$test_merge.result" + "name": "Get Merged Keys", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "object": "$test_merge.result" + } } } } @@ -371,11 +459,19 @@ "name": "Assert Merge Length", "typeVersion": 1, "position": [ - 600, - 300 + 700, + 700 ], "parameters": { - "items": "$test_merged_keys.result" + "name": "Assert Merge Length", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "items": "$test_merged_keys.result" + } } } } @@ -400,13 +496,21 @@ "name": "Assert Merge", "typeVersion": 1, "position": [ - 900, - 300 + 100, + 900 ], "parameters": { - "actual": "$assert_merge_length.result", - "expected": 3, - "message": "dict.merge should merge dicts" + "name": "Assert Merge", + "typeVersion": 1, + "position": [ + 900, + 300 + ], + "parameters": { + "actual": "$assert_merge_length.result", + "expected": 3, + "message": "dict.merge should merge dicts" + } } } } diff --git a/workflow/examples/python/game_tick_loop/workflow.backup.backup.json b/workflow/examples/python/game_tick_loop/workflow.backup.backup.json deleted file mode 100644 index 16d53eb5e..000000000 --- a/workflow/examples/python/game_tick_loop/workflow.backup.backup.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "name": "meta.workflow_packages.game_tick_loop.label", - "active": false, - "nodes": [ - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - }, - { - "id": "map_ticks", - "name": "Map Ticks", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Map Ticks", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": [ - "tick_start", - "tick_update", - "tick_render" - ], - "template": "Tick: {item}" - } - } - }, - { - "id": "reduce_ticks", - "name": "Reduce Ticks", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Ticks", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$tick_lines", - "separator": "\\n" - } - } - }, - { - "id": "append_tick_context", - "name": "Append Tick Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append Tick Context", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$tick_context" - } - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "max_iterations": 3, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - } - ], - "connections": { - "Map Ticks": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tick Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Ticks": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/game_tick_loop/workflow.backup.json b/workflow/examples/python/game_tick_loop/workflow.backup.json deleted file mode 100644 index 957ae20ca..000000000 --- a/workflow/examples/python/game_tick_loop/workflow.backup.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "name": "meta.workflow_packages.game_tick_loop.label", - "active": false, - "nodes": [ - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "map_ticks", - "name": "Map Ticks", - "type": "utils.map_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Map Ticks", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Map Ticks", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": [ - "tick_start", - "tick_update", - "tick_render" - ], - "template": "Tick: {item}" - } - } - } - }, - { - "id": "reduce_ticks", - "name": "Reduce Ticks", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Ticks", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Ticks", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$tick_lines", - "separator": "\\n" - } - } - } - }, - { - "id": "append_tick_context", - "name": "Append Tick Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append Tick Context", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append Tick Context", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$tick_context" - } - } - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "max_iterations": 3, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - } - } - ], - "connections": { - "Map Ticks": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tick Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Ticks": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/game_tick_loop/workflow.json b/workflow/examples/python/game_tick_loop/workflow.json index 957ae20ca..d6d870fa6 100644 --- a/workflow/examples/python/game_tick_loop/workflow.json +++ b/workflow/examples/python/game_tick_loop/workflow.json @@ -22,10 +22,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": {} + } } } }, @@ -49,16 +57,24 @@ "name": "Map Ticks", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "items": [ - "tick_start", - "tick_update", - "tick_render" + "name": "Map Ticks", + "typeVersion": 1, + "position": [ + 300, + 50 ], - "template": "Tick: {item}" + "parameters": { + "items": [ + "tick_start", + "tick_update", + "tick_render" + ], + "template": "Tick: {item}" + } } } } @@ -83,12 +99,20 @@ "name": "Reduce Ticks", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "items": "$tick_lines", - "separator": "\\n" + "name": "Reduce Ticks", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$tick_lines", + "separator": "\\n" + } } } } @@ -113,12 +137,20 @@ "name": "Append Tick Context", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], "parameters": { - "messages": "$messages", - "context": "$tick_context" + "name": "Append Tick Context", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$tick_context" + } } } } @@ -143,13 +175,21 @@ "name": "Main Loop", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], "parameters": { - "max_iterations": 3, - "stop_when": "$no_tool_calls", - "stop_on": "true" + "name": "Main Loop", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "max_iterations": 3, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } } } } diff --git a/workflow/examples/python/iterative_loop/workflow.backup.backup.json b/workflow/examples/python/iterative_loop/workflow.backup.backup.json deleted file mode 100644 index 0dcc432c2..000000000 --- a/workflow/examples/python/iterative_loop/workflow.backup.backup.json +++ /dev/null @@ -1,261 +0,0 @@ -{ - "name": "Iterative Agent Loop", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": {} - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "max_iterations": 10, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "AI Request", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": {} - } - } - ], - "connections": { - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Main Loop": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/iterative_loop/workflow.backup.json b/workflow/examples/python/iterative_loop/workflow.backup.json deleted file mode 100644 index b224ecc08..000000000 --- a/workflow/examples/python/iterative_loop/workflow.backup.json +++ /dev/null @@ -1,325 +0,0 @@ -{ - "name": "Iterative Agent Loop", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": {} - } - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "main_loop", - "name": "Main Loop", - "type": "control.loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Main Loop", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "max_iterations": 10, - "stop_when": "$no_tool_calls", - "stop_on": "true" - } - } - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Ai Request", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "AI Request", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": {} - } - } - } - ], - "connections": { - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Main Loop": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/iterative_loop/workflow.json b/workflow/examples/python/iterative_loop/workflow.json index b224ecc08..42ff778c8 100644 --- a/workflow/examples/python/iterative_loop/workflow.json +++ b/workflow/examples/python/iterative_loop/workflow.json @@ -22,10 +22,18 @@ "name": "Load Context", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Context", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } } } }, @@ -49,10 +57,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 0, + 400, 100 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": {} + } } } }, @@ -76,10 +92,18 @@ "name": "Append Context", "typeVersion": 1, "position": [ - 300, - 50 + 700, + 100 ], - "parameters": {} + "parameters": { + "name": "Append Context", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + } } } }, @@ -103,10 +127,18 @@ "name": "Append User Instruction", "typeVersion": 1, "position": [ - 600, - 50 + 100, + 300 ], - "parameters": {} + "parameters": { + "name": "Append User Instruction", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": {} + } } } }, @@ -130,13 +162,21 @@ "name": "Main Loop", "typeVersion": 1, "position": [ - 900, - 50 + 400, + 300 ], "parameters": { - "max_iterations": 10, - "stop_when": "$no_tool_calls", - "stop_on": "true" + "name": "Main Loop", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "max_iterations": 10, + "stop_when": "$no_tool_calls", + "stop_on": "true" + } } } } @@ -158,13 +198,21 @@ 300 ], "parameters": { - "name": "AI Request", + "name": "Ai Request", "typeVersion": 1, "position": [ - 1200, - 50 + 700, + 300 ], - "parameters": {} + "parameters": { + "name": "AI Request", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + } } } }, @@ -188,10 +236,18 @@ "name": "Run Tool Calls", "typeVersion": 1, "position": [ - 1500, - 50 + 100, + 500 ], - "parameters": {} + "parameters": { + "name": "Run Tool Calls", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": {} + } } } }, @@ -215,10 +271,18 @@ "name": "Append Tool Results", "typeVersion": 1, "position": [ - 1800, - 50 + 400, + 500 ], - "parameters": {} + "parameters": { + "name": "Append Tool Results", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": {} + } } } } diff --git a/workflow/examples/python/list_plugins_test/workflow.backup.backup.json b/workflow/examples/python/list_plugins_test/workflow.backup.backup.json deleted file mode 100644 index 3e78ede48..000000000 --- a/workflow/examples/python/list_plugins_test/workflow.backup.backup.json +++ /dev/null @@ -1,359 +0,0 @@ -{ - "name": "List Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_concat", - "name": "Test Concat", - "type": "list.concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "lists": [ - [ - 1, - 2 - ], - [ - 3, - 4 - ], - [ - 5 - ] - ] - } - } - }, - { - "id": "assert_concat_length", - "name": "Assert Concat Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat Length", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "items": "$test_concat.result" - } - } - }, - { - "id": "assert_concat", - "name": "Assert Concat", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "actual": "$assert_concat_length.result", - "expected": 5, - "message": "list.concat should concatenate lists" - } - } - }, - { - "id": "test_length", - "name": "Test Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 - ] - } - } - }, - { - "id": "assert_length", - "name": "Assert Length", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "list.length should count items" - } - } - }, - { - "id": "test_slice", - "name": "Test Slice", - "type": "list.slice", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Test Slice", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 - ], - "start": 1, - "end": 3 - } - } - }, - { - "id": "assert_slice_length", - "name": "Assert Slice Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Assert Slice Length", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "items": "$test_slice.result" - } - } - }, - { - "id": "assert_slice", - "name": "Assert Slice", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Slice", - "typeVersion": 1, - "position": [ - 600, - 200 - ], - "parameters": { - "actual": "$assert_slice_length.result", - "expected": 2, - "message": "list.slice should extract slice" - } - } - }, - { - "id": "test_find", - "name": "Test Find", - "type": "list.find", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Find", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "items": [ - { - "id": 1, - "name": "Alice" - }, - { - "id": 2, - "name": "Bob" - } - ], - "key": "name", - "value": "Bob" - } - } - }, - { - "id": "assert_find", - "name": "Assert Find", - "type": "test.assert_exists", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Find Result", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "value": "$test_find.result", - "message": "list.find should find item" - } - } - }, - { - "id": "assert_find_found", - "name": "Assert Find Found", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Found Flag", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "value": "$test_find.found", - "message": "list.find should set found flag" - } - } - } - ], - "connections": { - "Test Concat": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Concat Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Slice": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Slice Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Find": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/list_plugins_test/workflow.backup.json b/workflow/examples/python/list_plugins_test/workflow.backup.json deleted file mode 100644 index f65fda253..000000000 --- a/workflow/examples/python/list_plugins_test/workflow.backup.json +++ /dev/null @@ -1,447 +0,0 @@ -{ - "name": "List Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_concat", - "name": "Test Concat", - "type": "list.concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "lists": [ - [ - 1, - 2 - ], - [ - 3, - 4 - ], - [ - 5 - ] - ] - } - } - } - }, - { - "id": "assert_concat_length", - "name": "Assert Concat Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat Length", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat Length", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "items": "$test_concat.result" - } - } - } - }, - { - "id": "assert_concat", - "name": "Assert Concat", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "actual": "$assert_concat_length.result", - "expected": 5, - "message": "list.concat should concatenate lists" - } - } - } - }, - { - "id": "test_length", - "name": "Test Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 - ] - } - } - } - }, - { - "id": "assert_length", - "name": "Assert Length", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "list.length should count items" - } - } - } - }, - { - "id": "test_slice", - "name": "Test Slice", - "type": "list.slice", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Test Slice", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Test Slice", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 - ], - "start": 1, - "end": 3 - } - } - } - }, - { - "id": "assert_slice_length", - "name": "Assert Slice Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Assert Slice Length", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Assert Slice Length", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "items": "$test_slice.result" - } - } - } - }, - { - "id": "assert_slice", - "name": "Assert Slice", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Slice", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Slice", - "typeVersion": 1, - "position": [ - 600, - 200 - ], - "parameters": { - "actual": "$assert_slice_length.result", - "expected": 2, - "message": "list.slice should extract slice" - } - } - } - }, - { - "id": "test_find", - "name": "Test Find", - "type": "list.find", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Find", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Find", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "items": [ - { - "id": 1, - "name": "Alice" - }, - { - "id": 2, - "name": "Bob" - } - ], - "key": "name", - "value": "Bob" - } - } - } - }, - { - "id": "assert_find", - "name": "Assert Find", - "type": "test.assert_exists", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Find", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Find Result", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "value": "$test_find.result", - "message": "list.find should find item" - } - } - } - }, - { - "id": "assert_find_found", - "name": "Assert Find Found", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Find Found", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Found Flag", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "value": "$test_find.found", - "message": "list.find should set found flag" - } - } - } - } - ], - "connections": { - "Test Concat": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Concat Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Slice": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Slice Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Find": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/list_plugins_test/workflow.json b/workflow/examples/python/list_plugins_test/workflow.json index f65fda253..be29bf5fb 100644 --- a/workflow/examples/python/list_plugins_test/workflow.json +++ b/workflow/examples/python/list_plugins_test/workflow.json @@ -22,23 +22,31 @@ "name": "Test Concat", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], "parameters": { - "lists": [ - [ - 1, - 2 - ], - [ - 3, - 4 - ], - [ - 5 + "name": "Test Concat", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "lists": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 5 + ] ] - ] + } } } } @@ -63,11 +71,19 @@ "name": "Assert Concat Length", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], "parameters": { - "items": "$test_concat.result" + "name": "Assert Concat Length", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "items": "$test_concat.result" + } } } } @@ -92,13 +108,21 @@ "name": "Assert Concat", "typeVersion": 1, "position": [ - 600, - 0 + 700, + 100 ], "parameters": { - "actual": "$assert_concat_length.result", - "expected": 5, - "message": "list.concat should concatenate lists" + "name": "Assert Concat", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "actual": "$assert_concat_length.result", + "expected": 5, + "message": "list.concat should concatenate lists" + } } } } @@ -123,17 +147,25 @@ "name": "Test Length", "typeVersion": 1, "position": [ - 0, - 100 + 100, + 300 ], "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 - ] + "name": "Test Length", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "items": [ + 1, + 2, + 3, + 4, + 5 + ] + } } } } @@ -158,13 +190,21 @@ "name": "Assert Length", "typeVersion": 1, "position": [ - 300, - 100 + 400, + 300 ], "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "list.length should count items" + "name": "Assert Length", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_length.result", + "expected": 5, + "message": "list.length should count items" + } } } } @@ -189,19 +229,27 @@ "name": "Test Slice", "typeVersion": 1, "position": [ - 0, - 200 + 700, + 300 ], "parameters": { - "items": [ - 1, - 2, - 3, - 4, - 5 + "name": "Test Slice", + "typeVersion": 1, + "position": [ + 0, + 200 ], - "start": 1, - "end": 3 + "parameters": { + "items": [ + 1, + 2, + 3, + 4, + 5 + ], + "start": 1, + "end": 3 + } } } } @@ -226,11 +274,19 @@ "name": "Assert Slice Length", "typeVersion": 1, "position": [ - 300, - 200 + 100, + 500 ], "parameters": { - "items": "$test_slice.result" + "name": "Assert Slice Length", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "items": "$test_slice.result" + } } } } @@ -255,13 +311,21 @@ "name": "Assert Slice", "typeVersion": 1, "position": [ - 600, - 200 + 400, + 500 ], "parameters": { - "actual": "$assert_slice_length.result", - "expected": 2, - "message": "list.slice should extract slice" + "name": "Assert Slice", + "typeVersion": 1, + "position": [ + 600, + 200 + ], + "parameters": { + "actual": "$assert_slice_length.result", + "expected": 2, + "message": "list.slice should extract slice" + } } } } @@ -286,22 +350,30 @@ "name": "Test Find", "typeVersion": 1, "position": [ - 0, - 300 + 700, + 500 ], "parameters": { - "items": [ - { - "id": 1, - "name": "Alice" - }, - { - "id": 2, - "name": "Bob" - } + "name": "Test Find", + "typeVersion": 1, + "position": [ + 0, + 300 ], - "key": "name", - "value": "Bob" + "parameters": { + "items": [ + { + "id": 1, + "name": "Alice" + }, + { + "id": 2, + "name": "Bob" + } + ], + "key": "name", + "value": "Bob" + } } } } @@ -323,15 +395,23 @@ 700 ], "parameters": { - "name": "Assert Find Result", + "name": "Assert Find", "typeVersion": 1, "position": [ - 300, - 300 + 100, + 700 ], "parameters": { - "value": "$test_find.result", - "message": "list.find should find item" + "name": "Assert Find Result", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "value": "$test_find.result", + "message": "list.find should find item" + } } } } @@ -353,15 +433,23 @@ 700 ], "parameters": { - "name": "Assert Found Flag", + "name": "Assert Find Found", "typeVersion": 1, "position": [ - 600, - 300 + 400, + 700 ], "parameters": { - "value": "$test_find.found", - "message": "list.find should set found flag" + "name": "Assert Found Flag", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "value": "$test_find.found", + "message": "list.find should set found flag" + } } } } diff --git a/workflow/examples/python/logic_plugins_test/workflow.backup.backup.json b/workflow/examples/python/logic_plugins_test/workflow.backup.backup.json deleted file mode 100644 index 55a148524..000000000 --- a/workflow/examples/python/logic_plugins_test/workflow.backup.backup.json +++ /dev/null @@ -1,469 +0,0 @@ -{ - "name": "Logic Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_and_true", - "name": "Test And True", - "type": "logic.and", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test AND (all true)", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "values": [ - true, - true, - true - ] - } - } - }, - { - "id": "assert_and_true", - "name": "Assert And True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert AND result is true", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "value": "$test_and_true.result", - "message": "logic.and with all true values should return true" - } - } - }, - { - "id": "test_and_false", - "name": "Test And False", - "type": "logic.and", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test AND (with false)", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "values": [ - true, - false, - true - ] - } - } - }, - { - "id": "assert_and_false", - "name": "Assert And False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert AND result is false", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "value": "$test_and_false.result", - "message": "logic.and with any false value should return false" - } - } - }, - { - "id": "test_or_true", - "name": "Test Or True", - "type": "logic.or", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test OR (with true)", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "values": [ - false, - false, - true - ] - } - } - }, - { - "id": "assert_or_true", - "name": "Assert Or True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert OR result is true", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "value": "$test_or_true.result", - "message": "logic.or with any true value should return true" - } - } - }, - { - "id": "test_or_false", - "name": "Test Or False", - "type": "logic.or", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test OR (all false)", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "values": [ - false, - false, - false - ] - } - } - }, - { - "id": "assert_or_false", - "name": "Assert Or False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert OR result is false", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "value": "$test_or_false.result", - "message": "logic.or with all false values should return false" - } - } - }, - { - "id": "test_equals_true", - "name": "Test Equals True", - "type": "logic.equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Equals (same)", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "a": 42, - "b": 42 - } - } - }, - { - "id": "assert_equals_true", - "name": "Assert Equals True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Equals is true", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "value": "$test_equals_true.result", - "message": "logic.equals with same values should return true" - } - } - }, - { - "id": "test_equals_false", - "name": "Test Equals False", - "type": "logic.equals", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Equals (different)", - "typeVersion": 1, - "position": [ - 0, - 500 - ], - "parameters": { - "a": 42, - "b": 24 - } - } - }, - { - "id": "assert_equals_false", - "name": "Assert Equals False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Equals is false", - "typeVersion": 1, - "position": [ - 300, - 500 - ], - "parameters": { - "value": "$test_equals_false.result", - "message": "logic.equals with different values should return false" - } - } - }, - { - "id": "test_gt", - "name": "Test Gt", - "type": "logic.gt", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Test Greater Than", - "typeVersion": 1, - "position": [ - 0, - 600 - ], - "parameters": { - "a": 10, - "b": 5 - } - } - }, - { - "id": "assert_gt", - "name": "Assert Gt", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Assert GT is true", - "typeVersion": 1, - "position": [ - 300, - 600 - ], - "parameters": { - "value": "$test_gt.result", - "message": "logic.gt should return true when a > b" - } - } - }, - { - "id": "test_lt", - "name": "Test Lt", - "type": "logic.lt", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Test Less Than", - "typeVersion": 1, - "position": [ - 0, - 700 - ], - "parameters": { - "a": 3, - "b": 7 - } - } - }, - { - "id": "assert_lt", - "name": "Assert Lt", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Assert LT is true", - "typeVersion": 1, - "position": [ - 300, - 700 - ], - "parameters": { - "value": "$test_lt.result", - "message": "logic.lt should return true when a < b" - } - } - } - ], - "connections": { - "Test And (all True)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test And (with False)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Or (with True)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Or (all False)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Equals (same)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Equals (different)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Greater Than": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Less Than": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/logic_plugins_test/workflow.backup.json b/workflow/examples/python/logic_plugins_test/workflow.backup.json deleted file mode 100644 index 5f7630b8d..000000000 --- a/workflow/examples/python/logic_plugins_test/workflow.backup.json +++ /dev/null @@ -1,597 +0,0 @@ -{ - "name": "Logic Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_and_true", - "name": "Test And True", - "type": "logic.and", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test And True", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test AND (all true)", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "values": [ - true, - true, - true - ] - } - } - } - }, - { - "id": "assert_and_true", - "name": "Assert And True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert And True", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert AND result is true", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "value": "$test_and_true.result", - "message": "logic.and with all true values should return true" - } - } - } - }, - { - "id": "test_and_false", - "name": "Test And False", - "type": "logic.and", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test And False", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test AND (with false)", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "values": [ - true, - false, - true - ] - } - } - } - }, - { - "id": "assert_and_false", - "name": "Assert And False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert And False", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert AND result is false", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "value": "$test_and_false.result", - "message": "logic.and with any false value should return false" - } - } - } - }, - { - "id": "test_or_true", - "name": "Test Or True", - "type": "logic.or", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Or True", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test OR (with true)", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "values": [ - false, - false, - true - ] - } - } - } - }, - { - "id": "assert_or_true", - "name": "Assert Or True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Or True", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert OR result is true", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "value": "$test_or_true.result", - "message": "logic.or with any true value should return true" - } - } - } - }, - { - "id": "test_or_false", - "name": "Test Or False", - "type": "logic.or", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Or False", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test OR (all false)", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "values": [ - false, - false, - false - ] - } - } - } - }, - { - "id": "assert_or_false", - "name": "Assert Or False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Or False", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert OR result is false", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "value": "$test_or_false.result", - "message": "logic.or with all false values should return false" - } - } - } - }, - { - "id": "test_equals_true", - "name": "Test Equals True", - "type": "logic.equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Equals True", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Equals (same)", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "a": 42, - "b": 42 - } - } - } - }, - { - "id": "assert_equals_true", - "name": "Assert Equals True", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Equals True", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Equals is true", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "value": "$test_equals_true.result", - "message": "logic.equals with same values should return true" - } - } - } - }, - { - "id": "test_equals_false", - "name": "Test Equals False", - "type": "logic.equals", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Equals False", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Equals (different)", - "typeVersion": 1, - "position": [ - 0, - 500 - ], - "parameters": { - "a": 42, - "b": 24 - } - } - } - }, - { - "id": "assert_equals_false", - "name": "Assert Equals False", - "type": "test.assert_false", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Equals False", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Equals is false", - "typeVersion": 1, - "position": [ - 300, - 500 - ], - "parameters": { - "value": "$test_equals_false.result", - "message": "logic.equals with different values should return false" - } - } - } - }, - { - "id": "test_gt", - "name": "Test Gt", - "type": "logic.gt", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Test Gt", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Test Greater Than", - "typeVersion": 1, - "position": [ - 0, - 600 - ], - "parameters": { - "a": 10, - "b": 5 - } - } - } - }, - { - "id": "assert_gt", - "name": "Assert Gt", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Assert Gt", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Assert GT is true", - "typeVersion": 1, - "position": [ - 300, - 600 - ], - "parameters": { - "value": "$test_gt.result", - "message": "logic.gt should return true when a > b" - } - } - } - }, - { - "id": "test_lt", - "name": "Test Lt", - "type": "logic.lt", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Test Lt", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Test Less Than", - "typeVersion": 1, - "position": [ - 0, - 700 - ], - "parameters": { - "a": 3, - "b": 7 - } - } - } - }, - { - "id": "assert_lt", - "name": "Assert Lt", - "type": "test.assert_true", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Assert Lt", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Assert LT is true", - "typeVersion": 1, - "position": [ - 300, - 700 - ], - "parameters": { - "value": "$test_lt.result", - "message": "logic.lt should return true when a < b" - } - } - } - } - ], - "connections": { - "Test And (all True)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test And (with False)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Or (with True)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Or (all False)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Equals (same)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Equals (different)": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Greater Than": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Less Than": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/logic_plugins_test/workflow.json b/workflow/examples/python/logic_plugins_test/workflow.json index 5f7630b8d..f4c06d962 100644 --- a/workflow/examples/python/logic_plugins_test/workflow.json +++ b/workflow/examples/python/logic_plugins_test/workflow.json @@ -19,18 +19,26 @@ 100 ], "parameters": { - "name": "Test AND (all true)", + "name": "Test And True", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], "parameters": { - "values": [ - true, - true, - true - ] + "name": "Test AND (all true)", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "values": [ + true, + true, + true + ] + } } } } @@ -52,15 +60,23 @@ 100 ], "parameters": { - "name": "Assert AND result is true", + "name": "Assert And True", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], "parameters": { - "value": "$test_and_true.result", - "message": "logic.and with all true values should return true" + "name": "Assert AND result is true", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "value": "$test_and_true.result", + "message": "logic.and with all true values should return true" + } } } } @@ -82,18 +98,26 @@ 100 ], "parameters": { - "name": "Test AND (with false)", + "name": "Test And False", "typeVersion": 1, "position": [ - 0, + 700, 100 ], "parameters": { - "values": [ - true, - false, - true - ] + "name": "Test AND (with false)", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "values": [ + true, + false, + true + ] + } } } } @@ -115,15 +139,23 @@ 300 ], "parameters": { - "name": "Assert AND result is false", + "name": "Assert And False", "typeVersion": 1, "position": [ - 300, - 100 + 100, + 300 ], "parameters": { - "value": "$test_and_false.result", - "message": "logic.and with any false value should return false" + "name": "Assert AND result is false", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "value": "$test_and_false.result", + "message": "logic.and with any false value should return false" + } } } } @@ -145,18 +177,26 @@ 300 ], "parameters": { - "name": "Test OR (with true)", + "name": "Test Or True", "typeVersion": 1, "position": [ - 0, - 200 + 400, + 300 ], "parameters": { - "values": [ - false, - false, - true - ] + "name": "Test OR (with true)", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "values": [ + false, + false, + true + ] + } } } } @@ -178,15 +218,23 @@ 300 ], "parameters": { - "name": "Assert OR result is true", + "name": "Assert Or True", "typeVersion": 1, "position": [ - 300, - 200 + 700, + 300 ], "parameters": { - "value": "$test_or_true.result", - "message": "logic.or with any true value should return true" + "name": "Assert OR result is true", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "value": "$test_or_true.result", + "message": "logic.or with any true value should return true" + } } } } @@ -208,18 +256,26 @@ 500 ], "parameters": { - "name": "Test OR (all false)", + "name": "Test Or False", "typeVersion": 1, "position": [ - 0, - 300 + 100, + 500 ], "parameters": { - "values": [ - false, - false, - false - ] + "name": "Test OR (all false)", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "values": [ + false, + false, + false + ] + } } } } @@ -241,15 +297,23 @@ 500 ], "parameters": { - "name": "Assert OR result is false", + "name": "Assert Or False", "typeVersion": 1, "position": [ - 300, - 300 + 400, + 500 ], "parameters": { - "value": "$test_or_false.result", - "message": "logic.or with all false values should return false" + "name": "Assert OR result is false", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "value": "$test_or_false.result", + "message": "logic.or with all false values should return false" + } } } } @@ -271,15 +335,23 @@ 500 ], "parameters": { - "name": "Test Equals (same)", + "name": "Test Equals True", "typeVersion": 1, "position": [ - 0, - 400 + 700, + 500 ], "parameters": { - "a": 42, - "b": 42 + "name": "Test Equals (same)", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "a": 42, + "b": 42 + } } } } @@ -301,15 +373,23 @@ 700 ], "parameters": { - "name": "Assert Equals is true", + "name": "Assert Equals True", "typeVersion": 1, "position": [ - 300, - 400 + 100, + 700 ], "parameters": { - "value": "$test_equals_true.result", - "message": "logic.equals with same values should return true" + "name": "Assert Equals is true", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "value": "$test_equals_true.result", + "message": "logic.equals with same values should return true" + } } } } @@ -331,15 +411,23 @@ 700 ], "parameters": { - "name": "Test Equals (different)", + "name": "Test Equals False", "typeVersion": 1, "position": [ - 0, - 500 + 400, + 700 ], "parameters": { - "a": 42, - "b": 24 + "name": "Test Equals (different)", + "typeVersion": 1, + "position": [ + 0, + 500 + ], + "parameters": { + "a": 42, + "b": 24 + } } } } @@ -361,15 +449,23 @@ 700 ], "parameters": { - "name": "Assert Equals is false", + "name": "Assert Equals False", "typeVersion": 1, "position": [ - 300, - 500 + 700, + 700 ], "parameters": { - "value": "$test_equals_false.result", - "message": "logic.equals with different values should return false" + "name": "Assert Equals is false", + "typeVersion": 1, + "position": [ + 300, + 500 + ], + "parameters": { + "value": "$test_equals_false.result", + "message": "logic.equals with different values should return false" + } } } } @@ -391,15 +487,23 @@ 900 ], "parameters": { - "name": "Test Greater Than", + "name": "Test Gt", "typeVersion": 1, "position": [ - 0, - 600 + 100, + 900 ], "parameters": { - "a": 10, - "b": 5 + "name": "Test Greater Than", + "typeVersion": 1, + "position": [ + 0, + 600 + ], + "parameters": { + "a": 10, + "b": 5 + } } } } @@ -421,15 +525,23 @@ 900 ], "parameters": { - "name": "Assert GT is true", + "name": "Assert Gt", "typeVersion": 1, "position": [ - 300, - 600 + 400, + 900 ], "parameters": { - "value": "$test_gt.result", - "message": "logic.gt should return true when a > b" + "name": "Assert GT is true", + "typeVersion": 1, + "position": [ + 300, + 600 + ], + "parameters": { + "value": "$test_gt.result", + "message": "logic.gt should return true when a > b" + } } } } @@ -451,15 +563,23 @@ 900 ], "parameters": { - "name": "Test Less Than", + "name": "Test Lt", "typeVersion": 1, "position": [ - 0, - 700 + 700, + 900 ], "parameters": { - "a": 3, - "b": 7 + "name": "Test Less Than", + "typeVersion": 1, + "position": [ + 0, + 700 + ], + "parameters": { + "a": 3, + "b": 7 + } } } } @@ -481,15 +601,23 @@ 1100 ], "parameters": { - "name": "Assert LT is true", + "name": "Assert Lt", "typeVersion": 1, "position": [ - 300, - 700 + 100, + 1100 ], "parameters": { - "value": "$test_lt.result", - "message": "logic.lt should return true when a < b" + "name": "Assert LT is true", + "typeVersion": 1, + "position": [ + 300, + 700 + ], + "parameters": { + "value": "$test_lt.result", + "message": "logic.lt should return true when a < b" + } } } } diff --git a/workflow/examples/python/math_plugins_test/workflow.backup.backup.json b/workflow/examples/python/math_plugins_test/workflow.backup.backup.json deleted file mode 100644 index 82d32247c..000000000 --- a/workflow/examples/python/math_plugins_test/workflow.backup.backup.json +++ /dev/null @@ -1,371 +0,0 @@ -{ - "name": "Math Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_add", - "name": "Test Add", - "type": "math.add", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Add", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "numbers": [ - 1, - 2, - 3, - 4, - 5 - ] - } - } - }, - { - "id": "assert_add", - "name": "Assert Add", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Add equals 15", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_add.result", - "expected": 15, - "message": "math.add should sum all numbers" - } - } - }, - { - "id": "test_multiply", - "name": "Test Multiply", - "type": "math.multiply", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Multiply", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "numbers": [ - 2, - 3, - 4 - ] - } - } - }, - { - "id": "assert_multiply", - "name": "Assert Multiply", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Multiply equals 24", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_multiply.result", - "expected": 24, - "message": "math.multiply should multiply all numbers" - } - } - }, - { - "id": "test_subtract", - "name": "Test Subtract", - "type": "math.subtract", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Subtract", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "a": 10, - "b": 3 - } - } - }, - { - "id": "assert_subtract", - "name": "Assert Subtract", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Subtract equals 7", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "actual": "$test_subtract.result", - "expected": 7, - "message": "math.subtract should return a - b" - } - } - }, - { - "id": "test_divide", - "name": "Test Divide", - "type": "math.divide", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Divide", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "a": 20, - "b": 4 - } - } - }, - { - "id": "assert_divide", - "name": "Assert Divide", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Divide equals 5", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "actual": "$test_divide.result", - "expected": 5, - "message": "math.divide should return a / b" - } - } - }, - { - "id": "test_max", - "name": "Test Max", - "type": "math.max", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Max", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] - } - } - }, - { - "id": "assert_max", - "name": "Assert Max", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Max equals 9", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "actual": "$test_max.result", - "expected": 9, - "message": "math.max should return maximum value" - } - } - }, - { - "id": "test_min", - "name": "Test Min", - "type": "math.min", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Min", - "typeVersion": 1, - "position": [ - 0, - 500 - ], - "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] - } - } - }, - { - "id": "assert_min", - "name": "Assert Min", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Min equals 1", - "typeVersion": 1, - "position": [ - 300, - 500 - ], - "parameters": { - "actual": "$test_min.result", - "expected": 1, - "message": "math.min should return minimum value" - } - } - } - ], - "connections": { - "Test Add": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Multiply": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Subtract": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Divide": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Max": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Min": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/math_plugins_test/workflow.backup.json b/workflow/examples/python/math_plugins_test/workflow.backup.json deleted file mode 100644 index dfc49bc55..000000000 --- a/workflow/examples/python/math_plugins_test/workflow.backup.json +++ /dev/null @@ -1,467 +0,0 @@ -{ - "name": "Math Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_add", - "name": "Test Add", - "type": "math.add", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Add", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Add", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "numbers": [ - 1, - 2, - 3, - 4, - 5 - ] - } - } - } - }, - { - "id": "assert_add", - "name": "Assert Add", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Add", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Add equals 15", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_add.result", - "expected": 15, - "message": "math.add should sum all numbers" - } - } - } - }, - { - "id": "test_multiply", - "name": "Test Multiply", - "type": "math.multiply", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Multiply", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Multiply", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "numbers": [ - 2, - 3, - 4 - ] - } - } - } - }, - { - "id": "assert_multiply", - "name": "Assert Multiply", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Multiply", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Multiply equals 24", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_multiply.result", - "expected": 24, - "message": "math.multiply should multiply all numbers" - } - } - } - }, - { - "id": "test_subtract", - "name": "Test Subtract", - "type": "math.subtract", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Subtract", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Subtract", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "a": 10, - "b": 3 - } - } - } - }, - { - "id": "assert_subtract", - "name": "Assert Subtract", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Subtract", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Subtract equals 7", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "actual": "$test_subtract.result", - "expected": 7, - "message": "math.subtract should return a - b" - } - } - } - }, - { - "id": "test_divide", - "name": "Test Divide", - "type": "math.divide", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Divide", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Divide", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "a": 20, - "b": 4 - } - } - } - }, - { - "id": "assert_divide", - "name": "Assert Divide", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Divide", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Divide equals 5", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "actual": "$test_divide.result", - "expected": 5, - "message": "math.divide should return a / b" - } - } - } - }, - { - "id": "test_max", - "name": "Test Max", - "type": "math.max", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Max", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Test Max", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] - } - } - } - }, - { - "id": "assert_max", - "name": "Assert Max", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Max", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Assert Max equals 9", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "actual": "$test_max.result", - "expected": 9, - "message": "math.max should return maximum value" - } - } - } - }, - { - "id": "test_min", - "name": "Test Min", - "type": "math.min", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Min", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Test Min", - "typeVersion": 1, - "position": [ - 0, - 500 - ], - "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] - } - } - } - }, - { - "id": "assert_min", - "name": "Assert Min", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Min", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Assert Min equals 1", - "typeVersion": 1, - "position": [ - 300, - 500 - ], - "parameters": { - "actual": "$test_min.result", - "expected": 1, - "message": "math.min should return minimum value" - } - } - } - } - ], - "connections": { - "Test Add": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Multiply": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Subtract": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Divide": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Max": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Min": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/math_plugins_test/workflow.json b/workflow/examples/python/math_plugins_test/workflow.json index dfc49bc55..cede7eca6 100644 --- a/workflow/examples/python/math_plugins_test/workflow.json +++ b/workflow/examples/python/math_plugins_test/workflow.json @@ -22,17 +22,25 @@ "name": "Test Add", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], "parameters": { - "numbers": [ - 1, - 2, - 3, - 4, - 5 - ] + "name": "Test Add", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": { + "numbers": [ + 1, + 2, + 3, + 4, + 5 + ] + } } } } @@ -54,16 +62,24 @@ 100 ], "parameters": { - "name": "Assert Add equals 15", + "name": "Assert Add", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], "parameters": { - "actual": "$test_add.result", - "expected": 15, - "message": "math.add should sum all numbers" + "name": "Assert Add equals 15", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_add.result", + "expected": 15, + "message": "math.add should sum all numbers" + } } } } @@ -88,15 +104,23 @@ "name": "Test Multiply", "typeVersion": 1, "position": [ - 0, + 700, 100 ], "parameters": { - "numbers": [ - 2, - 3, - 4 - ] + "name": "Test Multiply", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "numbers": [ + 2, + 3, + 4 + ] + } } } } @@ -118,16 +142,24 @@ 300 ], "parameters": { - "name": "Assert Multiply equals 24", + "name": "Assert Multiply", "typeVersion": 1, "position": [ - 300, - 100 + 100, + 300 ], "parameters": { - "actual": "$test_multiply.result", - "expected": 24, - "message": "math.multiply should multiply all numbers" + "name": "Assert Multiply equals 24", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_multiply.result", + "expected": 24, + "message": "math.multiply should multiply all numbers" + } } } } @@ -152,12 +184,20 @@ "name": "Test Subtract", "typeVersion": 1, "position": [ - 0, - 200 + 400, + 300 ], "parameters": { - "a": 10, - "b": 3 + "name": "Test Subtract", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "a": 10, + "b": 3 + } } } } @@ -179,16 +219,24 @@ 300 ], "parameters": { - "name": "Assert Subtract equals 7", + "name": "Assert Subtract", "typeVersion": 1, "position": [ - 300, - 200 + 700, + 300 ], "parameters": { - "actual": "$test_subtract.result", - "expected": 7, - "message": "math.subtract should return a - b" + "name": "Assert Subtract equals 7", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "actual": "$test_subtract.result", + "expected": 7, + "message": "math.subtract should return a - b" + } } } } @@ -213,12 +261,20 @@ "name": "Test Divide", "typeVersion": 1, "position": [ - 0, - 300 + 100, + 500 ], "parameters": { - "a": 20, - "b": 4 + "name": "Test Divide", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "a": 20, + "b": 4 + } } } } @@ -240,16 +296,24 @@ 500 ], "parameters": { - "name": "Assert Divide equals 5", + "name": "Assert Divide", "typeVersion": 1, "position": [ - 300, - 300 + 400, + 500 ], "parameters": { - "actual": "$test_divide.result", - "expected": 5, - "message": "math.divide should return a / b" + "name": "Assert Divide equals 5", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "actual": "$test_divide.result", + "expected": 5, + "message": "math.divide should return a / b" + } } } } @@ -274,17 +338,25 @@ "name": "Test Max", "typeVersion": 1, "position": [ - 0, - 400 + 700, + 500 ], "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] + "name": "Test Max", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "numbers": [ + 3, + 7, + 2, + 9, + 1 + ] + } } } } @@ -306,16 +378,24 @@ 700 ], "parameters": { - "name": "Assert Max equals 9", + "name": "Assert Max", "typeVersion": 1, "position": [ - 300, - 400 + 100, + 700 ], "parameters": { - "actual": "$test_max.result", - "expected": 9, - "message": "math.max should return maximum value" + "name": "Assert Max equals 9", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "actual": "$test_max.result", + "expected": 9, + "message": "math.max should return maximum value" + } } } } @@ -340,17 +420,25 @@ "name": "Test Min", "typeVersion": 1, "position": [ - 0, - 500 + 400, + 700 ], "parameters": { - "numbers": [ - 3, - 7, - 2, - 9, - 1 - ] + "name": "Test Min", + "typeVersion": 1, + "position": [ + 0, + 500 + ], + "parameters": { + "numbers": [ + 3, + 7, + 2, + 9, + 1 + ] + } } } } @@ -372,16 +460,24 @@ 700 ], "parameters": { - "name": "Assert Min equals 1", + "name": "Assert Min", "typeVersion": 1, "position": [ - 300, - 500 + 700, + 700 ], "parameters": { - "actual": "$test_min.result", - "expected": 1, - "message": "math.min should return minimum value" + "name": "Assert Min equals 1", + "typeVersion": 1, + "position": [ + 300, + 500 + ], + "parameters": { + "actual": "$test_min.result", + "expected": 1, + "message": "math.min should return minimum value" + } } } } diff --git a/workflow/examples/python/plan_execute_summarize/workflow.backup.backup.json b/workflow/examples/python/plan_execute_summarize/workflow.backup.backup.json deleted file mode 100644 index 81c197768..000000000 --- a/workflow/examples/python/plan_execute_summarize/workflow.backup.backup.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "name": "meta.workflow_packages.plan_execute_summarize.label", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$sdlc_context" - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - }, - { - "id": "planner_request", - "name": "Planner Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Planner Request", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "response": "$llm_response" - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" - } - } - }, - { - "id": "summary_request", - "name": "Summary Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Summary Request", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - ], - "connections": { - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Planner Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/plan_execute_summarize/workflow.backup.json b/workflow/examples/python/plan_execute_summarize/workflow.backup.json deleted file mode 100644 index f289ffd69..000000000 --- a/workflow/examples/python/plan_execute_summarize/workflow.backup.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "name": "meta.workflow_packages.plan_execute_summarize.label", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$sdlc_context" - } - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - }, - { - "id": "planner_request", - "name": "Planner Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Planner Request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Planner Request", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "response": "$llm_response" - } - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" - } - } - } - }, - { - "id": "summary_request", - "name": "Summary Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Summary Request", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Summary Request", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - } - ], - "connections": { - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Planner Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/plan_execute_summarize/workflow.json b/workflow/examples/python/plan_execute_summarize/workflow.json index f289ffd69..17edc31ca 100644 --- a/workflow/examples/python/plan_execute_summarize/workflow.json +++ b/workflow/examples/python/plan_execute_summarize/workflow.json @@ -22,10 +22,18 @@ "name": "Load Context", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Context", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": {} + } } } }, @@ -49,10 +57,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + } } } }, @@ -76,12 +92,20 @@ "name": "Append Context", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "messages": "$messages", - "context": "$sdlc_context" + "name": "Append Context", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$sdlc_context" + } } } } @@ -106,11 +130,19 @@ "name": "Append User Instruction", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], "parameters": { - "messages": "$messages" + "name": "Append User Instruction", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } @@ -135,11 +167,19 @@ "name": "Planner Request", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], "parameters": { - "messages": "$messages" + "name": "Planner Request", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } @@ -164,11 +204,19 @@ "name": "Run Tool Calls", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], "parameters": { - "response": "$llm_response" + "name": "Run Tool Calls", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "response": "$llm_response" + } } } } @@ -193,12 +241,20 @@ "name": "Append Tool Results", "typeVersion": 1, "position": [ - 1800, - 50 + 100, + 500 ], "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" + "name": "Append Tool Results", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages", + "tool_results": "$tool_results" + } } } } @@ -223,11 +279,19 @@ "name": "Summary Request", "typeVersion": 1, "position": [ - 2100, - 50 + 400, + 500 ], "parameters": { - "messages": "$messages" + "name": "Summary Request", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } diff --git a/workflow/examples/python/repo_scan_context/workflow.backup.backup.json b/workflow/examples/python/repo_scan_context/workflow.backup.backup.json deleted file mode 100644 index f947840be..000000000 --- a/workflow/examples/python/repo_scan_context/workflow.backup.backup.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "name": "meta.workflow_packages.repo_scan_context.label", - "active": false, - "nodes": [ - { - "id": "list_files", - "name": "List Files", - "type": "tools.list_files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "." - } - } - }, - { - "id": "filter_python", - "name": "Filter Python", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" - } - } - }, - { - "id": "reduce_python", - "name": "Reduce Python", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$python_files", - "separator": "\\n" - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_repo_summary", - "name": "Append Repo Summary", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$python_summary" - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ai Request", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "response": "$llm_response" - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 2400, - 50 - ], - "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" - } - } - } - ], - "connections": { - "List Files": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/repo_scan_context/workflow.backup.json b/workflow/examples/python/repo_scan_context/workflow.backup.json deleted file mode 100644 index 9795c6282..000000000 --- a/workflow/examples/python/repo_scan_context/workflow.backup.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "name": "meta.workflow_packages.repo_scan_context.label", - "active": false, - "nodes": [ - { - "id": "list_files", - "name": "List Files", - "type": "tools.list_files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "List Files", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "." - } - } - } - }, - { - "id": "filter_python", - "name": "Filter Python", - "type": "utils.filter_list", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Filter Python", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" - } - } - } - }, - { - "id": "reduce_python", - "name": "Reduce Python", - "type": "utils.reduce_list", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Reduce Python", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "items": "$python_files", - "separator": "\\n" - } - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_repo_summary", - "name": "Append Repo Summary", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Append Repo Summary", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "messages": "$messages", - "context": "$python_summary" - } - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ai Request", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ai Request", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "messages": "$messages" - } - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 2100, - 50 - ], - "parameters": { - "response": "$llm_response" - } - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 2400, - 50 - ], - "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" - } - } - } - } - ], - "connections": { - "List Files": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Filter Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Tool Results": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Reduce Python": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/repo_scan_context/workflow.json b/workflow/examples/python/repo_scan_context/workflow.json index 9795c6282..b029aadf2 100644 --- a/workflow/examples/python/repo_scan_context/workflow.json +++ b/workflow/examples/python/repo_scan_context/workflow.json @@ -22,11 +22,19 @@ "name": "List Files", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], "parameters": { - "path": "." + "name": "List Files", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "." + } } } } @@ -51,13 +59,21 @@ "name": "Filter Python", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "items": "$repo_files", - "mode": "regex", - "pattern": "\\.py$" + "name": "Filter Python", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "items": "$repo_files", + "mode": "regex", + "pattern": "\\.py$" + } } } } @@ -82,12 +98,20 @@ "name": "Reduce Python", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "items": "$python_files", - "separator": "\\n" + "name": "Reduce Python", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "items": "$python_files", + "separator": "\\n" + } } } } @@ -112,10 +136,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + } } } }, @@ -139,12 +171,20 @@ "name": "Append Repo Summary", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], "parameters": { - "messages": "$messages", - "context": "$python_summary" + "name": "Append Repo Summary", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "messages": "$messages", + "context": "$python_summary" + } } } } @@ -169,11 +209,19 @@ "name": "Append User Instruction", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], "parameters": { - "messages": "$messages" + "name": "Append User Instruction", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } @@ -198,11 +246,19 @@ "name": "Ai Request", "typeVersion": 1, "position": [ - 1800, - 50 + 100, + 500 ], "parameters": { - "messages": "$messages" + "name": "Ai Request", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "messages": "$messages" + } } } } @@ -227,11 +283,19 @@ "name": "Run Tool Calls", "typeVersion": 1, "position": [ - 2100, - 50 + 400, + 500 ], "parameters": { - "response": "$llm_response" + "name": "Run Tool Calls", + "typeVersion": 1, + "position": [ + 2100, + 50 + ], + "parameters": { + "response": "$llm_response" + } } } } @@ -256,12 +320,20 @@ "name": "Append Tool Results", "typeVersion": 1, "position": [ - 2400, - 50 + 700, + 500 ], "parameters": { - "messages": "$messages", - "tool_results": "$tool_results" + "name": "Append Tool Results", + "typeVersion": 1, + "position": [ + 2400, + 50 + ], + "parameters": { + "messages": "$messages", + "tool_results": "$tool_results" + } } } } diff --git a/workflow/examples/python/single_pass/workflow.backup.backup.json b/workflow/examples/python/single_pass/workflow.backup.backup.json deleted file mode 100644 index 52a65f172..000000000 --- a/workflow/examples/python/single_pass/workflow.backup.backup.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "name": "Single Pass", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": {} - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "AI Request", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - } - ], - "connections": { - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/single_pass/workflow.backup.json b/workflow/examples/python/single_pass/workflow.backup.json deleted file mode 100644 index 798958eea..000000000 --- a/workflow/examples/python/single_pass/workflow.backup.json +++ /dev/null @@ -1,272 +0,0 @@ -{ - "name": "Single Pass", - "active": false, - "nodes": [ - { - "id": "load_context", - "name": "Load Context", - "type": "core.load_context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Load Context", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "seed_messages", - "name": "Seed Messages", - "type": "core.seed_messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Seed Messages", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": {} - } - } - }, - { - "id": "append_context", - "name": "Append Context", - "type": "core.append_context_message", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Append Context", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_user_instruction", - "name": "Append User Instruction", - "type": "core.append_user_instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Append User Instruction", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "ai_request", - "name": "Ai Request", - "type": "core.ai_request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Ai Request", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "AI Request", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "run_tool_calls", - "name": "Run Tool Calls", - "type": "core.run_tool_calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Run Tool Calls", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "append_tool_results", - "name": "Append Tool Results", - "type": "core.append_tool_results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Append Tool Results", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": {} - } - } - } - ], - "connections": { - "Load Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Seed Messages": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append Context": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Append User Instruction": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Ai Request": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Run Tool Calls": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/single_pass/workflow.json b/workflow/examples/python/single_pass/workflow.json index 798958eea..5cf5a26dd 100644 --- a/workflow/examples/python/single_pass/workflow.json +++ b/workflow/examples/python/single_pass/workflow.json @@ -22,10 +22,18 @@ "name": "Load Context", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Context", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } } } }, @@ -49,10 +57,18 @@ "name": "Seed Messages", "typeVersion": 1, "position": [ - 0, + 400, 100 ], - "parameters": {} + "parameters": { + "name": "Seed Messages", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": {} + } } } }, @@ -76,10 +92,18 @@ "name": "Append Context", "typeVersion": 1, "position": [ - 300, - 50 + 700, + 100 ], - "parameters": {} + "parameters": { + "name": "Append Context", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": {} + } } } }, @@ -103,10 +127,18 @@ "name": "Append User Instruction", "typeVersion": 1, "position": [ - 600, - 50 + 100, + 300 ], - "parameters": {} + "parameters": { + "name": "Append User Instruction", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": {} + } } } }, @@ -127,13 +159,21 @@ 300 ], "parameters": { - "name": "AI Request", + "name": "Ai Request", "typeVersion": 1, "position": [ - 900, - 50 + 400, + 300 ], - "parameters": {} + "parameters": { + "name": "AI Request", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + } } } }, @@ -157,10 +197,18 @@ "name": "Run Tool Calls", "typeVersion": 1, "position": [ - 1200, - 50 + 700, + 300 ], - "parameters": {} + "parameters": { + "name": "Run Tool Calls", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": {} + } } } }, @@ -184,10 +232,18 @@ "name": "Append Tool Results", "typeVersion": 1, "position": [ - 1500, - 50 + 100, + 500 ], - "parameters": {} + "parameters": { + "name": "Append Tool Results", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": {} + } } } } diff --git a/workflow/examples/python/string_plugins_test/workflow.backup.backup.json b/workflow/examples/python/string_plugins_test/workflow.backup.backup.json deleted file mode 100644 index f6042da9e..000000000 --- a/workflow/examples/python/string_plugins_test/workflow.backup.backup.json +++ /dev/null @@ -1,329 +0,0 @@ -{ - "name": "String Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_concat", - "name": "Test Concat", - "type": "string.concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "strings": [ - "Hello", - "World" - ], - "separator": " " - } - } - }, - { - "id": "assert_concat", - "name": "Assert Concat", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_concat.result", - "expected": "Hello World", - "message": "string.concat should join strings" - } - } - }, - { - "id": "test_upper", - "name": "Test Upper", - "type": "string.upper", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Upper", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "text": "hello" - } - } - }, - { - "id": "assert_upper", - "name": "Assert Upper", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Upper", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_upper.result", - "expected": "HELLO", - "message": "string.upper should uppercase text" - } - } - }, - { - "id": "test_lower", - "name": "Test Lower", - "type": "string.lower", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Lower", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "text": "WORLD" - } - } - }, - { - "id": "assert_lower", - "name": "Assert Lower", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Lower", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "actual": "$test_lower.result", - "expected": "world", - "message": "string.lower should lowercase text" - } - } - }, - { - "id": "test_split", - "name": "Test Split", - "type": "string.split", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Split", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "text": "a,b,c", - "separator": "," - } - } - }, - { - "id": "assert_split_length", - "name": "Assert Split Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Split Length", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "items": "$test_split.result" - } - } - }, - { - "id": "assert_split", - "name": "Assert Split", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Split Count", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "actual": "$assert_split_length.result", - "expected": 3, - "message": "string.split should split into array" - } - } - }, - { - "id": "test_length", - "name": "Test Length", - "type": "string.length", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "text": "Hello" - } - } - }, - { - "id": "assert_length", - "name": "Assert Length", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "string.length should return character count" - } - } - } - ], - "connections": { - "Test Concat": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Upper": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Lower": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Split": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Split Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/string_plugins_test/workflow.backup.json b/workflow/examples/python/string_plugins_test/workflow.backup.json deleted file mode 100644 index 48059ac14..000000000 --- a/workflow/examples/python/string_plugins_test/workflow.backup.json +++ /dev/null @@ -1,417 +0,0 @@ -{ - "name": "String Plugins Test Suite", - "active": false, - "nodes": [ - { - "id": "test_concat", - "name": "Test Concat", - "type": "string.concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Test Concat", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": { - "strings": [ - "Hello", - "World" - ], - "separator": " " - } - } - } - }, - { - "id": "assert_concat", - "name": "Assert Concat", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Assert Concat", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": { - "actual": "$test_concat.result", - "expected": "Hello World", - "message": "string.concat should join strings" - } - } - } - }, - { - "id": "test_upper", - "name": "Test Upper", - "type": "string.upper", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Upper", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Test Upper", - "typeVersion": 1, - "position": [ - 0, - 100 - ], - "parameters": { - "text": "hello" - } - } - } - }, - { - "id": "assert_upper", - "name": "Assert Upper", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Upper", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Assert Upper", - "typeVersion": 1, - "position": [ - 300, - 100 - ], - "parameters": { - "actual": "$test_upper.result", - "expected": "HELLO", - "message": "string.upper should uppercase text" - } - } - } - }, - { - "id": "test_lower", - "name": "Test Lower", - "type": "string.lower", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Lower", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Test Lower", - "typeVersion": 1, - "position": [ - 0, - 200 - ], - "parameters": { - "text": "WORLD" - } - } - } - }, - { - "id": "assert_lower", - "name": "Assert Lower", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Lower", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Assert Lower", - "typeVersion": 1, - "position": [ - 300, - 200 - ], - "parameters": { - "actual": "$test_lower.result", - "expected": "world", - "message": "string.lower should lowercase text" - } - } - } - }, - { - "id": "test_split", - "name": "Test Split", - "type": "string.split", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Split", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Test Split", - "typeVersion": 1, - "position": [ - 0, - 300 - ], - "parameters": { - "text": "a,b,c", - "separator": "," - } - } - } - }, - { - "id": "assert_split_length", - "name": "Assert Split Length", - "type": "list.length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Split Length", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Assert Split Length", - "typeVersion": 1, - "position": [ - 300, - 300 - ], - "parameters": { - "items": "$test_split.result" - } - } - } - }, - { - "id": "assert_split", - "name": "Assert Split", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Split", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Assert Split Count", - "typeVersion": 1, - "position": [ - 600, - 300 - ], - "parameters": { - "actual": "$assert_split_length.result", - "expected": 3, - "message": "string.split should split into array" - } - } - } - }, - { - "id": "test_length", - "name": "Test Length", - "type": "string.length", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Test Length", - "typeVersion": 1, - "position": [ - 0, - 400 - ], - "parameters": { - "text": "Hello" - } - } - } - }, - { - "id": "assert_length", - "name": "Assert Length", - "type": "test.assert_equals", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Assert Length", - "typeVersion": 1, - "position": [ - 300, - 400 - ], - "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "string.length should return character count" - } - } - } - } - ], - "connections": { - "Test Concat": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Upper": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Lower": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Split": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Assert Split Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Test Length": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/string_plugins_test/workflow.json b/workflow/examples/python/string_plugins_test/workflow.json index 48059ac14..060b75023 100644 --- a/workflow/examples/python/string_plugins_test/workflow.json +++ b/workflow/examples/python/string_plugins_test/workflow.json @@ -22,15 +22,23 @@ "name": "Test Concat", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], "parameters": { - "strings": [ - "Hello", - "World" + "name": "Test Concat", + "typeVersion": 1, + "position": [ + 0, + 0 ], - "separator": " " + "parameters": { + "strings": [ + "Hello", + "World" + ], + "separator": " " + } } } } @@ -55,13 +63,21 @@ "name": "Assert Concat", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], "parameters": { - "actual": "$test_concat.result", - "expected": "Hello World", - "message": "string.concat should join strings" + "name": "Assert Concat", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": { + "actual": "$test_concat.result", + "expected": "Hello World", + "message": "string.concat should join strings" + } } } } @@ -86,11 +102,19 @@ "name": "Test Upper", "typeVersion": 1, "position": [ - 0, + 700, 100 ], "parameters": { - "text": "hello" + "name": "Test Upper", + "typeVersion": 1, + "position": [ + 0, + 100 + ], + "parameters": { + "text": "hello" + } } } } @@ -115,13 +139,21 @@ "name": "Assert Upper", "typeVersion": 1, "position": [ - 300, - 100 + 100, + 300 ], "parameters": { - "actual": "$test_upper.result", - "expected": "HELLO", - "message": "string.upper should uppercase text" + "name": "Assert Upper", + "typeVersion": 1, + "position": [ + 300, + 100 + ], + "parameters": { + "actual": "$test_upper.result", + "expected": "HELLO", + "message": "string.upper should uppercase text" + } } } } @@ -146,11 +178,19 @@ "name": "Test Lower", "typeVersion": 1, "position": [ - 0, - 200 + 400, + 300 ], "parameters": { - "text": "WORLD" + "name": "Test Lower", + "typeVersion": 1, + "position": [ + 0, + 200 + ], + "parameters": { + "text": "WORLD" + } } } } @@ -175,13 +215,21 @@ "name": "Assert Lower", "typeVersion": 1, "position": [ - 300, - 200 + 700, + 300 ], "parameters": { - "actual": "$test_lower.result", - "expected": "world", - "message": "string.lower should lowercase text" + "name": "Assert Lower", + "typeVersion": 1, + "position": [ + 300, + 200 + ], + "parameters": { + "actual": "$test_lower.result", + "expected": "world", + "message": "string.lower should lowercase text" + } } } } @@ -206,12 +254,20 @@ "name": "Test Split", "typeVersion": 1, "position": [ - 0, - 300 + 100, + 500 ], "parameters": { - "text": "a,b,c", - "separator": "," + "name": "Test Split", + "typeVersion": 1, + "position": [ + 0, + 300 + ], + "parameters": { + "text": "a,b,c", + "separator": "," + } } } } @@ -236,11 +292,19 @@ "name": "Assert Split Length", "typeVersion": 1, "position": [ - 300, - 300 + 400, + 500 ], "parameters": { - "items": "$test_split.result" + "name": "Assert Split Length", + "typeVersion": 1, + "position": [ + 300, + 300 + ], + "parameters": { + "items": "$test_split.result" + } } } } @@ -262,16 +326,24 @@ 500 ], "parameters": { - "name": "Assert Split Count", + "name": "Assert Split", "typeVersion": 1, "position": [ - 600, - 300 + 700, + 500 ], "parameters": { - "actual": "$assert_split_length.result", - "expected": 3, - "message": "string.split should split into array" + "name": "Assert Split Count", + "typeVersion": 1, + "position": [ + 600, + 300 + ], + "parameters": { + "actual": "$assert_split_length.result", + "expected": 3, + "message": "string.split should split into array" + } } } } @@ -296,11 +368,19 @@ "name": "Test Length", "typeVersion": 1, "position": [ - 0, - 400 + 100, + 700 ], "parameters": { - "text": "Hello" + "name": "Test Length", + "typeVersion": 1, + "position": [ + 0, + 400 + ], + "parameters": { + "text": "Hello" + } } } } @@ -325,13 +405,21 @@ "name": "Assert Length", "typeVersion": 1, "position": [ - 300, - 400 + 400, + 700 ], "parameters": { - "actual": "$test_length.result", - "expected": 5, - "message": "string.length should return character count" + "name": "Assert Length", + "typeVersion": 1, + "position": [ + 300, + 400 + ], + "parameters": { + "actual": "$test_length.result", + "expected": 5, + "message": "string.length should return character count" + } } } } diff --git a/workflow/examples/python/testing_triangle/workflow.backup.backup.json b/workflow/examples/python/testing_triangle/workflow.backup.backup.json deleted file mode 100644 index 1cbbd19de..000000000 --- a/workflow/examples/python/testing_triangle/workflow.backup.backup.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "name": "meta.workflow_packages.testing_triangle.label", - "active": false, - "nodes": [ - { - "id": "lint", - "name": "Lint", - "type": "tools.run_lint", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Lint", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "src" - } - } - }, - { - "id": "lint_failed", - "name": "Lint Failed", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Lint Failed", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "value": "$lint_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" - } - } - }, - { - "id": "lint_ok", - "name": "Lint Ok", - "type": "utils.not", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Lint Ok", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "value": "$lint_failed" - } - } - }, - { - "id": "unit_tests", - "name": "Unit Tests", - "type": "tools.run_tests", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Unit Tests", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "path": "tests" - } - } - }, - { - "id": "unit_failed", - "name": "Unit Failed", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Unit Failed", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "value": "$unit_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" - } - } - }, - { - "id": "unit_ok", - "name": "Unit Ok", - "type": "utils.not", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Unit Ok", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "value": "$unit_failed" - } - } - }, - { - "id": "ui_tests", - "name": "Ui Tests", - "type": "tools.run_tests", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ui Tests", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "path": "tests/ui" - } - } - } - ], - "connections": { - "Lint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Lint Failed": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Unit Tests": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Unit Failed": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/testing_triangle/workflow.backup.json b/workflow/examples/python/testing_triangle/workflow.backup.json deleted file mode 100644 index 3c75b1caf..000000000 --- a/workflow/examples/python/testing_triangle/workflow.backup.json +++ /dev/null @@ -1,268 +0,0 @@ -{ - "name": "meta.workflow_packages.testing_triangle.label", - "active": false, - "nodes": [ - { - "id": "lint", - "name": "Lint", - "type": "tools.run_lint", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Lint", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Lint", - "typeVersion": 1, - "position": [ - 0, - 50 - ], - "parameters": { - "path": "src" - } - } - } - }, - { - "id": "lint_failed", - "name": "Lint Failed", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Lint Failed", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Lint Failed", - "typeVersion": 1, - "position": [ - 300, - 50 - ], - "parameters": { - "value": "$lint_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" - } - } - } - }, - { - "id": "lint_ok", - "name": "Lint Ok", - "type": "utils.not", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Lint Ok", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Lint Ok", - "typeVersion": 1, - "position": [ - 600, - 50 - ], - "parameters": { - "value": "$lint_failed" - } - } - } - }, - { - "id": "unit_tests", - "name": "Unit Tests", - "type": "tools.run_tests", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Unit Tests", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Unit Tests", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": { - "path": "tests" - } - } - } - }, - { - "id": "unit_failed", - "name": "Unit Failed", - "type": "utils.branch_condition", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Unit Failed", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Unit Failed", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "value": "$unit_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" - } - } - } - }, - { - "id": "unit_ok", - "name": "Unit Ok", - "type": "utils.not", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Unit Ok", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Unit Ok", - "typeVersion": 1, - "position": [ - 1500, - 50 - ], - "parameters": { - "value": "$unit_failed" - } - } - } - }, - { - "id": "ui_tests", - "name": "Ui Tests", - "type": "tools.run_tests", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ui Tests", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Ui Tests", - "typeVersion": 1, - "position": [ - 1800, - 50 - ], - "parameters": { - "path": "tests/ui" - } - } - } - } - ], - "connections": { - "Lint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Lint Failed": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Unit Tests": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Unit Failed": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/testing_triangle/workflow.json b/workflow/examples/python/testing_triangle/workflow.json index 3c75b1caf..726a457c4 100644 --- a/workflow/examples/python/testing_triangle/workflow.json +++ b/workflow/examples/python/testing_triangle/workflow.json @@ -22,11 +22,19 @@ "name": "Lint", "typeVersion": 1, "position": [ - 0, - 50 + 100, + 100 ], "parameters": { - "path": "src" + "name": "Lint", + "typeVersion": 1, + "position": [ + 0, + 50 + ], + "parameters": { + "path": "src" + } } } } @@ -51,13 +59,21 @@ "name": "Lint Failed", "typeVersion": 1, "position": [ - 300, - 50 + 400, + 100 ], "parameters": { - "value": "$lint_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" + "name": "Lint Failed", + "typeVersion": 1, + "position": [ + 300, + 50 + ], + "parameters": { + "value": "$lint_results", + "mode": "regex", + "compare": "(FAILED|ERROR)" + } } } } @@ -82,11 +98,19 @@ "name": "Lint Ok", "typeVersion": 1, "position": [ - 600, - 50 + 700, + 100 ], "parameters": { - "value": "$lint_failed" + "name": "Lint Ok", + "typeVersion": 1, + "position": [ + 600, + 50 + ], + "parameters": { + "value": "$lint_failed" + } } } } @@ -111,11 +135,19 @@ "name": "Unit Tests", "typeVersion": 1, "position": [ - 900, - 50 + 100, + 300 ], "parameters": { - "path": "tests" + "name": "Unit Tests", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": { + "path": "tests" + } } } } @@ -140,13 +172,21 @@ "name": "Unit Failed", "typeVersion": 1, "position": [ - 1200, - 50 + 400, + 300 ], "parameters": { - "value": "$unit_results", - "mode": "regex", - "compare": "(FAILED|ERROR)" + "name": "Unit Failed", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "value": "$unit_results", + "mode": "regex", + "compare": "(FAILED|ERROR)" + } } } } @@ -171,11 +211,19 @@ "name": "Unit Ok", "typeVersion": 1, "position": [ - 1500, - 50 + 700, + 300 ], "parameters": { - "value": "$unit_failed" + "name": "Unit Ok", + "typeVersion": 1, + "position": [ + 1500, + 50 + ], + "parameters": { + "value": "$unit_failed" + } } } } @@ -200,11 +248,19 @@ "name": "Ui Tests", "typeVersion": 1, "position": [ - 1800, - 50 + 100, + 500 ], "parameters": { - "path": "tests/ui" + "name": "Ui Tests", + "typeVersion": 1, + "position": [ + 1800, + 50 + ], + "parameters": { + "path": "tests/ui" + } } } } diff --git a/workflow/examples/python/web_server_bootstrap/workflow.backup.backup.json b/workflow/examples/python/web_server_bootstrap/workflow.backup.backup.json deleted file mode 100644 index 2dea8751b..000000000 --- a/workflow/examples/python/web_server_bootstrap/workflow.backup.backup.json +++ /dev/null @@ -1,507 +0,0 @@ -{ - "name": "Web Server Bootstrap", - "active": false, - "nodes": [ - { - "id": "configure_logging", - "name": "Configure Logging", - "type": "backend.configure_logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - }, - { - "id": "load_env", - "name": "Load Env", - "type": "backend.load_env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Environment", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": {} - } - }, - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create Flask App", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false - } - } - } - }, - { - "id": "create_context_routes", - "name": "Create Context Routes", - "type": "web.route_context", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Context Routes", - "typeVersion": 1, - "position": [ - 900, - -150 - ], - "parameters": {} - } - }, - { - "id": "create_run_routes", - "name": "Create Run Routes", - "type": "web.route_run", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Run Routes", - "typeVersion": 1, - "position": [ - 900, - -50 - ], - "parameters": {} - } - }, - { - "id": "create_prompt_routes", - "name": "Create Prompt Routes", - "type": "web.route_prompt", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Create Prompt Routes", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - }, - { - "id": "create_settings_routes", - "name": "Create Settings Routes", - "type": "web.route_settings", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Create Settings Routes", - "typeVersion": 1, - "position": [ - 900, - 150 - ], - "parameters": {} - } - }, - { - "id": "create_translations_routes", - "name": "Create Translations Routes", - "type": "web.route_translations", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Create Translation Routes", - "typeVersion": 1, - "position": [ - 900, - 250 - ], - "parameters": {} - } - }, - { - "id": "create_navigation_routes", - "name": "Create Navigation Routes", - "type": "web.route_navigation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Create Navigation Routes", - "typeVersion": 1, - "position": [ - 900, - 350 - ], - "parameters": {} - } - }, - { - "id": "register_context", - "name": "Register Context", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Register Context Blueprint", - "typeVersion": 1, - "position": [ - 1200, - -150 - ], - "parameters": { - "blueprint": "={{$node.create_context_routes.json.result}}" - } - } - }, - { - "id": "register_run", - "name": "Register Run", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Register Run Blueprint", - "typeVersion": 1, - "position": [ - 1200, - -50 - ], - "parameters": { - "blueprint": "={{$node.create_run_routes.json.result}}" - } - } - }, - { - "id": "register_prompt", - "name": "Register Prompt", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Register Prompt Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "blueprint": "={{$node.create_prompt_routes.json.result}}" - } - } - }, - { - "id": "register_settings", - "name": "Register Settings", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Register Settings Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 150 - ], - "parameters": { - "blueprint": "={{$node.create_settings_routes.json.result}}" - } - } - }, - { - "id": "register_translations", - "name": "Register Translations", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Register Translations Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 250 - ], - "parameters": { - "blueprint": "={{$node.create_translations_routes.json.result}}" - } - } - }, - { - "id": "register_navigation", - "name": "Register Navigation", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Register Navigation Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 350 - ], - "parameters": { - "blueprint": "={{$node.create_navigation_routes.json.result}}" - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Start Web Server", - "typeVersion": 1, - "position": [ - 1500, - 100 - ], - "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false - } - } - } - ], - "connections": { - "Configure Logging": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Environment": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Flask App": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Context Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Run Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Prompt Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Settings Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Translation Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Navigation Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Context Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Run Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Prompt Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Settings Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Translations Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Navigation Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/web_server_bootstrap/workflow.backup.json b/workflow/examples/python/web_server_bootstrap/workflow.backup.json deleted file mode 100644 index 33bed5c10..000000000 --- a/workflow/examples/python/web_server_bootstrap/workflow.backup.json +++ /dev/null @@ -1,635 +0,0 @@ -{ - "name": "Web Server Bootstrap", - "active": false, - "nodes": [ - { - "id": "configure_logging", - "name": "Configure Logging", - "type": "backend.configure_logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "load_env", - "name": "Load Env", - "type": "backend.load_env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Environment", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create App", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create Flask App", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false - } - } - } - } - }, - { - "id": "create_context_routes", - "name": "Create Context Routes", - "type": "web.route_context", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Context Routes", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Create Context Routes", - "typeVersion": 1, - "position": [ - 900, - -150 - ], - "parameters": {} - } - } - }, - { - "id": "create_run_routes", - "name": "Create Run Routes", - "type": "web.route_run", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Run Routes", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Create Run Routes", - "typeVersion": 1, - "position": [ - 900, - -50 - ], - "parameters": {} - } - } - }, - { - "id": "create_prompt_routes", - "name": "Create Prompt Routes", - "type": "web.route_prompt", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Create Prompt Routes", - "typeVersion": 1, - "position": [ - 700, - 300 - ], - "parameters": { - "name": "Create Prompt Routes", - "typeVersion": 1, - "position": [ - 900, - 50 - ], - "parameters": {} - } - } - }, - { - "id": "create_settings_routes", - "name": "Create Settings Routes", - "type": "web.route_settings", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Create Settings Routes", - "typeVersion": 1, - "position": [ - 100, - 500 - ], - "parameters": { - "name": "Create Settings Routes", - "typeVersion": 1, - "position": [ - 900, - 150 - ], - "parameters": {} - } - } - }, - { - "id": "create_translations_routes", - "name": "Create Translations Routes", - "type": "web.route_translations", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Create Translations Routes", - "typeVersion": 1, - "position": [ - 400, - 500 - ], - "parameters": { - "name": "Create Translation Routes", - "typeVersion": 1, - "position": [ - 900, - 250 - ], - "parameters": {} - } - } - }, - { - "id": "create_navigation_routes", - "name": "Create Navigation Routes", - "type": "web.route_navigation", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Create Navigation Routes", - "typeVersion": 1, - "position": [ - 700, - 500 - ], - "parameters": { - "name": "Create Navigation Routes", - "typeVersion": 1, - "position": [ - 900, - 350 - ], - "parameters": {} - } - } - }, - { - "id": "register_context", - "name": "Register Context", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Register Context", - "typeVersion": 1, - "position": [ - 100, - 700 - ], - "parameters": { - "name": "Register Context Blueprint", - "typeVersion": 1, - "position": [ - 1200, - -150 - ], - "parameters": { - "blueprint": "={{$node.create_context_routes.json.result}}" - } - } - } - }, - { - "id": "register_run", - "name": "Register Run", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Register Run", - "typeVersion": 1, - "position": [ - 400, - 700 - ], - "parameters": { - "name": "Register Run Blueprint", - "typeVersion": 1, - "position": [ - 1200, - -50 - ], - "parameters": { - "blueprint": "={{$node.create_run_routes.json.result}}" - } - } - } - }, - { - "id": "register_prompt", - "name": "Register Prompt", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Register Prompt", - "typeVersion": 1, - "position": [ - 700, - 700 - ], - "parameters": { - "name": "Register Prompt Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 50 - ], - "parameters": { - "blueprint": "={{$node.create_prompt_routes.json.result}}" - } - } - } - }, - { - "id": "register_settings", - "name": "Register Settings", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Register Settings", - "typeVersion": 1, - "position": [ - 100, - 900 - ], - "parameters": { - "name": "Register Settings Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 150 - ], - "parameters": { - "blueprint": "={{$node.create_settings_routes.json.result}}" - } - } - } - }, - { - "id": "register_translations", - "name": "Register Translations", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Register Translations", - "typeVersion": 1, - "position": [ - 400, - 900 - ], - "parameters": { - "name": "Register Translations Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 250 - ], - "parameters": { - "blueprint": "={{$node.create_translations_routes.json.result}}" - } - } - } - }, - { - "id": "register_navigation", - "name": "Register Navigation", - "type": "web.register_blueprint", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Register Navigation", - "typeVersion": 1, - "position": [ - 700, - 900 - ], - "parameters": { - "name": "Register Navigation Blueprint", - "typeVersion": 1, - "position": [ - 1200, - 350 - ], - "parameters": { - "blueprint": "={{$node.create_navigation_routes.json.result}}" - } - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Start Server", - "typeVersion": 1, - "position": [ - 100, - 1100 - ], - "parameters": { - "name": "Start Web Server", - "typeVersion": 1, - "position": [ - 1500, - 100 - ], - "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false - } - } - } - } - ], - "connections": { - "Configure Logging": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Environment": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Flask App": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Context Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Run Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Prompt Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Settings Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Translation Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Navigation Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Context Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Run Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Prompt Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Settings Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Translations Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Navigation Blueprint": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/web_server_bootstrap/workflow.json b/workflow/examples/python/web_server_bootstrap/workflow.json index 33bed5c10..f3aac8efe 100644 --- a/workflow/examples/python/web_server_bootstrap/workflow.json +++ b/workflow/examples/python/web_server_bootstrap/workflow.json @@ -22,10 +22,18 @@ "name": "Configure Logging", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Configure Logging", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } } } }, @@ -46,13 +54,21 @@ 100 ], "parameters": { - "name": "Load Environment", + "name": "Load Env", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Environment", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": {} + } } } }, @@ -73,16 +89,24 @@ 100 ], "parameters": { - "name": "Create Flask App", + "name": "Create App", "typeVersion": 1, "position": [ - 600, - 0 + 700, + 100 ], "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false + "name": "Create Flask App", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "name": "autometabuilder", + "config": { + "JSON_SORT_KEYS": false + } } } } @@ -108,10 +132,18 @@ "name": "Create Context Routes", "typeVersion": 1, "position": [ - 900, - -150 + 100, + 300 ], - "parameters": {} + "parameters": { + "name": "Create Context Routes", + "typeVersion": 1, + "position": [ + 900, + -150 + ], + "parameters": {} + } } } }, @@ -135,10 +167,18 @@ "name": "Create Run Routes", "typeVersion": 1, "position": [ - 900, - -50 + 400, + 300 ], - "parameters": {} + "parameters": { + "name": "Create Run Routes", + "typeVersion": 1, + "position": [ + 900, + -50 + ], + "parameters": {} + } } } }, @@ -162,10 +202,18 @@ "name": "Create Prompt Routes", "typeVersion": 1, "position": [ - 900, - 50 + 700, + 300 ], - "parameters": {} + "parameters": { + "name": "Create Prompt Routes", + "typeVersion": 1, + "position": [ + 900, + 50 + ], + "parameters": {} + } } } }, @@ -189,10 +237,18 @@ "name": "Create Settings Routes", "typeVersion": 1, "position": [ - 900, - 150 + 100, + 500 ], - "parameters": {} + "parameters": { + "name": "Create Settings Routes", + "typeVersion": 1, + "position": [ + 900, + 150 + ], + "parameters": {} + } } } }, @@ -213,13 +269,21 @@ 500 ], "parameters": { - "name": "Create Translation Routes", + "name": "Create Translations Routes", "typeVersion": 1, "position": [ - 900, - 250 + 400, + 500 ], - "parameters": {} + "parameters": { + "name": "Create Translation Routes", + "typeVersion": 1, + "position": [ + 900, + 250 + ], + "parameters": {} + } } } }, @@ -243,10 +307,18 @@ "name": "Create Navigation Routes", "typeVersion": 1, "position": [ - 900, - 350 + 700, + 500 ], - "parameters": {} + "parameters": { + "name": "Create Navigation Routes", + "typeVersion": 1, + "position": [ + 900, + 350 + ], + "parameters": {} + } } } }, @@ -267,14 +339,22 @@ 700 ], "parameters": { - "name": "Register Context Blueprint", + "name": "Register Context", "typeVersion": 1, "position": [ - 1200, - -150 + 100, + 700 ], "parameters": { - "blueprint": "={{$node.create_context_routes.json.result}}" + "name": "Register Context Blueprint", + "typeVersion": 1, + "position": [ + 1200, + -150 + ], + "parameters": { + "blueprint": "={{$node.create_context_routes.json.result}}" + } } } } @@ -296,14 +376,22 @@ 700 ], "parameters": { - "name": "Register Run Blueprint", + "name": "Register Run", "typeVersion": 1, "position": [ - 1200, - -50 + 400, + 700 ], "parameters": { - "blueprint": "={{$node.create_run_routes.json.result}}" + "name": "Register Run Blueprint", + "typeVersion": 1, + "position": [ + 1200, + -50 + ], + "parameters": { + "blueprint": "={{$node.create_run_routes.json.result}}" + } } } } @@ -325,14 +413,22 @@ 700 ], "parameters": { - "name": "Register Prompt Blueprint", + "name": "Register Prompt", "typeVersion": 1, "position": [ - 1200, - 50 + 700, + 700 ], "parameters": { - "blueprint": "={{$node.create_prompt_routes.json.result}}" + "name": "Register Prompt Blueprint", + "typeVersion": 1, + "position": [ + 1200, + 50 + ], + "parameters": { + "blueprint": "={{$node.create_prompt_routes.json.result}}" + } } } } @@ -354,14 +450,22 @@ 900 ], "parameters": { - "name": "Register Settings Blueprint", + "name": "Register Settings", "typeVersion": 1, "position": [ - 1200, - 150 + 100, + 900 ], "parameters": { - "blueprint": "={{$node.create_settings_routes.json.result}}" + "name": "Register Settings Blueprint", + "typeVersion": 1, + "position": [ + 1200, + 150 + ], + "parameters": { + "blueprint": "={{$node.create_settings_routes.json.result}}" + } } } } @@ -383,14 +487,22 @@ 900 ], "parameters": { - "name": "Register Translations Blueprint", + "name": "Register Translations", "typeVersion": 1, "position": [ - 1200, - 250 + 400, + 900 ], "parameters": { - "blueprint": "={{$node.create_translations_routes.json.result}}" + "name": "Register Translations Blueprint", + "typeVersion": 1, + "position": [ + 1200, + 250 + ], + "parameters": { + "blueprint": "={{$node.create_translations_routes.json.result}}" + } } } } @@ -412,14 +524,22 @@ 900 ], "parameters": { - "name": "Register Navigation Blueprint", + "name": "Register Navigation", "typeVersion": 1, "position": [ - 1200, - 350 + 700, + 900 ], "parameters": { - "blueprint": "={{$node.create_navigation_routes.json.result}}" + "name": "Register Navigation Blueprint", + "typeVersion": 1, + "position": [ + 1200, + 350 + ], + "parameters": { + "blueprint": "={{$node.create_navigation_routes.json.result}}" + } } } } @@ -441,16 +561,24 @@ 1100 ], "parameters": { - "name": "Start Web Server", + "name": "Start Server", "typeVersion": 1, "position": [ - 1500, - 100 + 100, + 1100 ], "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false + "name": "Start Web Server", + "typeVersion": 1, + "position": [ + 1500, + 100 + ], + "parameters": { + "host": "0.0.0.0", + "port": 8000, + "debug": false + } } } } diff --git a/workflow/examples/python/web_server_json_routes/workflow.backup.backup.json b/workflow/examples/python/web_server_json_routes/workflow.backup.backup.json deleted file mode 100644 index 61702f288..000000000 --- a/workflow/examples/python/web_server_json_routes/workflow.backup.backup.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "name": "Web Server with JSON Routes", - "active": false, - "nodes": [ - { - "id": "configure_logging", - "name": "Configure Logging", - "type": "backend.configure_logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - }, - { - "id": "load_env", - "name": "Load Env", - "type": "backend.load_env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Environment", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": {} - } - }, - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create Flask App", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false - } - } - } - }, - { - "id": "register_api_routes", - "name": "Register Api Routes", - "type": "web.register_routes", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Register API Routes", - "typeVersion": 1, - "position": [ - 900, - 0 - ], - "parameters": { - "blueprint_name": "api", - "routes": [ - { - "path": "/api/navigation", - "methods": [ - "GET" - ], - "handler": "web.api_navigation", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/packages", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_packages", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/plugins", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_plugins", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/graph", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_graph", - "handler_type": "plugin" - }, - { - "path": "/api/translation-options", - "methods": [ - "GET" - ], - "handler": "web.api_translation_options", - "handler_type": "plugin" - } - ] - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Start Web Server", - "typeVersion": 1, - "position": [ - 1200, - 0 - ], - "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false - } - } - } - ], - "connections": { - "Configure Logging": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Environment": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Flask App": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Api Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/web_server_json_routes/workflow.backup.json b/workflow/examples/python/web_server_json_routes/workflow.backup.json deleted file mode 100644 index 854f16fd2..000000000 --- a/workflow/examples/python/web_server_json_routes/workflow.backup.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "name": "Web Server with JSON Routes", - "active": false, - "nodes": [ - { - "id": "configure_logging", - "name": "Configure Logging", - "type": "backend.configure_logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 100, - 100 - ], - "parameters": { - "name": "Configure Logging", - "typeVersion": 1, - "position": [ - 0, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "load_env", - "name": "Load Env", - "type": "backend.load_env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Env", - "typeVersion": 1, - "position": [ - 400, - 100 - ], - "parameters": { - "name": "Load Environment", - "typeVersion": 1, - "position": [ - 300, - 0 - ], - "parameters": {} - } - } - }, - { - "id": "create_app", - "name": "Create App", - "type": "web.create_flask_app", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create App", - "typeVersion": 1, - "position": [ - 700, - 100 - ], - "parameters": { - "name": "Create Flask App", - "typeVersion": 1, - "position": [ - 600, - 0 - ], - "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false - } - } - } - } - }, - { - "id": "register_api_routes", - "name": "Register Api Routes", - "type": "web.register_routes", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Register Api Routes", - "typeVersion": 1, - "position": [ - 100, - 300 - ], - "parameters": { - "name": "Register API Routes", - "typeVersion": 1, - "position": [ - 900, - 0 - ], - "parameters": { - "blueprint_name": "api", - "routes": [ - { - "path": "/api/navigation", - "methods": [ - "GET" - ], - "handler": "web.api_navigation", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/packages", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_packages", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/plugins", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_plugins", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/graph", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_graph", - "handler_type": "plugin" - }, - { - "path": "/api/translation-options", - "methods": [ - "GET" - ], - "handler": "web.api_translation_options", - "handler_type": "plugin" - } - ] - } - } - } - }, - { - "id": "start_server", - "name": "Start Server", - "type": "web.start_server", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Start Server", - "typeVersion": 1, - "position": [ - 400, - 300 - ], - "parameters": { - "name": "Start Web Server", - "typeVersion": 1, - "position": [ - 1200, - 0 - ], - "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false - } - } - } - } - ], - "connections": { - "Configure Logging": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Load Environment": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Create Flask App": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - }, - "Register Api Routes": { - "main": { - "0": [ - { - "node": "[object Object]", - "type": "main", - "index": 0 - } - ] - } - } - }, - "staticData": {}, - "meta": {}, - "settings": { - "timezone": "UTC", - "executionTimeout": 3600, - "saveExecutionProgress": true, - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all" - } -} diff --git a/workflow/examples/python/web_server_json_routes/workflow.json b/workflow/examples/python/web_server_json_routes/workflow.json index 854f16fd2..b7266d423 100644 --- a/workflow/examples/python/web_server_json_routes/workflow.json +++ b/workflow/examples/python/web_server_json_routes/workflow.json @@ -22,10 +22,18 @@ "name": "Configure Logging", "typeVersion": 1, "position": [ - 0, - 0 + 100, + 100 ], - "parameters": {} + "parameters": { + "name": "Configure Logging", + "typeVersion": 1, + "position": [ + 0, + 0 + ], + "parameters": {} + } } } }, @@ -46,13 +54,21 @@ 100 ], "parameters": { - "name": "Load Environment", + "name": "Load Env", "typeVersion": 1, "position": [ - 300, - 0 + 400, + 100 ], - "parameters": {} + "parameters": { + "name": "Load Environment", + "typeVersion": 1, + "position": [ + 300, + 0 + ], + "parameters": {} + } } } }, @@ -73,16 +89,24 @@ 100 ], "parameters": { - "name": "Create Flask App", + "name": "Create App", "typeVersion": 1, "position": [ - 600, - 0 + 700, + 100 ], "parameters": { - "name": "autometabuilder", - "config": { - "JSON_SORT_KEYS": false + "name": "Create Flask App", + "typeVersion": 1, + "position": [ + 600, + 0 + ], + "parameters": { + "name": "autometabuilder", + "config": { + "JSON_SORT_KEYS": false + } } } } @@ -105,56 +129,64 @@ 300 ], "parameters": { - "name": "Register API Routes", + "name": "Register Api Routes", "typeVersion": 1, "position": [ - 900, - 0 + 100, + 300 ], "parameters": { - "blueprint_name": "api", - "routes": [ - { - "path": "/api/navigation", - "methods": [ - "GET" - ], - "handler": "web.api_navigation", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/packages", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_packages", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/plugins", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_plugins", - "handler_type": "plugin" - }, - { - "path": "/api/workflow/graph", - "methods": [ - "GET" - ], - "handler": "web.api_workflow_graph", - "handler_type": "plugin" - }, - { - "path": "/api/translation-options", - "methods": [ - "GET" - ], - "handler": "web.api_translation_options", - "handler_type": "plugin" - } - ] + "name": "Register API Routes", + "typeVersion": 1, + "position": [ + 900, + 0 + ], + "parameters": { + "blueprint_name": "api", + "routes": [ + { + "path": "/api/navigation", + "methods": [ + "GET" + ], + "handler": "web.api_navigation", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/packages", + "methods": [ + "GET" + ], + "handler": "web.api_workflow_packages", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/plugins", + "methods": [ + "GET" + ], + "handler": "web.api_workflow_plugins", + "handler_type": "plugin" + }, + { + "path": "/api/workflow/graph", + "methods": [ + "GET" + ], + "handler": "web.api_workflow_graph", + "handler_type": "plugin" + }, + { + "path": "/api/translation-options", + "methods": [ + "GET" + ], + "handler": "web.api_translation_options", + "handler_type": "plugin" + } + ] + } } } } @@ -176,16 +208,24 @@ 300 ], "parameters": { - "name": "Start Web Server", + "name": "Start Server", "typeVersion": 1, "position": [ - 1200, - 0 + 400, + 300 ], "parameters": { - "host": "0.0.0.0", - "port": 8000, - "debug": false + "name": "Start Web Server", + "typeVersion": 1, + "position": [ + 1200, + 0 + ], + "parameters": { + "host": "0.0.0.0", + "port": 8000, + "debug": false + } } } }