@stacksjs/ts-cloud 0.7.83 → 0.7.84
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/dist/bin/cli.js +602 -602
- package/dist/{chunk-ptf1hhsd.js → chunk-8m38yfba.js} +25 -4
- package/dist/deploy/index.js +1 -1
- package/dist/deploy/local-dashboard-server.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/ui/access-denied.html +2 -2
- package/dist/ui/account/automation.html +3 -3
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +4 -4
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +4 -4
- package/dist/ui/data/services.html +4 -4
- package/dist/ui/data/volumes.html +4 -4
- package/dist/ui/index.html +4 -4
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +4 -4
- package/dist/ui/operations/configuration.html +3 -3
- package/dist/ui/operations/jobs.html +4 -4
- package/dist/ui/operations/maintenance.html +3 -3
- package/dist/ui/operations/observability.html +4 -4
- package/dist/ui/operations/previews.html +4 -4
- package/dist/ui/operations/queue.html +4 -4
- package/dist/ui/operations/regions.html +4 -4
- package/dist/ui/operations/releases.html +4 -4
- package/dist/ui/operations/workloads.html +4 -4
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +3 -3
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +4 -4
- package/dist/ui/server/database.html +4 -4
- package/dist/ui/server/deployments.html +4 -4
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +4 -4
- package/dist/ui/server/fleet.html +4 -4
- package/dist/ui/server/logs.html +4 -4
- package/dist/ui/server/metrics.html +4 -4
- package/dist/ui/server/services.html +2 -2
- package/dist/ui/server/sites.html +4 -4
- package/dist/ui/server/ssh-keys.html +4 -4
- package/dist/ui/server/team.html +4 -4
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +4 -4
- package/dist/ui/serverless/data.html +4 -4
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +2 -2
- package/dist/ui/serverless/functions.html +4 -4
- package/dist/ui/serverless/logs.html +4 -4
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +4 -4
- package/dist/ui/serverless/secrets.html +4 -4
- package/dist/ui/serverless/traces.html +4 -4
- package/dist/ui/serverless.html +4 -4
- package/package.json +3 -3
|
@@ -43156,7 +43156,7 @@ function authorizationScope(body) {
|
|
|
43156
43156
|
const id2 = String(body.scopeId ?? "").trim();
|
|
43157
43157
|
return id2 ? { type, id: id2 } : undefined;
|
|
43158
43158
|
}
|
|
43159
|
-
async function resolveLiveDashboardData(config6, environment2) {
|
|
43159
|
+
async function resolveLiveDashboardData(config6, environment2, options = {}) {
|
|
43160
43160
|
const mode = resolveDeploymentMode(config6);
|
|
43161
43161
|
const meta = {
|
|
43162
43162
|
mode,
|
|
@@ -43165,12 +43165,24 @@ async function resolveLiveDashboardData(config6, environment2) {
|
|
|
43165
43165
|
project: { name: config6.project.name, slug: config6.project.slug, region: config6.project.region }
|
|
43166
43166
|
};
|
|
43167
43167
|
try {
|
|
43168
|
-
const data = mode === "serverless" ? await resolveDashboardData(config6, environment2) : await resolveServerDashboardData(config6, environment2
|
|
43168
|
+
const data = mode === "serverless" ? await resolveDashboardData(config6, environment2) : await resolveServerDashboardData(config6, environment2, {
|
|
43169
|
+
includeSiteHealth: options.includeSiteHealth
|
|
43170
|
+
});
|
|
43169
43171
|
return { ...data ?? {}, ...meta };
|
|
43170
43172
|
} catch {
|
|
43171
43173
|
return { ...meta };
|
|
43172
43174
|
}
|
|
43173
43175
|
}
|
|
43176
|
+
function preserveDashboardSiteSnapshot(previous, next) {
|
|
43177
|
+
if (!previous)
|
|
43178
|
+
return next;
|
|
43179
|
+
return {
|
|
43180
|
+
...next,
|
|
43181
|
+
...Array.isArray(previous.sites) ? { sites: previous.sites } : {},
|
|
43182
|
+
...Array.isArray(previous.sitesDetail) ? { sitesDetail: previous.sitesDetail } : {},
|
|
43183
|
+
...Array.isArray(previous.siteHealth) ? { siteHealth: previous.siteHealth } : {}
|
|
43184
|
+
};
|
|
43185
|
+
}
|
|
43174
43186
|
function resolveUiSourceDir(cwd) {
|
|
43175
43187
|
const candidates = [
|
|
43176
43188
|
join13(cwd, "packages", "ui"),
|
|
@@ -43524,8 +43536,13 @@ async function startLocalDashboardServer(options = {}) {
|
|
|
43524
43536
|
const initialData = await resolveLiveDashboardData(config6, defaultEnvironment);
|
|
43525
43537
|
const latestDataByEnvironment = new Map([[defaultEnvironment, initialData]]);
|
|
43526
43538
|
const latestDataRefreshedAtByEnvironment = new Map([[defaultEnvironment, Date.now()]]);
|
|
43539
|
+
const latestSiteHealthRefreshedAtByEnvironment = new Map([
|
|
43540
|
+
[defaultEnvironment, Date.now()]
|
|
43541
|
+
]);
|
|
43527
43542
|
const liveDataRefreshesByEnvironment = new Map;
|
|
43528
43543
|
const dashboardDataMinimumRefreshMs = Math.min(5 * 60000, Math.max(5000, Number(process.env.TS_CLOUD_DASHBOARD_REFRESH_MS) || 30000));
|
|
43544
|
+
const dashboardSiteHealthMinimumRefreshMs = Math.min(30 * 60000, Math.max(60000, Number(process.env.TS_CLOUD_DASHBOARD_SITE_REFRESH_MS) || 5 * 60000));
|
|
43545
|
+
const computeDashboard = resolveDeploymentMode(config6) !== "serverless";
|
|
43529
43546
|
const refreshLatestDashboardData = (environment2) => {
|
|
43530
43547
|
const previous = latestDataByEnvironment.get(environment2);
|
|
43531
43548
|
if (previous && !dashboardDataRefreshDue(latestDataRefreshedAtByEnvironment.get(environment2), Date.now(), dashboardDataMinimumRefreshMs))
|
|
@@ -43533,10 +43550,14 @@ async function startLocalDashboardServer(options = {}) {
|
|
|
43533
43550
|
const running = liveDataRefreshesByEnvironment.get(environment2);
|
|
43534
43551
|
if (running)
|
|
43535
43552
|
return running;
|
|
43536
|
-
const
|
|
43553
|
+
const includeSiteHealth = !computeDashboard || dashboardDataRefreshDue(latestSiteHealthRefreshedAtByEnvironment.get(environment2), Date.now(), dashboardSiteHealthMinimumRefreshMs);
|
|
43554
|
+
const refresh = resolveLiveDashboardData(config6, environment2, { includeSiteHealth }).then((refreshedData) => {
|
|
43537
43555
|
const previous2 = latestDataByEnvironment.get(environment2);
|
|
43556
|
+
const data = includeSiteHealth ? refreshedData : preserveDashboardSiteSnapshot(previous2, refreshedData);
|
|
43538
43557
|
latestDataByEnvironment.set(environment2, data);
|
|
43539
43558
|
latestDataRefreshedAtByEnvironment.set(environment2, Date.now());
|
|
43559
|
+
if (includeSiteHealth)
|
|
43560
|
+
latestSiteHealthRefreshedAtByEnvironment.set(environment2, Date.now());
|
|
43540
43561
|
if (previous2?._serverReachable !== data._serverReachable || previous2?._metricsStatus !== data._metricsStatus || (previous2?.sitesDetail?.length ?? 0) !== (data.sitesDetail?.length ?? 0))
|
|
43541
43562
|
clearUiCache();
|
|
43542
43563
|
return data;
|
|
@@ -43549,7 +43570,7 @@ async function startLocalDashboardServer(options = {}) {
|
|
|
43549
43570
|
const backgroundTelemetryEnabled = options.box && telemetryPreference !== "0" && (telemetryPreference === "1" || !config6.cloud?.attachTo);
|
|
43550
43571
|
if (backgroundTelemetryEnabled) {
|
|
43551
43572
|
let telemetryCollectionRunning = false;
|
|
43552
|
-
let nextSiteHealthCollectionAt =
|
|
43573
|
+
let nextSiteHealthCollectionAt = Date.now() + 5 * 60000;
|
|
43553
43574
|
const collectHostHistory = async () => {
|
|
43554
43575
|
if (telemetryCollectionRunning)
|
|
43555
43576
|
return;
|
package/dist/deploy/index.js
CHANGED
|
@@ -48,6 +48,7 @@ export declare function resolveDashboardEnvironment(available: readonly string[]
|
|
|
48
48
|
export declare function dashboardDataRefreshDue(lastRefreshedAt: number | undefined, now: number, minimumIntervalMs: number): boolean;
|
|
49
49
|
/** Reject browser cross-site mutations while retaining header-light CLI access. */
|
|
50
50
|
export declare function isTrustedMutationRequest(req: Request): boolean;
|
|
51
|
+
export declare function preserveDashboardSiteSnapshot(previous: Record<string, any> | undefined, next: Record<string, any>): Record<string, any>;
|
|
51
52
|
export declare function sanitizeCloudConfig(config: CloudConfig): Record<string, any>;
|
|
52
53
|
export declare function dashboardActions(environment: EnvironmentType): DashboardAction[];
|
|
53
54
|
export declare function resolveDashboardAction(id: string, environment: EnvironmentType): DashboardAction | undefined;
|