@merittdev/horus-lens 0.0.2 → 0.0.3
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/README.md +51 -22
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/{chunk-DU7HNRF4.js → chunk-CTBY5XIN.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js → chunk-XRONR4GR.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js.map → chunk-XRONR4GR.js.map} +1 -1
- package/dist/dashboard.cjs +784 -434
- package/dist/dashboard.cjs.map +1 -1
- package/dist/dashboard.css +224 -1
- package/dist/dashboard.d.cts +85 -1
- package/dist/dashboard.d.ts +85 -1
- package/dist/dashboard.js +648 -301
- package/dist/dashboard.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lens.min.js +1 -1
- package/dist/lens.min.js.map +1 -1
- package/dist/react.cjs +6 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -6
- package/dist/react.d.ts +18 -6
- package/dist/react.js +6 -4
- package/dist/react.js.map +1 -1
- package/dist/server.cjs +109 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +59 -0
- package/dist/server.d.ts +59 -0
- package/dist/server.js +82 -0
- package/dist/server.js.map +1 -0
- package/package.json +9 -4
- /package/dist/{chunk-DU7HNRF4.js.map → chunk-CTBY5XIN.js.map} +0 -0
package/dist/dashboard.css
CHANGED
|
@@ -1426,6 +1426,47 @@
|
|
|
1426
1426
|
cursor: default;
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
|
+
/* Dropdown variant of the config editor — matches the input, with a monochrome
|
|
1430
|
+
chevron (inline data-uri so it stays self-contained). */
|
|
1431
|
+
.lens-db__intconfig-select {
|
|
1432
|
+
appearance: none;
|
|
1433
|
+
height: 28px;
|
|
1434
|
+
width: 100%;
|
|
1435
|
+
max-width: 260px;
|
|
1436
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
1437
|
+
font-size: 12.5px;
|
|
1438
|
+
color: var(--lens-fg);
|
|
1439
|
+
background-color: var(--lens-bg);
|
|
1440
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|
1441
|
+
background-repeat: no-repeat;
|
|
1442
|
+
background-position: right 9px center;
|
|
1443
|
+
background-size: 12px;
|
|
1444
|
+
border: 1px solid var(--lens-border);
|
|
1445
|
+
border-radius: var(--lens-radius);
|
|
1446
|
+
padding: 0 28px 0 9px;
|
|
1447
|
+
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.lens-db__intconfig-select:focus {
|
|
1451
|
+
outline: none;
|
|
1452
|
+
border-color: var(--lens-accent);
|
|
1453
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--lens-accent) 20%, transparent);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
.lens-db__intconfig-select:disabled {
|
|
1457
|
+
background-color: var(--lens-well);
|
|
1458
|
+
color: var(--lens-muted);
|
|
1459
|
+
cursor: default;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
/* Subtle nudge shown when live options couldn't be loaded and we fell back to
|
|
1463
|
+
the free-text input. */
|
|
1464
|
+
.lens-db__intconfig-note {
|
|
1465
|
+
flex-basis: 100%;
|
|
1466
|
+
font-size: 11.5px;
|
|
1467
|
+
color: var(--lens-muted);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1429
1470
|
/* Busy/saved affordances occupy the Save button's slot so the row doesn't shift. */
|
|
1430
1471
|
.lens-db__intconfig-busy,
|
|
1431
1472
|
.lens-db__intconfig-done {
|
|
@@ -1484,7 +1525,8 @@
|
|
|
1484
1525
|
flex-basis: 100%;
|
|
1485
1526
|
}
|
|
1486
1527
|
|
|
1487
|
-
.lens-db__intconfig-input
|
|
1528
|
+
.lens-db__intconfig-input,
|
|
1529
|
+
.lens-db__intconfig-select {
|
|
1488
1530
|
max-width: none;
|
|
1489
1531
|
}
|
|
1490
1532
|
}
|
|
@@ -2231,3 +2273,184 @@
|
|
|
2231
2273
|
color: var(--lens-muted);
|
|
2232
2274
|
border: 1px solid var(--lens-border);
|
|
2233
2275
|
}
|
|
2276
|
+
|
|
2277
|
+
/* ===========================================================================
|
|
2278
|
+
* <LensDashboard> shell — the batteries-included admin surface.
|
|
2279
|
+
* A full-width segmented tab bar (Issue Reports / Integrations / Setup), an
|
|
2280
|
+
* optional project switcher on the same row, first-run provisioning, and the
|
|
2281
|
+
* minted-secret env block. All monochrome + existing --lens-* variables.
|
|
2282
|
+
* ======================================================================== */
|
|
2283
|
+
|
|
2284
|
+
.lens-db__shell {
|
|
2285
|
+
display: flex;
|
|
2286
|
+
flex-direction: column;
|
|
2287
|
+
gap: 16px;
|
|
2288
|
+
width: 100%;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
/* Row: [ 3-up segmented tabs .................. ] [ project switcher ] */
|
|
2292
|
+
.lens-db__shell-bar {
|
|
2293
|
+
display: flex;
|
|
2294
|
+
align-items: center;
|
|
2295
|
+
gap: 12px;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
.lens-db__shell-tabs {
|
|
2299
|
+
flex: 1 1 auto;
|
|
2300
|
+
min-width: 0;
|
|
2301
|
+
display: grid;
|
|
2302
|
+
grid-template-columns: repeat(3, 1fr);
|
|
2303
|
+
gap: 4px;
|
|
2304
|
+
padding: 3px;
|
|
2305
|
+
background: var(--lens-well);
|
|
2306
|
+
border: 1px solid var(--lens-border);
|
|
2307
|
+
border-radius: var(--lens-radius);
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
.lens-db__shell-tab {
|
|
2311
|
+
display: inline-flex;
|
|
2312
|
+
align-items: center;
|
|
2313
|
+
justify-content: center;
|
|
2314
|
+
gap: 7px;
|
|
2315
|
+
height: 34px;
|
|
2316
|
+
min-width: 0;
|
|
2317
|
+
border: none;
|
|
2318
|
+
background: none;
|
|
2319
|
+
color: var(--lens-muted);
|
|
2320
|
+
font: inherit;
|
|
2321
|
+
font-size: 13px;
|
|
2322
|
+
font-weight: 500;
|
|
2323
|
+
border-radius: 6px;
|
|
2324
|
+
cursor: pointer;
|
|
2325
|
+
white-space: nowrap;
|
|
2326
|
+
transition: background 150ms ease, color 150ms ease;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
.lens-db__shell-tab svg {
|
|
2330
|
+
flex: none;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
.lens-db__shell-tab-label {
|
|
2334
|
+
overflow: hidden;
|
|
2335
|
+
text-overflow: ellipsis;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
.lens-db__shell-tab:hover:not(.lens-db__shell-tab--active) {
|
|
2339
|
+
color: var(--lens-fg);
|
|
2340
|
+
background: var(--lens-subtle);
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
.lens-db__shell-tab--active {
|
|
2344
|
+
background: var(--lens-accent);
|
|
2345
|
+
color: var(--lens-accent-fg);
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.lens-db__shell-tab:focus-visible {
|
|
2349
|
+
outline: 2px solid var(--lens-accent);
|
|
2350
|
+
outline-offset: 2px;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
/* Project switcher — the intconfig-select look, sized up to 32px. */
|
|
2354
|
+
.lens-db__shell-switcher {
|
|
2355
|
+
flex: none;
|
|
2356
|
+
display: inline-flex;
|
|
2357
|
+
align-items: center;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
.lens-db__shell-select {
|
|
2361
|
+
appearance: none;
|
|
2362
|
+
height: 32px;
|
|
2363
|
+
max-width: 220px;
|
|
2364
|
+
font: inherit;
|
|
2365
|
+
font-size: 13px;
|
|
2366
|
+
font-weight: 500;
|
|
2367
|
+
color: var(--lens-fg);
|
|
2368
|
+
background-color: var(--lens-bg);
|
|
2369
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|
2370
|
+
background-repeat: no-repeat;
|
|
2371
|
+
background-position: right 9px center;
|
|
2372
|
+
background-size: 12px;
|
|
2373
|
+
border: 1px solid var(--lens-border);
|
|
2374
|
+
border-radius: var(--lens-radius);
|
|
2375
|
+
padding: 0 30px 0 10px;
|
|
2376
|
+
cursor: pointer;
|
|
2377
|
+
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
.lens-db__shell-select:focus {
|
|
2381
|
+
outline: none;
|
|
2382
|
+
border-color: var(--lens-accent);
|
|
2383
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--lens-accent) 20%, transparent);
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
.lens-db__shell-content {
|
|
2387
|
+
min-width: 0;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
/* Loading placeholder while the project list resolves. */
|
|
2391
|
+
.lens-db__shell-loading {
|
|
2392
|
+
padding: 40px 16px;
|
|
2393
|
+
text-align: center;
|
|
2394
|
+
color: var(--lens-muted);
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/* ---------- First-run provisioning ---------- */
|
|
2398
|
+
|
|
2399
|
+
.lens-db__shell-provision {
|
|
2400
|
+
display: flex;
|
|
2401
|
+
flex-direction: column;
|
|
2402
|
+
gap: 16px;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
.lens-db__shell-notice {
|
|
2406
|
+
padding: 16px 18px;
|
|
2407
|
+
border: 1px solid var(--lens-border);
|
|
2408
|
+
border-radius: var(--lens-radius-card);
|
|
2409
|
+
background: var(--lens-well);
|
|
2410
|
+
box-shadow: var(--lens-shadow);
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
.lens-db__shell-notice-title {
|
|
2414
|
+
margin: 0 0 4px;
|
|
2415
|
+
font-size: 14px;
|
|
2416
|
+
font-weight: 600;
|
|
2417
|
+
color: var(--lens-fg);
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
.lens-db__shell-notice p:last-child {
|
|
2421
|
+
margin: 0;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
.lens-db__shell-env {
|
|
2425
|
+
display: flex;
|
|
2426
|
+
flex-direction: column;
|
|
2427
|
+
gap: 8px;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
/* Under 560px: tabs stay 3-up with tighter padding; switcher drops to its own
|
|
2431
|
+
full-width row above them. */
|
|
2432
|
+
@media (max-width: 560px) {
|
|
2433
|
+
.lens-db__shell-bar {
|
|
2434
|
+
flex-wrap: wrap;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
.lens-db__shell-switcher {
|
|
2438
|
+
order: -1;
|
|
2439
|
+
width: 100%;
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
.lens-db__shell-select {
|
|
2443
|
+
max-width: none;
|
|
2444
|
+
width: 100%;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
.lens-db__shell-tabs {
|
|
2448
|
+
flex-basis: 100%;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
.lens-db__shell-tab {
|
|
2452
|
+
gap: 5px;
|
|
2453
|
+
padding: 0 6px;
|
|
2454
|
+
font-size: 12.5px;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
package/dist/dashboard.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Heavy payloads are uploaded to S3 as individual assets via presigned URLs;
|
|
@@ -515,6 +516,19 @@ interface LensApi {
|
|
|
515
516
|
disconnectIntegration(provider: IntegrationProvider): Promise<Integration[]>;
|
|
516
517
|
/** Updates `provider`'s non-secret issue-routing config; returns the refreshed list. */
|
|
517
518
|
updateIntegrationConfig(provider: IntegrationProvider, config: IntegrationConfig): Promise<Integration[]>;
|
|
519
|
+
/**
|
|
520
|
+
* Live dropdown choices for `provider`'s config line, fetched from the
|
|
521
|
+
* connected provider's API with the stored OAuth token. Rejects with code
|
|
522
|
+
* `not_connected` (409) when the provider isn't connected, or
|
|
523
|
+
* `options_fetch_failed` (502) on an upstream failure.
|
|
524
|
+
*/
|
|
525
|
+
getIntegrationOptions(provider: IntegrationProvider): Promise<{
|
|
526
|
+
field: string;
|
|
527
|
+
options: {
|
|
528
|
+
value: string;
|
|
529
|
+
label: string;
|
|
530
|
+
}[];
|
|
531
|
+
}>;
|
|
518
532
|
/** Bootstrap/admin auth. `accessSecret` is returned exactly once. */
|
|
519
533
|
createProject(body: CreateProjectRequest): Promise<CreateProjectResponse>;
|
|
520
534
|
/** Reads the current project (S3 config masked, secret never returned). */
|
|
@@ -592,6 +606,76 @@ declare function LensDashboardProvider(props: LensDashboardProviderProps): React
|
|
|
592
606
|
/** Reads the {@link LensApi} from context, throwing a clear error if missing. */
|
|
593
607
|
declare function useLensApi(): LensApi;
|
|
594
608
|
|
|
609
|
+
/** A project the dashboard can switch between, as returned by `projectsUrl`. */
|
|
610
|
+
interface ProjectRef {
|
|
611
|
+
name: string;
|
|
612
|
+
accessId: string;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Direct-mode configuration: full credentials passed straight to the
|
|
616
|
+
* component, which then talks to the Lens API without any host-side proxy.
|
|
617
|
+
* Only use this on pages that are themselves access-controlled (the secrets
|
|
618
|
+
* are visible to anyone who can render the page).
|
|
619
|
+
*/
|
|
620
|
+
interface LensAdminConfig {
|
|
621
|
+
projects: {
|
|
622
|
+
name: string;
|
|
623
|
+
accessId: string;
|
|
624
|
+
secretKey: string;
|
|
625
|
+
}[];
|
|
626
|
+
/** Enables project creation from the Setup wizard (admin-scoped). */
|
|
627
|
+
adminToken?: string;
|
|
628
|
+
/** Lens API base. Default: the hosted API. */
|
|
629
|
+
apiUrl?: string;
|
|
630
|
+
}
|
|
631
|
+
type TabId = 'reports' | 'integrations' | 'setup';
|
|
632
|
+
/**
|
|
633
|
+
* Loads the keys for <LensAdmin>:
|
|
634
|
+
*
|
|
635
|
+
* <LensProvider config={config}>
|
|
636
|
+
* <LensAdmin />
|
|
637
|
+
* </LensProvider>
|
|
638
|
+
*
|
|
639
|
+
* `config` comes from your server code (page/server component reading env) —
|
|
640
|
+
* render this only on access-controlled pages.
|
|
641
|
+
*/
|
|
642
|
+
declare function LensProvider({ config, children, }: {
|
|
643
|
+
config: LensAdminConfig;
|
|
644
|
+
children: ReactNode;
|
|
645
|
+
}): React.JSX.Element;
|
|
646
|
+
interface LensAdminProps {
|
|
647
|
+
/**
|
|
648
|
+
* Direct mode: pass keys and skip server routes entirely (or supply them via
|
|
649
|
+
* the surrounding <LensProvider config={…}>). Wins over `baseUrl` /
|
|
650
|
+
* `projectsUrl` / `projects`.
|
|
651
|
+
*/
|
|
652
|
+
config?: LensAdminConfig;
|
|
653
|
+
/** Proxy mode: server-side proxy base. Default '/api/lens'. */
|
|
654
|
+
baseUrl?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Proxy mode: endpoint returning `{ projects: [{ name, accessId }] }`.
|
|
657
|
+
* Default '/api/lens-projects'. Ignored when `projects` is passed.
|
|
658
|
+
*/
|
|
659
|
+
projectsUrl?: string;
|
|
660
|
+
/** Proxy mode: static project list — skips the projectsUrl fetch. */
|
|
661
|
+
projects?: ProjectRef[];
|
|
662
|
+
/** Initial tab. Default 'reports'. */
|
|
663
|
+
defaultTab?: TabId;
|
|
664
|
+
theme?: 'light' | 'dark';
|
|
665
|
+
className?: string;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Batteries-included admin surface for Lens. Renders the segmented tab bar
|
|
669
|
+
* (Issue Reports / Integrations / Setup), an optional project switcher, report
|
|
670
|
+
* deep-linking, and first-run provisioning — so a host writes a single import
|
|
671
|
+
* instead of assembling the pieces by hand. Pairs with a server-side proxy the
|
|
672
|
+
* host owns (`baseUrl`) that attaches project credentials.
|
|
673
|
+
*/
|
|
674
|
+
declare function LensAdmin(props: LensAdminProps): React.JSX.Element;
|
|
675
|
+
declare const LensDashboard: typeof LensAdmin;
|
|
676
|
+
type LensDashboardProps = LensAdminProps;
|
|
677
|
+
type LensDashboardConfig = LensAdminConfig;
|
|
678
|
+
|
|
595
679
|
interface ReportsTableProps {
|
|
596
680
|
onSelect?: (id: string) => void;
|
|
597
681
|
status?: ReportStatus;
|
|
@@ -704,4 +788,4 @@ interface AsyncState<T> {
|
|
|
704
788
|
*/
|
|
705
789
|
declare function useAsync<T>(fn: () => Promise<T>, deps: unknown[]): AsyncState<T>;
|
|
706
790
|
|
|
707
|
-
export { type AssetKind, type AssetRef, type AsyncState, type ConnectIntegrationResponse, type CreateProjectRequest, type CreateProjectResponse, type Integration, type IntegrationProvider, IntegrationSettings, type IntegrationSettingsProps, type IntegrationStatus, type LensApi, type LensApiConfig, LensApiError, LensDashboardProvider, type LensDashboardProviderProps, type ListIntegrationsResponse, type ListReportsQuery, type ListReportsResult, OnboardingWizard, type OnboardingWizardProps, type Project, ProjectSettings, type ProjectSettingsProps, ReplayPlayer, type ReplayPlayerProps, type Report, ReportDetail, type ReportDetailProps, type ReportMetadata, type ReportStatus, type ReportSummary, ReportsTable, type ReportsTableProps, type S3ConfigInput, type S3ConfigPublic, StatusBadge, type UpdateProjectRequest, createLensApi, useAsync, useLensApi };
|
|
791
|
+
export { type AssetKind, type AssetRef, type AsyncState, type ConnectIntegrationResponse, type CreateProjectRequest, type CreateProjectResponse, type Integration, type IntegrationProvider, IntegrationSettings, type IntegrationSettingsProps, type IntegrationStatus, LensAdmin, type LensAdminConfig, type LensAdminProps, type LensApi, type LensApiConfig, LensApiError, LensDashboard, type LensDashboardConfig, type LensDashboardProps, LensDashboardProvider, type LensDashboardProviderProps, LensProvider, type ListIntegrationsResponse, type ListReportsQuery, type ListReportsResult, OnboardingWizard, type OnboardingWizardProps, type Project, ProjectSettings, type ProjectSettingsProps, ReplayPlayer, type ReplayPlayerProps, type Report, ReportDetail, type ReportDetailProps, type ReportMetadata, type ReportStatus, type ReportSummary, ReportsTable, type ReportsTableProps, type S3ConfigInput, type S3ConfigPublic, StatusBadge, type UpdateProjectRequest, createLensApi, useAsync, useLensApi };
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Heavy payloads are uploaded to S3 as individual assets via presigned URLs;
|
|
@@ -515,6 +516,19 @@ interface LensApi {
|
|
|
515
516
|
disconnectIntegration(provider: IntegrationProvider): Promise<Integration[]>;
|
|
516
517
|
/** Updates `provider`'s non-secret issue-routing config; returns the refreshed list. */
|
|
517
518
|
updateIntegrationConfig(provider: IntegrationProvider, config: IntegrationConfig): Promise<Integration[]>;
|
|
519
|
+
/**
|
|
520
|
+
* Live dropdown choices for `provider`'s config line, fetched from the
|
|
521
|
+
* connected provider's API with the stored OAuth token. Rejects with code
|
|
522
|
+
* `not_connected` (409) when the provider isn't connected, or
|
|
523
|
+
* `options_fetch_failed` (502) on an upstream failure.
|
|
524
|
+
*/
|
|
525
|
+
getIntegrationOptions(provider: IntegrationProvider): Promise<{
|
|
526
|
+
field: string;
|
|
527
|
+
options: {
|
|
528
|
+
value: string;
|
|
529
|
+
label: string;
|
|
530
|
+
}[];
|
|
531
|
+
}>;
|
|
518
532
|
/** Bootstrap/admin auth. `accessSecret` is returned exactly once. */
|
|
519
533
|
createProject(body: CreateProjectRequest): Promise<CreateProjectResponse>;
|
|
520
534
|
/** Reads the current project (S3 config masked, secret never returned). */
|
|
@@ -592,6 +606,76 @@ declare function LensDashboardProvider(props: LensDashboardProviderProps): React
|
|
|
592
606
|
/** Reads the {@link LensApi} from context, throwing a clear error if missing. */
|
|
593
607
|
declare function useLensApi(): LensApi;
|
|
594
608
|
|
|
609
|
+
/** A project the dashboard can switch between, as returned by `projectsUrl`. */
|
|
610
|
+
interface ProjectRef {
|
|
611
|
+
name: string;
|
|
612
|
+
accessId: string;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Direct-mode configuration: full credentials passed straight to the
|
|
616
|
+
* component, which then talks to the Lens API without any host-side proxy.
|
|
617
|
+
* Only use this on pages that are themselves access-controlled (the secrets
|
|
618
|
+
* are visible to anyone who can render the page).
|
|
619
|
+
*/
|
|
620
|
+
interface LensAdminConfig {
|
|
621
|
+
projects: {
|
|
622
|
+
name: string;
|
|
623
|
+
accessId: string;
|
|
624
|
+
secretKey: string;
|
|
625
|
+
}[];
|
|
626
|
+
/** Enables project creation from the Setup wizard (admin-scoped). */
|
|
627
|
+
adminToken?: string;
|
|
628
|
+
/** Lens API base. Default: the hosted API. */
|
|
629
|
+
apiUrl?: string;
|
|
630
|
+
}
|
|
631
|
+
type TabId = 'reports' | 'integrations' | 'setup';
|
|
632
|
+
/**
|
|
633
|
+
* Loads the keys for <LensAdmin>:
|
|
634
|
+
*
|
|
635
|
+
* <LensProvider config={config}>
|
|
636
|
+
* <LensAdmin />
|
|
637
|
+
* </LensProvider>
|
|
638
|
+
*
|
|
639
|
+
* `config` comes from your server code (page/server component reading env) —
|
|
640
|
+
* render this only on access-controlled pages.
|
|
641
|
+
*/
|
|
642
|
+
declare function LensProvider({ config, children, }: {
|
|
643
|
+
config: LensAdminConfig;
|
|
644
|
+
children: ReactNode;
|
|
645
|
+
}): React.JSX.Element;
|
|
646
|
+
interface LensAdminProps {
|
|
647
|
+
/**
|
|
648
|
+
* Direct mode: pass keys and skip server routes entirely (or supply them via
|
|
649
|
+
* the surrounding <LensProvider config={…}>). Wins over `baseUrl` /
|
|
650
|
+
* `projectsUrl` / `projects`.
|
|
651
|
+
*/
|
|
652
|
+
config?: LensAdminConfig;
|
|
653
|
+
/** Proxy mode: server-side proxy base. Default '/api/lens'. */
|
|
654
|
+
baseUrl?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Proxy mode: endpoint returning `{ projects: [{ name, accessId }] }`.
|
|
657
|
+
* Default '/api/lens-projects'. Ignored when `projects` is passed.
|
|
658
|
+
*/
|
|
659
|
+
projectsUrl?: string;
|
|
660
|
+
/** Proxy mode: static project list — skips the projectsUrl fetch. */
|
|
661
|
+
projects?: ProjectRef[];
|
|
662
|
+
/** Initial tab. Default 'reports'. */
|
|
663
|
+
defaultTab?: TabId;
|
|
664
|
+
theme?: 'light' | 'dark';
|
|
665
|
+
className?: string;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Batteries-included admin surface for Lens. Renders the segmented tab bar
|
|
669
|
+
* (Issue Reports / Integrations / Setup), an optional project switcher, report
|
|
670
|
+
* deep-linking, and first-run provisioning — so a host writes a single import
|
|
671
|
+
* instead of assembling the pieces by hand. Pairs with a server-side proxy the
|
|
672
|
+
* host owns (`baseUrl`) that attaches project credentials.
|
|
673
|
+
*/
|
|
674
|
+
declare function LensAdmin(props: LensAdminProps): React.JSX.Element;
|
|
675
|
+
declare const LensDashboard: typeof LensAdmin;
|
|
676
|
+
type LensDashboardProps = LensAdminProps;
|
|
677
|
+
type LensDashboardConfig = LensAdminConfig;
|
|
678
|
+
|
|
595
679
|
interface ReportsTableProps {
|
|
596
680
|
onSelect?: (id: string) => void;
|
|
597
681
|
status?: ReportStatus;
|
|
@@ -704,4 +788,4 @@ interface AsyncState<T> {
|
|
|
704
788
|
*/
|
|
705
789
|
declare function useAsync<T>(fn: () => Promise<T>, deps: unknown[]): AsyncState<T>;
|
|
706
790
|
|
|
707
|
-
export { type AssetKind, type AssetRef, type AsyncState, type ConnectIntegrationResponse, type CreateProjectRequest, type CreateProjectResponse, type Integration, type IntegrationProvider, IntegrationSettings, type IntegrationSettingsProps, type IntegrationStatus, type LensApi, type LensApiConfig, LensApiError, LensDashboardProvider, type LensDashboardProviderProps, type ListIntegrationsResponse, type ListReportsQuery, type ListReportsResult, OnboardingWizard, type OnboardingWizardProps, type Project, ProjectSettings, type ProjectSettingsProps, ReplayPlayer, type ReplayPlayerProps, type Report, ReportDetail, type ReportDetailProps, type ReportMetadata, type ReportStatus, type ReportSummary, ReportsTable, type ReportsTableProps, type S3ConfigInput, type S3ConfigPublic, StatusBadge, type UpdateProjectRequest, createLensApi, useAsync, useLensApi };
|
|
791
|
+
export { type AssetKind, type AssetRef, type AsyncState, type ConnectIntegrationResponse, type CreateProjectRequest, type CreateProjectResponse, type Integration, type IntegrationProvider, IntegrationSettings, type IntegrationSettingsProps, type IntegrationStatus, LensAdmin, type LensAdminConfig, type LensAdminProps, type LensApi, type LensApiConfig, LensApiError, LensDashboard, type LensDashboardConfig, type LensDashboardProps, LensDashboardProvider, type LensDashboardProviderProps, LensProvider, type ListIntegrationsResponse, type ListReportsQuery, type ListReportsResult, OnboardingWizard, type OnboardingWizardProps, type Project, ProjectSettings, type ProjectSettingsProps, ReplayPlayer, type ReplayPlayerProps, type Report, ReportDetail, type ReportDetailProps, type ReportMetadata, type ReportStatus, type ReportSummary, ReportsTable, type ReportsTableProps, type S3ConfigInput, type S3ConfigPublic, StatusBadge, type UpdateProjectRequest, createLensApi, useAsync, useLensApi };
|