mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Portal: full mock-driven surfaces, demonolithed components, backend-ready mocks (#6686)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
import type { DocsContent, DocsNavSection } from "@portal/mocks/docs";
|
||||
|
||||
export type {
|
||||
AgentSkill,
|
||||
ApiErrorRow,
|
||||
CodeSample,
|
||||
DocsContent,
|
||||
DocsNavItem,
|
||||
DocsNavSection,
|
||||
EmbedComponent,
|
||||
Playbook,
|
||||
RateLimit,
|
||||
Sdk,
|
||||
SdkStatus,
|
||||
} from "@portal/mocks/docs";
|
||||
|
||||
/** GET /v1/docs/nav — the docs nav tree. */
|
||||
export async function fetchDocsNav(): Promise<DocsNavSection[]> {
|
||||
return httpJson<DocsNavSection[]>("/v1/docs/nav");
|
||||
}
|
||||
|
||||
/** GET /v1/docs/content — the tier-scaled reference content. */
|
||||
export async function fetchDocsContent(tier: Tier): Promise<DocsContent> {
|
||||
return httpJson<DocsContent>(`/v1/docs/content?tier=${tier}`);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
import type {
|
||||
ApiKey,
|
||||
AuditLogResponse,
|
||||
DeploymentRegion,
|
||||
RecentDeployment,
|
||||
SecurityConfig,
|
||||
StorageConfig,
|
||||
} from "@portal/mocks/infrastructure";
|
||||
|
||||
export type {
|
||||
AccessPolicy,
|
||||
ApiKey,
|
||||
ApiKeyPermission,
|
||||
ApiKeyStatus,
|
||||
AuditCategory,
|
||||
AuditEvent,
|
||||
AuditLogResponse,
|
||||
AuditStatus,
|
||||
AuditSummary,
|
||||
CertStatus,
|
||||
ComplianceCert,
|
||||
DataResidency,
|
||||
DeploymentRegion,
|
||||
DeploymentStatus,
|
||||
IpAllowEntry,
|
||||
RecentDeployment,
|
||||
RegionStatus,
|
||||
RetentionWindow,
|
||||
SecurityConfig,
|
||||
StorageConfig,
|
||||
StorageProvider,
|
||||
} from "@portal/mocks/infrastructure";
|
||||
|
||||
export interface DeploymentsResponse {
|
||||
regions: DeploymentRegion[];
|
||||
recent: RecentDeployment[];
|
||||
}
|
||||
|
||||
const q = (tier: Tier) => `?tier=${encodeURIComponent(tier)}`;
|
||||
|
||||
/** GET /v1/infrastructure/deployments?tier=… */
|
||||
export async function fetchDeployments(
|
||||
tier: Tier,
|
||||
): Promise<DeploymentsResponse> {
|
||||
return httpJson<DeploymentsResponse>(
|
||||
`/v1/infrastructure/deployments${q(tier)}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** GET /v1/infrastructure/api-keys?tier=… */
|
||||
export async function fetchApiKeys(tier: Tier): Promise<ApiKey[]> {
|
||||
return httpJson<ApiKey[]>(`/v1/infrastructure/api-keys${q(tier)}`);
|
||||
}
|
||||
|
||||
/** GET /v1/infrastructure/security?tier=… */
|
||||
export async function fetchSecurity(tier: Tier): Promise<SecurityConfig> {
|
||||
return httpJson<SecurityConfig>(`/v1/infrastructure/security${q(tier)}`);
|
||||
}
|
||||
|
||||
/** GET /v1/infrastructure/storage?tier=… */
|
||||
export async function fetchStorage(tier: Tier): Promise<StorageConfig> {
|
||||
return httpJson<StorageConfig>(`/v1/infrastructure/storage${q(tier)}`);
|
||||
}
|
||||
|
||||
/** GET /v1/infrastructure/audit-log?tier=… */
|
||||
export async function fetchAuditLog(tier: Tier): Promise<AuditLogResponse> {
|
||||
return httpJson<AuditLogResponse>(`/v1/infrastructure/audit-log${q(tier)}`);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { PipelinesResponse } from "@portal/mocks/pipelines";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
|
||||
export type {
|
||||
EvalsNote,
|
||||
GoldenSet,
|
||||
Pipeline,
|
||||
PipelineMetrics,
|
||||
PipelinesResponse,
|
||||
PipelineStatus,
|
||||
SchemaDrift,
|
||||
StageKey,
|
||||
StageSummary,
|
||||
} from "@portal/mocks/pipelines";
|
||||
|
||||
/** GET /v1/pipelines?tier=… — the deployed fleet plus tier-specific extras. */
|
||||
export async function fetchPipelines(tier: Tier): Promise<PipelinesResponse> {
|
||||
return httpJson<PipelinesResponse>(
|
||||
`/v1/pipelines?tier=${encodeURIComponent(tier)}`,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { SettingsSnapshot } from "@portal/mocks/settings";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
|
||||
export type {
|
||||
NotificationDefault,
|
||||
RegionOption,
|
||||
SettingsSnapshot,
|
||||
} from "@portal/mocks/settings";
|
||||
|
||||
/** GET /v1/settings?tier=… — the account + workspace snapshot the modal edits. */
|
||||
export async function fetchSettings(tier: Tier): Promise<SettingsSnapshot> {
|
||||
return httpJson<SettingsSnapshot>(
|
||||
`/v1/settings?tier=${encodeURIComponent(tier)}`,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { SourcesResponse } from "@portal/mocks/sources";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
|
||||
export type {
|
||||
AgentDetail,
|
||||
ApiClientDetail,
|
||||
BasicDetail,
|
||||
Source,
|
||||
SourceDetail,
|
||||
SourceStatus,
|
||||
SourceType,
|
||||
SourceTypeMeta,
|
||||
SourcesKpi,
|
||||
SourcesResponse,
|
||||
WebhookDetail,
|
||||
} from "@portal/mocks/sources";
|
||||
export { SOURCE_STATUS_TONE, SOURCE_TYPE_META } from "@portal/mocks/sources";
|
||||
|
||||
/** GET /v1/sources?tier=… — KPI strip + the sources table for the tier. */
|
||||
export async function fetchSources(tier: Tier): Promise<SourcesResponse> {
|
||||
return httpJson<SourcesResponse>(
|
||||
`/v1/sources?tier=${encodeURIComponent(tier)}`,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { httpJson } from "@portal/api/http";
|
||||
import type { Tier } from "@portal/contexts/TierContext";
|
||||
import type {
|
||||
BillingHistoryRow,
|
||||
BillingSummary,
|
||||
PlanOption,
|
||||
UsageSeriesResponse,
|
||||
} from "@portal/mocks/usage";
|
||||
|
||||
export type {
|
||||
BillingHistoryRow,
|
||||
BillingSummary,
|
||||
InvoiceStatus,
|
||||
PlanOption,
|
||||
UsagePoint,
|
||||
UsageSeriesResponse,
|
||||
} from "@portal/mocks/usage";
|
||||
export { OVERAGE_RATE } from "@portal/mocks/usage";
|
||||
|
||||
/** GET /v1/billing/usage — 30-day docs-processed series. */
|
||||
export async function fetchBillingUsage(): Promise<UsageSeriesResponse> {
|
||||
return httpJson<UsageSeriesResponse>("/v1/billing/usage");
|
||||
}
|
||||
|
||||
/** GET /v1/billing/summary?tier=… — KPI strip + current-plan figures. */
|
||||
export async function fetchBillingSummary(tier: Tier): Promise<BillingSummary> {
|
||||
return httpJson<BillingSummary>(
|
||||
`/v1/billing/summary?tier=${encodeURIComponent(tier)}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** GET /v1/billing/plans — available plan catalogue. */
|
||||
export async function fetchPlanOptions(): Promise<PlanOption[]> {
|
||||
return httpJson<PlanOption[]>("/v1/billing/plans");
|
||||
}
|
||||
|
||||
/** GET /v1/billing/history?tier=… — invoice / line-item history. */
|
||||
export async function fetchBillingHistory(
|
||||
tier: Tier,
|
||||
): Promise<BillingHistoryRow[]> {
|
||||
return httpJson<BillingHistoryRow[]>(
|
||||
`/v1/billing/history?tier=${encodeURIComponent(tier)}`,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user