You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: expand ContentstackEndpoints with OAuth-callable product endpoints - #188
Expands the ContentstackEndpoints type to surface the Contentstack management-plane product endpoints that an app's OAuth token can call via appSdk.api(), beyond the existing APP / CMA / DEVELOPER_HUB.
What changed
src/types/api.type.ts: added optional keys LAUNCH, AUTOMATE, BRAND_KIT, GEN_AI, PERSONALIZE_MANAGEMENT, ASSET_MANAGEMENT. Index signature widened to [key: string]: string | undefined so optional keys are honest. Added JSDoc explaining the OAuth-only rationale and the host-shell injection caveat.
__test__/uiLocation.test.ts: extended the init mock with two new keys (LAUNCH, BRAND_KIT) to exercise the expanded type.
Required vs optional — deliberate choice
APP, CMA, DEVELOPER_HUB stay required: the host shell always injects them today and live apps depend on them. (APP is the web-app URL, not an OAuth API, but kept required for backward compatibility.)
All new keys are optional: they resolve to a URL only when the host shell injects them, and availability varies by region — e.g. ASSET_MANAGEMENT exists only in the AWS North America region (per regions.json). Required keys would make the type lie when the parent omits them.
Runtime caveat (important)
This PR is a type/contract change only. The typed keys resolve to real URLs only when the host shell (Developer Hub / Marketplace UI) injects them into the initialization data at init. Today the shell injects APP / CMA / DEVELOPER_HUB; the companion marketplace-ui PR expands injection to the full OAuth set. Until that ships, the new keys read undefined at runtime — which is the correct "not available in this host/region" signal.
Why only OAuth-callable endpoints
appSdk.api() proxies to the host shell, which attaches the app's OAuth token. Delivery-plane APIs (Content/GraphQL Delivery, Preview, Image/Asset CDN, Personalize Edge) need a separate delivery/preview token, so surfacing them here would be misleading — they are intentionally excluded.
ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.
Check Type
Count (with fixes)
Without fixes
Threshold
Result
🔴 Critical Severity
0
0
10
✅ Passed
🟠 High Severity
0
0
25
✅ Passed
🟡 Medium Severity
11
0
500
✅ Passed
🔵 Low Severity
0
0
1000
✅ Passed
⏱️ SLA Breach Summary
✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.
Severity
Breaches (with fixes)
Breaches (no fixes)
SLA Threshold (with/no fixes)
Status
🔴 Critical
0
0
15 / 30 days
✅ Passed
🟠 High
0
0
30 / 120 days
✅ Passed
🟡 Medium
0
0
90 / 365 days
✅ Passed
🔵 Low
0
0
180 / 365 days
✅ Passed
✅ BUILD PASSED - All security checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands the
ContentstackEndpointstype to surface the Contentstack management-plane product endpoints that an app's OAuth token can call viaappSdk.api(), beyond the existingAPP/CMA/DEVELOPER_HUB.What changed
src/types/api.type.ts: added optional keysLAUNCH,AUTOMATE,BRAND_KIT,GEN_AI,PERSONALIZE_MANAGEMENT,ASSET_MANAGEMENT. Index signature widened to[key: string]: string | undefinedso optional keys are honest. Added JSDoc explaining the OAuth-only rationale and the host-shell injection caveat.__test__/uiLocation.test.ts: extended the init mock with two new keys (LAUNCH,BRAND_KIT) to exercise the expanded type.Required vs optional — deliberate choice
APP,CMA,DEVELOPER_HUBstay required: the host shell always injects them today and live apps depend on them. (APPis the web-app URL, not an OAuth API, but kept required for backward compatibility.)ASSET_MANAGEMENTexists only in the AWS North America region (per regions.json). Required keys would make the type lie when the parent omits them.Runtime caveat (important)
This PR is a type/contract change only. The typed keys resolve to real URLs only when the host shell (Developer Hub / Marketplace UI) injects them into the initialization data at init. Today the shell injects
APP/CMA/DEVELOPER_HUB; the companion marketplace-ui PR expands injection to the full OAuth set. Until that ships, the new keys readundefinedat runtime — which is the correct "not available in this host/region" signal.Why only OAuth-callable endpoints
appSdk.api()proxies to the host shell, which attaches the app's OAuth token. Delivery-plane APIs (Content/GraphQL Delivery, Preview, Image/Asset CDN, Personalize Edge) need a separate delivery/preview token, so surfacing them here would be misleading — they are intentionally excluded.