@meetreeve/ui 0.9.0 → 0.11.0

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/index.d.mts CHANGED
@@ -555,6 +555,17 @@ interface ContextSwitcherItem {
555
555
  accentColor?: string | null;
556
556
  orgId?: string | null;
557
557
  orgName?: string | null;
558
+ /**
559
+ * Pre-resolved noun for what this context IS ("Company", "Space", …),
560
+ * rendered as a muted marker on the row. Optional, and omitted for a
561
+ * host's default kind — labelling every row is noise.
562
+ *
563
+ * Resolved by the host (DEV-8585), matching the `favicon` precedent
564
+ * above: two contexts can share a display name (a brand and a spawned
565
+ * company in the same org both render as "MindFortress"), and only the
566
+ * host knows its own vocabulary for telling them apart.
567
+ */
568
+ kindLabel?: string | null;
558
569
  }
559
570
  interface ContextOrgGroup {
560
571
  orgId: string | null;
@@ -641,6 +652,73 @@ interface ConnectorGrantInput {
641
652
  granteeType: ConnectorGranteeType;
642
653
  granteeId: string;
643
654
  }
655
+ /**
656
+ * One credential input on the paste path (DEV-7849 / G1). Data-driven per
657
+ * provider exactly like the legacy cockpit modal's `fieldDefs` prop, which
658
+ * this shape is lifted from (src/components/connectors/dual-auth-modal.tsx)
659
+ * — the package renders `label`/`placeholder` generically and never knows
660
+ * which provider it is rendering.
661
+ */
662
+ interface ConnectorCredentialField {
663
+ key: string;
664
+ label: string;
665
+ placeholder?: string | null;
666
+ /** Input type; "password" masks the value. Defaults to "text". */
667
+ type?: "text" | "password" | "url";
668
+ /** Only an explicit `false` makes a field optional. */
669
+ required?: boolean;
670
+ /** Prefilled value the form starts from (e.g. PostHog's default host);
671
+ * submitted as-is when the customer doesn't change it. */
672
+ defaultValue?: string | null;
673
+ }
674
+ /** One numbered step of a setup guide; `copyable` is a literal to paste. */
675
+ interface ConnectorGuideStep {
676
+ text: string;
677
+ copyable?: string | null;
678
+ }
679
+ /**
680
+ * A fully-rendered setup guide as the server returns it (SG-1). The backend
681
+ * refuses to render a guide it cannot fully ground, so this is never a
682
+ * partially interpolated guide — see `hasUngroundedPlaceholder` for what
683
+ * happens if one ever arrives anyway.
684
+ */
685
+ interface ConnectorSetupGuide {
686
+ prerequisites: string[];
687
+ steps: ConnectorGuideStep[];
688
+ verify: string;
689
+ scope_note: string;
690
+ }
691
+ /**
692
+ * The result of testing a credential WITHOUT storing it (DEV-7852 / G4).
693
+ *
694
+ * `valid` is deliberately tri-state and mirrors the server's own semantics
695
+ * (`TestCredentialsResponse`): true/false for a provider with a live
696
+ * verifier, null for one that has none. null is NOT a pass — the UI says so
697
+ * in words rather than showing a green check it cannot justify.
698
+ */
699
+ interface ConnectorCredentialTestResult {
700
+ valid: boolean | null;
701
+ /** The account the verifier resolved, shown on success. */
702
+ account_name?: string | null;
703
+ /**
704
+ * Why the test failed. Already redacted server-side (the repo's
705
+ * no-raw-error-passthrough invariant) — the picker renders it verbatim and
706
+ * never composes its own message out of an upstream envelope.
707
+ */
708
+ error?: string | null;
709
+ /**
710
+ * Failure reasons keyed by credential field key. For a multi-field
711
+ * credential bundle a bare "invalid credentials" is close to useless, so
712
+ * anything that can be attributed to one field is rendered on that field.
713
+ */
714
+ field_errors?: Record<string, string> | null;
715
+ /**
716
+ * What the stored credential would actually be able to do, as read back
717
+ * from the verifier — e.g. "reporting only, this token cannot publish".
718
+ * Absent when the verifier reports no permission set.
719
+ */
720
+ permissions_note?: string | null;
721
+ }
644
722
  interface ConnectableEntry {
645
723
  slug: string;
646
724
  name: string;
@@ -676,6 +754,18 @@ interface ConnectableEntry {
676
754
  deprecated: boolean;
677
755
  /** Org-connect permission + role options for this entry (CD-4). */
678
756
  org_connect?: OrgConnectPolicy | null;
757
+ /**
758
+ * Fully-rendered setup guide for this entry, or null/absent when the
759
+ * server has none for it (DEV-7849 / G1). Absent is the NORMAL state
760
+ * while the guide registry fills in (G2/G3), never an error.
761
+ */
762
+ guide?: ConnectorSetupGuide | null;
763
+ /**
764
+ * Credential fields for the bring-your-own-credential path (DEV-7849).
765
+ * Absent or empty = this entry has no paste path and only the OAuth
766
+ * connect button renders, exactly as before.
767
+ */
768
+ credential_fields?: ConnectorCredentialField[] | null;
679
769
  }
680
770
  interface ConnectorPickerClient {
681
771
  listConnectable(opts: {
@@ -700,6 +790,21 @@ interface ConnectorPickerClient {
700
790
  listGrants?(entry: ConnectableEntry): Promise<ConnectorGrant[]>;
701
791
  grant?(entry: ConnectableEntry, input: ConnectorGrantInput): Promise<void>;
702
792
  revokeGrant?(entry: ConnectableEntry, grantId: string): Promise<void>;
793
+ /**
794
+ * Store a pasted credential (DEV-7849 / G1). Optional, same posture as the
795
+ * grant methods: the credential form renders only when the injected client
796
+ * provides this, so a pre-G1 client keeps working unchanged. Rejecting
797
+ * with an Error surfaces that message on the form.
798
+ */
799
+ submitCredentials?(entry: ConnectableEntry, values: Record<string, string>, opts?: {
800
+ kind: ConnectionKind;
801
+ }): Promise<void>;
802
+ /**
803
+ * Validate a credential without storing it (DEV-7852 / G4). Optional for
804
+ * the same reason `submitCredentials` is: a client that cannot test simply
805
+ * gets the G1 form with no Test action and no test gate.
806
+ */
807
+ testCredentials?(entry: ConnectableEntry, values: Record<string, string>): Promise<ConnectorCredentialTestResult>;
703
808
  }
704
809
  /**
705
810
  * Structurally identical to the app's own `DnaLens` (src/lib/dna-lens.ts) —
@@ -724,4 +829,4 @@ interface ConnectorPickerProps {
724
829
  }
725
830
  declare function ConnectorPicker({ client, purpose, lens, layout, onConnected, }: ConnectorPickerProps): react.JSX.Element | null;
726
831
 
727
- export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, type HeaderNavItem, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, type UseLadderRungOptions, WORDMARK_WEIGHT, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
832
+ export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, type HeaderNavItem, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, type UseLadderRungOptions, WORDMARK_WEIGHT, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
package/dist/index.d.ts CHANGED
@@ -555,6 +555,17 @@ interface ContextSwitcherItem {
555
555
  accentColor?: string | null;
556
556
  orgId?: string | null;
557
557
  orgName?: string | null;
558
+ /**
559
+ * Pre-resolved noun for what this context IS ("Company", "Space", …),
560
+ * rendered as a muted marker on the row. Optional, and omitted for a
561
+ * host's default kind — labelling every row is noise.
562
+ *
563
+ * Resolved by the host (DEV-8585), matching the `favicon` precedent
564
+ * above: two contexts can share a display name (a brand and a spawned
565
+ * company in the same org both render as "MindFortress"), and only the
566
+ * host knows its own vocabulary for telling them apart.
567
+ */
568
+ kindLabel?: string | null;
558
569
  }
559
570
  interface ContextOrgGroup {
560
571
  orgId: string | null;
@@ -641,6 +652,73 @@ interface ConnectorGrantInput {
641
652
  granteeType: ConnectorGranteeType;
642
653
  granteeId: string;
643
654
  }
655
+ /**
656
+ * One credential input on the paste path (DEV-7849 / G1). Data-driven per
657
+ * provider exactly like the legacy cockpit modal's `fieldDefs` prop, which
658
+ * this shape is lifted from (src/components/connectors/dual-auth-modal.tsx)
659
+ * — the package renders `label`/`placeholder` generically and never knows
660
+ * which provider it is rendering.
661
+ */
662
+ interface ConnectorCredentialField {
663
+ key: string;
664
+ label: string;
665
+ placeholder?: string | null;
666
+ /** Input type; "password" masks the value. Defaults to "text". */
667
+ type?: "text" | "password" | "url";
668
+ /** Only an explicit `false` makes a field optional. */
669
+ required?: boolean;
670
+ /** Prefilled value the form starts from (e.g. PostHog's default host);
671
+ * submitted as-is when the customer doesn't change it. */
672
+ defaultValue?: string | null;
673
+ }
674
+ /** One numbered step of a setup guide; `copyable` is a literal to paste. */
675
+ interface ConnectorGuideStep {
676
+ text: string;
677
+ copyable?: string | null;
678
+ }
679
+ /**
680
+ * A fully-rendered setup guide as the server returns it (SG-1). The backend
681
+ * refuses to render a guide it cannot fully ground, so this is never a
682
+ * partially interpolated guide — see `hasUngroundedPlaceholder` for what
683
+ * happens if one ever arrives anyway.
684
+ */
685
+ interface ConnectorSetupGuide {
686
+ prerequisites: string[];
687
+ steps: ConnectorGuideStep[];
688
+ verify: string;
689
+ scope_note: string;
690
+ }
691
+ /**
692
+ * The result of testing a credential WITHOUT storing it (DEV-7852 / G4).
693
+ *
694
+ * `valid` is deliberately tri-state and mirrors the server's own semantics
695
+ * (`TestCredentialsResponse`): true/false for a provider with a live
696
+ * verifier, null for one that has none. null is NOT a pass — the UI says so
697
+ * in words rather than showing a green check it cannot justify.
698
+ */
699
+ interface ConnectorCredentialTestResult {
700
+ valid: boolean | null;
701
+ /** The account the verifier resolved, shown on success. */
702
+ account_name?: string | null;
703
+ /**
704
+ * Why the test failed. Already redacted server-side (the repo's
705
+ * no-raw-error-passthrough invariant) — the picker renders it verbatim and
706
+ * never composes its own message out of an upstream envelope.
707
+ */
708
+ error?: string | null;
709
+ /**
710
+ * Failure reasons keyed by credential field key. For a multi-field
711
+ * credential bundle a bare "invalid credentials" is close to useless, so
712
+ * anything that can be attributed to one field is rendered on that field.
713
+ */
714
+ field_errors?: Record<string, string> | null;
715
+ /**
716
+ * What the stored credential would actually be able to do, as read back
717
+ * from the verifier — e.g. "reporting only, this token cannot publish".
718
+ * Absent when the verifier reports no permission set.
719
+ */
720
+ permissions_note?: string | null;
721
+ }
644
722
  interface ConnectableEntry {
645
723
  slug: string;
646
724
  name: string;
@@ -676,6 +754,18 @@ interface ConnectableEntry {
676
754
  deprecated: boolean;
677
755
  /** Org-connect permission + role options for this entry (CD-4). */
678
756
  org_connect?: OrgConnectPolicy | null;
757
+ /**
758
+ * Fully-rendered setup guide for this entry, or null/absent when the
759
+ * server has none for it (DEV-7849 / G1). Absent is the NORMAL state
760
+ * while the guide registry fills in (G2/G3), never an error.
761
+ */
762
+ guide?: ConnectorSetupGuide | null;
763
+ /**
764
+ * Credential fields for the bring-your-own-credential path (DEV-7849).
765
+ * Absent or empty = this entry has no paste path and only the OAuth
766
+ * connect button renders, exactly as before.
767
+ */
768
+ credential_fields?: ConnectorCredentialField[] | null;
679
769
  }
680
770
  interface ConnectorPickerClient {
681
771
  listConnectable(opts: {
@@ -700,6 +790,21 @@ interface ConnectorPickerClient {
700
790
  listGrants?(entry: ConnectableEntry): Promise<ConnectorGrant[]>;
701
791
  grant?(entry: ConnectableEntry, input: ConnectorGrantInput): Promise<void>;
702
792
  revokeGrant?(entry: ConnectableEntry, grantId: string): Promise<void>;
793
+ /**
794
+ * Store a pasted credential (DEV-7849 / G1). Optional, same posture as the
795
+ * grant methods: the credential form renders only when the injected client
796
+ * provides this, so a pre-G1 client keeps working unchanged. Rejecting
797
+ * with an Error surfaces that message on the form.
798
+ */
799
+ submitCredentials?(entry: ConnectableEntry, values: Record<string, string>, opts?: {
800
+ kind: ConnectionKind;
801
+ }): Promise<void>;
802
+ /**
803
+ * Validate a credential without storing it (DEV-7852 / G4). Optional for
804
+ * the same reason `submitCredentials` is: a client that cannot test simply
805
+ * gets the G1 form with no Test action and no test gate.
806
+ */
807
+ testCredentials?(entry: ConnectableEntry, values: Record<string, string>): Promise<ConnectorCredentialTestResult>;
703
808
  }
704
809
  /**
705
810
  * Structurally identical to the app's own `DnaLens` (src/lib/dna-lens.ts) —
@@ -724,4 +829,4 @@ interface ConnectorPickerProps {
724
829
  }
725
830
  declare function ConnectorPicker({ client, purpose, lens, layout, onConnected, }: ConnectorPickerProps): react.JSX.Element | null;
726
831
 
727
- export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, type HeaderNavItem, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, type UseLadderRungOptions, WORDMARK_WEIGHT, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };
832
+ export { type AppRungItem, AppSidebar, type AppSidebarBrand, type AppSidebarModuleDef, type AppSidebarProps, type AppSidebarTopItem, type Brand, BrandGlyph, type BrandGlyphProps, type ConnectableCapability, type ConnectableEntry, type ConnectableTransport, type ConnectionKind, type ConnectorCredentialField, type ConnectorCredentialTestResult, type ConnectorGrant, type ConnectorGrantInput, type ConnectorGranteeType, type ConnectorGuideStep, ConnectorPicker, type ConnectorPickerClient, type ConnectorPickerLens, type ConnectorPickerProps, type ConnectorRoleOption, type ConnectorSetupGuide, type ContextOrgGroup, ContextSwitcher, type ContextSwitcherItem, type ContextSwitcherProps, type FallbackModuleDef, Flyout, type FlyoutChild, type FlyoutProps, GLYPH_CANVAS_FILL, type GroupRungItem, type HeaderNavItem, LOCKUP_GAP, LOCKUP_ROW, MARK_CAP_RATIO, MARK_WEIGHT, type OrgConnectPolicy, REEVE_ACCENT, ResponsiveHeader, type ResponsiveHeaderProps, type RungItem, type SidebarLadder, type SidebarLadderParsed, type SidebarRung, type UseLadderRungOptions, WORDMARK_WEIGHT, deriveFallbackLadder, faviconUrl, groupByOrg, reconcileLadder, resolveLadder, useLadderRung, useResponsivePlaceholder, zSidebarLadder };