Updated code generator for Shuffle
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
## Related repositories
|
## Related repositories
|
||||||
* Apps: https://github.com/frikky/shuffle-apps
|
* Apps: https://github.com/frikky/shuffle-apps
|
||||||
* Workflows: https://github.com/frikky/shuffle-workflows (empty)
|
* Workflows: https://github.com/frikky/shuffle-workflows
|
||||||
* Security OpenAPI apps: https://github.com/frikky/OpenAPI-security-definitions
|
* Security OpenAPI apps: https://github.com/frikky/security-openapis
|
||||||
* Documentation: https://github.com/frikky/shuffle-docs
|
* Documentation: https://github.com/frikky/shuffle-docs
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|||||||
@@ -73,12 +73,9 @@ class AppBase:
|
|||||||
except requests.exceptions.ConnectionError as e:
|
except requests.exceptions.ConnectionError as e:
|
||||||
print("Connectionerror: %s" % e)
|
print("Connectionerror: %s" % e)
|
||||||
return
|
return
|
||||||
#self.logger.info("AFTER initial stream result")
|
|
||||||
self.logger.info("THIS IS THE NEW UPDATE")
|
|
||||||
|
|
||||||
# Verify whether there are any parameters with ACTION_RESULT required
|
# Verify whether there are any parameters with ACTION_RESULT required
|
||||||
# If found, we get the full results list from backend
|
# If found, we get the full results list from backend
|
||||||
|
|
||||||
fullexecution = {}
|
fullexecution = {}
|
||||||
try:
|
try:
|
||||||
tmpdata = {
|
tmpdata = {
|
||||||
@@ -195,10 +192,9 @@ class AppBase:
|
|||||||
# Regex to find all the things
|
# Regex to find all the things
|
||||||
if parameter["variant"] == "STATIC_VALUE":
|
if parameter["variant"] == "STATIC_VALUE":
|
||||||
data = parameter["value"]
|
data = parameter["value"]
|
||||||
self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
|
|
||||||
|
|
||||||
actualitem = re.findall(match, data, re.MULTILINE)
|
actualitem = re.findall(match, data, re.MULTILINE)
|
||||||
self.logger.info("STATIC PARSED: %s" % actualitem)
|
#self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
|
||||||
|
#self.logger.info("STATIC PARSED: %s" % actualitem)
|
||||||
if len(actualitem) > 0:
|
if len(actualitem) > 0:
|
||||||
for replace in actualitem:
|
for replace in actualitem:
|
||||||
try:
|
try:
|
||||||
@@ -487,7 +483,6 @@ class AppBase:
|
|||||||
# With this parameter ready, add it to... a greater list of parameters. Rofl
|
# With this parameter ready, add it to... a greater list of parameters. Rofl
|
||||||
multi_parameters[parameter["name"]] = resultarray
|
multi_parameters[parameter["name"]] = resultarray
|
||||||
else:
|
else:
|
||||||
print("Hello, in here?: %s" % value)
|
|
||||||
params[parameter["name"]] = value
|
params[parameter["name"]] = value
|
||||||
multi_parameters[parameter["name"]] = value
|
multi_parameters[parameter["name"]] = value
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ func buildStructure(swagger *openapi3.Swagger, curHash string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This function generates the python code that's being used.
|
// This function generates the python code that's being used.
|
||||||
|
// This is really meta when you program it. Handling parameters is hard here.
|
||||||
func makePythoncode(swagger *openapi3.Swagger, name, url, method string, parameters, optionalQueries, headers []string) (string, string) {
|
func makePythoncode(swagger *openapi3.Swagger, name, url, method string, parameters, optionalQueries, headers []string) (string, string) {
|
||||||
method = strings.ToLower(method)
|
method = strings.ToLower(method)
|
||||||
queryString := ""
|
queryString := ""
|
||||||
|
|||||||
@@ -2281,6 +2281,7 @@ const AngularWorkflow = (props) => {
|
|||||||
rows="5"
|
rows="5"
|
||||||
color="primary"
|
color="primary"
|
||||||
defaultValue={data.value}
|
defaultValue={data.value}
|
||||||
|
type={placeholder.includes("***") ? "password" : "text"}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
changeActionParameter(event, count)
|
changeActionParameter(event, count)
|
||||||
@@ -2585,7 +2586,7 @@ const AngularWorkflow = (props) => {
|
|||||||
: null*/}
|
: null*/}
|
||||||
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
|
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
|
||||||
<div style={{flex: "6", marginTop: "20px"}}>
|
<div style={{flex: "6", marginTop: "20px"}}>
|
||||||
<div>
|
<div style={{marginBottom: 5}}>
|
||||||
<b>Actions</b>
|
<b>Actions</b>
|
||||||
</div>
|
</div>
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
@@ -1020,7 +1020,7 @@ const AppCreator = (props) => {
|
|||||||
// Url verification
|
// Url verification
|
||||||
if (currentAction.url.length === 0) {
|
if (currentAction.url.length === 0) {
|
||||||
errormessage.push("URL path can't be empty.")
|
errormessage.push("URL path can't be empty.")
|
||||||
} else if (!currentAction.url.startsWith("/")) {
|
} else if (!currentAction.url.startsWith("/") && baseUrl.length > 0) {
|
||||||
errormessage.push("URL must start with /")
|
errormessage.push("URL must start with /")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ func deployWorker(cli *dockerclient.Client, image string, identifier string, env
|
|||||||
|
|
||||||
err = cli.ContainerStart(context.Background(), cont.ID, types.ContainerStartOptions{})
|
err = cli.ContainerStart(context.Background(), cont.ID, types.ContainerStartOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed to start container: %s", err)
|
log.Printf("Failed to start container in environment %s: %s", environment, err)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Container %s is created", cont.ID)
|
log.Printf("Container %s was created under environment %s", cont.ID, environment)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,7 @@ func main() {
|
|||||||
//log.Println(string(body))
|
//log.Println(string(body))
|
||||||
//log.Println(resultResp)
|
//log.Println(resultResp)
|
||||||
if len(toBeRemoved.Data) == len(executionRequests.Data) {
|
if len(toBeRemoved.Data) == len(executionRequests.Data) {
|
||||||
log.Println("Should remove ALL!")
|
//log.Println("Should remove ALL!")
|
||||||
} else {
|
} else {
|
||||||
log.Printf("NOT IMPLEMENTED: Should remove %d workflows from backend because they're executed!", len(toBeRemoved.Data))
|
log.Printf("NOT IMPLEMENTED: Should remove %d workflows from backend because they're executed!", len(toBeRemoved.Data))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user