{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "identity",
        "module": "auth",
        "action": "identify",
        "options": {
          "provider": "auth"
        },
        "output": true,
        "meta": []
      },
      {
        "name": "query",
        "module": "dbconnector",
        "action": "single",
        "options": {
          "connection": "authdb",
          "sql": {
            "type": "select",
            "columns": [
              {
                "table": "users",
                "column": "id"
              },
              {
                "table": "users",
                "column": "email"
              },
              {
                "table": "users",
                "column": "firstname"
              },
              {
                "table": "users",
                "column": "lastname"
              },
              {
                "table": "users",
                "column": "validated"
              }
            ],
            "params": [
              {
                "operator": "equal",
                "type": "expression",
                "name": ":P1",
                "value": "{{identity}}",
                "test": ""
              }
            ],
            "table": {
              "name": "users"
            },
            "primary": "id",
            "joins": [],
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "id": "users.id",
                  "field": "users.id",
                  "type": "double",
                  "operator": "equal",
                  "value": "{{identity}}",
                  "data": {
                    "table": "users",
                    "column": "id",
                    "type": "number",
                    "columnObj": {
                      "type": "increments",
                      "primary": true,
                      "unique": false,
                      "nullable": false,
                      "name": "id"
                    }
                  },
                  "operation": "="
                }
              ],
              "conditional": null,
              "valid": true
            },
            "query": "select `id`, `email`, `firstname`, `lastname`, `validated` from `users` where `users`.`id` = ?"
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "id"
          },
          {
            "type": "text",
            "name": "email"
          },
          {
            "type": "text",
            "name": "firstname"
          },
          {
            "type": "text",
            "name": "lastname"
          },
          {
            "type": "boolean",
            "name": "validated"
          }
        ],
        "outputType": "object"
      },
      {
        "name": "query1",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "authdb",
          "sql": {
            "type": "select",
            "columns": [
              {
                "table": "xuserrole",
                "column": "roleid"
              }
            ],
            "params": [
              {
                "operator": "equal",
                "type": "expression",
                "name": ":P1",
                "value": "{{identity}}",
                "test": ""
              }
            ],
            "table": {
              "name": "xuserrole"
            },
            "primary": "id",
            "joins": [],
            "wheres": {
              "condition": "AND",
              "rules": [
                {
                  "id": "xuserrole.userid",
                  "field": "xuserrole.userid",
                  "type": "double",
                  "operator": "equal",
                  "value": "{{identity}}",
                  "data": {
                    "table": "xuserrole",
                    "column": "userid",
                    "type": "number",
                    "columnObj": {
                      "type": "integer",
                      "primary": false,
                      "unique": false,
                      "nullable": true,
                      "name": "userid"
                    }
                  },
                  "operation": "="
                }
              ],
              "conditional": null,
              "valid": true
            },
            "query": "select `roleid` from `xuserrole` where `xuserrole`.`userid` = ?"
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "roleid"
          }
        ],
        "outputType": "array"
      },
      {
        "name": "api_userinfo",
        "module": "api",
        "action": "send",
        "options": {
          "url": "{{$_ENV.API_BASEURL+'users/'+identity}}",
          "schema": [
            {
              "type": "object",
              "name": "data",
              "sub": [
                {
                  "type": "number",
                  "name": "id"
                },
                {
                  "type": "array",
                  "name": "roles",
                  "sub": [
                    {
                      "type": "text",
                      "name": "updatedate"
                    },
                    {
                      "type": "text",
                      "name": "name"
                    },
                    {
                      "type": "number",
                      "name": "id"
                    },
                    {
                      "type": "number",
                      "name": "updateuserid"
                    },
                    {
                      "type": "text",
                      "name": "createdate"
                    },
                    {
                      "type": "text",
                      "name": "description"
                    },
                    {
                      "type": "boolean",
                      "name": "isdepartment"
                    },
                    {
                      "type": "number",
                      "name": "createuserid"
                    }
                  ]
                },
                {
                  "type": "number",
                  "name": "createuserid"
                },
                {
                  "type": "text",
                  "name": "updatedate"
                },
                {
                  "type": "text",
                  "name": "lastname"
                },
                {
                  "type": "text",
                  "name": "firstname"
                },
                {
                  "type": "number",
                  "name": "updateuserid"
                },
                {
                  "type": "text",
                  "name": "password"
                },
                {
                  "type": "boolean",
                  "name": "isactive"
                },
                {
                  "type": "text",
                  "name": "username"
                },
                {
                  "type": "text",
                  "name": "createdate"
                },
                {
                  "type": "text",
                  "name": "email"
                }
              ]
            },
            {
              "type": "object",
              "name": "headers",
              "sub": [
                {
                  "type": "text",
                  "name": "connection"
                },
                {
                  "type": "text",
                  "name": "content-length"
                },
                {
                  "type": "text",
                  "name": "content-type"
                },
                {
                  "type": "text",
                  "name": "date"
                }
              ]
            }
          ]
        },
        "output": true,
        "meta": [
          {
            "type": "object",
            "name": "data",
            "sub": [
              {
                "type": "number",
                "name": "id"
              },
              {
                "type": "array",
                "name": "roles",
                "sub": [
                  {
                    "type": "text",
                    "name": "updatedate"
                  },
                  {
                    "type": "text",
                    "name": "name"
                  },
                  {
                    "type": "number",
                    "name": "id"
                  },
                  {
                    "type": "number",
                    "name": "updateuserid"
                  },
                  {
                    "type": "text",
                    "name": "createdate"
                  },
                  {
                    "type": "text",
                    "name": "description"
                  },
                  {
                    "type": "boolean",
                    "name": "isdepartment"
                  },
                  {
                    "type": "number",
                    "name": "createuserid"
                  }
                ]
              },
              {
                "type": "number",
                "name": "createuserid"
              },
              {
                "type": "text",
                "name": "updatedate"
              },
              {
                "type": "text",
                "name": "lastname"
              },
              {
                "type": "text",
                "name": "firstname"
              },
              {
                "type": "number",
                "name": "updateuserid"
              },
              {
                "type": "text",
                "name": "password"
              },
              {
                "type": "boolean",
                "name": "isactive"
              },
              {
                "type": "text",
                "name": "username"
              },
              {
                "type": "text",
                "name": "createdate"
              },
              {
                "type": "text",
                "name": "email"
              }
            ]
          },
          {
            "type": "object",
            "name": "headers",
            "sub": [
              {
                "type": "text",
                "name": "connection"
              },
              {
                "type": "text",
                "name": "content-length"
              },
              {
                "type": "text",
                "name": "content-type"
              },
              {
                "type": "text",
                "name": "date"
              }
            ]
          }
        ],
        "outputType": "object",
        "disabled": true
      }
    ]
  }
}