-
Notifications
You must be signed in to change notification settings - Fork 22
Add custom hostname support #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
4e866f8
a580791
a72243c
52709e2
90871de
6fb96ae
6224c9c
45d9344
64062b0
49ba70e
6f04630
c1b72b4
c8b9073
25f5c7c
eaeb11c
7ed5bb4
1191572
7b92bc5
cadf3fc
f34cd5f
243bcf9
f7a82fc
8fce771
f22711f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,36 @@ | ||
| import { constants } from '@sitecore-content-sdk/core'; | ||
| import { normalizeUrl } from '@sitecore-content-sdk/core/tools'; | ||
|
|
||
| const { SITECORE_EDGE_URL_DEFAULT } = constants; | ||
| /** | ||
| * Resolves the base Edge URL from config. Caller should pass the resolved Edge URL from config. | ||
| * @param {string} [sitecoreEdgeUrl] - The base Edge URL from config. Defaults to platform URL. | ||
| * @internal | ||
| */ | ||
| const getBaseEdgeUrl = ( | ||
| sitecoreEdgeUrl: string = constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT | ||
| ): string => normalizeUrl(sitecoreEdgeUrl); | ||
|
|
||
| /** | ||
| * Generates a URL for accessing Sitecore Edge Platform Content using the provided endpoint and context ID. | ||
| * @param {string} [sitecoreEdgeUrl] - The base endpoint URL for the Edge Platform. Default is https://edge-platform.sitecorecloud.io | ||
| * @param {string} [sitecoreEdgeUrl] - The base endpoint URL for the Edge Platform (resolved at config level). Defaults to platform URL. | ||
| * @returns {string} The complete URL for accessing content through the Edge Platform. | ||
| * @public | ||
| */ | ||
| export const getEdgeProxyContentUrl = (sitecoreEdgeUrl = SITECORE_EDGE_URL_DEFAULT) => | ||
| `${normalizeUrl(sitecoreEdgeUrl)}/v1/content/api/graphql/v1`; | ||
| export const getEdgeProxyContentUrl = ( | ||
| sitecoreEdgeUrl: string = constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT | ||
| ) => `${getBaseEdgeUrl(sitecoreEdgeUrl)}/v1/content/api/graphql/v1`; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me clarify again the difference between Experience Edge and Edge Platform URLs, as there appears to be a misunderstanding. Experience Edge (https://edge.sitecorecloud.io) Edge Platform (https://edge-platform.sitecorecloud.io) Based on the changes you introduced, Experience Edge is now being referenced when resolving service endpoints. This is not correct. We should continue using the default Edge Platform URL for service-related requests. The Experience Edge URL should be referenced only when replacing media URLs. |
||
|
|
||
| /** | ||
| * Generates a URL for accessing Sitecore Edge Platform Forms using the provided form ID and context ID. | ||
| * @param {string} sitecoreEdgeContextId - The unique context id. | ||
| * @param {string} formId - The unique form id. | ||
| * @param {string} [sitecoreEdgeUrl] - The base endpoint URL for the Edge Platform. Default is https://edge-platform.sitecorecloud.io | ||
| * @param {string} [sitecoreEdgeUrl] - The base endpoint URL for the Edge Platform (resolved at config level). Defaults to platform URL. | ||
| * @returns {string} The complete URL for accessing forms through the Edge Platform. | ||
| * @internal | ||
| */ | ||
| export const getEdgeProxyFormsUrl = ( | ||
| sitecoreEdgeContextId: string, | ||
| formId: string, | ||
| sitecoreEdgeUrl = SITECORE_EDGE_URL_DEFAULT | ||
| sitecoreEdgeUrl: string = constants.SITECORE_EDGE_PLATFORM_URL_DEFAULT | ||
| ) => | ||
| `${normalizeUrl( | ||
| sitecoreEdgeUrl | ||
| )}/v1/forms/publisher/${formId}?sitecoreContextId=${sitecoreEdgeContextId}`; | ||
| `${getBaseEdgeUrl(sitecoreEdgeUrl)}/v1/forms/publisher/${formId}?sitecoreContextId=${sitecoreEdgeContextId}`; | ||
Uh oh!
There was an error while loading. Please reload this page.