diff --git a/.gitignore b/.gitignore
index 83eceb667..5c4c97e10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,12 +4,10 @@
/DSL/Ruuter/services/POST/services/active
/DSL/Ruuter/services/POST/services/draft
/DSL/Ruuter/services/POST/services/inactive
-/DSL/Ruuter/services/POST/services/endpoints
/DSL/Ruuter/services/POST/services/inactive
/DSL/Ruuter/services/GET/services/active
/DSL/Ruuter/services/GET/services/draft
/DSL/Ruuter/services/GET/services/inactive
-/DSL/Ruuter/services/GET/services/endpoints
/DSL/Ruuter/services/GET/services/inactive
.DS_Store
.vscode
diff --git a/DSL/Liquibase/changelog/20250516152343-remove_file_name_from_endpoints.xml b/DSL/Liquibase/changelog/20250516152343-remove_file_name_from_endpoints.xml
new file mode 100644
index 000000000..6c2ff2936
--- /dev/null
+++ b/DSL/Liquibase/changelog/20250516152343-remove_file_name_from_endpoints.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/DSL/Liquibase/changelog/migrations/20250516152343-remove_file_name_from_endpoints.sql b/DSL/Liquibase/changelog/migrations/20250516152343-remove_file_name_from_endpoints.sql
new file mode 100644
index 000000000..ee7504e23
--- /dev/null
+++ b/DSL/Liquibase/changelog/migrations/20250516152343-remove_file_name_from_endpoints.sql
@@ -0,0 +1,4 @@
+-- liquibase formatted sql
+-- changeset 1AhmedYasser:20250516152343
+
+ALTER TABLE endpoints DROP COLUMN file_name;
diff --git a/DSL/Liquibase/changelog/migrations/rollback/20250516152343_rollback.sql b/DSL/Liquibase/changelog/migrations/rollback/20250516152343_rollback.sql
new file mode 100644
index 000000000..c34aa60e4
--- /dev/null
+++ b/DSL/Liquibase/changelog/migrations/rollback/20250516152343_rollback.sql
@@ -0,0 +1,5 @@
+-- liquibase formatted sql
+-- rollback
+
+-- Add back the file_name column as TEXT
+ALTER TABLE endpoints ADD COLUMN file_name TEXT NOT NULL;
diff --git a/DSL/Resql/services/POST/endpoints/create_endpoint.sql b/DSL/Resql/services/POST/endpoints/create_endpoint.sql
index 0d763bfdf..579adfb52 100644
--- a/DSL/Resql/services/POST/endpoints/create_endpoint.sql
+++ b/DSL/Resql/services/POST/endpoints/create_endpoint.sql
@@ -3,7 +3,6 @@ INSERT INTO endpoints (
service_id,
name,
type,
- file_name,
is_common,
definitions
)
@@ -12,7 +11,6 @@ VALUES (
:serviceId::uuid,
:name,
:type::endpoint_type,
- :fileName,
:isCommon,
:definitions::jsonb
-);
\ No newline at end of file
+);
diff --git a/DSL/Resql/services/POST/endpoints/delete_endpoint.sql b/DSL/Resql/services/POST/endpoints/delete_endpoint.sql
index 2006f0ed5..ec9a9e547 100644
--- a/DSL/Resql/services/POST/endpoints/delete_endpoint.sql
+++ b/DSL/Resql/services/POST/endpoints/delete_endpoint.sql
@@ -3,7 +3,6 @@ INSERT INTO endpoints (
service_id,
name,
type,
- file_name,
is_common,
definitions,
deleted,
@@ -15,7 +14,6 @@ SELECT
service_id,
name,
type,
- file_name,
is_common,
definitions,
TRUE AS deleted,
@@ -24,4 +22,4 @@ SELECT
FROM endpoints
WHERE endpoint_id = :id::uuid
ORDER BY id DESC
-LIMIT 1;
\ No newline at end of file
+LIMIT 1;
diff --git a/DSL/Resql/services/POST/endpoints/delete_endpoints_by_service_id.sql b/DSL/Resql/services/POST/endpoints/delete_endpoints_by_service_id.sql
index 07261fba9..0bd961deb 100644
--- a/DSL/Resql/services/POST/endpoints/delete_endpoints_by_service_id.sql
+++ b/DSL/Resql/services/POST/endpoints/delete_endpoints_by_service_id.sql
@@ -12,7 +12,6 @@ INSERT INTO endpoints (
service_id,
name,
type,
- file_name,
is_common,
definitions,
deleted,
@@ -24,7 +23,6 @@ SELECT
service_id,
name,
type,
- file_name,
is_common,
definitions,
TRUE AS deleted,
diff --git a/DSL/Resql/services/POST/endpoints/get_common_endpoints.sql b/DSL/Resql/services/POST/endpoints/get_common_endpoints.sql
index 4f0006a4e..329fcad5c 100644
--- a/DSL/Resql/services/POST/endpoints/get_common_endpoints.sql
+++ b/DSL/Resql/services/POST/endpoints/get_common_endpoints.sql
@@ -8,7 +8,6 @@ SELECT
endpoint_id,
name,
type,
- file_name,
is_common,
definitions
FROM LatestEndpoints
diff --git a/DSL/Resql/services/POST/endpoints/get_endpoints_by_service_id.sql b/DSL/Resql/services/POST/endpoints/get_endpoints_by_service_id.sql
index eec808f65..ee2e8398c 100644
--- a/DSL/Resql/services/POST/endpoints/get_endpoints_by_service_id.sql
+++ b/DSL/Resql/services/POST/endpoints/get_endpoints_by_service_id.sql
@@ -8,9 +8,8 @@ SELECT
endpoint_id,
name,
type,
- file_name,
is_common,
definitions
FROM LatestEndpoints
WHERE deleted IS FALSE
-ORDER BY id DESC;
\ No newline at end of file
+ORDER BY id DESC;
diff --git a/DSL/Resql/services/POST/endpoints/update_endpoint.sql b/DSL/Resql/services/POST/endpoints/update_endpoint.sql
index 09c80f9e3..428e6c7b1 100644
--- a/DSL/Resql/services/POST/endpoints/update_endpoint.sql
+++ b/DSL/Resql/services/POST/endpoints/update_endpoint.sql
@@ -1,10 +1,9 @@
-INSERT INTO endpoints (endpoint_id, service_id, name, type, file_name, is_common, definitions)
+INSERT INTO endpoints (endpoint_id, service_id, name, type, is_common, definitions)
VALUES (
:endpointId::uuid,
:serviceId::uuid,
:name,
:type::endpoint_type,
- :fileName,
:isCommon,
:definitions::jsonb
-);
\ No newline at end of file
+);
diff --git a/DSL/Resql/services/POST/get-common-services-list.sql b/DSL/Resql/services/POST/get-common-services-list.sql
index 5c8002e0e..663ee2d27 100644
--- a/DSL/Resql/services/POST/get-common-services-list.sql
+++ b/DSL/Resql/services/POST/get-common-services-list.sql
@@ -16,9 +16,9 @@ FROM services
JOIN MaxServices ON id = maxId
WHERE NOT deleted AND is_common
ORDER BY
- CASE WHEN :sorting = 'id asc' THEN id END ASC,
CASE WHEN :sorting = 'name asc' THEN name END ASC,
CASE WHEN :sorting = 'name desc' THEN name END DESC,
CASE WHEN :sorting = 'state asc' THEN current_state END ASC,
- CASE WHEN :sorting = 'state desc' THEN current_state END DESC
+ CASE WHEN :sorting = 'state desc' THEN current_state END DESC,
+ name ASC
OFFSET ((GREATEST(:page, 1) - 1) * :page_size) LIMIT :page_size;
diff --git a/DSL/Resql/services/POST/get-services-list.sql b/DSL/Resql/services/POST/get-services-list.sql
index 530127dce..65e3f75a7 100644
--- a/DSL/Resql/services/POST/get-services-list.sql
+++ b/DSL/Resql/services/POST/get-services-list.sql
@@ -15,9 +15,9 @@ FROM services
JOIN MaxServices ON id = maxId
WHERE NOT deleted AND NOT is_common
ORDER BY
- CASE WHEN :sorting = 'id asc' THEN id END ASC,
CASE WHEN :sorting = 'name asc' THEN name END ASC,
CASE WHEN :sorting = 'name desc' THEN name END DESC,
CASE WHEN :sorting = 'state asc' THEN current_state END ASC,
- CASE WHEN :sorting = 'state desc' THEN current_state END DESC
+ CASE WHEN :sorting = 'state desc' THEN current_state END DESC,
+ name ASC
OFFSET ((GREATEST(:page, 1) - 1) * :page_size) LIMIT :page_size;
diff --git a/DSL/Ruuter/services/GET/services/endpoints/.guard b/DSL/Ruuter/services/GET/services/endpoints/.guard
deleted file mode 100644
index 644353775..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/.guard
+++ /dev/null
@@ -1,4 +0,0 @@
-guard_allow_all:
- return: "success"
- status: 200
- next: end
diff --git a/DSL/Ruuter/services/GET/services/endpoints/common/common-endpoint.yml b/DSL/Ruuter/services/GET/services/endpoints/common/common-endpoint.yml
deleted file mode 100644
index 9202e4628..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/common/common-endpoint.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'COMMON-ENDPOINT'"
- method: get
- accepts: json
- returns: json
- namespace: service
- allowlist:
- params:
- - field: type
- type: string
- description: "Parameter 'type'"
-
-extract_request_data:
- assign:
- type: ${incoming.params.type}
- next: check_for_type
-
-check_for_type:
- switch:
- - condition: ${type == null}
- next: return_no_type_error
- next: check_for_environment
-
-check_for_environment:
- switch:
- - condition: ${type.toLowerCase() === 'prod'}
- next: get_prod_info
- next: get_test_info
-
-get_prod_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-prod-info"
- result: info
- next: check_for_endpoint_url
-
-get_test_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-test-info"
- result: info
- next: check_for_endpoint_url
-
-check_for_endpoint_url:
- switch:
- - condition: ${info.response.body.response[0].url == null}
- next: return_no_url_provided
- next: execute_endpoint
-
-execute_endpoint:
- call: http.post
- args:
- url: ${info.response.body.response[0].url}
- result: res
- next: return_info
-
-return_info:
- return: ${res.response.body}
- next: end
-
-return_no_url_provided:
- status: 400
- return: "No Url Provided"
- next: end
-
-return_no_type_error:
- status: 400
- return: "Please Specify Endpoint Type 'Prod' Or 'Test'"
- next: end
diff --git a/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-prod-configs.yml b/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-prod-configs.yml
deleted file mode 100644
index f79de8acd..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-prod-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-CONFIGS'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212Prod'
- username: 'User100'
- password: 'pwd158'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-test-configs.yml b/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-test-configs.yml
deleted file mode 100644
index 5c400ad73..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/configs/common/service-endpoint-test-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-CONFIGS'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212TEST'
- username: 'User20'
- password: 'pwd18'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-prod-configs.yml b/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-prod-configs.yml
deleted file mode 100644
index f79de8acd..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-prod-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-CONFIGS'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212Prod'
- username: 'User100'
- password: 'pwd158'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-test-configs.yml b/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-test-configs.yml
deleted file mode 100644
index 5c400ad73..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/configs/service-endpoint-test-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-CONFIGS'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212TEST'
- username: 'User20'
- password: 'pwd18'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-prod-info.yml b/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-prod-info.yml
deleted file mode 100644
index 075d6da0a..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-prod-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-INFO'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-prod-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/post
- user_id: 10
- headers:
- token: 'isdfbkajsdhkajsdhjsbckajsgdyasudhqwddasax'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-test-info.yml b/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-test-info.yml
deleted file mode 100644
index d2a5aeab7..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/info/common/service-endpoint-test-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-INFO'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-test-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/anything
- user_id: 20
- headers:
- token: 'htbaslaiscvasjaskasyiuhashbxjhasgdqqysasjdhasd'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-prod-info.yml b/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-prod-info.yml
deleted file mode 100644
index 075d6da0a..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-prod-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-INFO'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-prod-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/post
- user_id: 10
- headers:
- token: 'isdfbkajsdhkajsdhjsbckajsgdyasudhqwddasax'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-test-info.yml b/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-test-info.yml
deleted file mode 100644
index d2a5aeab7..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/info/service-endpoint-test-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-INFO'"
- method: get
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-test-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/anything
- user_id: 20
- headers:
- token: 'htbaslaiscvasjaskasyiuhashbxjhasgdqqysasjdhasd'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/GET/services/endpoints/service-endpoint.yml b/DSL/Ruuter/services/GET/services/endpoints/service-endpoint.yml
deleted file mode 100644
index 1f7752219..000000000
--- a/DSL/Ruuter/services/GET/services/endpoints/service-endpoint.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT'"
- method: get
- accepts: json
- returns: json
- namespace: service
- allowlist:
- params:
- - field: type
- type: string
- description: "Parameter 'type'"
-
-extract_request_data:
- assign:
- type: ${incoming.params.type}
- next: check_for_type
-
-check_for_type:
- switch:
- - condition: ${type == null}
- next: return_no_type_error
- next: check_for_environment
-
-check_for_environment:
- switch:
- - condition: ${type.toLowerCase() === 'prod'}
- next: get_prod_info
- next: get_test_info
-
-get_prod_info:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-prod-info"
- result: info
- next: check_for_endpoint_url
-
-get_test_info:
- call: http.get
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-test-info"
- result: info
- next: check_for_endpoint_url
-
-check_for_endpoint_url:
- switch:
- - condition: ${info.response.body.response[0].url == null}
- next: return_no_url_provided
- next: execute_endpoint
-
-execute_endpoint:
- call: http.post
- args:
- url: ${info.response.body.response[0].url}
- result: res
- next: return_info
-
-return_info:
- return: ${res.response.body}
- next: end
-
-return_no_url_provided:
- status: 400
- return: "No Url Provided"
- next: end
-
-return_no_type_error:
- status: 400
- return: "Please Specify Endpoint Type 'Prod' Or 'Test'"
- next: end
diff --git a/DSL/Ruuter/services/POST/services/create-endpoint.yml b/DSL/Ruuter/services/POST/services/create-endpoint.yml
index 9a7555005..7917956ae 100644
--- a/DSL/Ruuter/services/POST/services/create-endpoint.yml
+++ b/DSL/Ruuter/services/POST/services/create-endpoint.yml
@@ -14,9 +14,6 @@ declaration:
- field: name
type: string
description: "Endpoint name"
- - field: fileName
- type: string
- description: "Endpoint file name"
- field: type
type: string
description: "Endpoint type"
@@ -37,7 +34,6 @@ create_endpoint:
body:
endpointId: ${incoming.body.endpointId}
name: ${incoming.body.name}
- fileName: ${incoming.body.fileName}
type: ${incoming.body.type}
isCommon: ${incoming.body.isCommon}
serviceId: ${incoming.body.serviceId ?? ''}
diff --git a/DSL/Ruuter/services/POST/services/delete-endpoint-files.yml b/DSL/Ruuter/services/POST/services/delete-endpoint-files.yml
deleted file mode 100644
index ad41d8452..000000000
--- a/DSL/Ruuter/services/POST/services/delete-endpoint-files.yml
+++ /dev/null
@@ -1,132 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'DELETE-ENDPOINTS'"
- method: post
- accepts: json
- returns: json
- namespace: service
- allowlist:
- body:
- - field: name
- type: string
- description: "Body field 'name'"
- - field: endpoint_name
- type: string
- description: "Body field 'endpoint_name'"
-
-extract_request_data:
- assign:
- name: ${incoming.body.name}
- endpoint_name: ${incoming.body.endpoint_name ?? ''}
-
-delete_get_endpoints:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_get_endpoints_configs:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints/configs"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_get_endpoints_info:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints/info"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_endpoints:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_endpoints_configs:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints/configs"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_endpoints_info:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints/info"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_get_common_endpoints:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_get_common_endpoints_configs:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints/configs/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_get_common_endpoints_info:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_GET_PATH]/endpoints/info/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_common_endpoints:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_common_endpoints_configs:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints/configs/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-delete_post_common_endpoints_info:
- call: http.post
- args:
- url: "[#SERVICE_DMAPPER]/file-manager/delete-all-that-starts-with"
- body:
- path: "[#RUUTER_SERVICES_POST_PATH]/endpoints/info/common"
- keyword: "${name}-${endpoint_name}"
- result: results
-
-return_result:
- return: "Service Endpoints are deleted successfully"
diff --git a/DSL/Ruuter/services/POST/services/delete-endpoint.yml b/DSL/Ruuter/services/POST/services/delete-endpoint.yml
index b0a5d29be..bf5f6319c 100644
--- a/DSL/Ruuter/services/POST/services/delete-endpoint.yml
+++ b/DSL/Ruuter/services/POST/services/delete-endpoint.yml
@@ -7,31 +7,10 @@ declaration:
returns: json
namespace: service
allowlist:
- headers:
- - field: cookie
- type: string
- description: "Cookie field"
body:
- field: id
type: string
description: "Endpoint UUID"
- - field: service_name
- type: string
- description: "Service Name"
- - field: endpoint_name
- type: string
- description: "Endpoint Name"
-
-delete_endpoint_files:
- call: http.post
- args:
- url: "[#SERVICE_RUUTER]/services/delete-endpoint-files"
- headers:
- cookie: ${incoming.headers.cookie}
- body:
- name: ${incoming.body.service_name}
- endpoint_name: ${incoming.body.endpoint_name}
- result: delete_files_res
delete_endpoint:
call: http.post
diff --git a/DSL/Ruuter/services/POST/services/delete.yml b/DSL/Ruuter/services/POST/services/delete.yml
index c25e8b1b5..544e8aea4 100644
--- a/DSL/Ruuter/services/POST/services/delete.yml
+++ b/DSL/Ruuter/services/POST/services/delete.yml
@@ -113,18 +113,6 @@ delete_endpoints_by_service_id:
body:
serviceId: ${id}
result: delete_endpoint_results
- next: delete_endpoint_files
-
-delete_endpoint_files:
- call: http.post
- args:
- url: "[#SERVICE_RUUTER]/services/delete-endpoint-files"
- headers:
- cookie: ${incoming.headers.cookie}
- body:
- name: ${name_res.response.body[0].name}
- endpoint_name: ""
- result: delete_endpoint_files_results
next: delete_mcq_files
delete_mcq_files:
diff --git a/DSL/Ruuter/services/POST/services/edit.yml b/DSL/Ruuter/services/POST/services/edit.yml
index 0af3297b2..a44f670ee 100644
--- a/DSL/Ruuter/services/POST/services/edit.yml
+++ b/DSL/Ruuter/services/POST/services/edit.yml
@@ -196,12 +196,6 @@ rename_dsl:
new_path: "[#RUUTER_SERVICES_PATH]/${type}/[#RUUTER_SERVICES_DIR_PATH]/${old_state}/${name}.tmp"
result: results
-check_result:
- switch:
- - condition: ${200 <= results.response.statusCodeValue && results.response.statusCodeValue < 300}
- next: service_edit
- next: return_bad_request
-
service_edit:
call: http.post
args:
@@ -221,11 +215,6 @@ return_ok:
return: "Edited Successfully"
next: end
-return_bad_request:
- status: 200
- return: "Error while editing service"
- next: end
-
return_incorrect_request:
status: 400
return: "Required parameter(s) missing"
diff --git a/DSL/Ruuter/services/POST/services/endpoints/.guard b/DSL/Ruuter/services/POST/services/endpoints/.guard
deleted file mode 100644
index 644353775..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/.guard
+++ /dev/null
@@ -1,4 +0,0 @@
-guard_allow_all:
- return: "success"
- status: 200
- next: end
diff --git a/DSL/Ruuter/services/POST/services/endpoints/common/common-endpoint.yml b/DSL/Ruuter/services/POST/services/endpoints/common/common-endpoint.yml
deleted file mode 100644
index 9143870e4..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/common/common-endpoint.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'COMMON-ENDPOINT'"
- method: post
- accepts: json
- returns: json
- namespace: service
- allowlist:
- body:
- - field: type
- type: string
- description: "Body field 'type'"
-
-extract_request_data:
- assign:
- type: ${incoming.body.type}
- next: check_for_type
-
-check_for_type:
- switch:
- - condition: ${type == null}
- next: return_no_type_error
- next: check_for_environment
-
-check_for_environment:
- switch:
- - condition: ${type.toLowerCase() === 'prod'}
- next: get_prod_info
- next: get_test_info
-
-get_prod_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-prod-info"
- result: info
- next: check_for_endpoint_url
-
-get_test_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-test-info"
- result: info
- next: check_for_endpoint_url
-
-check_for_endpoint_url:
- switch:
- - condition: ${info.response.body.response[0].url == null}
- next: return_no_url_provided
- next: execute_endpoint
-
-execute_endpoint:
- call: http.post
- args:
- url: ${info.response.body.response[0].url}
- result: res
- next: return_info
-
-return_info:
- return: ${res.response.body}
- next: end
-
-return_no_url_provided:
- status: 400
- return: "No Url Provided"
- next: end
-
-return_no_type_error:
- status: 400
- return: "Please Specify Endpoint Type 'Prod' Or 'Test'"
- next: end
diff --git a/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-prod-configs.yml b/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-prod-configs.yml
deleted file mode 100644
index 6d8a30513..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-prod-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-CONFIGS'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212Prod'
- username: 'User100'
- password: 'pwd158'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-test-configs.yml b/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-test-configs.yml
deleted file mode 100644
index c07f0bcbe..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/configs/common/service-endpoint-test-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-CONFIGS'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212TEST'
- username: 'User20'
- password: 'pwd18'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-prod-configs.yml b/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-prod-configs.yml
deleted file mode 100644
index 6d8a30513..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-prod-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-CONFIGS'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212Prod'
- username: 'User100'
- password: 'pwd158'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-test-configs.yml b/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-test-configs.yml
deleted file mode 100644
index c07f0bcbe..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/configs/service-endpoint-test-configs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-CONFIGS'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-assign_step:
- assign:
- sensitive:
- api_key: '112218ssQQ212TEST'
- username: 'User20'
- password: 'pwd18'
-
-return_value:
- wrapper: false
- return: ${sensitive}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-prod-info.yml b/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-prod-info.yml
deleted file mode 100644
index f66ea0318..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-prod-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-INFO'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-prod-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/post
- user_id: 10
- headers:
- token: 'isdfbkajsdhkajsdhjsbckajsgdyasudhqwddasax'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-test-info.yml b/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-test-info.yml
deleted file mode 100644
index e3d604c00..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/info/common/service-endpoint-test-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-INFO'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-test-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/anything
- user_id: 20
- headers:
- token: 'htbaslaiscvasjaskasyiuhashbxjhasgdqqysasjdhasd'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-prod-info.yml b/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-prod-info.yml
deleted file mode 100644
index f66ea0318..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-prod-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-PROD-INFO'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-prod-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/post
- user_id: 10
- headers:
- token: 'isdfbkajsdhkajsdhjsbckajsgdyasudhqwddasax'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-test-info.yml b/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-test-info.yml
deleted file mode 100644
index e3d604c00..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/info/service-endpoint-test-info.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT-TEST-INFO'"
- method: post
- accepts: json
- returns: json
- namespace: service
-
-getConfigs:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/configs/service-endpoint-test-configs"
- result: configs
-
-assign_step:
- assign:
- info:
- url: https://httpbin.org/anything
- user_id: 20
- headers:
- token: 'htbaslaiscvasjaskasyiuhashbxjhasgdqqysasjdhasd'
-
-return_value:
- return: ${[info , configs.response.body]}
diff --git a/DSL/Ruuter/services/POST/services/endpoints/service-endpoint.yml b/DSL/Ruuter/services/POST/services/endpoints/service-endpoint.yml
deleted file mode 100644
index a25f1f56c..000000000
--- a/DSL/Ruuter/services/POST/services/endpoints/service-endpoint.yml
+++ /dev/null
@@ -1,71 +0,0 @@
-declaration:
- call: declare
- version: 0.1
- description: "Decription placeholder for 'SERVICE-ENDPOINT'"
- method: post
- accepts: json
- returns: json
- namespace: service
- allowlist:
- body:
- - field: type
- type: string
- description: "Body field 'type'"
-
-extract_request_data:
- assign:
- type: ${incoming.body.type}
- next: check_for_type
-
-check_for_type:
- switch:
- - condition: ${type == null}
- next: return_no_type_error
- next: check_for_environment
-
-check_for_environment:
- switch:
- - condition: ${type.toLowerCase() === 'prod'}
- next: get_prod_info
- next: get_test_info
-
-get_prod_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-prod-info"
- result: info
- next: check_for_endpoint_url
-
-get_test_info:
- call: http.post
- args:
- url: "[#SERVICE_ENDPOINTS]:[#SERVICE_ENDPOINTS_PORT]/services/endpoints/info/service-endpoint-test-info"
- result: info
- next: check_for_endpoint_url
-
-check_for_endpoint_url:
- switch:
- - condition: ${info.response.body.response[0].url == null}
- next: return_no_url_provided
- next: execute_endpoint
-
-execute_endpoint:
- call: http.post
- args:
- url: ${info.response.body.response[0].url}
- result: res
- next: return_info
-
-return_info:
- return: ${res.response.body}
- next: end
-
-return_no_url_provided:
- status: 400
- return: "No Url Provided"
- next: end
-
-return_no_type_error:
- status: 400
- return: "Please Specify Endpoint Type 'Prod' Or 'Test'"
- next: end
diff --git a/DSL/Ruuter/services/POST/services/update-endpoint.yml b/DSL/Ruuter/services/POST/services/update-endpoint.yml
index d72ce2e18..5b2304a3e 100644
--- a/DSL/Ruuter/services/POST/services/update-endpoint.yml
+++ b/DSL/Ruuter/services/POST/services/update-endpoint.yml
@@ -11,9 +11,6 @@ declaration:
- field: name
type: string
description: "Endpoint name"
- - field: fileName
- type: string
- description: "Endpoint file name"
- field: type
type: string
description: "Endpoint type"
@@ -47,7 +44,6 @@ update_endpoint:
body:
endpointId: ${id}
name: ${incoming.body.name}
- fileName: ${incoming.body.fileName}
type: ${incoming.body.type}
isCommon: ${incoming.body.isCommon}
serviceId: ${incoming.body.serviceId ?? ''}
diff --git a/GUI/src/components/ApiEndpoint/index.tsx b/GUI/src/components/ApiEndpoint/index.tsx
index 6f08989fc..004db3811 100644
--- a/GUI/src/components/ApiEndpoint/index.tsx
+++ b/GUI/src/components/ApiEndpoint/index.tsx
@@ -2,7 +2,7 @@ import Box from "components/Box";
import Button from "components/Button";
import Icon from "components/Icon";
import Track from "components/Track";
-import { FC, useState } from "react";
+import { FC, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { MdDeleteOutline, MdOutlineEdit } from "react-icons/md";
import { Link } from "react-router-dom";
@@ -42,6 +42,9 @@ const ApiEndpoint: FC = ({ step, onClick }) => {
const nodes = useServiceStore((state) => state.nodes);
const [endpointName, setEndpointName] = useState(step.data?.name ?? "");
const [isCommonEndpoint, setIsCommonEndpoint] = useState(step.data?.isCommon ?? false);
+ const originalEndpoint = useMemo(() => {
+ return step.data ? JSON.parse(JSON.stringify(step.data)) : undefined;
+ }, [step.data]);
const { deleteEndpoint: deleteEndpointFromStore } = useServiceStore();
@@ -64,7 +67,6 @@ const ApiEndpoint: FC = ({ step, onClick }) => {
});
useToastStore.getState().success({ title: t("serviceFlow.apiElements.deleteSuccess") });
deleteEndpointFromStore(endpoint.endpointId);
- useServiceStore.getState().loadEndpointsResponseVariables();
} catch (error) {
console.error(`Error deleting API endpoint: ${error}`);
useToastStore.getState().error({ title: t("serviceFlow.apiElements.deleteError") });
@@ -108,7 +110,13 @@ const ApiEndpoint: FC = ({ step, onClick }) => {
)}
{showEditModal && step?.data && (
- setShowEditModal(false)}>
+ {
+ useServiceStore.getState().editEndpoint(originalEndpoint);
+ setShowEditModal(false);
+ }}
+ >