UNPKG

1.42 kBTypeScriptView Raw
1import { RemoteRepoRef } from "@atomist/automation-client/lib/operations/common/RepoId";
2import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent";
3import { CoreRepoFieldsAndChannels, OnPushToAnyBranch, ScmProvider } from "../../typings/types";
4/**
5 * Resolve a RemoteRepoRef from data in our model
6 */
7export interface RepoRefResolver {
8 /**
9 * Obtain a RemoteRepoRef from the given push, correctly
10 * resolving provider.
11 * @param {OnPushToAnyBranch.Push} push
12 * @return {any}
13 */
14 repoRefFromPush(push: OnPushToAnyBranch.Push): RemoteRepoRef;
15 providerIdFromPush(push: OnPushToAnyBranch.Push): string | null;
16 /**
17 * get a repoRef from an SdmGoal.
18 * @param {SdmGoalEvent} sdmGoal
19 * @param {ScmProvider.ScmProvider} provider: No longer needed; the SdmGoalEvent now contains this information
20 * @returns {RemoteRepoRef}
21 */
22 repoRefFromSdmGoal(sdmGoal: SdmGoalEvent, provider?: ScmProvider.ScmProvider): RemoteRepoRef;
23 /**
24 * Convert GraphQL return to our remote repo ref, instantiating
25 * the correct type based on provider
26 * @param {CoreRepoFieldsAndChannels.Fragment} repo
27 * @param opts options - sha or branch
28 * @return {RemoteRepoRef}
29 */
30 toRemoteRepoRef(repo: CoreRepoFieldsAndChannels.Fragment, opts: {
31 sha?: string;
32 branch?: string;
33 }): RemoteRepoRef;
34}
35//# sourceMappingURL=RepoRefResolver.d.ts.map
\No newline at end of file