@deveye/types 0.24.3 → 0.24.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveye/types",
3
- "version": "0.24.3",
3
+ "version": "0.24.5",
4
4
  "description": "Shared contracts (types + zod schemas) for DevEye apps",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -715,6 +715,19 @@ declare module 'deveye-sdk-client' {
715
715
  format?: (value: number) => string;
716
716
  usedWord?: string;
717
717
  }>;
718
+ /**
719
+ * The top band of a view: its header, and the tab bar right under it. It
720
+ * stays at the top of the scrolling popup while the content moves under it,
721
+ * and draws a line once stuck. Its height is published as `--sticky-head`
722
+ * on its parent, which must be the view's root: a sticky band in the
723
+ * content sits under it with `top: var(--sticky-head, 0px)`.
724
+ */
725
+ export interface StickyHeaderProps {
726
+ /** The band's layout when it holds more than the header (a tab bar). */
727
+ className?: string;
728
+ children: ReactNode;
729
+ }
730
+ export const StickyHeader: ComponentType<StickyHeaderProps>;
718
731
 
719
732
  // ── Server push events ─────────────────────────────────────────────────
720
733
  /** Typed push subscription: filters `event`, safeParses, drops mismatches. */
@@ -1111,15 +1124,6 @@ declare module 'deveye-sdk-client' {
1111
1124
  * third-party library) depends on it to read them again when it changes.
1112
1125
  */
1113
1126
  export function useColorScheme(): 'dark' | 'light';
1114
- /**
1115
- * Two sticky bands, one under the other: measure the top one and hand the
1116
- * ancestor a `--sticky-head` variable the lower band offsets itself by.
1117
- */
1118
- export interface StickyOffset<T extends HTMLElement> {
1119
- ref: RefObject<T | null>;
1120
- style: CSSProperties;
1121
- }
1122
- export function useStickyOffset<T extends HTMLElement>(): StickyOffset<T>;
1123
1127
  /**
1124
1128
  * The client contract another module offers (`FeatureClient.providers`,
1125
1129
  * keys in `@deveye/types/sdk`): how a module composes another's screens
@@ -454,6 +454,17 @@ export interface GitItemsProvider {
454
454
  * service, right before the clone, and never store what it returns.
455
455
  */
456
456
  openCheckout(repoId: number, workspaceId: number): Promise<GitCheckout | null>;
457
+ /** The repositories at home in the workspace, named `owner/repo`: what a picker offers. */
458
+ list(workspaceId: number): Promise<readonly ItemCandidate[]>;
459
+ /** May this member read the repository? The rule of the feature's screens, the item's override included. */
460
+ authorize(repoId: number, workspaceId: number, userId: number): Promise<SdkAccessVerdict>;
461
+ /**
462
+ * What put the repository's code online since `since`, asked of the forge
463
+ * on the spot: a successful workflow run on the default branch, or a
464
+ * successful deployment outside transient environments. A token without
465
+ * the right to read them answers through `error`, never by throwing.
466
+ */
467
+ activity(repoId: number, workspaceId: number, since: number): Promise<DeployActivity>;
457
468
  }
458
469
 
459
470
  /**
@@ -534,6 +545,38 @@ export interface DeployItemsProvider {
534
545
  * an id.
535
546
  */
536
547
  labelOf(targetId: number, workspaceId: number): Promise<string | null>;
548
+ /** The targets at home in the workspace: what a picker offers. */
549
+ list(workspaceId: number): Promise<readonly ItemCandidate[]>;
550
+ /** May this member read the target? The rule of the feature's screens, the item's override included. */
551
+ authorize(targetId: number, workspaceId: number, userId: number): Promise<SdkAccessVerdict>;
552
+ /**
553
+ * The target's deployments since `since`, wherever they were started from
554
+ * (DevEye, the provider's own screen, a CI). The target is synced with its
555
+ * provider first, so a deployment that just ended is not missed.
556
+ */
557
+ activity(targetId: number, workspaceId: number, since: number): Promise<DeployActivity>;
558
+ }
559
+
560
+ /** An item of another feature, as a picker lists it. */
561
+ export interface ItemCandidate {
562
+ id: number;
563
+ name: string;
564
+ /** What tells two items apart beyond their name (a provider, a host), `null` when nothing does. */
565
+ detail: string | null;
566
+ }
567
+
568
+ /**
569
+ * What an item says of its deployments since a moment (epoch seconds): the
570
+ * latest one that succeeded, one still under way, or why it could not tell.
571
+ * What Uptime asks the sources of a site whose files changed.
572
+ */
573
+ export interface DeployActivity {
574
+ /** The most recent success that ended at or after `since`; `what` names it for a journal, article included (`le déploiement « api »`). */
575
+ succeeded: { at: number; what: string } | null;
576
+ /** A deployment still queued or running. */
577
+ inFlight: { what: string } | null;
578
+ /** Why the item could not answer in full (a token without the right, a forge down), `null` when it did. */
579
+ error: string | null;
537
580
  }
538
581
 
539
582
  /**
@@ -691,6 +734,16 @@ export interface ProjectsUsageProvider {
691
734
  workspaceId: number,
692
735
  version: string
693
736
  ): Promise<void>;
737
+ /** May this member read the project? Open tier only: a guarded project is refused as `hidden`. */
738
+ authorize(projectId: number, workspaceId: number, userId: number): Promise<SdkAccessVerdict>;
739
+ /**
740
+ * The Deploy targets and Git repositories one project of the workspace
741
+ * links, by id. Empty for an unknown, projected or guarded project.
742
+ */
743
+ linkedItems(
744
+ projectId: number,
745
+ workspaceId: number
746
+ ): Promise<{ deploy: number[]; git: number[] }>;
694
747
  }
695
748
 
696
749
  /**