@replicated/portal-components 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/metadata/registry.json +2 -2
- package/components/metadata/registry.md +2 -2
- package/dist/actions/change-team.js +66 -7
- package/dist/actions/change-team.js.map +1 -1
- package/dist/actions/index.d.mts +3 -1
- package/dist/actions/index.d.ts +3 -1
- package/dist/actions/index.js +182 -465
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/install-actions.d.mts +3 -1
- package/dist/actions/install-actions.d.ts +3 -1
- package/dist/actions/install-actions.js +58 -5
- package/dist/actions/install-actions.js.map +1 -1
- package/dist/actions/service-account.d.mts +3 -1
- package/dist/actions/service-account.d.ts +3 -1
- package/dist/actions/service-account.js +58 -5
- package/dist/actions/service-account.js.map +1 -1
- package/dist/actions/support-bundles.d.mts +3 -1
- package/dist/actions/support-bundles.d.ts +3 -1
- package/dist/actions/support-bundles.js +58 -5
- package/dist/actions/support-bundles.js.map +1 -1
- package/dist/actions/team-settings.d.mts +3 -1
- package/dist/actions/team-settings.d.ts +3 -1
- package/dist/actions/team-settings.js +91 -27
- package/dist/actions/team-settings.js.map +1 -1
- package/dist/actions/trial-signup.d.mts +24 -0
- package/dist/actions/trial-signup.d.ts +24 -0
- package/dist/actions/trial-signup.js +482 -0
- package/dist/actions/trial-signup.js.map +1 -0
- package/dist/actions/user-settings.d.mts +3 -1
- package/dist/actions/user-settings.d.ts +3 -1
- package/dist/actions/user-settings.js +58 -5
- package/dist/actions/user-settings.js.map +1 -1
- package/dist/airgap-instances.d.mts +3 -1
- package/dist/airgap-instances.d.ts +3 -1
- package/dist/airgap-instances.js +41 -112
- package/dist/airgap-instances.js.map +1 -1
- package/dist/branding-BsMSywts.d.mts +36 -0
- package/dist/branding-BsMSywts.d.ts +36 -0
- package/dist/error-page.js +10 -2
- package/dist/error-page.js.map +1 -1
- package/dist/error.js +10 -2
- package/dist/error.js.map +1 -1
- package/dist/esm/actions/change-team.js +66 -7
- package/dist/esm/actions/change-team.js.map +1 -1
- package/dist/esm/actions/index.js +181 -462
- package/dist/esm/actions/index.js.map +1 -1
- package/dist/esm/actions/install-actions.js +58 -5
- package/dist/esm/actions/install-actions.js.map +1 -1
- package/dist/esm/actions/service-account.js +58 -5
- package/dist/esm/actions/service-account.js.map +1 -1
- package/dist/esm/actions/support-bundles.js +58 -5
- package/dist/esm/actions/support-bundles.js.map +1 -1
- package/dist/esm/actions/team-settings.js +91 -27
- package/dist/esm/actions/team-settings.js.map +1 -1
- package/dist/esm/actions/trial-signup.js +478 -0
- package/dist/esm/actions/trial-signup.js.map +1 -0
- package/dist/esm/actions/user-settings.js +58 -5
- package/dist/esm/actions/user-settings.js.map +1 -1
- package/dist/esm/airgap-instances.js +40 -112
- package/dist/esm/airgap-instances.js.map +1 -1
- package/dist/esm/error-page.js +10 -2
- package/dist/esm/error-page.js.map +1 -1
- package/dist/esm/error.js +10 -2
- package/dist/esm/error.js.map +1 -1
- package/dist/esm/helm-install-wizard.js +118 -79
- package/dist/esm/helm-install-wizard.js.map +1 -1
- package/dist/esm/index.js +706 -438
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/install-actions.js +40 -5
- package/dist/esm/install-actions.js.map +1 -1
- package/dist/esm/install-card.js +9 -6
- package/dist/esm/install-card.js.map +1 -1
- package/dist/esm/install-targets.js +9 -2
- package/dist/esm/install-targets.js.map +1 -1
- package/dist/esm/instance-card.js +39 -111
- package/dist/esm/instance-card.js.map +1 -1
- package/dist/esm/join-team.js +9 -3
- package/dist/esm/join-team.js.map +1 -1
- package/dist/esm/license-card.js +24 -22
- package/dist/esm/license-card.js.map +1 -1
- package/dist/esm/license-details.js +128 -334
- package/dist/esm/license-details.js.map +1 -1
- package/dist/esm/linux-install-wizard.js +95 -41
- package/dist/esm/linux-install-wizard.js.map +1 -1
- package/dist/esm/login.js +20 -4
- package/dist/esm/login.js.map +1 -1
- package/dist/esm/middleware.js +33 -0
- package/dist/esm/middleware.js.map +1 -0
- package/dist/esm/online-instance-list.js +40 -112
- package/dist/esm/online-instance-list.js.map +1 -1
- package/dist/esm/release-history-panel.js +27 -14
- package/dist/esm/release-history-panel.js.map +1 -1
- package/dist/esm/saml-callback-client.js +82 -0
- package/dist/esm/saml-callback-client.js.map +1 -0
- package/dist/esm/saml-handlers.js +138 -0
- package/dist/esm/saml-handlers.js.map +1 -0
- package/dist/esm/security-card.js +53 -38
- package/dist/esm/security-card.js.map +1 -1
- package/dist/esm/service-accounts-tab.js +800 -0
- package/dist/esm/service-accounts-tab.js.map +1 -0
- package/dist/esm/support-bundle-collection-card.js +48 -24
- package/dist/esm/support-bundle-collection-card.js.map +1 -1
- package/dist/esm/support-bundles-card.js +10 -5
- package/dist/esm/support-bundles-card.js.map +1 -1
- package/dist/esm/support-card.js +37 -5
- package/dist/esm/support-card.js.map +1 -1
- package/dist/esm/team-selection.js +5 -1
- package/dist/esm/team-selection.js.map +1 -1
- package/dist/esm/team-settings-card.js +5 -2
- package/dist/esm/team-settings-card.js.map +1 -1
- package/dist/esm/team-settings.js +7 -2
- package/dist/esm/team-settings.js.map +1 -1
- package/dist/esm/top-nav-user-menu.js +5 -1
- package/dist/esm/top-nav-user-menu.js.map +1 -1
- package/dist/esm/top-nav.js +175 -62
- package/dist/esm/top-nav.js.map +1 -1
- package/dist/esm/trial-signup.js +256 -0
- package/dist/esm/trial-signup.js.map +1 -0
- package/dist/esm/update-layout.js +175 -62
- package/dist/esm/update-layout.js.map +1 -1
- package/dist/esm/updates-card.js +15 -4
- package/dist/esm/updates-card.js.map +1 -1
- package/dist/esm/upload-support-bundle-modal.js +9 -4
- package/dist/esm/upload-support-bundle-modal.js.map +1 -1
- package/dist/esm/user-settings-card.js +5 -2
- package/dist/esm/user-settings-card.js.map +1 -1
- package/dist/esm/user-settings.js +12 -6
- package/dist/esm/user-settings.js.map +1 -1
- package/dist/esm/utils/index.js +204 -13
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/fetch-license-iTyF7_GY.d.mts +81 -0
- package/dist/fetch-license-iTyF7_GY.d.ts +81 -0
- package/dist/helm-install-wizard.d.mts +11 -3
- package/dist/helm-install-wizard.d.ts +11 -3
- package/dist/helm-install-wizard.js +118 -79
- package/dist/helm-install-wizard.js.map +1 -1
- package/dist/{index-BAiVrSSR.d.mts → index-DyzJ0yKD.d.mts} +48 -50
- package/dist/{index-DWt-N5od.d.ts → index-sMbq94M7.d.ts} +48 -50
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +726 -438
- package/dist/index.js.map +1 -1
- package/dist/install-actions.d.mts +4 -2
- package/dist/install-actions.d.ts +4 -2
- package/dist/install-actions.js +40 -5
- package/dist/install-actions.js.map +1 -1
- package/dist/install-card.d.mts +2 -3
- package/dist/install-card.d.ts +2 -3
- package/dist/install-card.js +9 -6
- package/dist/install-card.js.map +1 -1
- package/dist/install-targets.js +9 -2
- package/dist/install-targets.js.map +1 -1
- package/dist/instance-card.d.mts +3 -1
- package/dist/instance-card.d.ts +3 -1
- package/dist/instance-card.js +40 -111
- package/dist/instance-card.js.map +1 -1
- package/dist/join-team.js +9 -3
- package/dist/join-team.js.map +1 -1
- package/dist/license-card.d.mts +2 -3
- package/dist/license-card.d.ts +2 -3
- package/dist/license-card.js +24 -22
- package/dist/license-card.js.map +1 -1
- package/dist/license-details.js +128 -334
- package/dist/license-details.js.map +1 -1
- package/dist/linux-install-wizard.d.mts +9 -3
- package/dist/linux-install-wizard.d.ts +9 -3
- package/dist/linux-install-wizard.js +95 -41
- package/dist/linux-install-wizard.js.map +1 -1
- package/dist/login.d.mts +4 -0
- package/dist/login.d.ts +4 -0
- package/dist/login.js +20 -4
- package/dist/login.js.map +1 -1
- package/dist/middleware.d.mts +13 -0
- package/dist/middleware.d.ts +13 -0
- package/dist/middleware.js +35 -0
- package/dist/middleware.js.map +1 -0
- package/dist/online-instance-list.d.mts +3 -1
- package/dist/online-instance-list.d.ts +3 -1
- package/dist/online-instance-list.js +41 -112
- package/dist/online-instance-list.js.map +1 -1
- package/dist/pending-installations.d.mts +3 -1
- package/dist/pending-installations.d.ts +3 -1
- package/dist/release-history-panel.js +27 -14
- package/dist/release-history-panel.js.map +1 -1
- package/dist/saml-callback-client.d.mts +36 -0
- package/dist/saml-callback-client.d.ts +36 -0
- package/dist/saml-callback-client.js +88 -0
- package/dist/saml-callback-client.js.map +1 -0
- package/dist/saml-handlers.d.mts +50 -0
- package/dist/saml-handlers.d.ts +50 -0
- package/dist/saml-handlers.js +141 -0
- package/dist/saml-handlers.js.map +1 -0
- package/dist/security-card.d.mts +3 -1
- package/dist/security-card.d.ts +3 -1
- package/dist/security-card.js +53 -38
- package/dist/security-card.js.map +1 -1
- package/dist/service-accounts-tab.d.mts +51 -0
- package/dist/service-accounts-tab.d.ts +51 -0
- package/dist/service-accounts-tab.js +802 -0
- package/dist/service-accounts-tab.js.map +1 -0
- package/dist/styles.css +375 -127
- package/dist/support-bundle-collection-card.d.mts +1 -1
- package/dist/support-bundle-collection-card.d.ts +1 -1
- package/dist/support-bundle-collection-card.js +47 -23
- package/dist/support-bundle-collection-card.js.map +1 -1
- package/dist/support-bundles-card.d.mts +4 -2
- package/dist/support-bundles-card.d.ts +4 -2
- package/dist/support-bundles-card.js +10 -5
- package/dist/support-bundles-card.js.map +1 -1
- package/dist/support-card.js +37 -5
- package/dist/support-card.js.map +1 -1
- package/dist/team-selection.js +5 -1
- package/dist/team-selection.js.map +1 -1
- package/dist/team-settings-card.js +5 -2
- package/dist/team-settings-card.js.map +1 -1
- package/dist/team-settings.js +7 -2
- package/dist/team-settings.js.map +1 -1
- package/dist/{top-nav-IRIn66wS.d.ts → top-nav-BUQAGoG1.d.mts} +14 -2
- package/dist/{top-nav-IRIn66wS.d.mts → top-nav-CEqw0KpO.d.ts} +14 -2
- package/dist/top-nav-user-menu.js +5 -1
- package/dist/top-nav-user-menu.js.map +1 -1
- package/dist/top-nav.d.mts +2 -1
- package/dist/top-nav.d.ts +2 -1
- package/dist/top-nav.js +175 -62
- package/dist/top-nav.js.map +1 -1
- package/dist/trial-signup.d.mts +31 -0
- package/dist/trial-signup.d.ts +31 -0
- package/dist/trial-signup.js +258 -0
- package/dist/trial-signup.js.map +1 -0
- package/dist/update-layout.js +175 -62
- package/dist/update-layout.js.map +1 -1
- package/dist/updates-card.js +15 -4
- package/dist/updates-card.js.map +1 -1
- package/dist/upload-support-bundle-modal.js +9 -4
- package/dist/upload-support-bundle-modal.js.map +1 -1
- package/dist/user-settings-card.js +5 -2
- package/dist/user-settings-card.js.map +1 -1
- package/dist/user-settings.js +12 -6
- package/dist/user-settings.js.map +1 -1
- package/dist/utils/index.d.mts +74 -16
- package/dist/utils/index.d.ts +74 -16
- package/dist/utils/index.js +215 -12
- package/dist/utils/index.js.map +1 -1
- package/package.json +37 -2
package/dist/actions/index.js
CHANGED
|
@@ -120,6 +120,9 @@ var init_tracer = __esm({
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
// src/utils/api-client.ts
|
|
123
|
+
function isRedirectError(error) {
|
|
124
|
+
return typeof error === "object" && error !== null && "digest" in error && typeof error.digest === "string" && error.digest.startsWith("NEXT_REDIRECT");
|
|
125
|
+
}
|
|
123
126
|
async function authenticatedFetch(url, options = {}) {
|
|
124
127
|
const { token, ...fetchOptions } = options;
|
|
125
128
|
const headers = new Headers(fetchOptions.headers);
|
|
@@ -142,8 +145,17 @@ async function handle401() {
|
|
|
142
145
|
const { redirect } = await import('next/navigation');
|
|
143
146
|
return redirect("/?expired=1");
|
|
144
147
|
}
|
|
148
|
+
function isErrorPage(url) {
|
|
149
|
+
try {
|
|
150
|
+
const urlObj = new URL(url);
|
|
151
|
+
return urlObj.pathname === "/error";
|
|
152
|
+
} catch {
|
|
153
|
+
return url === "/error" || url.startsWith("/error?");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
145
156
|
async function handleServerError(statusCode) {
|
|
146
157
|
const { redirect } = await import('next/navigation');
|
|
158
|
+
const { cookies: cookies9 } = await import('next/headers');
|
|
147
159
|
let sourceUrl;
|
|
148
160
|
try {
|
|
149
161
|
const { headers } = await import('next/headers');
|
|
@@ -151,12 +163,20 @@ async function handleServerError(statusCode) {
|
|
|
151
163
|
const referer = headersList.get("referer");
|
|
152
164
|
const host = headersList.get("host");
|
|
153
165
|
const pathname = headersList.get("x-invoke-path") || headersList.get("x-forwarded-path");
|
|
154
|
-
if (referer) {
|
|
166
|
+
if (referer && !isErrorPage(referer)) {
|
|
155
167
|
sourceUrl = referer;
|
|
156
168
|
} else if (host && pathname) {
|
|
157
169
|
const protocol = headersList.get("x-forwarded-proto") || "https";
|
|
158
170
|
sourceUrl = `${protocol}://${host}${pathname}`;
|
|
159
171
|
}
|
|
172
|
+
if (!sourceUrl || isErrorPage(sourceUrl)) {
|
|
173
|
+
const cookieStore = await cookies9();
|
|
174
|
+
const preservedSource = cookieStore.get("portal_error_source");
|
|
175
|
+
if (preservedSource?.value) {
|
|
176
|
+
sourceUrl = decodeURIComponent(preservedSource.value);
|
|
177
|
+
cookieStore.delete("portal_error_source");
|
|
178
|
+
}
|
|
179
|
+
}
|
|
160
180
|
} catch (error) {
|
|
161
181
|
console.debug("[portal-components] Could not determine source URL", error);
|
|
162
182
|
}
|
|
@@ -225,6 +245,81 @@ function traceServerAction(name, fn) {
|
|
|
225
245
|
};
|
|
226
246
|
return traced;
|
|
227
247
|
}
|
|
248
|
+
var deriveInstallMethods = (licenseData) => {
|
|
249
|
+
const methods = [];
|
|
250
|
+
if (licenseData.isKotsInstallEnabled) {
|
|
251
|
+
methods.push("Replicated KOTS");
|
|
252
|
+
}
|
|
253
|
+
if (licenseData.isHelmInstallEnabled) {
|
|
254
|
+
methods.push("Helm");
|
|
255
|
+
}
|
|
256
|
+
if (licenseData.isHelmAirgapEnabled) {
|
|
257
|
+
methods.push("Helm Airgap");
|
|
258
|
+
}
|
|
259
|
+
if (licenseData.isEmbeddedClusterDownloadEnabled || licenseData.isEmbeddedClusterMultiNodeEnabled) {
|
|
260
|
+
methods.push("Embedded Cluster");
|
|
261
|
+
}
|
|
262
|
+
if (licenseData.isKurlInstallEnabled) {
|
|
263
|
+
methods.push("kURL");
|
|
264
|
+
}
|
|
265
|
+
if (licenseData.isGitopsSupported) {
|
|
266
|
+
methods.push("GitOps");
|
|
267
|
+
}
|
|
268
|
+
return Array.from(new Set(methods));
|
|
269
|
+
};
|
|
270
|
+
var convertEntitlementsToFields = (entitlementFields, entitlementValues) => {
|
|
271
|
+
const valuesMap = /* @__PURE__ */ new Map();
|
|
272
|
+
entitlementValues.forEach((ev) => {
|
|
273
|
+
valuesMap.set(ev.name, ev.value);
|
|
274
|
+
});
|
|
275
|
+
return entitlementFields.filter((field) => field.hidden === 0).map((field) => ({
|
|
276
|
+
key: field.name,
|
|
277
|
+
label: field.title || field.name,
|
|
278
|
+
value: valuesMap.get(field.name) || field.defaultVal || null,
|
|
279
|
+
isSecret: field.type === "Password"
|
|
280
|
+
}));
|
|
281
|
+
};
|
|
282
|
+
async function fetchLicenseCore() {
|
|
283
|
+
const sessionStore = await headers.cookies();
|
|
284
|
+
const session = sessionStore.get("portal_session");
|
|
285
|
+
const token = session?.value;
|
|
286
|
+
if (!token) {
|
|
287
|
+
throw new Error("No session found - user must be authenticated");
|
|
288
|
+
}
|
|
289
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
290
|
+
if (process.env.NODE_ENV !== "production") {
|
|
291
|
+
console.debug("[portal-components] fetching license via %s (Enterprise Portal API)", endpoint);
|
|
292
|
+
}
|
|
293
|
+
const response = await authenticatedFetch(endpoint, {
|
|
294
|
+
method: "GET",
|
|
295
|
+
token,
|
|
296
|
+
headers: {
|
|
297
|
+
Accept: "application/json"
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
if (!response.ok) {
|
|
301
|
+
throw new Error(
|
|
302
|
+
`License request failed (${response.status} ${response.statusText})`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
const envelope = await response.json();
|
|
306
|
+
const licenseData = envelope.data;
|
|
307
|
+
const license = {
|
|
308
|
+
...licenseData,
|
|
309
|
+
// Alias fields for backward compatibility
|
|
310
|
+
expiresAt: licenseData.expireAt,
|
|
311
|
+
environment: licenseData.licenseType,
|
|
312
|
+
// Extract channel names from channels array
|
|
313
|
+
releaseChannels: (licenseData.channels || []).map((ch) => ch.channelName),
|
|
314
|
+
// Derive install methods from feature flags
|
|
315
|
+
installMethods: deriveInstallMethods(licenseData),
|
|
316
|
+
// Convert entitlements to fields format
|
|
317
|
+
fields: convertEntitlementsToFields(licenseData.entitlementFields || [], licenseData.entitlementValues || [])
|
|
318
|
+
};
|
|
319
|
+
return license;
|
|
320
|
+
}
|
|
321
|
+
var fetchLicenseImpl = react.cache(fetchLicenseCore);
|
|
322
|
+
var fetchLicense = fetchLicenseImpl;
|
|
228
323
|
|
|
229
324
|
// src/actions/install.ts
|
|
230
325
|
async function fetchChannelReleases(input, context) {
|
|
@@ -592,21 +687,19 @@ async function fetchAppInfoImpl() {
|
|
|
592
687
|
if (branding?.brandingData) {
|
|
593
688
|
const decoded = buffer.Buffer.from(branding.brandingData, "base64").toString("utf-8");
|
|
594
689
|
const brandingObj = JSON.parse(decoded);
|
|
595
|
-
|
|
690
|
+
if (brandingObj.title) {
|
|
691
|
+
appName = brandingObj.title;
|
|
692
|
+
}
|
|
596
693
|
}
|
|
597
694
|
} catch (error) {
|
|
598
695
|
console.error("[fetch-app-info] fetchCustomBranding failed", error);
|
|
599
696
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
channelName = channel;
|
|
606
|
-
}
|
|
697
|
+
const license = await fetchLicense();
|
|
698
|
+
if (license?.releaseChannels && license.releaseChannels.length > 0) {
|
|
699
|
+
const channel = license.releaseChannels[0];
|
|
700
|
+
if (channel) {
|
|
701
|
+
channelName = channel;
|
|
607
702
|
}
|
|
608
|
-
} catch (error) {
|
|
609
|
-
console.error("[fetch-app-info] fetchLicenseDetails failed", error);
|
|
610
703
|
}
|
|
611
704
|
return { appName, channelName };
|
|
612
705
|
}
|
|
@@ -796,35 +889,46 @@ async function deprovisionSamlActionImpl() {
|
|
|
796
889
|
return { success: true };
|
|
797
890
|
}
|
|
798
891
|
var deprovisionSamlAction = traceServerAction("deprovisionSamlAction", deprovisionSamlActionImpl);
|
|
799
|
-
async function
|
|
892
|
+
async function fetchAppFeaturesImpl() {
|
|
800
893
|
const sessionStore = await headers.cookies();
|
|
801
894
|
const session = sessionStore.get("portal_session");
|
|
802
|
-
if (!session?.value) {
|
|
803
|
-
return false;
|
|
804
|
-
}
|
|
805
895
|
const appSlug = process.env.PORTAL_APP_SLUG;
|
|
806
896
|
if (!appSlug) {
|
|
807
|
-
|
|
897
|
+
throw new Error("PORTAL_APP_SLUG is not configured");
|
|
808
898
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
const response = await fetch(url, {
|
|
817
|
-
headers: {
|
|
818
|
-
Accept: "application/json"
|
|
899
|
+
const params = new URLSearchParams({ app_slug: appSlug });
|
|
900
|
+
if (session?.value) {
|
|
901
|
+
try {
|
|
902
|
+
const payload = decodeJwtPayload(session.value);
|
|
903
|
+
const customerId = payload?.customer_id;
|
|
904
|
+
if (customerId) {
|
|
905
|
+
params.set("customer_id", customerId);
|
|
819
906
|
}
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
907
|
+
} catch {
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
const url = `${getApiOrigin()}/enterprise-portal/public/app-features?${params.toString()}`;
|
|
911
|
+
const response = await fetch(url, {
|
|
912
|
+
headers: {
|
|
913
|
+
Accept: "application/json"
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
if (!response.ok) {
|
|
917
|
+
throw new Error(`Failed to fetch app features: ${response.status} ${response.statusText}`);
|
|
825
918
|
}
|
|
919
|
+
const data = await response.json();
|
|
920
|
+
return {
|
|
921
|
+
epEnabled: data.ep_enabled ?? false,
|
|
922
|
+
trialSignupEnabled: data.trial_signup_enabled ?? false,
|
|
923
|
+
trialExpirationDays: data.trial_expiration_days ?? 30,
|
|
924
|
+
licenseType: data.license_type ?? "trial",
|
|
925
|
+
termsAndConditionsUrl: data.terms_and_conditions_url ?? "",
|
|
926
|
+
epSecurityCenterEnabled: data.ep_security_center_enabled ?? false,
|
|
927
|
+
epSamlAuthEnabled: data.ep_saml_auth_enabled ?? false,
|
|
928
|
+
epHideSupportBundleUploadEnabled: data.ep_hide_support_bundle_upload_enabled ?? false
|
|
929
|
+
};
|
|
826
930
|
}
|
|
827
|
-
var
|
|
931
|
+
var fetchAppFeatures = traceServerAction("fetchAppFeatures", fetchAppFeaturesImpl);
|
|
828
932
|
async function fetchCurrentUserActionImpl() {
|
|
829
933
|
const sessionStore = await headers.cookies();
|
|
830
934
|
const session = sessionStore.get("portal_session");
|
|
@@ -935,10 +1039,10 @@ async function fetchCustomersForMenuImpl() {
|
|
|
935
1039
|
const token = session.value;
|
|
936
1040
|
const currentCustomerId = getCustomerIdFromToken(token);
|
|
937
1041
|
const endpoint = `${getApiOrigin()}/enterprise-portal/user`;
|
|
938
|
-
const response = await
|
|
1042
|
+
const response = await authenticatedFetch(endpoint, {
|
|
939
1043
|
method: "GET",
|
|
1044
|
+
token,
|
|
940
1045
|
headers: {
|
|
941
|
-
Authorization: `Bearer ${token}`,
|
|
942
1046
|
Accept: "application/json"
|
|
943
1047
|
}
|
|
944
1048
|
});
|
|
@@ -957,6 +1061,9 @@ async function fetchCustomersForMenuImpl() {
|
|
|
957
1061
|
currentCustomerId
|
|
958
1062
|
};
|
|
959
1063
|
} catch (error) {
|
|
1064
|
+
if (isRedirectError(error)) {
|
|
1065
|
+
throw error;
|
|
1066
|
+
}
|
|
960
1067
|
console.error("[fetch-customers-for-menu] Failed to fetch customers:", error);
|
|
961
1068
|
return { customers: [] };
|
|
962
1069
|
}
|
|
@@ -1086,10 +1193,10 @@ async function fetchUserCore() {
|
|
|
1086
1193
|
}
|
|
1087
1194
|
try {
|
|
1088
1195
|
const endpoint = `${getApiOrigin()}/enterprise-portal/user`;
|
|
1089
|
-
const response = await
|
|
1196
|
+
const response = await authenticatedFetch(endpoint, {
|
|
1090
1197
|
method: "GET",
|
|
1198
|
+
token,
|
|
1091
1199
|
headers: {
|
|
1092
|
-
Authorization: `Bearer ${token}`,
|
|
1093
1200
|
Accept: "application/json"
|
|
1094
1201
|
}
|
|
1095
1202
|
});
|
|
@@ -1103,6 +1210,9 @@ async function fetchUserCore() {
|
|
|
1103
1210
|
}
|
|
1104
1211
|
return data;
|
|
1105
1212
|
} catch (error) {
|
|
1213
|
+
if (isRedirectError(error)) {
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1106
1216
|
console.error("[fetch-user] Error fetching from API:", error);
|
|
1107
1217
|
return {};
|
|
1108
1218
|
}
|
|
@@ -1286,11 +1396,15 @@ var fetchCustomBrandingImpl = async () => {
|
|
|
1286
1396
|
const payload = await response.json();
|
|
1287
1397
|
const brandingObject = {
|
|
1288
1398
|
logo: payload.logoUrl,
|
|
1289
|
-
title: payload.
|
|
1290
|
-
|
|
1291
|
-
|
|
1399
|
+
title: payload.title,
|
|
1400
|
+
primaryColor: payload.primaryColor,
|
|
1401
|
+
secondaryColor: payload.secondaryColor,
|
|
1292
1402
|
favicon: payload.faviconUrl,
|
|
1293
|
-
supportPortalLink: payload.supportPortalLink || ""
|
|
1403
|
+
supportPortalLink: payload.supportPortalLink || "",
|
|
1404
|
+
background: payload.background,
|
|
1405
|
+
backgroundImage: payload.backgroundImage,
|
|
1406
|
+
customColor1: payload.customColor1,
|
|
1407
|
+
customColor2: payload.customColor2
|
|
1294
1408
|
};
|
|
1295
1409
|
const brandingData = buffer.Buffer.from(JSON.stringify(brandingObject)).toString("base64");
|
|
1296
1410
|
return {
|
|
@@ -1553,433 +1667,38 @@ var uploadSupportBundle = defineServerAction({
|
|
|
1553
1667
|
var getSupportBundleUploadUrl = (appId) => {
|
|
1554
1668
|
return `${getApiOrigin()}/enterprise-portal/support-bundles/upload/${encodeURIComponent(appId)}`;
|
|
1555
1669
|
};
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
throw new Error("List releases requires a session token");
|
|
1564
|
-
}
|
|
1565
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/releases`;
|
|
1566
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1567
|
-
console.debug("[portal-components] fetching releases via %s (Enterprise Portal API)", endpoint);
|
|
1568
|
-
}
|
|
1569
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1570
|
-
method: "GET",
|
|
1571
|
-
token,
|
|
1572
|
-
headers: {
|
|
1573
|
-
accept: "application/json"
|
|
1574
|
-
},
|
|
1575
|
-
signal: context?.signal
|
|
1576
|
-
});
|
|
1577
|
-
const bodyText = await response.text().catch((error) => {
|
|
1578
|
-
console.warn("[portal-components] listReleases read error", error);
|
|
1579
|
-
return null;
|
|
1580
|
-
});
|
|
1581
|
-
if (!response.ok) {
|
|
1582
|
-
throw new Error(
|
|
1583
|
-
`List releases request failed (${response.status} ${response.statusText})`
|
|
1584
|
-
);
|
|
1585
|
-
}
|
|
1586
|
-
return {
|
|
1587
|
-
status: response.status,
|
|
1588
|
-
body: bodyText
|
|
1589
|
-
};
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
var asRecord = (value) => {
|
|
1593
|
-
if (value && typeof value === "object") {
|
|
1594
|
-
return value;
|
|
1595
|
-
}
|
|
1596
|
-
return void 0;
|
|
1597
|
-
};
|
|
1598
|
-
var getValue = (record, key) => record ? record[key] : void 0;
|
|
1599
|
-
var getString = (record, key) => {
|
|
1600
|
-
const value = getValue(record, key);
|
|
1601
|
-
return typeof value === "string" ? value : void 0;
|
|
1602
|
-
};
|
|
1603
|
-
var getBoolean = (record, key) => {
|
|
1604
|
-
const value = getValue(record, key);
|
|
1605
|
-
if (typeof value === "boolean") {
|
|
1606
|
-
return value;
|
|
1607
|
-
}
|
|
1608
|
-
if (typeof value === "number") {
|
|
1609
|
-
return value === 1;
|
|
1610
|
-
}
|
|
1611
|
-
if (typeof value === "string") {
|
|
1612
|
-
const normalized = value.trim().toLowerCase();
|
|
1613
|
-
if (["true", "1", "yes"].includes(normalized)) {
|
|
1614
|
-
return true;
|
|
1615
|
-
}
|
|
1616
|
-
if (["false", "0", "no"].includes(normalized)) {
|
|
1617
|
-
return false;
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
return void 0;
|
|
1621
|
-
};
|
|
1622
|
-
var toDisplayValue = (value) => {
|
|
1623
|
-
if (value === null || value === void 0) {
|
|
1624
|
-
return null;
|
|
1625
|
-
}
|
|
1626
|
-
if (typeof value === "string") {
|
|
1627
|
-
return value;
|
|
1628
|
-
}
|
|
1629
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
1630
|
-
return String(value);
|
|
1631
|
-
}
|
|
1632
|
-
try {
|
|
1633
|
-
return JSON.stringify(value);
|
|
1634
|
-
} catch {
|
|
1635
|
-
return String(value);
|
|
1636
|
-
}
|
|
1637
|
-
};
|
|
1638
|
-
var normalizeStringArray = (value) => {
|
|
1639
|
-
if (Array.isArray(value)) {
|
|
1640
|
-
const normalized = value.map(
|
|
1641
|
-
(item) => typeof item === "string" ? item.trim() : ""
|
|
1642
|
-
).filter((item) => item.length > 0);
|
|
1643
|
-
return normalized.length ? normalized : void 0;
|
|
1644
|
-
}
|
|
1645
|
-
if (typeof value === "string") {
|
|
1646
|
-
const normalized = value.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
1647
|
-
return normalized.length ? normalized : void 0;
|
|
1648
|
-
}
|
|
1649
|
-
return void 0;
|
|
1650
|
-
};
|
|
1651
|
-
var normalizeLicenseFields = (input) => {
|
|
1652
|
-
if (!input) {
|
|
1653
|
-
return [];
|
|
1654
|
-
}
|
|
1655
|
-
if (Array.isArray(input)) {
|
|
1656
|
-
return input.map((field, index) => {
|
|
1657
|
-
if (!field || typeof field !== "object") {
|
|
1658
|
-
return null;
|
|
1659
|
-
}
|
|
1660
|
-
const candidate = field;
|
|
1661
|
-
const key = typeof candidate.key === "string" && candidate.key.trim().length ? candidate.key.trim() : typeof candidate.name === "string" && candidate.name.trim().length ? candidate.name.trim() : typeof candidate.label === "string" && candidate.label.trim().length ? candidate.label.trim() : `field-${index}`;
|
|
1662
|
-
const label = typeof candidate.label === "string" && candidate.label.trim().length ? candidate.label.trim() : typeof candidate.name === "string" && candidate.name.trim().length ? candidate.name.trim() : key;
|
|
1663
|
-
let value = candidate.value ?? candidate.data ?? candidate.content;
|
|
1664
|
-
if ((value === void 0 || value === null) && typeof candidate.text === "string") {
|
|
1665
|
-
value = candidate.text;
|
|
1666
|
-
}
|
|
1667
|
-
if ((value === void 0 || value === null) && typeof candidate.defaultValue === "string") {
|
|
1668
|
-
value = candidate.defaultValue;
|
|
1669
|
-
}
|
|
1670
|
-
const isSecret = Boolean(
|
|
1671
|
-
candidate.isSecret ?? candidate.secret ?? candidate.masked
|
|
1672
|
-
);
|
|
1673
|
-
const resolved = toDisplayValue(value);
|
|
1674
|
-
return {
|
|
1675
|
-
key,
|
|
1676
|
-
label,
|
|
1677
|
-
value: resolved,
|
|
1678
|
-
isSecret
|
|
1679
|
-
};
|
|
1680
|
-
}).filter((field) => Boolean(field));
|
|
1681
|
-
}
|
|
1682
|
-
if (typeof input === "object") {
|
|
1683
|
-
return Object.entries(input).map(
|
|
1684
|
-
([key, value]) => {
|
|
1685
|
-
let resolvedValue = value;
|
|
1686
|
-
let isSecret = false;
|
|
1687
|
-
if (value && typeof value === "object") {
|
|
1688
|
-
const obj = value;
|
|
1689
|
-
if ("value" in obj) {
|
|
1690
|
-
resolvedValue = obj.value;
|
|
1691
|
-
}
|
|
1692
|
-
isSecret = Boolean(obj.isSecret ?? obj.secret ?? obj.masked);
|
|
1693
|
-
}
|
|
1694
|
-
const normalized = toDisplayValue(resolvedValue);
|
|
1695
|
-
return {
|
|
1696
|
-
key,
|
|
1697
|
-
label: key,
|
|
1698
|
-
value: normalized,
|
|
1699
|
-
isSecret
|
|
1700
|
-
};
|
|
1701
|
-
}
|
|
1702
|
-
);
|
|
1670
|
+
async function listReleasesImpl() {
|
|
1671
|
+
const { cookies: cookies9 } = await import('next/headers');
|
|
1672
|
+
const sessionStore = await cookies9();
|
|
1673
|
+
const session = sessionStore.get("portal_session");
|
|
1674
|
+
const token = session?.value;
|
|
1675
|
+
if (!token) {
|
|
1676
|
+
throw new Error("List releases requires a session token");
|
|
1703
1677
|
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
if (!Array.isArray(input)) {
|
|
1708
|
-
return void 0;
|
|
1678
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/releases`;
|
|
1679
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1680
|
+
console.debug("[portal-components] fetching releases via %s (Enterprise Portal API)", endpoint);
|
|
1709
1681
|
}
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
if (!record) {
|
|
1716
|
-
return null;
|
|
1717
|
-
}
|
|
1718
|
-
return getString(record, "name") ?? getString(record, "channelName") ?? getString(record, "channel") ?? getString(record, "channelSlug") ?? getString(record, "slug") ?? void 0;
|
|
1719
|
-
}).filter((name) => Boolean(name && name.length));
|
|
1720
|
-
return names.length ? names : void 0;
|
|
1721
|
-
};
|
|
1722
|
-
var normalizeEntitlementFields = (fieldsInput, valuesInput) => {
|
|
1723
|
-
const valuesMap = /* @__PURE__ */ new Map();
|
|
1724
|
-
const assignValue = (key, value) => {
|
|
1725
|
-
if (!key) {
|
|
1726
|
-
return;
|
|
1682
|
+
const response = await authenticatedFetch(endpoint, {
|
|
1683
|
+
method: "GET",
|
|
1684
|
+
token,
|
|
1685
|
+
headers: {
|
|
1686
|
+
accept: "application/json"
|
|
1727
1687
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
const record = asRecord(item);
|
|
1733
|
-
if (!record) {
|
|
1734
|
-
if (typeof item === "string") {
|
|
1735
|
-
assignValue(item, item);
|
|
1736
|
-
}
|
|
1737
|
-
return;
|
|
1738
|
-
}
|
|
1739
|
-
const key = getString(record, "name") ?? getString(record, "field") ?? getString(record, "title") ?? getString(record, "label") ?? getString(record, "slug") ?? (() => {
|
|
1740
|
-
const idValue = getValue(record, "id");
|
|
1741
|
-
if (typeof idValue === "string" || typeof idValue === "number") {
|
|
1742
|
-
return String(idValue);
|
|
1743
|
-
}
|
|
1744
|
-
return void 0;
|
|
1745
|
-
})();
|
|
1746
|
-
const value = getValue(record, "value") ?? getValue(record, "currentValue") ?? getValue(record, "entitlementValue") ?? getValue(record, "content") ?? getValue(record, "data") ?? getValue(record, "defaultVal") ?? getValue(record, "defaultValue");
|
|
1747
|
-
assignValue(key, value);
|
|
1748
|
-
});
|
|
1749
|
-
} else if (valuesInput && typeof valuesInput === "object") {
|
|
1750
|
-
Object.entries(valuesInput).forEach(
|
|
1751
|
-
([key, value]) => assignValue(key, value)
|
|
1688
|
+
});
|
|
1689
|
+
if (!response.ok) {
|
|
1690
|
+
throw new Error(
|
|
1691
|
+
`List releases request failed (${response.status} ${response.statusText})`
|
|
1752
1692
|
);
|
|
1753
1693
|
}
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
return;
|
|
1760
|
-
}
|
|
1761
|
-
const baseKey = getString(record, "name") ?? getString(record, "field") ?? getString(record, "slug") ?? `entitlement-${index}`;
|
|
1762
|
-
const key = `entitlement-${baseKey}`;
|
|
1763
|
-
const label = getString(record, "title") ?? getString(record, "label") ?? baseKey;
|
|
1764
|
-
const defaultValue = getString(record, "defaultVal") ?? getString(record, "default") ?? getString(record, "defaultValue");
|
|
1765
|
-
const value = valuesMap.get(baseKey) ?? valuesMap.get(label) ?? defaultValue ?? null;
|
|
1766
|
-
const isSecret = Boolean(
|
|
1767
|
-
getBoolean(record, "secret") ?? getBoolean(record, "isSecret") ?? getBoolean(record, "masked")
|
|
1768
|
-
);
|
|
1769
|
-
normalized.push({
|
|
1770
|
-
key,
|
|
1771
|
-
label,
|
|
1772
|
-
value,
|
|
1773
|
-
isSecret
|
|
1774
|
-
});
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1777
|
-
valuesMap.forEach((value, key) => {
|
|
1778
|
-
const normalizedKey = `entitlement-${key}`;
|
|
1779
|
-
if (!normalized.some((field) => field.key === normalizedKey)) {
|
|
1780
|
-
normalized.push({
|
|
1781
|
-
key: normalizedKey,
|
|
1782
|
-
label: key,
|
|
1783
|
-
value
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
});
|
|
1787
|
-
return normalized;
|
|
1788
|
-
};
|
|
1789
|
-
var normalizeLicensePayload = (payload) => {
|
|
1790
|
-
const payloadRecord = asRecord(payload);
|
|
1791
|
-
const rootRecord = asRecord(getValue(payloadRecord, "license")) ?? asRecord(getValue(payloadRecord, "data")) ?? payloadRecord ?? {};
|
|
1792
|
-
const sourceRecord = asRecord(getValue(rootRecord, "metadata")) ?? rootRecord;
|
|
1793
|
-
const customer = asRecord(getValue(rootRecord, "customer")) ?? asRecord(getValue(sourceRecord, "customer")) ?? asRecord(getValue(payloadRecord, "customer")) ?? {};
|
|
1794
|
-
let releaseChannels = normalizeStringArray(
|
|
1795
|
-
getValue(rootRecord, "releaseChannels") ?? getValue(sourceRecord, "releaseChannels") ?? getValue(sourceRecord, "channels") ?? getValue(rootRecord, "channels") ?? getValue(sourceRecord, "channel") ?? getValue(rootRecord, "channel")
|
|
1796
|
-
) ?? void 0;
|
|
1797
|
-
if (!releaseChannels) {
|
|
1798
|
-
releaseChannels = extractChannelNames(getValue(rootRecord, "channels")) ?? extractChannelNames(getValue(sourceRecord, "channels")) ?? void 0;
|
|
1799
|
-
}
|
|
1800
|
-
let installMethods = normalizeStringArray(
|
|
1801
|
-
getValue(rootRecord, "installMethods") ?? getValue(sourceRecord, "installMethods") ?? getValue(sourceRecord, "install_options") ?? getValue(rootRecord, "install_options") ?? getValue(sourceRecord, "installOptions")
|
|
1802
|
-
) ?? void 0;
|
|
1803
|
-
if (!installMethods || installMethods.length === 0) {
|
|
1804
|
-
const resolved = [];
|
|
1805
|
-
const flag = (key) => getBoolean(rootRecord, key) ?? getBoolean(sourceRecord, key) ?? false;
|
|
1806
|
-
if (flag("isKotsInstallEnabled")) {
|
|
1807
|
-
resolved.push("Replicated KOTS");
|
|
1808
|
-
}
|
|
1809
|
-
if (flag("isHelmInstallEnabled")) {
|
|
1810
|
-
resolved.push("Helm");
|
|
1811
|
-
}
|
|
1812
|
-
if (flag("isHelmAirgapEnabled")) {
|
|
1813
|
-
resolved.push("Helm Airgap");
|
|
1814
|
-
}
|
|
1815
|
-
if (flag("isEmbeddedClusterDownloadEnabled") || flag("isEmbeddedClusterMultiNodeEnabled")) {
|
|
1816
|
-
resolved.push("Embedded Cluster");
|
|
1817
|
-
}
|
|
1818
|
-
if (flag("isKurlInstallEnabled")) {
|
|
1819
|
-
resolved.push("kURL");
|
|
1820
|
-
}
|
|
1821
|
-
if (flag("isGitopsSupported")) {
|
|
1822
|
-
resolved.push("GitOps");
|
|
1823
|
-
}
|
|
1824
|
-
if (resolved.length) {
|
|
1825
|
-
installMethods = Array.from(new Set(resolved));
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
const expiresAtSource = getValue(sourceRecord, "expiresAt") ?? getValue(sourceRecord, "expireAt") ?? getValue(sourceRecord, "expire_at") ?? getValue(sourceRecord, "expiration") ?? getValue(sourceRecord, "expirationDate") ?? getValue(sourceRecord, "expires_on") ?? getValue(rootRecord, "expiresAt") ?? getValue(rootRecord, "expireAt") ?? getValue(rootRecord, "expire_at") ?? getValue(rootRecord, "expiration");
|
|
1829
|
-
const expiresAt = typeof expiresAtSource === "string" && expiresAtSource.trim().length ? expiresAtSource : expiresAtSource === null ? null : void 0;
|
|
1830
|
-
const baseFields = normalizeLicenseFields(
|
|
1831
|
-
getValue(rootRecord, "additionalFields") ?? getValue(sourceRecord, "additionalFields") ?? getValue(sourceRecord, "fields") ?? getValue(rootRecord, "fields") ?? getValue(payloadRecord, "fields") ?? getValue(payloadRecord, "additional_fields")
|
|
1832
|
-
);
|
|
1833
|
-
const entitlementFields = normalizeEntitlementFields(
|
|
1834
|
-
getValue(rootRecord, "entitlementFields") ?? getValue(sourceRecord, "entitlementFields"),
|
|
1835
|
-
getValue(rootRecord, "entitlementValues") ?? getValue(sourceRecord, "entitlementValues")
|
|
1836
|
-
);
|
|
1837
|
-
const fields = [
|
|
1838
|
-
...baseFields,
|
|
1839
|
-
...entitlementFields.filter(
|
|
1840
|
-
(field) => !baseFields.some((existing) => existing.key === field.key)
|
|
1841
|
-
)
|
|
1842
|
-
];
|
|
1843
|
-
const statusFromSource = getString(sourceRecord, "status") ?? getString(sourceRecord, "state");
|
|
1844
|
-
const statusLabelFromSource = getString(sourceRecord, "statusLabel") ?? getString(sourceRecord, "stateLabel");
|
|
1845
|
-
const expiredFlag = getBoolean(sourceRecord, "isExpired") ?? getBoolean(rootRecord, "isExpired");
|
|
1846
|
-
const derivedStatus = statusFromSource ?? (typeof expiredFlag === "boolean" ? expiredFlag ? "expired" : "active" : void 0);
|
|
1847
|
-
const statusLabel = statusLabelFromSource ?? (derivedStatus ? derivedStatus.charAt(0).toUpperCase() + derivedStatus.slice(1) : void 0);
|
|
1848
|
-
const licenseType = getString(sourceRecord, "licenseType") ?? getString(rootRecord, "licenseType");
|
|
1849
|
-
const status = derivedStatus;
|
|
1850
|
-
const license = {
|
|
1851
|
-
id: getString(rootRecord, "id") ?? getString(sourceRecord, "id") ?? getString(sourceRecord, "licenseId") ?? getString(customer, "licenseId") ?? void 0,
|
|
1852
|
-
status,
|
|
1853
|
-
statusLabel,
|
|
1854
|
-
environment: getString(sourceRecord, "environment") ?? getString(sourceRecord, "tier") ?? licenseType ?? void 0,
|
|
1855
|
-
expiresAt: expiresAt ?? null,
|
|
1856
|
-
releaseChannels: releaseChannels ?? [
|
|
1857
|
-
getString(rootRecord, "channelName") ?? getString(rootRecord, "channel") ?? void 0
|
|
1858
|
-
].filter((value) => Boolean(value)),
|
|
1859
|
-
installMethods,
|
|
1860
|
-
installNotes: getString(sourceRecord, "installNotes"),
|
|
1861
|
-
customerName: getString(sourceRecord, "customerName") ?? getString(customer, "name") ?? void 0,
|
|
1862
|
-
customerId: getString(sourceRecord, "customerId") ?? getString(customer, "id") ?? getString(rootRecord, "customerId") ?? void 0,
|
|
1863
|
-
customerOrganization: getString(customer, "organization") ?? getString(sourceRecord, "customerOrganization") ?? getString(rootRecord, "customerOrganization") ?? void 0,
|
|
1864
|
-
fields
|
|
1694
|
+
const envelope = await response.json();
|
|
1695
|
+
const data = envelope.data;
|
|
1696
|
+
return {
|
|
1697
|
+
releases: Array.isArray(data?.releases) ? data.releases : [],
|
|
1698
|
+
totalCount: data?.totalCount || 0
|
|
1865
1699
|
};
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
var fetchLicenseDetails = defineServerAction({
|
|
1869
|
-
id: "license/fetch-details",
|
|
1870
|
-
description: "Fetches the authenticated user's enterprise license details.",
|
|
1871
|
-
visibility: "customer",
|
|
1872
|
-
tags: ["license", "entitlements"],
|
|
1873
|
-
async run({ token }, context) {
|
|
1874
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1875
|
-
throw new Error("fetchLicenseDetails requires a non-empty token");
|
|
1876
|
-
}
|
|
1877
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1878
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1879
|
-
console.debug("[portal-components] fetching license via %s (Enterprise Portal API)", endpoint);
|
|
1880
|
-
}
|
|
1881
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1882
|
-
method: "GET",
|
|
1883
|
-
token,
|
|
1884
|
-
headers: {
|
|
1885
|
-
accept: "application/json"
|
|
1886
|
-
},
|
|
1887
|
-
signal: context?.signal
|
|
1888
|
-
});
|
|
1889
|
-
if (!response.ok) {
|
|
1890
|
-
throw new Error(
|
|
1891
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1892
|
-
);
|
|
1893
|
-
}
|
|
1894
|
-
const payload = await response.json();
|
|
1895
|
-
const licenseData = payload.data;
|
|
1896
|
-
const license = normalizeLicensePayload(licenseData);
|
|
1897
|
-
return {
|
|
1898
|
-
license,
|
|
1899
|
-
raw: licenseData ?? null
|
|
1900
|
-
};
|
|
1901
|
-
}
|
|
1902
|
-
});
|
|
1903
|
-
var fetchInstallOptions = defineServerAction({
|
|
1904
|
-
id: "license/fetch-install-options",
|
|
1905
|
-
description: "Fetches install options based on license entitlements.",
|
|
1906
|
-
visibility: "customer",
|
|
1907
|
-
tags: ["license", "install"],
|
|
1908
|
-
async run({ token }, context) {
|
|
1909
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1910
|
-
throw new Error("fetchInstallOptions requires a non-empty token");
|
|
1911
|
-
}
|
|
1912
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1913
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1914
|
-
console.debug("[portal-components] fetching install options via %s (Enterprise Portal API)", endpoint);
|
|
1915
|
-
}
|
|
1916
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1917
|
-
method: "GET",
|
|
1918
|
-
token,
|
|
1919
|
-
headers: {
|
|
1920
|
-
accept: "application/json"
|
|
1921
|
-
},
|
|
1922
|
-
signal: context?.signal
|
|
1923
|
-
});
|
|
1924
|
-
if (!response.ok) {
|
|
1925
|
-
throw new Error(
|
|
1926
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1927
|
-
);
|
|
1928
|
-
}
|
|
1929
|
-
const envelope = await response.json();
|
|
1930
|
-
const licenseData = envelope.data;
|
|
1931
|
-
const getBoolean2 = (obj, key) => {
|
|
1932
|
-
if (obj && typeof obj === "object" && key in obj) {
|
|
1933
|
-
const val = obj[key];
|
|
1934
|
-
return val === true || val === "true";
|
|
1935
|
-
}
|
|
1936
|
-
return false;
|
|
1937
|
-
};
|
|
1938
|
-
const showLinux = getBoolean2(licenseData, "isEmbeddedClusterDownloadEnabled");
|
|
1939
|
-
const showHelm = getBoolean2(licenseData, "isHelmInstallEnabled");
|
|
1940
|
-
return {
|
|
1941
|
-
showLinux,
|
|
1942
|
-
showHelm
|
|
1943
|
-
};
|
|
1944
|
-
}
|
|
1945
|
-
});
|
|
1946
|
-
var fetchLicenseSummary = defineServerAction({
|
|
1947
|
-
id: "license/fetch-summary",
|
|
1948
|
-
description: "Fetches license summary for the license card.",
|
|
1949
|
-
visibility: "customer",
|
|
1950
|
-
tags: ["license"],
|
|
1951
|
-
async run({ token }, context) {
|
|
1952
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1953
|
-
throw new Error("fetchLicenseSummary requires a non-empty token");
|
|
1954
|
-
}
|
|
1955
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1956
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1957
|
-
console.debug("[portal-components] fetching license summary via %s (Enterprise Portal API)", endpoint);
|
|
1958
|
-
}
|
|
1959
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1960
|
-
method: "GET",
|
|
1961
|
-
token,
|
|
1962
|
-
headers: {
|
|
1963
|
-
accept: "application/json"
|
|
1964
|
-
},
|
|
1965
|
-
signal: context?.signal
|
|
1966
|
-
});
|
|
1967
|
-
if (!response.ok) {
|
|
1968
|
-
throw new Error(
|
|
1969
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1970
|
-
);
|
|
1971
|
-
}
|
|
1972
|
-
const envelope = await response.json();
|
|
1973
|
-
const licenseData = envelope.data;
|
|
1974
|
-
const license = normalizeLicensePayload(licenseData);
|
|
1975
|
-
const type = license.environment || "Unknown";
|
|
1976
|
-
const expiresAt = license.expiresAt || null;
|
|
1977
|
-
return {
|
|
1978
|
-
type,
|
|
1979
|
-
expiresAt
|
|
1980
|
-
};
|
|
1981
|
-
}
|
|
1982
|
-
});
|
|
1700
|
+
}
|
|
1701
|
+
var listReleases = traceServerAction("listReleases", listReleasesImpl);
|
|
1983
1702
|
var fetchCustomers = defineServerAction({
|
|
1984
1703
|
id: "auth/fetch-customers",
|
|
1985
1704
|
description: "Fetches the list of customers/teams for the authenticated user.",
|
|
@@ -3046,6 +2765,7 @@ exports.discardInstallationAction = discardInstallationAction;
|
|
|
3046
2765
|
exports.downloadSecuritySBOM = downloadSecuritySBOM;
|
|
3047
2766
|
exports.downloadSupportBundle = downloadSupportBundle;
|
|
3048
2767
|
exports.downloadSupportBundleAction = downloadSupportBundleAction;
|
|
2768
|
+
exports.fetchAppFeatures = fetchAppFeatures;
|
|
3049
2769
|
exports.fetchAppInfo = fetchAppInfo;
|
|
3050
2770
|
exports.fetchChannelReleasesAction = fetchChannelReleasesAction;
|
|
3051
2771
|
exports.fetchCurrentUser = fetchCurrentUser;
|
|
@@ -3055,11 +2775,9 @@ exports.fetchCustomers = fetchCustomers;
|
|
|
3055
2775
|
exports.fetchCustomersForMenu = fetchCustomersForMenu;
|
|
3056
2776
|
exports.fetchDashboardComposite = fetchDashboardComposite;
|
|
3057
2777
|
exports.fetchDashboardInstances = fetchDashboardInstances;
|
|
3058
|
-
exports.fetchInstallOptions = fetchInstallOptions;
|
|
3059
2778
|
exports.fetchInstances = fetchInstances;
|
|
3060
2779
|
exports.fetchInstancesAction = fetchInstancesAction;
|
|
3061
|
-
exports.
|
|
3062
|
-
exports.fetchLicenseSummary = fetchLicenseSummary;
|
|
2780
|
+
exports.fetchLicense = fetchLicense;
|
|
3063
2781
|
exports.fetchNotifications = fetchNotifications;
|
|
3064
2782
|
exports.fetchNotificationsAction = fetchNotificationsAction;
|
|
3065
2783
|
exports.fetchPendingInstallationsAction = fetchPendingInstallationsAction;
|
|
@@ -3075,7 +2793,6 @@ exports.fetchUser = fetchUser;
|
|
|
3075
2793
|
exports.getApiOrigin = getApiOrigin;
|
|
3076
2794
|
exports.getCustomerIdFromToken = getCustomerIdFromToken;
|
|
3077
2795
|
exports.getInstallOptionsAction = getInstallOptionsAction;
|
|
3078
|
-
exports.getSamlFeatureEnabled = getSamlFeatureEnabled;
|
|
3079
2796
|
exports.getSecurityInfo = getSecurityInfo;
|
|
3080
2797
|
exports.getSecurityInfoDiff = getSecurityInfoDiff;
|
|
3081
2798
|
exports.getSecurityInfoSBOM = getSecurityInfoSBOM;
|