Showing the changes to apps/server/src/sourceControl/SourceControlProvider.ts (1 of 13 files). Show all
Unified · Split
| @@ -3,24 +3,43 @@ import type { · 2 unmodified lines | ||
| 3 | 3 | ChangeRequest, |
| 4 | 4 | ChangeRequestState, |
| 5 | 5 | SourceControlProviderError, |
| 6 | + SourceControlProviderInfo, | |
| 6 | 7 | SourceControlProviderKind, |
| 7 | 8 | SourceControlRepositoryCloneUrls, |
| 8 | 9 | } from "@t3tools/contracts"; |
| 9 | 10 | |
| 11 | +export interface SourceControlProviderContext { | |
| 12 | + readonly provider: SourceControlProviderInfo; | |
| 13 | + readonly remoteName: string; | |
| 14 | + readonly remoteUrl: string; | |
| 15 | +} | |
| 16 | + | |
| 17 | +export interface SourceControlRefSelector { | |
| 18 | + readonly refName: string; | |
| 19 | + readonly owner?: string; | |
| 20 | + readonly repository?: string; | |
| 21 | +} | |
| 22 | + | |
| 10 | 23 | export interface SourceControlProviderShape { |
| 11 | 24 | readonly kind: SourceControlProviderKind; |
| 12 | 25 | readonly listChangeRequests: (input: { |
| 13 | 26 | readonly cwd: string; |
| 27 | + readonly context?: SourceControlProviderContext; | |
| 28 | + readonly source?: SourceControlRefSelector; | |
| 14 | 29 | readonly headSelector: string; |
| 15 | 30 | readonly state: ChangeRequestState | "all"; |
| 16 | 31 | readonly limit?: number; |
| 17 | 32 | }) => Effect.Effect<ReadonlyArray<ChangeRequest>, SourceControlProviderError>; |
| 18 | 33 | readonly getChangeRequest: (input: { |
| 19 | 34 | readonly cwd: string; |
| 35 | + readonly context?: SourceControlProviderContext; | |
| 20 | 36 | readonly reference: string; |
| 21 | 37 | }) => Effect.Effect<ChangeRequest, SourceControlProviderError>; |
| 22 | 38 | readonly createChangeRequest: (input: { |
| 23 | 39 | readonly cwd: string; |
| 40 | + readonly context?: SourceControlProviderContext; | |
| 41 | + readonly source?: SourceControlRefSelector; | |
| 42 | + readonly target?: SourceControlRefSelector; | |
| 24 | 43 | readonly baseRefName: string; |
| 25 | 44 | readonly headSelector: string; |
| 26 | 45 | readonly title: string; |
| @@ -28,13 +47,16 @@ export interface SourceControlProviderShape { · 1 unmodified line | ||
| 28 | 47 | }) => Effect.Effect<void, SourceControlProviderError>; |
| 29 | 48 | readonly getRepositoryCloneUrls: (input: { |
| 30 | 49 | readonly cwd: string; |
| 50 | + readonly context?: SourceControlProviderContext; | |
| 31 | 51 | readonly repository: string; |
| 32 | 52 | }) => Effect.Effect<SourceControlRepositoryCloneUrls, SourceControlProviderError>; |
| 33 | 53 | readonly getDefaultBranch: (input: { |
| 34 | 54 | readonly cwd: string; |
| 55 | + readonly context?: SourceControlProviderContext; | |
| 35 | 56 | }) => Effect.Effect<string | null, SourceControlProviderError>; |
| 36 | 57 | readonly checkoutChangeRequest: (input: { |
| 37 | 58 | readonly cwd: string; |
| 59 | + readonly context?: SourceControlProviderContext; | |
| 38 | 60 | readonly reference: string; |
| 39 | 61 | readonly force?: boolean; |
| 40 | 62 | }) => Effect.Effect<void, SourceControlProviderError>; |