internal static CamundaEndpointModel Transform(CamundaEndpoint endpoint) => new CamundaEndpointModel
 {
     Code     = endpoint.ActionCode,
     Category = endpoint.CategoryName,
     Action   = endpoint.ActionName,
     Endpoint = $"{endpoint.Method.GetDescription()} {endpoint.Path}"
 };
 internal static CamundaRequest ToEntity(this CamundaRequestModel model, CamundaEndpoint endpoint) => new CamundaRequest
 {
     Endpoint  = endpoint,
     Path      = JsonConvert.DeserializeObject <Dictionary <string, string> >(model.Path),
     Query     = JsonConvert.DeserializeObject <Dictionary <string, string> >(model.Query),
     Body      = model.Body,
     Resources = model.Files?.Select((file, index) => new LocalFile
     {
         Name     = $"file{index}",
         FileName = file.FileName,
         Stream   = file.OpenReadStream()
     }).ToList() ?? new List <LocalFile>()
 };
Пример #3
0
        public async Task <ActionResult <CamundaVersionsModel> > GetSupportedVersion() => await Execute(async operation =>
        {
            var response = await camundaServerService.Send(operation, new CamundaRequest
            {
                Endpoint  = CamundaEndpoint.GetEndpoint(CamundaAction.Version),
                Path      = new Dictionary <string, string>(),
                Query     = new Dictionary <string, string>(),
                Body      = "{}",
                Resources = new List <LocalFile>()
            });

            if (response.IsWithoutErrors())
            {
                return(new CamundaVersionsModel
                {
                    ClientVersion = "7.13.0-alpha5",
                    ServerVersion = JsonConvert.DeserializeObject <Dictionary <string, string> >(response.Output)["version"]
                });
            }

            throw CommonExceptions.FailedToGetCamundaVersion(operation);
        });
Пример #4
0
 public IEnumerable <CamundaEndpointModel> GetSupportedApi() => CamundaEndpoint.GetAll().Select(CamundaEndpointModel.Transform);