[codex] Migrate server source control Effect services (#3186)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
7118e43d16
commit
d9e9539862
42 files changed
+1326
-1328
No files matched your search
@@ -49,54 +49,52 @@ export function sourceControlRefFromInput(input: {
|
||||
return input.source ?? parseSourceControlOwnerRef(input.headSelector);
|
||||
}
|
||||
|
||||
export interface SourceControlProviderShape {
|
||||
readonly kind: SourceControlProviderKind;
|
||||
readonly listChangeRequests: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly source?: SourceControlRefSelector;
|
||||
readonly headSelector: string;
|
||||
readonly state: ChangeRequestState | "all";
|
||||
readonly limit?: number;
|
||||
}) => Effect.Effect<ReadonlyArray<ChangeRequest>, SourceControlProviderError>;
|
||||
readonly getChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly reference: string;
|
||||
}) => Effect.Effect<ChangeRequest, SourceControlProviderError>;
|
||||
readonly createChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly source?: SourceControlRefSelector;
|
||||
readonly target?: SourceControlRefSelector;
|
||||
readonly baseRefName: string;
|
||||
readonly headSelector: string;
|
||||
readonly title: string;
|
||||
readonly bodyFile: string;
|
||||
}) => Effect.Effect<void, SourceControlProviderError>;
|
||||
readonly getRepositoryCloneUrls: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly repository: string;
|
||||
}) => Effect.Effect<SourceControlRepositoryCloneUrls, SourceControlProviderError>;
|
||||
readonly createRepository: (input: {
|
||||
readonly cwd: string;
|
||||
readonly repository: string;
|
||||
readonly visibility: SourceControlRepositoryVisibility;
|
||||
}) => Effect.Effect<SourceControlRepositoryCloneUrls, SourceControlProviderError>;
|
||||
readonly getDefaultBranch: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
}) => Effect.Effect<string | null, SourceControlProviderError>;
|
||||
readonly checkoutChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly reference: string;
|
||||
readonly force?: boolean;
|
||||
}) => Effect.Effect<void, SourceControlProviderError>;
|
||||
}
|
||||
|
||||
export class SourceControlProvider extends Context.Service<
|
||||
SourceControlProvider,
|
||||
SourceControlProviderShape
|
||||
{
|
||||
readonly kind: SourceControlProviderKind;
|
||||
readonly listChangeRequests: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly source?: SourceControlRefSelector;
|
||||
readonly headSelector: string;
|
||||
readonly state: ChangeRequestState | "all";
|
||||
readonly limit?: number;
|
||||
}) => Effect.Effect<ReadonlyArray<ChangeRequest>, SourceControlProviderError>;
|
||||
readonly getChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly reference: string;
|
||||
}) => Effect.Effect<ChangeRequest, SourceControlProviderError>;
|
||||
readonly createChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly source?: SourceControlRefSelector;
|
||||
readonly target?: SourceControlRefSelector;
|
||||
readonly baseRefName: string;
|
||||
readonly headSelector: string;
|
||||
readonly title: string;
|
||||
readonly bodyFile: string;
|
||||
}) => Effect.Effect<void, SourceControlProviderError>;
|
||||
readonly getRepositoryCloneUrls: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly repository: string;
|
||||
}) => Effect.Effect<SourceControlRepositoryCloneUrls, SourceControlProviderError>;
|
||||
readonly createRepository: (input: {
|
||||
readonly cwd: string;
|
||||
readonly repository: string;
|
||||
readonly visibility: SourceControlRepositoryVisibility;
|
||||
}) => Effect.Effect<SourceControlRepositoryCloneUrls, SourceControlProviderError>;
|
||||
readonly getDefaultBranch: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
}) => Effect.Effect<string | null, SourceControlProviderError>;
|
||||
readonly checkoutChangeRequest: (input: {
|
||||
readonly cwd: string;
|
||||
readonly context?: SourceControlProviderContext;
|
||||
readonly reference: string;
|
||||
readonly force?: boolean;
|
||||
}) => Effect.Effect<void, SourceControlProviderError>;
|
||||
}
|
||||
>()("t3/sourceControl/SourceControlProvider") {}
|
||||
Reference in new issue
Block a user