@deveye/types 0.24.4 → 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 +1 -1
- package/src/sdk/providers.ts +53 -0
package/package.json
CHANGED
package/src/sdk/providers.ts
CHANGED
|
@@ -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
|
/**
|