Skip to content

Commit

Permalink
fix: added support for retrieving contentTypeId property for a node
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpop-zengenti committed Jan 17, 2024
1 parent 5ccddf2 commit 2cbb28d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static class Headers
// TODO: remove when we deprecate old nodes delivery api
public const string UseNewNodeService = "x-use-new-node-service";

public const string IsLocalRequestHandler = "x-is-local-request-handler";
public const string ServerType = "x-site-type";
public const string LoadBalancerVip = "x-loadbalancer-vip";
public const string IisHostName = "x-iis-hostname";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@
},
"LocalDevelopment_JSON_user": {
"commandName": "Project",
"commandLineArgs": "--port=5100 --alias=develop --project-id=blocksTesting --username=usr1 --password=pwd1 --block-cluster-ingress-ip=127.0.0.1--blocks-json=\"[{\\\"id\\\":\\\"blogs\\\",\\\"baseUri\\\":\\\"http:\\/\\/website.com\\\",\\\"staticPaths\\\":[\\\"image-gallery\\\"],\\\"endpoints\\\":[{\\\"id\\\":\\\"microblogRecord\\\",\\\"path\\\":\\\"\\/\\\"},{\\\"id\\\":\\\"record\\\",\\\"path\\\":\\\"\\/website\\/Record-single-pagelet.html\\\"},{\\\"id\\\":\\\"layout\\\",\\\"path\\\":\\\"\\/website\\/Layout.html\\\"},{\\\"id\\\":\\\"pagelet1\\\",\\\"path\\\":\\\"\\/website\\/pagelet1.html\\\"},{\\\"id\\\":\\\"pagelet2\\\",\\\"path\\\":\\\"\\/website\\/pagelet2.html\\\"},{\\\"id\\\":\\\"pagelet3\\\",\\\"path\\\":\\\"\\/website\\/pagelet3.html\\\"}]}]\" --renderers-json=\"[{\\\"id\\\":\\\"microblogRecord\\\",\\\"assignedContentTypes\\\":[\\\"microblog\\\"],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"microblogRecord\\\"}}]},{\\\"id\\\":\\\"blogRecord\\\",\\\"assignedContentTypes\\\":[\\\"blog\\\"],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"record\\\"}}]},{\\\"id\\\":\\\"layout\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"layout\\\"}}]},{\\\"id\\\":\\\"pagelet1\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet1\\\"}}]},{\\\"id\\\":\\\"pagelet2\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet2\\\"}}]},{\\\"id\\\":\\\"pagelet3\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet3\\\",\\\"version\\\":\\\"live\\\"}}]}]\"",
"commandLineArgs": "--port=5100 --alias=develop --project-id=blocksTesting --username=usr1 --password=pwd1 --block-cluster-ingress-ip=127.0.0.1 --blocks-json=\"[{\\\"id\\\":\\\"blogs\\\",\\\"baseUri\\\":\\\"http:\\/\\/website.com\\\",\\\"staticPaths\\\":[\\\"image-gallery\\\"],\\\"endpoints\\\":[{\\\"id\\\":\\\"microblogRecord\\\",\\\"path\\\":\\\"\\/\\\"},{\\\"id\\\":\\\"record\\\",\\\"path\\\":\\\"\\/website\\/Record-single-pagelet.html\\\"},{\\\"id\\\":\\\"layout\\\",\\\"path\\\":\\\"\\/website\\/Layout.html\\\"},{\\\"id\\\":\\\"pagelet1\\\",\\\"path\\\":\\\"\\/website\\/pagelet1.html\\\"},{\\\"id\\\":\\\"pagelet2\\\",\\\"path\\\":\\\"\\/website\\/pagelet2.html\\\"},{\\\"id\\\":\\\"pagelet3\\\",\\\"path\\\":\\\"\\/website\\/pagelet3.html\\\"}]}]\" --renderers-json=\"[{\\\"id\\\":\\\"microblogRecord\\\",\\\"assignedContentTypes\\\":[\\\"microblog\\\"],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"microblogRecord\\\"}}]},{\\\"id\\\":\\\"blogRecord\\\",\\\"assignedContentTypes\\\":[\\\"blog\\\"],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"record\\\"}}]},{\\\"id\\\":\\\"layout\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"layout\\\"}}]},{\\\"id\\\":\\\"pagelet1\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet1\\\"}}]},{\\\"id\\\":\\\"pagelet2\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet2\\\"}}]},{\\\"id\\\":\\\"pagelet3\\\",\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"blogs\\\",\\\"endpointId\\\":\\\"pagelet3\\\",\\\"version\\\":\\\"live\\\"}}]}]\"",
"launchBrowser": true,
"applicationUrl": "http://localhost:5100",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"LocalDev_Test": {
"commandName": "Project",
"commandLineArgs": "--block-cluster-ingress-ip=127.0.0.1 --alias zenhub-dev --project-api-id contensis --blocks-json \"[{\\\"id\\\":\\\"avatar-service\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-avatar-service-versionno=4\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":4,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"contensis-instance-management\\\",\\\"baseUri\\\":\\\"\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":13,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"contensis-rest-service\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-contensis-rest-service-versionno=31\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":31,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"contensis-website\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-contensis-website-versionno=347\\\",\\\"staticPaths\\\":[\\\"/static\\\"],\\\"endpoints\\\":[],\\\"versionNo\\\":347,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"http-echo\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-http-echo-versionno=2\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":2,\\\"branch\\\":\\\"main\\\"},{\\\"id\\\":\\\"kayako-helpdesk-api\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-kayako-helpdesk-api-versionstatus=live\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":149,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"media-service\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-media-service-versionno=83\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":83,\\\"branch\\\":\\\"main\\\"},{\\\"id\\\":\\\"media-streamer\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-media-streamer-versionno=71\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":71,\\\"branch\\\":\\\"main\\\"},{\\\"id\\\":\\\"si-kayako-helpdesk-api\\\",\\\"baseUri\\\":\\\"\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":6,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"zenhub-dev-crm-service\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-zenhub-dev-crm-service-versionno=3\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":3,\\\"branch\\\":\\\"master\\\"},{\\\"id\\\":\\\"zenhub-dev-readtime-service\\\",\\\"baseUri\\\":\\\"https://preview-contensis-zenhub-dev.cloud.contensis.com?block-zenhub-dev-readtime-service-versionno=7\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":7,\\\"branch\\\":\\\"main\\\"},{\\\"id\\\":\\\"zenhub-free-trials-service\\\",\\\"baseUri\\\":\\\"\\\",\\\"staticPaths\\\":[],\\\"endpoints\\\":[],\\\"versionNo\\\":13,\\\"branch\\\":\\\"master\\\"}]\" --renderers-json \"[{\\\"id\\\":\\\"avatar-service\\\",\\\"name\\\":\\\"avatar-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"avatar-service\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"contensis-instance-management\\\",\\\"name\\\":\\\"contensis-instance-management\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"contensis-instance-management\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"contensis-rest-service\\\",\\\"name\\\":\\\"contensis-rest-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"contensis-rest-service\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"contensis-website\\\",\\\"name\\\":\\\"contensis-website\\\",\\\"assignedContentTypes\\\":[\\\"*\\\"],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"contensis-website\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"http-echo\\\",\\\"name\\\":\\\"http-echo\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"http-echo\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"kayako-helpdesk-api\\\",\\\"name\\\":\\\"kayako-helpdesk-api\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"kayako-helpdesk-api\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"media-service\\\",\\\"name\\\":\\\"media-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"media-service\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"media-streamer\\\",\\\"name\\\":\\\"media-streamer\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"media-streamer\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"si-kayako-helpdesk-api\\\",\\\"name\\\":\\\"si-kayako-helpdesk-api\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"si-kayako-helpdesk-api\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"zenhub-dev-crm-service\\\",\\\"name\\\":\\\"zenhub-dev-crm-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"zenhub-dev-crm-service\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"zenhub-dev-readtime-service\\\",\\\"name\\\":\\\"zenhub-dev-readtime-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"zenhub-dev-readtime-service\\\",\\\"endpointId\\\":null}}]},{\\\"id\\\":\\\"zenhub-free-trials-service\\\",\\\"name\\\":\\\"zenhub-free-trials-service\\\",\\\"assignedContentTypes\\\":[],\\\"rules\\\":[{\\\"return\\\":{\\\"blockId\\\":\\\"zenhub-free-trials-service\\\",\\\"endpointId\\\":null}}]}]\" --username zengenti --password o89x0Y1GzTqM",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Zengenti.Contensis.RequestHandler.Domain.Entities;
using Zengenti.Contensis.RequestHandler.Domain.Common;
using Zengenti.Contensis.RequestHandler.Domain.Entities;
using Zengenti.Contensis.RequestHandler.Domain.Interfaces;
using Zengenti.Contensis.RequestHandler.LocalDevelopment.Models;
using Zengenti.Contensis.RequestHandler.LocalDevelopment.Services.Interfaces;
Expand Down Expand Up @@ -62,6 +63,7 @@ public LocalNodeService(
}
}

_internalRestClient.AddHeader(Constants.Headers.IsLocalRequestHandler, "true");
var restManagementNode = (await _internalRestClient.GetAsync<dynamic>(
$"api/management/projects/{_siteConfigLoader.SiteConfig.ProjectApiId}/nodes/{path.Trim('/')}"))
.ResponseObject;
Expand Down

0 comments on commit 2cbb28d

Please sign in to comment.