{
  "notice": {
    "n0": "This file is produced by CirrusWave line of products and platform.",
    "n1": "By producing this file and using this product you are agreeing to the terms and conditions outlined in the CirrusWave Enterprise License",
    "n2": "Please make sure that you read CirrusWave license at https://www.cirruswave.com/eula.html"
  },
  "loglevel": "trace",
  "servicename": "wsoc",
  "routes": [
    {
      "route": "/images",
      "type": "static",
      "configured": true,
      "routeclass": "./images",
      "description": "app specific images are served from the directory ./images under "
    },
    {
      "route": "/recipients",
      "type": "get",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "GetRecipients",
      "description": "Get all the recipients",
      "examples": [
        {
          "param": "/recipients"
        }
      ]
    },
    {
      "route": "/recipients",
      "type": "post",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "CreateRecipient",
      "description": "create a socket recipient",
      "bodyschema": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "unique name that identifies the recipient"
          },
          "receiver": {
            "type": "object",
            "description": "object that receives the messaghes sent by publisher. This is a service/servicefunction or a url implementing a post method",
            "oneOf": [
              {
                "required": [
                  "service",
                  "servicepath"
                ]
              },
              {
                "required": [
                  "url"
                ]
              }
            ],
            "properties": {
              "url": {
                "description": "fully qualified url",
                "type": "string"
              },
              "appserviceconfig": {
                "type": "string",
                "description": "appserviceconfig file path. Can be absolute or relative to the app dir"
              },
              "service": {
                "description": "cirrus installed service name",
                "type": "string"
              },
              "servicepath": {
                "description": "In the cirrus service, url of the specific route e.g. plan/task/add is this route path in workflow service",
                "type": "string"
              },
              "sysservice": {
                "description": "Indicates to the workflow that the service is to be located only in the system services. If false or not present, it will look in appservices first and then system services",
                "type": "boolean"
              },
              "security": {
                "description": "Applicable only in case of url based task. It can be accesskey which use hmac encryption or basic which is simply base64 encoding of the keys. If the url is secured by accesskey and secretkey, the type of security also needs to be specified",
                "type": {
                  "enum": [
                    "appkey",
                    "accesskey",
                    "basic",
                    "jwt"
                  ]
                }
              },
              "headers": {
                "description": "array of optional http header values that can be passed at the time of invoking the task",
                "type": "object",
                "patternProperties": {
                  "^[A-Za-z][A-Za-z0-9-_]*$": {
                    "type": "string"
                  }
                }
              },
              "appkey": {
                "description": "appkey needed to access the service if security is set to appkey",
                "type": "string"
              },
              "acckey": {
                "description": "access key portion of security credentials",
                "type": "string"
              },
              "secretna": {
                "description": "secret key portion of security credentials",
                "type": "string"
              },
              "jwttoken": {
                "description": "the jwt token value",
                "type": "string"
              }
            }
          }
        }
      },
      "examples": [
        {
          "param": "/recipients",
          "payload": {
            "name": "recipient1",
            "receiver": {
              "url": "https://localhost:8888/values/sample"
            }
          }
        },
        {
          "param": "/clients",
          "payload": {
            "name": "recipient2",
            "receiver": {
              "appserviceconfig": "./appserviceconfig.json",
              "service": "sampleservice",
              "servicepath": "/values/sample"
            }
          }
        }
      ]
    },
    {
      "route": "/recipients",
      "type": "delete",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "DeleteRecipients",
      "description": "Delete all the recipients. This is a dangerous route. Please observe extreme caution when you do this",
      "examples": [
        {
          "param": "/recipients"
        }
      ]
    },
    {
      "route": "/recipients/:recipient",
      "type": "get",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "GetRecipient",
      "description": "Get Specific recipient information",
      "examples": [
        {
          "param": "/recipients/recipient1"
        }
      ]
    },
    {
      "route": "/recipients/:recipient",
      "type": "delete",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "DeleteRecipient",
      "description": "Delete Specific recipient information",
      "examples": [
        {
          "param": "/recipients/recipient1"
        }
      ]
    },
    {
      "route": "/messages",
      "type": "post",
      "configured": true,
      "routeclass": "wsocserver.js",
      "routefunction": "SendMessage",
      "description": "Send a message to all the clients",
      "bodyschema": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": [
              "string",
              "object"
            ],
            "description": "unique name that identifies the client"
          }
        }
      },
      "examples": [
        {
          "param": "/messages",
          "payload": {
            "message": "message from server"
          }
        }
      ]
    }
  ]
}