[
    {
        "id": "7d0cf2c53d86d299",
        "type": "tab",
        "label": "API Design",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a187e82b2eb344da",
        "type": "group",
        "z": "7d0cf2c53d86d299",
        "name": "Customers API Endpoint Mockup",
        "style": {
            "fill": "#6f2fa0",
            "fill-opacity": "0.5",
            "label": true,
            "label-position": "n",
            "color": "#ffffff"
        },
        "nodes": [
            "69a64e3d.84da3",
            "43e49c36.dc7624",
            "8cb4b74e.602c28",
            "f54a63dc18bc8392",
            "5aa645182fc55b07",
            "92cd9ee09ceca861",
            "a853fc1610bb3020",
            "1ff74e976f1fe409",
            "f3ce9b4fddf14a98",
            "41dfae675a825e0f",
            "622a414f7d6e9376",
            "7236627a7f7f5721",
            "e56216898741060a",
            "25efbf4104a1262e",
            "8abaa11adc7fce77",
            "ece180d9db666b55",
            "487639d7d21607b5",
            "4df9fb69e20c330c",
            "eef3a846833dc7b5",
            "996587bf940dce23",
            "ba851e18476f8e70",
            "ebe029bbd2fab0b0",
            "ee273276bc137185",
            "dd97f32bebd7b989",
            "ae806403b1a80583",
            "d42a546b6ee61e19",
            "fa279eb4544a80eb",
            "7d6a1fe04f4f3a6a",
            "c51e7a063790a170",
            "8394ad8af1f51f4c",
            "9625a0abe11dfba1",
            "067a5794155edbc0",
            "8b5f2739b8f41efa",
            "e7f343b7d2171998",
            "e52d2359394ad390",
            "553994fd4cb1bb7b"
        ],
        "x": 54,
        "y": 59,
        "w": 1272,
        "h": 662
    },
    {
        "id": "8d2bcd00f9e80fb1",
        "type": "group",
        "z": "7d0cf2c53d86d299",
        "name": "Testing the Customer's API",
        "style": {
            "fill": "#6f2fa0",
            "fill-opacity": "0.5",
            "label": true,
            "label-position": "n",
            "color": "#ffffff"
        },
        "nodes": [
            "7c2812c.c6ee7ec",
            "e45041b6.9ec13",
            "af33dae7.b21138",
            "a878233e45f55212",
            "6b775eb167f98e8f",
            "50af4e93d2c68461",
            "da980d122c1e49ad",
            "6d64dcb3d910d61c",
            "c0fd77eb84a885c4",
            "71a1c4e07f63b9c9",
            "da777e201b5c5787",
            "39f02628617e2836",
            "651335e14a77db42",
            "bd5a04780aa47496",
            "a4ba98ce28afc701",
            "8fd90fcc0ff351f5",
            "edd989d71ea8417f",
            "8c44777bff5cb393",
            "d29e2145b8b6fead",
            "e313e7232ee5a507",
            "edb65c5cd0551f8d",
            "e6fd52f87441bc4e",
            "b91a3ef70bf7114a",
            "7801ad9e898cef5d",
            "c0ab158fa4e1694e",
            "78ad0d2c68e67c37",
            "ac142030042b847b",
            "a11cb99f9730c039",
            "302dc8cf1911e217",
            "8a4012b960d79ceb",
            "912981c3067290ad",
            "95d35a7d66fc30a7",
            "be2fc32420895d6a",
            "e8b2512566263a9b",
            "afc714b038088fb7",
            "60e2fb0f375f32df",
            "dd5c2d61f7a97708"
        ],
        "x": 64,
        "y": 759,
        "w": 1442,
        "h": 822
    },
    {
        "id": "c8da4b9c7c89a981",
        "type": "swagger-doc",
        "summary": "Creates a new customers",
        "description": "Creates a new customer and stores their data in the 'customers' global variable.",
        "tags": "customers",
        "consumes": "application/json",
        "produces": "application/json",
        "parameters": [
            {
                "name": "body",
                "in": "body",
                "description": "Customer's data",
                "required": true,
                "schema": {
                    "type": "object",
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "name": "email",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        }
                    }
                }
            }
        ],
        "responses": {
            "201": {
                "description": "Created",
                "schema": {
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "name": "email",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        },
                        "id": {
                            "type": "string",
                            "name": "id",
                            "propertyRow": true
                        }
                    }
                },
                "code": "201"
            },
            "400": {
                "description": "Bad Request",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "400"
            },
            "401": {
                "description": "Unauthorized",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "401"
            }
        },
        "security0": "8bfef498f687e670",
        "securityScopes0": "",
        "deprecated": false
    },
    {
        "id": "072305daf97dd74c",
        "type": "swagger-doc",
        "summary": "Retrieves a list of all created customers",
        "description": " Fetches a JSON array of customer details from the 'customers' global variable. Each customer is represented as a JSON object.",
        "tags": "customers",
        "consumes": "",
        "produces": "application/json",
        "parameters": [],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "name": "email",
                            "propertyRow": true
                        },
                        "address": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "address",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        },
                        "id": {
                            "type": "string",
                            "name": "id",
                            "propertyRow": true
                        }
                    }
                },
                "code": "200"
            }
        },
        "security0": "",
        "securityScopes0": "",
        "deprecated": false
    },
    {
        "id": "46dd8c02b7974421",
        "type": "swagger-doc",
        "summary": "Retrieves the data for a specific customer",
        "description": "Retrieves the details of a specific customer identified by the provided id parameter.",
        "tags": "customers",
        "consumes": "",
        "produces": "application/json",
        "parameters": [
            {
                "name": "id",
                "in": "path",
                "description": "ID of the Customer",
                "required": true,
                "type": "string",
                "format": "uuid"
            }
        ],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "name": "email",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        },
                        "id": {
                            "type": "string",
                            "name": "id",
                            "propertyRow": true
                        }
                    }
                },
                "code": "200"
            },
            "404": {
                "description": "Not Found",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "404"
            }
        },
        "security0": "",
        "securityScopes0": "",
        "deprecated": false
    },
    {
        "id": "a4d72567c63957e0",
        "type": "swagger-doc",
        "summary": "Deletes an existing customer",
        "description": "Deletes the customer with the specified id from the 'customers' global variable.",
        "tags": "customers",
        "consumes": "text/plain; charset=utf-8",
        "produces": "application/json",
        "parameters": [
            {
                "name": "id",
                "in": "path",
                "description": "ID of the Customer",
                "required": true,
                "type": "string",
                "format": "uuid"
            }
        ],
        "responses": {
            "204": {
                "description": "No Content"
            },
            "401": {
                "description": "Unauthorized",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string"
                        },
                        "description": {
                            "type": "string"
                        }
                    }
                }
            },
            "404": {
                "description": "Not Found",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "security0": "8bfef498f687e670",
        "securityScopes0": "",
        "deprecated": false
    },
    {
        "id": "6a53f846bcb2203f",
        "type": "swagger-doc",
        "summary": "Updates an existing customers",
        "description": "Updates the customer identified by the given id in the 'customers' global variable.",
        "tags": "customers",
        "consumes": "application/json",
        "produces": "application/json",
        "parameters": [
            {
                "name": "body",
                "in": "body",
                "description": "Customer's data",
                "required": true,
                "schema": {
                    "type": "object",
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "format": "email",
                            "name": "email",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        }
                    }
                }
            },
            {
                "name": "id",
                "in": "path",
                "description": "ID of the customer",
                "required": true,
                "type": "string",
                "format": "uuid"
            }
        ],
        "responses": {
            "200": {
                "description": "OK",
                "schema": {
                    "properties": {
                        "firstName": {
                            "type": "string",
                            "name": "firstName",
                            "propertyRow": true
                        },
                        "lastName": {
                            "type": "string",
                            "name": "lastName",
                            "propertyRow": true
                        },
                        "age": {
                            "type": "number",
                            "name": "age",
                            "propertyRow": true
                        },
                        "email": {
                            "type": "string",
                            "name": "email",
                            "propertyRow": true
                        },
                        "hobbies": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "",
                                "propertyRow": true
                            },
                            "name": "hobbies",
                            "propertyRow": true
                        },
                        "isStudent": {
                            "type": "boolean",
                            "name": "isStudent",
                            "propertyRow": true
                        },
                        "id": {
                            "type": "string",
                            "name": "id",
                            "propertyRow": true
                        }
                    }
                },
                "code": "200"
            },
            "400": {
                "description": "Bad Request",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "400"
            },
            "401": {
                "description": "Unauthorized",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "401"
            },
            "404": {
                "description": "Not Found",
                "schema": {
                    "properties": {
                        "status": {
                            "type": "string",
                            "name": "status",
                            "propertyRow": true
                        },
                        "description": {
                            "type": "string",
                            "name": "description",
                            "propertyRow": true
                        }
                    }
                },
                "code": "404"
            }
        },
        "security0": "8bfef498f687e670",
        "securityScopes0": "",
        "deprecated": false
    },
    {
        "id": "8bfef498f687e670",
        "type": "openapi-generator-security-scheme",
        "definitionName": "basic",
        "securityType": "basic",
        "description": "Basic Authentication",
        "name": "",
        "in": "",
        "flow": "",
        "authorizationUrl": "",
        "tokenUrl": "",
        "scopes": ""
    },
    {
        "id": "0bbbfee22f767145",
        "type": "qibb-openapi-client-config",
        "name": "My Qibb API-0.0.1",
        "source": "URL",
        "swaggerJson": "{\"swagger\":\"2.0\",\"info\":{\"title\":\"My Qibb API\",\"version\":\"0.0.1\"},\"tags\":[{\"name\":\"customers\",\"description\":\"customers\"}],\"paths\":{\"/customers\":{\"post\":{\"summary\":\"Creates a new customers\",\"description\":\"Creates a new customer and stores their data in the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"application/json\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"body\",\"in\":\"body\",\"description\":\"Customer's data\",\"required\":true,\"schema\":{\"type\":\"object\",\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true}}}}],\"responses\":{\"201\":{\"description\":\"Created\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}},\"400\":{\"description\":\"Bad Request\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}}},\"security\":[{\"basic\":[]}]},\"get\":{\"summary\":\"Retrieves a list of all created customers\",\"description\":\" Fetches a JSON array of customer details from the 'customers' global variable. Each customer is represented as a JSON object.\",\"tags\":[\"customers\"],\"consumes\":[],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"address\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"address\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}}}}},\"/customers/{id}\":{\"get\":{\"summary\":\"Retrieves the data for a specific customer\",\"description\":\"Retrieves the details of a specific customer identified by the provided id parameter.\",\"tags\":[\"customers\"],\"consumes\":[],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the Customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}}}},\"delete\":{\"summary\":\"Deletes an existing customer\",\"description\":\"Deletes the customer with the specified id from the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"text/plain; charset=utf-8\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the Customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"204\":{\"description\":\"No Content\"},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"}}}}},\"security\":[{\"basic\":[]}]},\"patch\":{\"summary\":\"Updates an existing customers\",\"description\":\"Updates the customer identified by the given id in the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"application/json\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"body\",\"in\":\"body\",\"description\":\"Customer's data\",\"required\":true,\"schema\":{\"type\":\"object\",\"properties\":{\"firstName\":{\"type\":\"string\"},\"lastName\":{\"type\":\"string\"},\"age\":{\"type\":\"number\"},\"email\":{\"type\":\"string\",\"format\":\"email\"},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\"}},\"isStudent\":{\"type\":\"boolean\"}}}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\"},\"lastName\":{\"type\":\"string\"},\"age\":{\"type\":\"number\"},\"email\":{\"type\":\"string\"},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\"}},\"isStudent\":{\"type\":\"boolean\"},\"id\":{\"type\":\"string\"}}}},\"400\":{\"description\":\"Bad Request\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}}},\"security\":[{\"basic\":[]}]}}},\"securityDefinitions\":{\"basic\":{\"type\":\"basic\",\"description\":\"Basic Authentication\"}}}",
        "url": "https://flow-h2u1dhpkm1of8.demo-01.qibb.com/http-api/openapi.json",
        "customName": false,
        "host": "https://flow-h2u1dhpkm1of8.demo-01.qibb.com/"
    },
    {
        "id": "957b20fde5525239",
        "type": "qibb-openapi-client-config",
        "name": "CUSTOMERS Copy",
        "source": "URL",
        "swaggerJson": "{\"swagger\":\"2.0\",\"info\":{\"title\":\"My Qibb API\",\"version\":\"0.0.1\"},\"tags\":[{\"name\":\"customers\",\"description\":\"customers\"}],\"paths\":{\"/customers\":{\"post\":{\"summary\":\"Creates a new customers\",\"description\":\"Creates a new customer and stores their data in the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"application/json\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"body\",\"in\":\"body\",\"description\":\"Customer's data\",\"required\":true,\"schema\":{\"type\":\"object\",\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true}}}}],\"responses\":{\"201\":{\"description\":\"Created\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}},\"400\":{\"description\":\"Bad Request\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}}},\"security\":[{\"basic\":[]}]},\"get\":{\"summary\":\"Retrieves a list of all created customers\",\"description\":\" Fetches a JSON array of customer details from the 'customers' global variable. Each customer is represented as a JSON object.\",\"tags\":[\"customers\"],\"consumes\":[],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\"},\"lastName\":{\"type\":\"string\"},\"age\":{\"type\":\"number\"},\"email\":{\"type\":\"string\"},\"address\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\"}},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\"}},\"isStudent\":{\"type\":\"boolean\"},\"id\":{\"type\":\"string\"}}}}}}},\"/customers/{id}\":{\"get\":{\"summary\":\"Retrieves the data for a specific customer\",\"description\":\"Retrieves the details of a specific customer identified by the provided id parameter.\",\"tags\":[\"customers\"],\"consumes\":[],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the Customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}}}},\"delete\":{\"summary\":\"Deletes an existing customer\",\"description\":\"Deletes the customer with the specified id from the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"text/plain; charset=utf-8\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the Customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"204\":{\"description\":\"No Content\"},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"},\"description\":{\"type\":\"string\"}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\"}}}}},\"security\":[{\"basic\":[]}]},\"patch\":{\"summary\":\"Updates an existing customers\",\"description\":\"Updates the customer identified by the given id in the 'customers' global variable.\",\"tags\":[\"customers\"],\"consumes\":[\"application/json\"],\"produces\":[\"application/json\"],\"deprecated\":false,\"parameters\":[{\"name\":\"body\",\"in\":\"body\",\"description\":\"Customer's data\",\"required\":true,\"schema\":{\"type\":\"object\",\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"format\":\"email\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true}}}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"ID of the customer\",\"required\":true,\"type\":\"string\",\"format\":\"uuid\"}],\"responses\":{\"200\":{\"description\":\"OK\",\"schema\":{\"properties\":{\"firstName\":{\"type\":\"string\",\"name\":\"firstName\",\"propertyRow\":true},\"lastName\":{\"type\":\"string\",\"name\":\"lastName\",\"propertyRow\":true},\"age\":{\"type\":\"number\",\"name\":\"age\",\"propertyRow\":true},\"email\":{\"type\":\"string\",\"name\":\"email\",\"propertyRow\":true},\"hobbies\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"\",\"propertyRow\":true},\"name\":\"hobbies\",\"propertyRow\":true},\"isStudent\":{\"type\":\"boolean\",\"name\":\"isStudent\",\"propertyRow\":true},\"id\":{\"type\":\"string\",\"name\":\"id\",\"propertyRow\":true}}}},\"400\":{\"description\":\"Bad Request\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}},\"401\":{\"description\":\"Unauthorized\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}},\"404\":{\"description\":\"Not Found\",\"schema\":{\"properties\":{\"status\":{\"type\":\"string\",\"name\":\"status\",\"propertyRow\":true},\"description\":{\"type\":\"string\",\"name\":\"description\",\"propertyRow\":true}}}}},\"security\":[{\"basic\":[]}]}}},\"securityDefinitions\":{\"basic\":{\"type\":\"basic\",\"description\":\"Basic Authentication\"}}}",
        "url": "https://flow-h2u1dhpkm1of8.demo-01.qibb.com/http-api/openapi.json",
        "customName": true,
        "host": "https://flow-h2u1dhpkm1of8.demo-01.qibb.com/"
    },
    {
        "id": "69a64e3d.84da3",
        "type": "http in",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "POST /customers",
        "url": "/customers",
        "method": "post",
        "upload": false,
        "swaggerDoc": "c8da4b9c7c89a981",
        "x": 160,
        "y": 440,
        "wires": [
            [
                "ebe029bbd2fab0b0"
            ]
        ]
    },
    {
        "id": "43e49c36.dc7624",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Created",
        "statusCode": "201",
        "headers": {},
        "x": 1220,
        "y": 420,
        "wires": []
    },
    {
        "id": "8cb4b74e.602c28",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Create a customer ",
        "info": "",
        "x": 170,
        "y": 400,
        "wires": []
    },
    {
        "id": "f54a63dc18bc8392",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Customer's Data Validation",
        "func": "// Fetching the body of the call and assigning it to the customer constant variable\nconst customer = msg.payload;\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Define the required properties\nconst requiredProperties = [\"firstName\", \"lastName\", \"email\"];\n\nconst validTypeMap = {\n    \"firstName\": \"string\",\n    \"lastName\": \"string\",\n    \"age\": \"number\",\n    \"email\": \"string\",\n    \"hobbies\": \"object\",\n    \"isStudent\": \"boolean\"\n};\n\n// Check if all required properties are present in the payload\nconst isValidCustomer = requiredProperties.every(property => customer[property]);\n\n// Check if the POST request body is invalid\nif (!isValidCustomer) {\n    const missingProperties = requiredProperties.filter(property => !customer[property]);\n    const errorMessage = `The provided data is incomplete or missing some required properties: '${missingProperties.join(', ')}'`;\n    setErrorResponse(400, errorMessage);\n    return [null, msg];\n}\n\n// Check if at least one valid property is present\nconst hasValidProperty = Object.keys(customer).some(property => validTypeMap.hasOwnProperty(property));\n\nif (!hasValidProperty) {\n    const errorMessage = 'Incomplete customer data. At least one valid property is required.';\n    setErrorResponse(400, errorMessage);\n    return [null, msg];\n}\n\n// Check if the properties have valid values\nfor (const property in customer) {\n    if (validTypeMap.hasOwnProperty(property)) {\n        const expectedType = validTypeMap[property];\n        if (typeof customer[property] !== expectedType) {\n            const errorMessage = `Invalid type for property: ${property}. Expected ${expectedType}.`;\n            setErrorResponse(400, errorMessage);\n            return [null, msg];\n        }\n    }\n    else {\n        const errorMessage = `Invalid property: ${property}. Supported Properties: ${Object.keys(validTypeMap)}.`;\n        setErrorResponse(400, errorMessage);\n        return [null, msg];\n    }\n}\n\nreturn [msg, null];",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 700,
        "y": 440,
        "wires": [
            [
                "e7f343b7d2171998"
            ],
            [
                "ba851e18476f8e70"
            ]
        ]
    },
    {
        "id": "5aa645182fc55b07",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 150,
        "y": 140,
        "wires": [
            [
                "92cd9ee09ceca861"
            ]
        ]
    },
    {
        "id": "92cd9ee09ceca861",
        "type": "change",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Initializes Customers Global Variable",
        "rules": [
            {
                "t": "set",
                "p": "CUSTOMERS",
                "pt": "global",
                "to": "[]",
                "tot": "json"
            },
            {
                "t": "set",
                "p": "USER_CREDENTIALS",
                "pt": "global",
                "to": "{\"username\":\"admin\",\"saltedPassword\":\"$2a$10$OGmjWgmKg7Sg8AibqCDFc.gLd6n78GK985B.IFYu4tKrz5UT4wzBa\"}",
                "tot": "json"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "a853fc1610bb3020",
        "type": "http in",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "GET /customers",
        "url": "/customers",
        "method": "get",
        "upload": false,
        "swaggerDoc": "072305daf97dd74c",
        "x": 160,
        "y": 240,
        "wires": [
            [
                "41dfae675a825e0f"
            ]
        ]
    },
    {
        "id": "1ff74e976f1fe409",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 240,
        "wires": []
    },
    {
        "id": "f3ce9b4fddf14a98",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Fetch All Customers",
        "info": "",
        "x": 170,
        "y": 200,
        "wires": []
    },
    {
        "id": "41dfae675a825e0f",
        "type": "change",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Retrieving Customers Data",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "CUSTOMERS",
                "tot": "global"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 420,
        "y": 240,
        "wires": [
            [
                "1ff74e976f1fe409"
            ]
        ]
    },
    {
        "id": "622a414f7d6e9376",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Retrieve Customer's Data",
        "func": "// Fetching all customers data\nconst customers = global.get(\"CUSTOMERS\");\n\n// Saving the path parameter ID from the GET call\nconst customerId = msg.req.params.id;\n\n// Attempting to find a customer with the specified ID\nconst matchingCustomer = customers.find(obj => obj.id === customerId);\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Check if a customer with the specified ID was found\nif (!matchingCustomer) {\n    // Matching customer is not found\n    const errorMessage = `No customer found with ID: ${customerId}. Please check the provided ID.`;\n    setErrorResponse(404, errorMessage);\n    return [null, msg];\n}\n\n// Sets the output payload to the specified customer's data\nmsg.payload = matchingCustomer;\n\n// Sets the HTTP status code to 200 (OK) (optional)\nmsg.statusCode = 200;\n\nreturn [ msg, null ];",
        "outputs": 2,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 410,
        "y": 340,
        "wires": [
            [
                "7236627a7f7f5721"
            ],
            [
                "e56216898741060a"
            ]
        ]
    },
    {
        "id": "7236627a7f7f5721",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 320,
        "wires": []
    },
    {
        "id": "e56216898741060a",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 360,
        "wires": []
    },
    {
        "id": "25efbf4104a1262e",
        "type": "http in",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "GET /customers/:id",
        "url": "/customers/:id",
        "method": "get",
        "upload": false,
        "swaggerDoc": "46dd8c02b7974421",
        "x": 170,
        "y": 340,
        "wires": [
            [
                "622a414f7d6e9376"
            ]
        ]
    },
    {
        "id": "8abaa11adc7fce77",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Fetch Specific Customer",
        "info": "",
        "x": 180,
        "y": 300,
        "wires": []
    },
    {
        "id": "ece180d9db666b55",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Check Customer's ID",
        "func": "// Fetching all customers data\nconst customers = global.get(\"CUSTOMERS\");\n\n// Saving the path parameter ID from the GET call\nconst customerId = msg.req.params.id;\n\n// Attempting to find a customer with the specified ID\nconst matchingCustomer = customers.find(obj => obj.id === customerId);\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Attempting to find a customer with the specified ID\nconst customerIndex = customers.findIndex(customer => customer.id === customerId);\n\n// Check if a customer with the specified ID was found\nif (!matchingCustomer) {\n    // Matching customer is not found\n    const errorMessage = `No customer found with ID: ${customerId}. Please check the provided ID.`;\n    setErrorResponse(404, errorMessage);\n    return [ null, msg ];\n}\nelse {\n    // Continue to the next function node\n    return [ msg, null ];\n}",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 680,
        "y": 640,
        "wires": [
            [
                "553994fd4cb1bb7b"
            ],
            [
                "eef3a846833dc7b5"
            ]
        ]
    },
    {
        "id": "eef3a846833dc7b5",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 950,
        "y": 660,
        "wires": []
    },
    {
        "id": "996587bf940dce23",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "No Content",
        "statusCode": "204",
        "headers": {},
        "x": 1230,
        "y": 620,
        "wires": []
    },
    {
        "id": "4df9fb69e20c330c",
        "type": "http in",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "DELETE /customers/:id",
        "url": "/customers/:id",
        "method": "delete",
        "upload": false,
        "swaggerDoc": "a4d72567c63957e0",
        "x": 180,
        "y": 640,
        "wires": [
            [
                "dd97f32bebd7b989"
            ]
        ]
    },
    {
        "id": "487639d7d21607b5",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Delete Customer",
        "info": "",
        "x": 160,
        "y": 600,
        "wires": []
    },
    {
        "id": "ba851e18476f8e70",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 950,
        "y": 460,
        "wires": []
    },
    {
        "id": "ebe029bbd2fab0b0",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Check Basic Authentication",
        "func": "// Extract the base-64-encoded credentials\nconst credentials = msg.req.headers.authorization;\nnode.warn(credentials);\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Check if there is basic authorization passed with the call\nif (!credentials) {\n    const errorMessage = \"Authentication failed. Please double-check your credentials.\";\n    setErrorResponse(401, errorMessage); // Unauthorized\n    return [null, msg];\n}\n// Extract the base64-encoded credentials part (after \"Basic \")\nconst base64Credentials = credentials.split(' ')[1];\n\n// Decode the base64-encoded credentials\nconst decodedCredentials = Buffer.from(base64Credentials, 'base64').toString('binary');\n\n// Extract username and password from decoded credentials\nconst [decodedUsername, decodedPassword] = decodedCredentials.split(':');\nnode.warn(decodedPassword);\nconst saltRounds = 10;\n\ntry {\n    const creds = global.get(\"USER_CREDENTIALS\");\n    const username = creds.username;\n    const saltedPass = creds.saltedPassword;\n\n    // Create a salted hash of the password (optional)\n    // const hashedPassword = await bcrypt.hash(decodedPassword, saltRounds);\n\n    // Compare the input password with the hashed password using bcrypt.compare\n    const passwordMatch = await bcrypt.compare(decodedPassword, saltedPass);\n    \n    if (decodedUsername === username && passwordMatch) {\n        return [msg, null];\n    } else {\n        const errorMessage = \"Authentication failed. Please double-check your credentials.\"\n        setErrorResponse(401, errorMessage); // Unauthorized\n        return [null, msg];\n    }\n} catch (error) {\n    const errorMessage = error.message || \"Error hashing the password\";\n    setErrorResponse(500, errorMessage); // Internal Server Error\n    return [null, msg];\n}",
        "outputs": 2,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "bcrypt",
                "module": "bcryptjs"
            }
        ],
        "x": 420,
        "y": 440,
        "wires": [
            [
                "f54a63dc18bc8392"
            ],
            [
                "ee273276bc137185"
            ]
        ]
    },
    {
        "id": "ee273276bc137185",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 480,
        "wires": []
    },
    {
        "id": "dd97f32bebd7b989",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Check Basic Authentication",
        "func": "// Extract the base-64-encoded credentials\nconst credentials = msg.req.headers.authorization;\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Check if there is basic authorization passed with the call\nif (!credentials) {\n    const errorMessage = \"Authentication failed. Please double-check your credentials.\";\n    setErrorResponse(401, errorMessage); // Unauthorized\n    return [null, msg];\n}\n// Extract the base64-encoded credentials part (after \"Basic \")\nconst base64Credentials = credentials.split(' ')[1];\n\n// Decode the base64-encoded credentials\nconst decodedCredentials = Buffer.from(base64Credentials, 'base64').toString('binary');\n\n// Extract username and password from decoded credentials\nconst [decodedUsername, decodedPassword] = decodedCredentials.split(':');\n\nconst saltRounds = 10;\n\ntry {\n    const creds = global.get(\"USER_CREDENTIALS\");\n    const username = creds.username;\n    const saltedPass = creds.saltedPassword;\n\n    // Create a salted hash of the password (optional)\n    // const hashedPassword = await bcrypt.hash(decodedPassword, saltRounds);\n\n    // Compare the input password with the hashed password using bcrypt.compare\n    const passwordMatch = await bcrypt.compare(decodedPassword, saltedPass);\n\n    if (decodedUsername === username && passwordMatch) {\n        return [msg, null];\n    } else {\n        const errorMessage = \"Authentication failed. Please double-check your credentials.\"\n        setErrorResponse(401, errorMessage); // Unauthorized\n        return [null, msg];\n    }\n} catch (error) {\n    const errorMessage = error.message || \"Error hashing the password\";\n    setErrorResponse(500, errorMessage); // Internal Server Error\n    return [null, msg];\n}\n",
        "outputs": 2,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "bcrypt",
                "module": "bcryptjs"
            }
        ],
        "x": 420,
        "y": 640,
        "wires": [
            [
                "ece180d9db666b55"
            ],
            [
                "ae806403b1a80583"
            ]
        ]
    },
    {
        "id": "ae806403b1a80583",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 680,
        "wires": []
    },
    {
        "id": "067a5794155edbc0",
        "type": "http in",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "PATCH /customers/:id",
        "url": "/customers/:id",
        "method": "patch",
        "upload": false,
        "swaggerDoc": "6a53f846bcb2203f",
        "x": 180,
        "y": 540,
        "wires": [
            [
                "8394ad8af1f51f4c"
            ]
        ]
    },
    {
        "id": "fa279eb4544a80eb",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "OK",
        "statusCode": "",
        "headers": {},
        "x": 1210,
        "y": 520,
        "wires": []
    },
    {
        "id": "9625a0abe11dfba1",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Update a customer ",
        "info": "",
        "x": 170,
        "y": 500,
        "wires": []
    },
    {
        "id": "7d6a1fe04f4f3a6a",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Customer's Data and ID Validation",
        "func": "// Fetching the body of the call and assigning it to the customer constant variable\nconst customer = msg.payload;\n\n// Fetching the data for all customers\nconst customers = global.get(\"CUSTOMERS\");\n\n// Saving the path parameter ID from the GET call\nconst customerId = msg.req.params.id;\n\n// Attempting to find a customer with the specified ID\nconst matchingCustomer = customers.find(obj => obj.id === customerId);\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Check if a customer with the specified ID was found\nif (!matchingCustomer) {\n    // Matching customer is not found\n    const errorMessage = `No customer found with ID: ${customerId}. Please check the provided ID.`;\n    setErrorResponse(404, errorMessage);\n    return [null, msg];\n}\n\nconst validTypeMap = {\n    \"firstName\": \"string\",\n    \"lastName\": \"string\",\n    \"age\": \"number\",\n    \"email\": \"string\",\n    \"hobbies\": \"object\",  \n    \"isStudent\": \"boolean\"\n};\n\n// Check if at least one valid property is present\nconst hasValidProperty = Object.keys(customer).some(property => validTypeMap.hasOwnProperty(property));\n\nif (!hasValidProperty) {\n    const errorMessage = 'Incomplete customer data. At least one valid property is required.';\n    setErrorResponse(400, errorMessage);\n    return [null, msg];\n}\n\n// Check if the properties have valid values\nfor (const property in customer) {\n    if (validTypeMap.hasOwnProperty(property)) {\n        const expectedType = validTypeMap[property];\n        if (typeof customer[property] !== expectedType) {\n            const errorMessage = `Invalid type for property: ${property}. Expected ${expectedType}.`;\n            setErrorResponse(400, errorMessage);\n            return [null, msg];\n        }\n    }\n    else {\n        const errorMessage = `Invalid property: ${property}. Supported Properties: ${Object.keys(validTypeMap)}.`;\n        setErrorResponse(400, errorMessage);\n        return [null, msg]; \n    }\n}\n\nreturn [ msg, null ];",
        "outputs": 2,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "uuid",
                "module": "uuid"
            }
        ],
        "x": 720,
        "y": 540,
        "wires": [
            [
                "e52d2359394ad390"
            ],
            [
                "d42a546b6ee61e19"
            ]
        ]
    },
    {
        "id": "d42a546b6ee61e19",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 950,
        "y": 560,
        "wires": []
    },
    {
        "id": "8394ad8af1f51f4c",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Check Basic Authentication",
        "func": "// Extract the base-64-encoded credentials\nconst credentials = msg.req.headers.authorization;\n\nfunction setErrorResponse(statusCode, description) {\n    // Sets the payload and status code in case of an error\n    msg.statusCode = statusCode;\n    msg.payload = {\n        \"status\": \"Error\",\n        \"description\": description\n    };\n}\n\n// Check if there is basic authorization passed with the call\nif (!credentials) {\n    const errorMessage = \"Authentication failed. Please double-check your credentials.\";\n    setErrorResponse(401, errorMessage); // Unauthorized\n    return [ null, msg ];\n}\n// Extract the base64-encoded credentials part (after \"Basic \")\nconst base64Credentials = credentials.split(' ')[1];\n\n// Decode the base64-encoded credentials\nconst decodedCredentials = Buffer.from(base64Credentials, 'base64').toString('binary');\n\n// Extract username and password from decoded credentials\nconst [decodedUsername, decodedPassword] = decodedCredentials.split(':');\n\nconst saltRounds = 10;\n\ntry {\n    const creds = global.get(\"USER_CREDENTIALS\");\n    const username = creds.username;\n    const saltedPass = creds.saltedPassword;\n\n    // Create a salted hash of the password (optional)\n    // const hashedPassword = await bcrypt.hash(decodedPassword, saltRounds);\n\n    // Compare the input password with the hashed password using bcrypt.compare\n    const passwordMatch = await bcrypt.compare(decodedPassword, saltedPass);\n\n    if (decodedUsername === username && passwordMatch) {\n        return [msg, null];\n    } else {\n        const errorMessage = \"Authentication failed. Please double-check your credentials.\"\n        setErrorResponse(401, errorMessage); // Unauthorized\n        return [ null, msg ];\n    }\n} catch (error) {\n    const errorMessage = error.message || \"Error hashing the password\";\n    setErrorResponse(500, errorMessage); // Internal Server Error\n    return [ null, msg ];\n}",
        "outputs": 2,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "bcrypt",
                "module": "bcryptjs"
            }
        ],
        "x": 420,
        "y": 540,
        "wires": [
            [
                "7d6a1fe04f4f3a6a"
            ],
            [
                "c51e7a063790a170"
            ]
        ]
    },
    {
        "id": "c51e7a063790a170",
        "type": "http response",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 630,
        "y": 580,
        "wires": []
    },
    {
        "id": "8b5f2739b8f41efa",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Initializing Fake Customer's Data",
        "info": "",
        "x": 210,
        "y": 100,
        "wires": []
    },
    {
        "id": "e7f343b7d2171998",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Create Customer",
        "func": "// Fetching the body of the call and assigning it to the customer constant variable\nconst customer = msg.payload;\n\n// Fetching the data for all customers\nconst customers = global.get(\"CUSTOMERS\");\n\n// Generating UUID v4 ID for each customer\ncustomer.id = uuid.v4();\n\n// Pushing the customer's data to the global variable\ncustomers.push(customer);\n\nglobal.set(\"CUSTOMERS\", customers);\n\n//Setting the response body of the API call and setting the HTTP status code to 201 (Created)\nmsg.payload = customer;\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "uuid",
                "module": "uuid"
            }
        ],
        "x": 990,
        "y": 420,
        "wires": [
            [
                "43e49c36.dc7624"
            ]
        ]
    },
    {
        "id": "e52d2359394ad390",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Update Existing Customer",
        "func": "// Fetching the body of the call and assigning it to the customer constant variable\nconst customer = msg.payload;\n\n// Fetching the data for all customers\nconst customers = global.get(\"CUSTOMERS\");\n\n// Saving the path parameter ID from the GET call\nconst customerId = msg.req.params.id;\n\n// Attempting to find a customer with the specified ID\nconst matchingCustomer = customers.find(obj => obj.id === customerId);\n\n// Re-assigns the values from the payload to the matchingCustomer object\nObject.assign(matchingCustomer, customer);\n\n// Overwriting the data for the matching customer\ncustomers[customers.findIndex(obj => obj.id === customerId)] = matchingCustomer;\n\n// Pushing the updated customers list to the global variable CUSTOMERS\nglobal.set(\"CUSTOMERS\", customers);\n\n// Sets the output payload from your call to the updated customer object\nmsg.payload = matchingCustomer;\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1010,
        "y": 520,
        "wires": [
            [
                "fa279eb4544a80eb"
            ]
        ]
    },
    {
        "id": "553994fd4cb1bb7b",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "a187e82b2eb344da",
        "name": "Delete Existing Customer",
        "func": "// Fetching all customers data\nlet customers = global.get(\"CUSTOMERS\");\n\n// Saving the path parameter ID from the GET call\nconst customerId = msg.req.params.id;\n\n// Attempting to find a customer with the specified ID\nconst customerIndex = customers.findIndex(customer => customer.id === customerId);\n\nif (customerIndex !== -1) {\n    // Delete the object with the matching ID\n    customers = customers.slice(0, customerIndex).concat(customers.slice(customerIndex + 1));\n\n    // Update the global 'customers' variable\n    global.set('CUSTOMERS', customers);\n\n    // Set status code to 204 (No Content)\n    msg.statusCode = 204;\n} else {\n    // Customer not found, set status code to 404 (Not Found)\n    msg.statusCode = 404;\n}\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1010,
        "y": 620,
        "wires": [
            [
                "996587bf940dce23"
            ]
        ]
    },
    {
        "id": "7c2812c.c6ee7ec",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Create Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 675,
        "y": 1400,
        "wires": [],
        "icon": "font-awesome/fa-info-circle",
        "l": false
    },
    {
        "id": "e45041b6.9ec13",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 135,
        "y": 1420,
        "wires": [
            [
                "39f02628617e2836"
            ]
        ],
        "l": false
    },
    {
        "id": "af33dae7.b21138",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Create, Update and Delete a Customer",
        "info": "",
        "x": 240,
        "y": 1380,
        "wires": []
    },
    {
        "id": "a878233e45f55212",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Peter Pan",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 135,
        "y": 1480,
        "wires": [
            [
                "651335e14a77db42"
            ]
        ],
        "l": false
    },
    {
        "id": "6b775eb167f98e8f",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [
            {
                "p": "url",
                "v": "$env(\"BASE_URL\") & \"/customers\"",
                "vt": "jsonata"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 200,
        "y": 840,
        "wires": [
            [
                "edb65c5cd0551f8d"
            ]
        ]
    },
    {
        "id": "50af4e93d2c68461",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "All Customers Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 840,
        "wires": [],
        "icon": "font-awesome/fa-info-circle"
    },
    {
        "id": "da980d122c1e49ad",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Fetch Information for All Customers",
        "info": "",
        "x": 270,
        "y": 800,
        "wires": []
    },
    {
        "id": "6d64dcb3d910d61c",
        "type": "change",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Save Customer ID & Call Preparation",
        "rules": [
            {
                "t": "delete",
                "p": "parameters.body",
                "pt": "msg"
            },
            {
                "t": "delete",
                "p": "headers",
                "pt": "msg"
            },
            {
                "t": "set",
                "p": "customerId",
                "pt": "msg",
                "to": "payload.id",
                "tot": "msg"
            },
            {
                "t": "delete",
                "p": "payload",
                "pt": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 790,
        "y": 1460,
        "wires": [
            [
                "8c44777bff5cb393"
            ]
        ]
    },
    {
        "id": "c0fd77eb84a885c4",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Update Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1225,
        "y": 1460,
        "wires": [],
        "icon": "font-awesome/fa-info-circle",
        "l": false
    },
    {
        "id": "71a1c4e07f63b9c9",
        "type": "change",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Cleaning the MSG Object",
        "rules": [
            {
                "t": "delete",
                "p": "payload",
                "pt": "msg"
            },
            {
                "t": "delete",
                "p": "headers",
                "pt": "msg"
            },
            {
                "t": "delete",
                "p": "parameters",
                "pt": "msg"
            },
            {
                "t": "delete",
                "p": "statusCode",
                "pt": "msg"
            },
            {
                "t": "delete",
                "p": "responseUrl",
                "pt": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 230,
        "y": 1540,
        "wires": [
            [
                "d29e2145b8b6fead"
            ]
        ]
    },
    {
        "id": "da777e201b5c5787",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Delete Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "statusCode",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 665,
        "y": 1540,
        "wires": [],
        "icon": "font-awesome/fa-info-circle",
        "l": false
    },
    {
        "id": "39f02628617e2836",
        "type": "template",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "John Doe",
        "field": "parameters.body",
        "fieldType": "msg",
        "format": "json",
        "syntax": "plain",
        "template": "{\n   \"firstName\":\"John\",\n   \"lastName\":\"Doe\",\n   \"age\":30,\n   \"email\":\"john.doe@qibb.com\",\n   \"hobbies\":[\n      \"Reading\",\n      \"Hiking\",\n      \"Cooking\"\n   ],\n   \"isStudent\":false\n}",
        "output": "json",
        "x": 240,
        "y": 1420,
        "wires": [
            [
                "bd5a04780aa47496"
            ]
        ]
    },
    {
        "id": "651335e14a77db42",
        "type": "template",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Peter Pan",
        "field": "parameters.body",
        "fieldType": "msg",
        "format": "json",
        "syntax": "plain",
        "template": "{\n   \"firstName\": \"Peter\",\n   \"lastName\": \"Pan\",\n   \"age\": 12,\n   \"email\": \"peter.pan@qibb.com\",\n   \"hobbies\": [\n      \"Battling Pirates\",\n      \"Flying\",\n      \"Listening bedtime stories\"\n   ],\n   \"isStudent\": true\n}",
        "output": "json",
        "x": 240,
        "y": 1480,
        "wires": [
            [
                "bd5a04780aa47496"
            ]
        ]
    },
    {
        "id": "bd5a04780aa47496",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "POST /customers",
        "selectedOperation": {
            "method": "post",
            "path": "/customers",
            "deprecated": false,
            "summary": "Creates a new customers",
            "description": "Creates a new customer and stores their data in the 'customers' global variable.",
            "tag": "customers",
            "operationId": "post_customers"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "body",
                "value": "{\n   \"firstName\": \"string\",\n   \"lastName\": \"string\",\n   \"age\": 0,\n   \"email\": \"string\",\n   \"hobbies\": [\n    \"string\"\n  ],\n   \"isStudent\": true\n}",
                "in": "body",
                "refType": "jsonata"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": false
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 480,
        "y": 1460,
        "wires": [
            [
                "7c2812c.c6ee7ec",
                "6d64dcb3d910d61c"
            ]
        ]
    },
    {
        "id": "a4ba98ce28afc701",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Specific Customer Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 640,
        "y": 960,
        "wires": [],
        "icon": "font-awesome/fa-info-circle"
    },
    {
        "id": "8fd90fcc0ff351f5",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [
            {
                "p": "customerId",
                "v": "38ff08e1-cad7-4e80-86ca-fd472b3eed0f",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 190,
        "y": 960,
        "wires": [
            [
                "e313e7232ee5a507"
            ]
        ]
    },
    {
        "id": "edd989d71ea8417f",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Fetch Information for Specific Customer",
        "info": "",
        "x": 270,
        "y": 920,
        "wires": []
    },
    {
        "id": "8c44777bff5cb393",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "PATCH /customers/{id}",
        "selectedOperation": {
            "method": "patch",
            "path": "/customers/{id}",
            "deprecated": false,
            "summary": "Updates an existing customers",
            "description": "Updates the customer identified by the given id in the 'customers' global variable.",
            "tag": "customers",
            "operationId": "patch_customers__id_"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "id",
                "value": "customerId",
                "in": "path",
                "refType": "msg"
            },
            {
                "name": "body",
                "value": "{\n   \"firstName\":\"Tom\",\n   \"lastName\":\"Sawyer\",\n   \"email\":\"tom.sawyer@qibb.com\"\n}",
                "in": "body",
                "refType": "jsonata"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 1060,
        "y": 1460,
        "wires": [
            [
                "c0fd77eb84a885c4",
                "71a1c4e07f63b9c9"
            ]
        ]
    },
    {
        "id": "d29e2145b8b6fead",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "DELETE /customers/{id}",
        "selectedOperation": {
            "method": "delete",
            "path": "/customers/{id}",
            "deprecated": false,
            "summary": "Deletes an existing customer",
            "description": "Deletes the customer with the specified id from the 'customers' global variable.",
            "tag": "customers",
            "operationId": "delete_customers__id_"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "id",
                "value": "customerId",
                "in": "path",
                "refType": "msg"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 490,
        "y": 1540,
        "wires": [
            [
                "da777e201b5c5787"
            ]
        ]
    },
    {
        "id": "e313e7232ee5a507",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "GET /customers/{id}",
        "selectedOperation": {
            "method": "get",
            "path": "/customers/{id}",
            "deprecated": false,
            "summary": "Retrieves the data for a specific customer",
            "description": "Retrieves the details of a specific customer identified by the provided id parameter.",
            "tag": "customers",
            "operationId": "get_customers__id_"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "id",
                "value": "customerId",
                "in": "path",
                "refType": "msg"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "outputs": 1,
        "x": 380,
        "y": 960,
        "wires": [
            [
                "a4ba98ce28afc701"
            ]
        ]
    },
    {
        "id": "edb65c5cd0551f8d",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "GET /customers",
        "selectedOperation": {
            "method": "get",
            "path": "/customers",
            "deprecated": false,
            "summary": "Retrieves a list of all created customers",
            "description": " Fetches a JSON array of customer details from the 'customers' global variable. Each customer is represented as a JSON object.",
            "tag": "customers",
            "operationId": "get_customers"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "outputs": 1,
        "x": 370,
        "y": 840,
        "wires": [
            [
                "50af4e93d2c68461"
            ]
        ]
    },
    {
        "id": "afc714b038088fb7",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "",
        "x": 890,
        "y": 840,
        "wires": [
            [
                "e8b2512566263a9b"
            ]
        ]
    },
    {
        "id": "e8b2512566263a9b",
        "type": "function",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Salted Hash Generation",
        "func": "const saltRounds = 10;\n\n// Please do NOT use such passwords in production :)\nconst plainTextPassword = \"password1234\";\n\n// Create a salted hash of the password (optional)\nconst saltedPassword = await bcrypt.hash(plainTextPassword, saltRounds);\n\n// const saltedPass = \"$2a$10$tTtp4M5oz2Uqw9MiLpuBseEQB1Fk/lB0dNzyqB7TETASRqe7Hzwoa\"\nconst passwordMatch = await bcrypt.compare(plainTextPassword, saltedPassword);\n\nmsg.payload = {\n  plainTextPassword: plainTextPassword,\n  saltedPassword: saltedPassword,\n  passwordMatch: passwordMatch\n};\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "bcrypt",
                "module": "bcryptjs"
            }
        ],
        "x": 1110,
        "y": 840,
        "wires": [
            [
                "dd5c2d61f7a97708"
            ]
        ]
    },
    {
        "id": "b91a3ef70bf7114a",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "POST /customers",
        "selectedOperation": {
            "method": "post",
            "path": "/customers",
            "deprecated": false,
            "summary": "Creates a new customers",
            "description": "Creates a new customer and stores their data in the 'customers' global variable.",
            "tag": "customers",
            "operationId": "post_customers"
        },
        "api": "957b20fde5525239",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "body",
                "value": "{\n   \"firstName\": \"Tom\",\n   \"lastName\": \"Pan\",\n   \"age\": 12,\n   \"email\": \"peter.pan@qibb.com\",\n   \"hobbies\": [\n       \"Battling Pirates\",\n       \"Flying\",\n       \"Listening bedtime stories\"\n   ],\n   \"isStudent\": true\n}",
                "in": "body",
                "refType": "jsonata"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 370,
        "y": 1080,
        "wires": [
            [
                "c0ab158fa4e1694e"
            ]
        ]
    },
    {
        "id": "7801ad9e898cef5d",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "",
        "x": 190,
        "y": 1080,
        "wires": [
            [
                "b91a3ef70bf7114a"
            ]
        ]
    },
    {
        "id": "c0ab158fa4e1694e",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Create a Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 1080,
        "wires": [],
        "icon": "font-awesome/fa-info-circle"
    },
    {
        "id": "e6fd52f87441bc4e",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "PATCH /customers/{id}",
        "selectedOperation": {
            "method": "patch",
            "path": "/customers/{id}",
            "deprecated": false,
            "summary": "Updates an existing customers",
            "description": "Updates the customer identified by the given id in the 'customers' global variable.",
            "tag": "customers",
            "operationId": "patch_customers__id_"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "id",
                "value": "customerId",
                "in": "path",
                "refType": "msg"
            },
            {
                "name": "body",
                "value": "{\n   \"firstName\":\"Peter\",\n   \"lastName\":\"Sawyer\",\n   \"email\":\"peter.sawyer@qibb.com\"\n}",
                "in": "body",
                "refType": "jsonata"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 380,
        "y": 1200,
        "wires": [
            [
                "ac142030042b847b"
            ]
        ]
    },
    {
        "id": "78ad0d2c68e67c37",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [
            {
                "p": "customerId",
                "v": "983a1eb9-c145-4c1a-a3f8-2a89330114d5",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 190,
        "y": 1200,
        "wires": [
            [
                "e6fd52f87441bc4e"
            ]
        ]
    },
    {
        "id": "ac142030042b847b",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Update Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 1200,
        "wires": [],
        "icon": "font-awesome/fa-info-circle"
    },
    {
        "id": "a11cb99f9730c039",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Create a Customer",
        "info": "",
        "x": 210,
        "y": 1040,
        "wires": []
    },
    {
        "id": "302dc8cf1911e217",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Update a Customer",
        "info": "",
        "x": 210,
        "y": 1160,
        "wires": []
    },
    {
        "id": "8a4012b960d79ceb",
        "type": "qibb-openapi-client",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "DELETE /customers/{id}",
        "selectedOperation": {
            "method": "delete",
            "path": "/customers/{id}",
            "deprecated": false,
            "summary": "Deletes an existing customer",
            "description": "Deletes the customer with the specified id from the 'customers' global variable.",
            "tag": "customers",
            "operationId": "delete_customers__id_"
        },
        "api": "0bbbfee22f767145",
        "errorHandlingModeSelectedIndex": 0,
        "security": [
            {
                "id": "basic",
                "type": "http",
                "description": "Basic Authentication",
                "scheme": "basic"
            }
        ],
        "requestContentTypeSelectedIndex": 0,
        "responseContentTypeSelectedIndex": 0,
        "parameters": [
            {
                "name": "id",
                "value": "",
                "in": "path",
                "refType": "type"
            }
        ],
        "uiFeatures": {
            "operations": {
                "advancedMode": true
            }
        },
        "credentialValues": {
            "username": {
                "value": "admin",
                "type": "string",
                "refType": "type"
            },
            "password": {
                "value": "J8Px(n23E%Sa<.l6)J2Ms6",
                "type": "string",
                "refType": "type"
            },
            "value": {
                "value": "",
                "type": "string",
                "refType": "type"
            }
        },
        "outputs": 1,
        "x": 390,
        "y": 1320,
        "wires": [
            [
                "95d35a7d66fc30a7"
            ]
        ]
    },
    {
        "id": "912981c3067290ad",
        "type": "inject",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "",
        "props": [
            {
                "p": "customerId",
                "v": "983a1eb9-c145-4c1a-a3f8-2a89330114d5",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 190,
        "y": 1320,
        "wires": [
            [
                "8a4012b960d79ceb"
            ]
        ]
    },
    {
        "id": "95d35a7d66fc30a7",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Delete Customer",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 630,
        "y": 1320,
        "wires": [],
        "icon": "font-awesome/fa-info-circle"
    },
    {
        "id": "be2fc32420895d6a",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Delete a Customer",
        "info": "",
        "x": 210,
        "y": 1280,
        "wires": []
    },
    {
        "id": "60e2fb0f375f32df",
        "type": "comment",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Salted Hash Generation",
        "info": "",
        "x": 920,
        "y": 800,
        "wires": []
    },
    {
        "id": "dd5c2d61f7a97708",
        "type": "debug",
        "z": "7d0cf2c53d86d299",
        "g": "8d2bcd00f9e80fb1",
        "name": "Salted Password Match",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1360,
        "y": 840,
        "wires": []
    }
]