@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
|
@@ -118,6 +118,9 @@ var init_tracer = __esm({
|
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
// src/utils/api-client.ts
|
|
121
|
+
function isRedirectError(error) {
|
|
122
|
+
return typeof error === "object" && error !== null && "digest" in error && typeof error.digest === "string" && error.digest.startsWith("NEXT_REDIRECT");
|
|
123
|
+
}
|
|
121
124
|
async function authenticatedFetch(url, options = {}) {
|
|
122
125
|
const { token, ...fetchOptions } = options;
|
|
123
126
|
const headers = new Headers(fetchOptions.headers);
|
|
@@ -140,8 +143,17 @@ async function handle401() {
|
|
|
140
143
|
const { redirect } = await import('next/navigation');
|
|
141
144
|
return redirect("/?expired=1");
|
|
142
145
|
}
|
|
146
|
+
function isErrorPage(url) {
|
|
147
|
+
try {
|
|
148
|
+
const urlObj = new URL(url);
|
|
149
|
+
return urlObj.pathname === "/error";
|
|
150
|
+
} catch {
|
|
151
|
+
return url === "/error" || url.startsWith("/error?");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
143
154
|
async function handleServerError(statusCode) {
|
|
144
155
|
const { redirect } = await import('next/navigation');
|
|
156
|
+
const { cookies: cookies9 } = await import('next/headers');
|
|
145
157
|
let sourceUrl;
|
|
146
158
|
try {
|
|
147
159
|
const { headers } = await import('next/headers');
|
|
@@ -149,12 +161,20 @@ async function handleServerError(statusCode) {
|
|
|
149
161
|
const referer = headersList.get("referer");
|
|
150
162
|
const host = headersList.get("host");
|
|
151
163
|
const pathname = headersList.get("x-invoke-path") || headersList.get("x-forwarded-path");
|
|
152
|
-
if (referer) {
|
|
164
|
+
if (referer && !isErrorPage(referer)) {
|
|
153
165
|
sourceUrl = referer;
|
|
154
166
|
} else if (host && pathname) {
|
|
155
167
|
const protocol = headersList.get("x-forwarded-proto") || "https";
|
|
156
168
|
sourceUrl = `${protocol}://${host}${pathname}`;
|
|
157
169
|
}
|
|
170
|
+
if (!sourceUrl || isErrorPage(sourceUrl)) {
|
|
171
|
+
const cookieStore = await cookies9();
|
|
172
|
+
const preservedSource = cookieStore.get("portal_error_source");
|
|
173
|
+
if (preservedSource?.value) {
|
|
174
|
+
sourceUrl = decodeURIComponent(preservedSource.value);
|
|
175
|
+
cookieStore.delete("portal_error_source");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
158
178
|
} catch (error) {
|
|
159
179
|
console.debug("[portal-components] Could not determine source URL", error);
|
|
160
180
|
}
|
|
@@ -223,6 +243,81 @@ function traceServerAction(name, fn) {
|
|
|
223
243
|
};
|
|
224
244
|
return traced;
|
|
225
245
|
}
|
|
246
|
+
var deriveInstallMethods = (licenseData) => {
|
|
247
|
+
const methods = [];
|
|
248
|
+
if (licenseData.isKotsInstallEnabled) {
|
|
249
|
+
methods.push("Replicated KOTS");
|
|
250
|
+
}
|
|
251
|
+
if (licenseData.isHelmInstallEnabled) {
|
|
252
|
+
methods.push("Helm");
|
|
253
|
+
}
|
|
254
|
+
if (licenseData.isHelmAirgapEnabled) {
|
|
255
|
+
methods.push("Helm Airgap");
|
|
256
|
+
}
|
|
257
|
+
if (licenseData.isEmbeddedClusterDownloadEnabled || licenseData.isEmbeddedClusterMultiNodeEnabled) {
|
|
258
|
+
methods.push("Embedded Cluster");
|
|
259
|
+
}
|
|
260
|
+
if (licenseData.isKurlInstallEnabled) {
|
|
261
|
+
methods.push("kURL");
|
|
262
|
+
}
|
|
263
|
+
if (licenseData.isGitopsSupported) {
|
|
264
|
+
methods.push("GitOps");
|
|
265
|
+
}
|
|
266
|
+
return Array.from(new Set(methods));
|
|
267
|
+
};
|
|
268
|
+
var convertEntitlementsToFields = (entitlementFields, entitlementValues) => {
|
|
269
|
+
const valuesMap = /* @__PURE__ */ new Map();
|
|
270
|
+
entitlementValues.forEach((ev) => {
|
|
271
|
+
valuesMap.set(ev.name, ev.value);
|
|
272
|
+
});
|
|
273
|
+
return entitlementFields.filter((field) => field.hidden === 0).map((field) => ({
|
|
274
|
+
key: field.name,
|
|
275
|
+
label: field.title || field.name,
|
|
276
|
+
value: valuesMap.get(field.name) || field.defaultVal || null,
|
|
277
|
+
isSecret: field.type === "Password"
|
|
278
|
+
}));
|
|
279
|
+
};
|
|
280
|
+
async function fetchLicenseCore() {
|
|
281
|
+
const sessionStore = await cookies();
|
|
282
|
+
const session = sessionStore.get("portal_session");
|
|
283
|
+
const token = session?.value;
|
|
284
|
+
if (!token) {
|
|
285
|
+
throw new Error("No session found - user must be authenticated");
|
|
286
|
+
}
|
|
287
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
288
|
+
if (process.env.NODE_ENV !== "production") {
|
|
289
|
+
console.debug("[portal-components] fetching license via %s (Enterprise Portal API)", endpoint);
|
|
290
|
+
}
|
|
291
|
+
const response = await authenticatedFetch(endpoint, {
|
|
292
|
+
method: "GET",
|
|
293
|
+
token,
|
|
294
|
+
headers: {
|
|
295
|
+
Accept: "application/json"
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
if (!response.ok) {
|
|
299
|
+
throw new Error(
|
|
300
|
+
`License request failed (${response.status} ${response.statusText})`
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
const envelope = await response.json();
|
|
304
|
+
const licenseData = envelope.data;
|
|
305
|
+
const license = {
|
|
306
|
+
...licenseData,
|
|
307
|
+
// Alias fields for backward compatibility
|
|
308
|
+
expiresAt: licenseData.expireAt,
|
|
309
|
+
environment: licenseData.licenseType,
|
|
310
|
+
// Extract channel names from channels array
|
|
311
|
+
releaseChannels: (licenseData.channels || []).map((ch) => ch.channelName),
|
|
312
|
+
// Derive install methods from feature flags
|
|
313
|
+
installMethods: deriveInstallMethods(licenseData),
|
|
314
|
+
// Convert entitlements to fields format
|
|
315
|
+
fields: convertEntitlementsToFields(licenseData.entitlementFields || [], licenseData.entitlementValues || [])
|
|
316
|
+
};
|
|
317
|
+
return license;
|
|
318
|
+
}
|
|
319
|
+
var fetchLicenseImpl = cache(fetchLicenseCore);
|
|
320
|
+
var fetchLicense = fetchLicenseImpl;
|
|
226
321
|
|
|
227
322
|
// src/actions/install.ts
|
|
228
323
|
async function fetchChannelReleases(input, context) {
|
|
@@ -590,21 +685,19 @@ async function fetchAppInfoImpl() {
|
|
|
590
685
|
if (branding?.brandingData) {
|
|
591
686
|
const decoded = Buffer.from(branding.brandingData, "base64").toString("utf-8");
|
|
592
687
|
const brandingObj = JSON.parse(decoded);
|
|
593
|
-
|
|
688
|
+
if (brandingObj.title) {
|
|
689
|
+
appName = brandingObj.title;
|
|
690
|
+
}
|
|
594
691
|
}
|
|
595
692
|
} catch (error) {
|
|
596
693
|
console.error("[fetch-app-info] fetchCustomBranding failed", error);
|
|
597
694
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
channelName = channel;
|
|
604
|
-
}
|
|
695
|
+
const license = await fetchLicense();
|
|
696
|
+
if (license?.releaseChannels && license.releaseChannels.length > 0) {
|
|
697
|
+
const channel = license.releaseChannels[0];
|
|
698
|
+
if (channel) {
|
|
699
|
+
channelName = channel;
|
|
605
700
|
}
|
|
606
|
-
} catch (error) {
|
|
607
|
-
console.error("[fetch-app-info] fetchLicenseDetails failed", error);
|
|
608
701
|
}
|
|
609
702
|
return { appName, channelName };
|
|
610
703
|
}
|
|
@@ -794,35 +887,46 @@ async function deprovisionSamlActionImpl() {
|
|
|
794
887
|
return { success: true };
|
|
795
888
|
}
|
|
796
889
|
var deprovisionSamlAction = traceServerAction("deprovisionSamlAction", deprovisionSamlActionImpl);
|
|
797
|
-
async function
|
|
890
|
+
async function fetchAppFeaturesImpl() {
|
|
798
891
|
const sessionStore = await cookies();
|
|
799
892
|
const session = sessionStore.get("portal_session");
|
|
800
|
-
if (!session?.value) {
|
|
801
|
-
return false;
|
|
802
|
-
}
|
|
803
893
|
const appSlug = process.env.PORTAL_APP_SLUG;
|
|
804
894
|
if (!appSlug) {
|
|
805
|
-
|
|
895
|
+
throw new Error("PORTAL_APP_SLUG is not configured");
|
|
806
896
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const response = await fetch(url, {
|
|
815
|
-
headers: {
|
|
816
|
-
Accept: "application/json"
|
|
897
|
+
const params = new URLSearchParams({ app_slug: appSlug });
|
|
898
|
+
if (session?.value) {
|
|
899
|
+
try {
|
|
900
|
+
const payload = decodeJwtPayload(session.value);
|
|
901
|
+
const customerId = payload?.customer_id;
|
|
902
|
+
if (customerId) {
|
|
903
|
+
params.set("customer_id", customerId);
|
|
817
904
|
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
905
|
+
} catch {
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
const url = `${getApiOrigin()}/enterprise-portal/public/app-features?${params.toString()}`;
|
|
909
|
+
const response = await fetch(url, {
|
|
910
|
+
headers: {
|
|
911
|
+
Accept: "application/json"
|
|
912
|
+
}
|
|
913
|
+
});
|
|
914
|
+
if (!response.ok) {
|
|
915
|
+
throw new Error(`Failed to fetch app features: ${response.status} ${response.statusText}`);
|
|
823
916
|
}
|
|
917
|
+
const data = await response.json();
|
|
918
|
+
return {
|
|
919
|
+
epEnabled: data.ep_enabled ?? false,
|
|
920
|
+
trialSignupEnabled: data.trial_signup_enabled ?? false,
|
|
921
|
+
trialExpirationDays: data.trial_expiration_days ?? 30,
|
|
922
|
+
licenseType: data.license_type ?? "trial",
|
|
923
|
+
termsAndConditionsUrl: data.terms_and_conditions_url ?? "",
|
|
924
|
+
epSecurityCenterEnabled: data.ep_security_center_enabled ?? false,
|
|
925
|
+
epSamlAuthEnabled: data.ep_saml_auth_enabled ?? false,
|
|
926
|
+
epHideSupportBundleUploadEnabled: data.ep_hide_support_bundle_upload_enabled ?? false
|
|
927
|
+
};
|
|
824
928
|
}
|
|
825
|
-
var
|
|
929
|
+
var fetchAppFeatures = traceServerAction("fetchAppFeatures", fetchAppFeaturesImpl);
|
|
826
930
|
async function fetchCurrentUserActionImpl() {
|
|
827
931
|
const sessionStore = await cookies();
|
|
828
932
|
const session = sessionStore.get("portal_session");
|
|
@@ -933,10 +1037,10 @@ async function fetchCustomersForMenuImpl() {
|
|
|
933
1037
|
const token = session.value;
|
|
934
1038
|
const currentCustomerId = getCustomerIdFromToken(token);
|
|
935
1039
|
const endpoint = `${getApiOrigin()}/enterprise-portal/user`;
|
|
936
|
-
const response = await
|
|
1040
|
+
const response = await authenticatedFetch(endpoint, {
|
|
937
1041
|
method: "GET",
|
|
1042
|
+
token,
|
|
938
1043
|
headers: {
|
|
939
|
-
Authorization: `Bearer ${token}`,
|
|
940
1044
|
Accept: "application/json"
|
|
941
1045
|
}
|
|
942
1046
|
});
|
|
@@ -955,6 +1059,9 @@ async function fetchCustomersForMenuImpl() {
|
|
|
955
1059
|
currentCustomerId
|
|
956
1060
|
};
|
|
957
1061
|
} catch (error) {
|
|
1062
|
+
if (isRedirectError(error)) {
|
|
1063
|
+
throw error;
|
|
1064
|
+
}
|
|
958
1065
|
console.error("[fetch-customers-for-menu] Failed to fetch customers:", error);
|
|
959
1066
|
return { customers: [] };
|
|
960
1067
|
}
|
|
@@ -1084,10 +1191,10 @@ async function fetchUserCore() {
|
|
|
1084
1191
|
}
|
|
1085
1192
|
try {
|
|
1086
1193
|
const endpoint = `${getApiOrigin()}/enterprise-portal/user`;
|
|
1087
|
-
const response = await
|
|
1194
|
+
const response = await authenticatedFetch(endpoint, {
|
|
1088
1195
|
method: "GET",
|
|
1196
|
+
token,
|
|
1089
1197
|
headers: {
|
|
1090
|
-
Authorization: `Bearer ${token}`,
|
|
1091
1198
|
Accept: "application/json"
|
|
1092
1199
|
}
|
|
1093
1200
|
});
|
|
@@ -1101,6 +1208,9 @@ async function fetchUserCore() {
|
|
|
1101
1208
|
}
|
|
1102
1209
|
return data;
|
|
1103
1210
|
} catch (error) {
|
|
1211
|
+
if (isRedirectError(error)) {
|
|
1212
|
+
throw error;
|
|
1213
|
+
}
|
|
1104
1214
|
console.error("[fetch-user] Error fetching from API:", error);
|
|
1105
1215
|
return {};
|
|
1106
1216
|
}
|
|
@@ -1284,11 +1394,15 @@ var fetchCustomBrandingImpl = async () => {
|
|
|
1284
1394
|
const payload = await response.json();
|
|
1285
1395
|
const brandingObject = {
|
|
1286
1396
|
logo: payload.logoUrl,
|
|
1287
|
-
title: payload.
|
|
1288
|
-
|
|
1289
|
-
|
|
1397
|
+
title: payload.title,
|
|
1398
|
+
primaryColor: payload.primaryColor,
|
|
1399
|
+
secondaryColor: payload.secondaryColor,
|
|
1290
1400
|
favicon: payload.faviconUrl,
|
|
1291
|
-
supportPortalLink: payload.supportPortalLink || ""
|
|
1401
|
+
supportPortalLink: payload.supportPortalLink || "",
|
|
1402
|
+
background: payload.background,
|
|
1403
|
+
backgroundImage: payload.backgroundImage,
|
|
1404
|
+
customColor1: payload.customColor1,
|
|
1405
|
+
customColor2: payload.customColor2
|
|
1292
1406
|
};
|
|
1293
1407
|
const brandingData = Buffer.from(JSON.stringify(brandingObject)).toString("base64");
|
|
1294
1408
|
return {
|
|
@@ -1551,433 +1665,38 @@ var uploadSupportBundle = defineServerAction({
|
|
|
1551
1665
|
var getSupportBundleUploadUrl = (appId) => {
|
|
1552
1666
|
return `${getApiOrigin()}/enterprise-portal/support-bundles/upload/${encodeURIComponent(appId)}`;
|
|
1553
1667
|
};
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
throw new Error("List releases requires a session token");
|
|
1562
|
-
}
|
|
1563
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/releases`;
|
|
1564
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1565
|
-
console.debug("[portal-components] fetching releases via %s (Enterprise Portal API)", endpoint);
|
|
1566
|
-
}
|
|
1567
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1568
|
-
method: "GET",
|
|
1569
|
-
token,
|
|
1570
|
-
headers: {
|
|
1571
|
-
accept: "application/json"
|
|
1572
|
-
},
|
|
1573
|
-
signal: context?.signal
|
|
1574
|
-
});
|
|
1575
|
-
const bodyText = await response.text().catch((error) => {
|
|
1576
|
-
console.warn("[portal-components] listReleases read error", error);
|
|
1577
|
-
return null;
|
|
1578
|
-
});
|
|
1579
|
-
if (!response.ok) {
|
|
1580
|
-
throw new Error(
|
|
1581
|
-
`List releases request failed (${response.status} ${response.statusText})`
|
|
1582
|
-
);
|
|
1583
|
-
}
|
|
1584
|
-
return {
|
|
1585
|
-
status: response.status,
|
|
1586
|
-
body: bodyText
|
|
1587
|
-
};
|
|
1588
|
-
}
|
|
1589
|
-
});
|
|
1590
|
-
var asRecord = (value) => {
|
|
1591
|
-
if (value && typeof value === "object") {
|
|
1592
|
-
return value;
|
|
1593
|
-
}
|
|
1594
|
-
return void 0;
|
|
1595
|
-
};
|
|
1596
|
-
var getValue = (record, key) => record ? record[key] : void 0;
|
|
1597
|
-
var getString = (record, key) => {
|
|
1598
|
-
const value = getValue(record, key);
|
|
1599
|
-
return typeof value === "string" ? value : void 0;
|
|
1600
|
-
};
|
|
1601
|
-
var getBoolean = (record, key) => {
|
|
1602
|
-
const value = getValue(record, key);
|
|
1603
|
-
if (typeof value === "boolean") {
|
|
1604
|
-
return value;
|
|
1605
|
-
}
|
|
1606
|
-
if (typeof value === "number") {
|
|
1607
|
-
return value === 1;
|
|
1608
|
-
}
|
|
1609
|
-
if (typeof value === "string") {
|
|
1610
|
-
const normalized = value.trim().toLowerCase();
|
|
1611
|
-
if (["true", "1", "yes"].includes(normalized)) {
|
|
1612
|
-
return true;
|
|
1613
|
-
}
|
|
1614
|
-
if (["false", "0", "no"].includes(normalized)) {
|
|
1615
|
-
return false;
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
return void 0;
|
|
1619
|
-
};
|
|
1620
|
-
var toDisplayValue = (value) => {
|
|
1621
|
-
if (value === null || value === void 0) {
|
|
1622
|
-
return null;
|
|
1623
|
-
}
|
|
1624
|
-
if (typeof value === "string") {
|
|
1625
|
-
return value;
|
|
1626
|
-
}
|
|
1627
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
1628
|
-
return String(value);
|
|
1629
|
-
}
|
|
1630
|
-
try {
|
|
1631
|
-
return JSON.stringify(value);
|
|
1632
|
-
} catch {
|
|
1633
|
-
return String(value);
|
|
1634
|
-
}
|
|
1635
|
-
};
|
|
1636
|
-
var normalizeStringArray = (value) => {
|
|
1637
|
-
if (Array.isArray(value)) {
|
|
1638
|
-
const normalized = value.map(
|
|
1639
|
-
(item) => typeof item === "string" ? item.trim() : ""
|
|
1640
|
-
).filter((item) => item.length > 0);
|
|
1641
|
-
return normalized.length ? normalized : void 0;
|
|
1642
|
-
}
|
|
1643
|
-
if (typeof value === "string") {
|
|
1644
|
-
const normalized = value.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
1645
|
-
return normalized.length ? normalized : void 0;
|
|
1646
|
-
}
|
|
1647
|
-
return void 0;
|
|
1648
|
-
};
|
|
1649
|
-
var normalizeLicenseFields = (input) => {
|
|
1650
|
-
if (!input) {
|
|
1651
|
-
return [];
|
|
1652
|
-
}
|
|
1653
|
-
if (Array.isArray(input)) {
|
|
1654
|
-
return input.map((field, index) => {
|
|
1655
|
-
if (!field || typeof field !== "object") {
|
|
1656
|
-
return null;
|
|
1657
|
-
}
|
|
1658
|
-
const candidate = field;
|
|
1659
|
-
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}`;
|
|
1660
|
-
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;
|
|
1661
|
-
let value = candidate.value ?? candidate.data ?? candidate.content;
|
|
1662
|
-
if ((value === void 0 || value === null) && typeof candidate.text === "string") {
|
|
1663
|
-
value = candidate.text;
|
|
1664
|
-
}
|
|
1665
|
-
if ((value === void 0 || value === null) && typeof candidate.defaultValue === "string") {
|
|
1666
|
-
value = candidate.defaultValue;
|
|
1667
|
-
}
|
|
1668
|
-
const isSecret = Boolean(
|
|
1669
|
-
candidate.isSecret ?? candidate.secret ?? candidate.masked
|
|
1670
|
-
);
|
|
1671
|
-
const resolved = toDisplayValue(value);
|
|
1672
|
-
return {
|
|
1673
|
-
key,
|
|
1674
|
-
label,
|
|
1675
|
-
value: resolved,
|
|
1676
|
-
isSecret
|
|
1677
|
-
};
|
|
1678
|
-
}).filter((field) => Boolean(field));
|
|
1679
|
-
}
|
|
1680
|
-
if (typeof input === "object") {
|
|
1681
|
-
return Object.entries(input).map(
|
|
1682
|
-
([key, value]) => {
|
|
1683
|
-
let resolvedValue = value;
|
|
1684
|
-
let isSecret = false;
|
|
1685
|
-
if (value && typeof value === "object") {
|
|
1686
|
-
const obj = value;
|
|
1687
|
-
if ("value" in obj) {
|
|
1688
|
-
resolvedValue = obj.value;
|
|
1689
|
-
}
|
|
1690
|
-
isSecret = Boolean(obj.isSecret ?? obj.secret ?? obj.masked);
|
|
1691
|
-
}
|
|
1692
|
-
const normalized = toDisplayValue(resolvedValue);
|
|
1693
|
-
return {
|
|
1694
|
-
key,
|
|
1695
|
-
label: key,
|
|
1696
|
-
value: normalized,
|
|
1697
|
-
isSecret
|
|
1698
|
-
};
|
|
1699
|
-
}
|
|
1700
|
-
);
|
|
1668
|
+
async function listReleasesImpl() {
|
|
1669
|
+
const { cookies: cookies9 } = await import('next/headers');
|
|
1670
|
+
const sessionStore = await cookies9();
|
|
1671
|
+
const session = sessionStore.get("portal_session");
|
|
1672
|
+
const token = session?.value;
|
|
1673
|
+
if (!token) {
|
|
1674
|
+
throw new Error("List releases requires a session token");
|
|
1701
1675
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
if (!Array.isArray(input)) {
|
|
1706
|
-
return void 0;
|
|
1676
|
+
const endpoint = `${getApiOrigin()}/enterprise-portal/releases`;
|
|
1677
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1678
|
+
console.debug("[portal-components] fetching releases via %s (Enterprise Portal API)", endpoint);
|
|
1707
1679
|
}
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
if (!record) {
|
|
1714
|
-
return null;
|
|
1715
|
-
}
|
|
1716
|
-
return getString(record, "name") ?? getString(record, "channelName") ?? getString(record, "channel") ?? getString(record, "channelSlug") ?? getString(record, "slug") ?? void 0;
|
|
1717
|
-
}).filter((name) => Boolean(name && name.length));
|
|
1718
|
-
return names.length ? names : void 0;
|
|
1719
|
-
};
|
|
1720
|
-
var normalizeEntitlementFields = (fieldsInput, valuesInput) => {
|
|
1721
|
-
const valuesMap = /* @__PURE__ */ new Map();
|
|
1722
|
-
const assignValue = (key, value) => {
|
|
1723
|
-
if (!key) {
|
|
1724
|
-
return;
|
|
1680
|
+
const response = await authenticatedFetch(endpoint, {
|
|
1681
|
+
method: "GET",
|
|
1682
|
+
token,
|
|
1683
|
+
headers: {
|
|
1684
|
+
accept: "application/json"
|
|
1725
1685
|
}
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
const record = asRecord(item);
|
|
1731
|
-
if (!record) {
|
|
1732
|
-
if (typeof item === "string") {
|
|
1733
|
-
assignValue(item, item);
|
|
1734
|
-
}
|
|
1735
|
-
return;
|
|
1736
|
-
}
|
|
1737
|
-
const key = getString(record, "name") ?? getString(record, "field") ?? getString(record, "title") ?? getString(record, "label") ?? getString(record, "slug") ?? (() => {
|
|
1738
|
-
const idValue = getValue(record, "id");
|
|
1739
|
-
if (typeof idValue === "string" || typeof idValue === "number") {
|
|
1740
|
-
return String(idValue);
|
|
1741
|
-
}
|
|
1742
|
-
return void 0;
|
|
1743
|
-
})();
|
|
1744
|
-
const value = getValue(record, "value") ?? getValue(record, "currentValue") ?? getValue(record, "entitlementValue") ?? getValue(record, "content") ?? getValue(record, "data") ?? getValue(record, "defaultVal") ?? getValue(record, "defaultValue");
|
|
1745
|
-
assignValue(key, value);
|
|
1746
|
-
});
|
|
1747
|
-
} else if (valuesInput && typeof valuesInput === "object") {
|
|
1748
|
-
Object.entries(valuesInput).forEach(
|
|
1749
|
-
([key, value]) => assignValue(key, value)
|
|
1686
|
+
});
|
|
1687
|
+
if (!response.ok) {
|
|
1688
|
+
throw new Error(
|
|
1689
|
+
`List releases request failed (${response.status} ${response.statusText})`
|
|
1750
1690
|
);
|
|
1751
1691
|
}
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
return;
|
|
1758
|
-
}
|
|
1759
|
-
const baseKey = getString(record, "name") ?? getString(record, "field") ?? getString(record, "slug") ?? `entitlement-${index}`;
|
|
1760
|
-
const key = `entitlement-${baseKey}`;
|
|
1761
|
-
const label = getString(record, "title") ?? getString(record, "label") ?? baseKey;
|
|
1762
|
-
const defaultValue = getString(record, "defaultVal") ?? getString(record, "default") ?? getString(record, "defaultValue");
|
|
1763
|
-
const value = valuesMap.get(baseKey) ?? valuesMap.get(label) ?? defaultValue ?? null;
|
|
1764
|
-
const isSecret = Boolean(
|
|
1765
|
-
getBoolean(record, "secret") ?? getBoolean(record, "isSecret") ?? getBoolean(record, "masked")
|
|
1766
|
-
);
|
|
1767
|
-
normalized.push({
|
|
1768
|
-
key,
|
|
1769
|
-
label,
|
|
1770
|
-
value,
|
|
1771
|
-
isSecret
|
|
1772
|
-
});
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1775
|
-
valuesMap.forEach((value, key) => {
|
|
1776
|
-
const normalizedKey = `entitlement-${key}`;
|
|
1777
|
-
if (!normalized.some((field) => field.key === normalizedKey)) {
|
|
1778
|
-
normalized.push({
|
|
1779
|
-
key: normalizedKey,
|
|
1780
|
-
label: key,
|
|
1781
|
-
value
|
|
1782
|
-
});
|
|
1783
|
-
}
|
|
1784
|
-
});
|
|
1785
|
-
return normalized;
|
|
1786
|
-
};
|
|
1787
|
-
var normalizeLicensePayload = (payload) => {
|
|
1788
|
-
const payloadRecord = asRecord(payload);
|
|
1789
|
-
const rootRecord = asRecord(getValue(payloadRecord, "license")) ?? asRecord(getValue(payloadRecord, "data")) ?? payloadRecord ?? {};
|
|
1790
|
-
const sourceRecord = asRecord(getValue(rootRecord, "metadata")) ?? rootRecord;
|
|
1791
|
-
const customer = asRecord(getValue(rootRecord, "customer")) ?? asRecord(getValue(sourceRecord, "customer")) ?? asRecord(getValue(payloadRecord, "customer")) ?? {};
|
|
1792
|
-
let releaseChannels = normalizeStringArray(
|
|
1793
|
-
getValue(rootRecord, "releaseChannels") ?? getValue(sourceRecord, "releaseChannels") ?? getValue(sourceRecord, "channels") ?? getValue(rootRecord, "channels") ?? getValue(sourceRecord, "channel") ?? getValue(rootRecord, "channel")
|
|
1794
|
-
) ?? void 0;
|
|
1795
|
-
if (!releaseChannels) {
|
|
1796
|
-
releaseChannels = extractChannelNames(getValue(rootRecord, "channels")) ?? extractChannelNames(getValue(sourceRecord, "channels")) ?? void 0;
|
|
1797
|
-
}
|
|
1798
|
-
let installMethods = normalizeStringArray(
|
|
1799
|
-
getValue(rootRecord, "installMethods") ?? getValue(sourceRecord, "installMethods") ?? getValue(sourceRecord, "install_options") ?? getValue(rootRecord, "install_options") ?? getValue(sourceRecord, "installOptions")
|
|
1800
|
-
) ?? void 0;
|
|
1801
|
-
if (!installMethods || installMethods.length === 0) {
|
|
1802
|
-
const resolved = [];
|
|
1803
|
-
const flag = (key) => getBoolean(rootRecord, key) ?? getBoolean(sourceRecord, key) ?? false;
|
|
1804
|
-
if (flag("isKotsInstallEnabled")) {
|
|
1805
|
-
resolved.push("Replicated KOTS");
|
|
1806
|
-
}
|
|
1807
|
-
if (flag("isHelmInstallEnabled")) {
|
|
1808
|
-
resolved.push("Helm");
|
|
1809
|
-
}
|
|
1810
|
-
if (flag("isHelmAirgapEnabled")) {
|
|
1811
|
-
resolved.push("Helm Airgap");
|
|
1812
|
-
}
|
|
1813
|
-
if (flag("isEmbeddedClusterDownloadEnabled") || flag("isEmbeddedClusterMultiNodeEnabled")) {
|
|
1814
|
-
resolved.push("Embedded Cluster");
|
|
1815
|
-
}
|
|
1816
|
-
if (flag("isKurlInstallEnabled")) {
|
|
1817
|
-
resolved.push("kURL");
|
|
1818
|
-
}
|
|
1819
|
-
if (flag("isGitopsSupported")) {
|
|
1820
|
-
resolved.push("GitOps");
|
|
1821
|
-
}
|
|
1822
|
-
if (resolved.length) {
|
|
1823
|
-
installMethods = Array.from(new Set(resolved));
|
|
1824
|
-
}
|
|
1825
|
-
}
|
|
1826
|
-
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");
|
|
1827
|
-
const expiresAt = typeof expiresAtSource === "string" && expiresAtSource.trim().length ? expiresAtSource : expiresAtSource === null ? null : void 0;
|
|
1828
|
-
const baseFields = normalizeLicenseFields(
|
|
1829
|
-
getValue(rootRecord, "additionalFields") ?? getValue(sourceRecord, "additionalFields") ?? getValue(sourceRecord, "fields") ?? getValue(rootRecord, "fields") ?? getValue(payloadRecord, "fields") ?? getValue(payloadRecord, "additional_fields")
|
|
1830
|
-
);
|
|
1831
|
-
const entitlementFields = normalizeEntitlementFields(
|
|
1832
|
-
getValue(rootRecord, "entitlementFields") ?? getValue(sourceRecord, "entitlementFields"),
|
|
1833
|
-
getValue(rootRecord, "entitlementValues") ?? getValue(sourceRecord, "entitlementValues")
|
|
1834
|
-
);
|
|
1835
|
-
const fields = [
|
|
1836
|
-
...baseFields,
|
|
1837
|
-
...entitlementFields.filter(
|
|
1838
|
-
(field) => !baseFields.some((existing) => existing.key === field.key)
|
|
1839
|
-
)
|
|
1840
|
-
];
|
|
1841
|
-
const statusFromSource = getString(sourceRecord, "status") ?? getString(sourceRecord, "state");
|
|
1842
|
-
const statusLabelFromSource = getString(sourceRecord, "statusLabel") ?? getString(sourceRecord, "stateLabel");
|
|
1843
|
-
const expiredFlag = getBoolean(sourceRecord, "isExpired") ?? getBoolean(rootRecord, "isExpired");
|
|
1844
|
-
const derivedStatus = statusFromSource ?? (typeof expiredFlag === "boolean" ? expiredFlag ? "expired" : "active" : void 0);
|
|
1845
|
-
const statusLabel = statusLabelFromSource ?? (derivedStatus ? derivedStatus.charAt(0).toUpperCase() + derivedStatus.slice(1) : void 0);
|
|
1846
|
-
const licenseType = getString(sourceRecord, "licenseType") ?? getString(rootRecord, "licenseType");
|
|
1847
|
-
const status = derivedStatus;
|
|
1848
|
-
const license = {
|
|
1849
|
-
id: getString(rootRecord, "id") ?? getString(sourceRecord, "id") ?? getString(sourceRecord, "licenseId") ?? getString(customer, "licenseId") ?? void 0,
|
|
1850
|
-
status,
|
|
1851
|
-
statusLabel,
|
|
1852
|
-
environment: getString(sourceRecord, "environment") ?? getString(sourceRecord, "tier") ?? licenseType ?? void 0,
|
|
1853
|
-
expiresAt: expiresAt ?? null,
|
|
1854
|
-
releaseChannels: releaseChannels ?? [
|
|
1855
|
-
getString(rootRecord, "channelName") ?? getString(rootRecord, "channel") ?? void 0
|
|
1856
|
-
].filter((value) => Boolean(value)),
|
|
1857
|
-
installMethods,
|
|
1858
|
-
installNotes: getString(sourceRecord, "installNotes"),
|
|
1859
|
-
customerName: getString(sourceRecord, "customerName") ?? getString(customer, "name") ?? void 0,
|
|
1860
|
-
customerId: getString(sourceRecord, "customerId") ?? getString(customer, "id") ?? getString(rootRecord, "customerId") ?? void 0,
|
|
1861
|
-
customerOrganization: getString(customer, "organization") ?? getString(sourceRecord, "customerOrganization") ?? getString(rootRecord, "customerOrganization") ?? void 0,
|
|
1862
|
-
fields
|
|
1692
|
+
const envelope = await response.json();
|
|
1693
|
+
const data = envelope.data;
|
|
1694
|
+
return {
|
|
1695
|
+
releases: Array.isArray(data?.releases) ? data.releases : [],
|
|
1696
|
+
totalCount: data?.totalCount || 0
|
|
1863
1697
|
};
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
var fetchLicenseDetails = defineServerAction({
|
|
1867
|
-
id: "license/fetch-details",
|
|
1868
|
-
description: "Fetches the authenticated user's enterprise license details.",
|
|
1869
|
-
visibility: "customer",
|
|
1870
|
-
tags: ["license", "entitlements"],
|
|
1871
|
-
async run({ token }, context) {
|
|
1872
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1873
|
-
throw new Error("fetchLicenseDetails requires a non-empty token");
|
|
1874
|
-
}
|
|
1875
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1876
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1877
|
-
console.debug("[portal-components] fetching license via %s (Enterprise Portal API)", endpoint);
|
|
1878
|
-
}
|
|
1879
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1880
|
-
method: "GET",
|
|
1881
|
-
token,
|
|
1882
|
-
headers: {
|
|
1883
|
-
accept: "application/json"
|
|
1884
|
-
},
|
|
1885
|
-
signal: context?.signal
|
|
1886
|
-
});
|
|
1887
|
-
if (!response.ok) {
|
|
1888
|
-
throw new Error(
|
|
1889
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1890
|
-
);
|
|
1891
|
-
}
|
|
1892
|
-
const payload = await response.json();
|
|
1893
|
-
const licenseData = payload.data;
|
|
1894
|
-
const license = normalizeLicensePayload(licenseData);
|
|
1895
|
-
return {
|
|
1896
|
-
license,
|
|
1897
|
-
raw: licenseData ?? null
|
|
1898
|
-
};
|
|
1899
|
-
}
|
|
1900
|
-
});
|
|
1901
|
-
var fetchInstallOptions = defineServerAction({
|
|
1902
|
-
id: "license/fetch-install-options",
|
|
1903
|
-
description: "Fetches install options based on license entitlements.",
|
|
1904
|
-
visibility: "customer",
|
|
1905
|
-
tags: ["license", "install"],
|
|
1906
|
-
async run({ token }, context) {
|
|
1907
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1908
|
-
throw new Error("fetchInstallOptions requires a non-empty token");
|
|
1909
|
-
}
|
|
1910
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1911
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1912
|
-
console.debug("[portal-components] fetching install options via %s (Enterprise Portal API)", endpoint);
|
|
1913
|
-
}
|
|
1914
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1915
|
-
method: "GET",
|
|
1916
|
-
token,
|
|
1917
|
-
headers: {
|
|
1918
|
-
accept: "application/json"
|
|
1919
|
-
},
|
|
1920
|
-
signal: context?.signal
|
|
1921
|
-
});
|
|
1922
|
-
if (!response.ok) {
|
|
1923
|
-
throw new Error(
|
|
1924
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1925
|
-
);
|
|
1926
|
-
}
|
|
1927
|
-
const envelope = await response.json();
|
|
1928
|
-
const licenseData = envelope.data;
|
|
1929
|
-
const getBoolean2 = (obj, key) => {
|
|
1930
|
-
if (obj && typeof obj === "object" && key in obj) {
|
|
1931
|
-
const val = obj[key];
|
|
1932
|
-
return val === true || val === "true";
|
|
1933
|
-
}
|
|
1934
|
-
return false;
|
|
1935
|
-
};
|
|
1936
|
-
const showLinux = getBoolean2(licenseData, "isEmbeddedClusterDownloadEnabled");
|
|
1937
|
-
const showHelm = getBoolean2(licenseData, "isHelmInstallEnabled");
|
|
1938
|
-
return {
|
|
1939
|
-
showLinux,
|
|
1940
|
-
showHelm
|
|
1941
|
-
};
|
|
1942
|
-
}
|
|
1943
|
-
});
|
|
1944
|
-
var fetchLicenseSummary = defineServerAction({
|
|
1945
|
-
id: "license/fetch-summary",
|
|
1946
|
-
description: "Fetches license summary for the license card.",
|
|
1947
|
-
visibility: "customer",
|
|
1948
|
-
tags: ["license"],
|
|
1949
|
-
async run({ token }, context) {
|
|
1950
|
-
if (typeof token !== "string" || token.trim().length === 0) {
|
|
1951
|
-
throw new Error("fetchLicenseSummary requires a non-empty token");
|
|
1952
|
-
}
|
|
1953
|
-
const endpoint = `${getApiOrigin()}/enterprise-portal/license`;
|
|
1954
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1955
|
-
console.debug("[portal-components] fetching license summary via %s (Enterprise Portal API)", endpoint);
|
|
1956
|
-
}
|
|
1957
|
-
const response = await authenticatedFetch(endpoint, {
|
|
1958
|
-
method: "GET",
|
|
1959
|
-
token,
|
|
1960
|
-
headers: {
|
|
1961
|
-
accept: "application/json"
|
|
1962
|
-
},
|
|
1963
|
-
signal: context?.signal
|
|
1964
|
-
});
|
|
1965
|
-
if (!response.ok) {
|
|
1966
|
-
throw new Error(
|
|
1967
|
-
`License request failed (${response.status} ${response.statusText})`
|
|
1968
|
-
);
|
|
1969
|
-
}
|
|
1970
|
-
const envelope = await response.json();
|
|
1971
|
-
const licenseData = envelope.data;
|
|
1972
|
-
const license = normalizeLicensePayload(licenseData);
|
|
1973
|
-
const type = license.environment || "Unknown";
|
|
1974
|
-
const expiresAt = license.expiresAt || null;
|
|
1975
|
-
return {
|
|
1976
|
-
type,
|
|
1977
|
-
expiresAt
|
|
1978
|
-
};
|
|
1979
|
-
}
|
|
1980
|
-
});
|
|
1698
|
+
}
|
|
1699
|
+
var listReleases = traceServerAction("listReleases", listReleasesImpl);
|
|
1981
1700
|
var fetchCustomers = defineServerAction({
|
|
1982
1701
|
id: "auth/fetch-customers",
|
|
1983
1702
|
description: "Fetches the list of customers/teams for the authenticated user.",
|
|
@@ -3027,6 +2746,6 @@ var refreshInvite = defineServerAction({
|
|
|
3027
2746
|
}
|
|
3028
2747
|
});
|
|
3029
2748
|
|
|
3030
|
-
export { acceptInvite, changeTeamAction, createInstallOptionsAction, createServiceAccount, createServiceAccountAction, decodeJwtPayload, defineServerAction, deleteSupportBundle, deleteSupportBundleAction, deleteUser, deleteUserAction, deprovisionSaml, deprovisionSamlAction, discardInstallationAction, downloadSecuritySBOM, downloadSupportBundle, downloadSupportBundleAction, fetchAppInfo, fetchChannelReleasesAction, fetchCurrentUser, fetchCurrentUserAction, fetchCustomBranding, fetchCustomers, fetchCustomersForMenu, fetchDashboardComposite, fetchDashboardInstances,
|
|
2749
|
+
export { acceptInvite, changeTeamAction, createInstallOptionsAction, createServiceAccount, createServiceAccountAction, decodeJwtPayload, defineServerAction, deleteSupportBundle, deleteSupportBundleAction, deleteUser, deleteUserAction, deprovisionSaml, deprovisionSamlAction, discardInstallationAction, downloadSecuritySBOM, downloadSupportBundle, downloadSupportBundleAction, fetchAppFeatures, fetchAppInfo, fetchChannelReleasesAction, fetchCurrentUser, fetchCurrentUserAction, fetchCustomBranding, fetchCustomers, fetchCustomersForMenu, fetchDashboardComposite, fetchDashboardInstances, fetchInstances, fetchInstancesAction, fetchLicense, fetchNotifications, fetchNotificationsAction, fetchPendingInstallationsAction, fetchSamlConfig, fetchSamlConfigAction, fetchServiceAccounts, fetchServiceAccountsAction, fetchTeamStats, fetchTeamUsers, fetchTeamUsersAction, fetchTeamsForUserSettings, fetchUser, getApiOrigin, getCustomerIdFromToken, getInstallOptionsAction, getSecurityInfo, getSecurityInfoDiff, getSecurityInfoSBOM, getSupportBundleUploadUrl, initiateLogin, inviteUser, inviteUserAction, listReleases, listSupportBundles, listSupportBundlesAction, refreshInvite, revokeServiceAccount, revokeServiceAccountAction, rotateServiceAccountToken, rotateServiceAccountTokenAction, switchCustomer, toggleSamlEnabled, toggleSamlEnabledAction, updateInstallOptionsAction, updateNotifications, updateNotificationsAction, updateSamlConfig, updateSamlConfigAction, updateUser, updateUserAction, uploadSupportBundle, uploadSupportBundleAction, verifyMagicLink };
|
|
3031
2750
|
//# sourceMappingURL=index.js.map
|
|
3032
2751
|
//# sourceMappingURL=index.js.map
|