import { HarnessIntegrationConfig } from './config'; /** * Given a URL pointing to a file, returns a URL * for editing the contents of the data. * * @remarks * * Converts * from: https://app.harness.io/a/b/src/branchname/path/to/c.yaml * or: https://app.harness.io/a/b/_edit/branchname/path/to/c.yaml * * @param url - A URL pointing to a file * @param config - The relevant provider config * @public */ export declare function getHarnessEditContentsUrl(config: HarnessIntegrationConfig, url: string): string; /** * Given a file path URL, * it returns an API URL which returns the contents of the file . * @remarks * * Converts * from: https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projName/repos/repoName/files/refMain/~/all-apis.yaml * https://qa.harness.io/ng/account/bDCAuAjFSJCLFj_0ug3lCg/module/code/orgs/HiteshTest/repos/impoorter/files/main/~/catalog.yaml * to: https://app.harness.io/gateway/code/api/v1/repos/accountId/orgName/projName/repoName/+/content/all-apis.yaml?routingId=accountId&include_commit=false&ref=refMain * * @param url - A URL pointing to a file * @param config - The relevant provider config * @public */ export declare function getHarnessFileContentsUrl(config: HarnessIntegrationConfig, url: string): string; /** * Given a URL pointing to a repository/path, returns a URL * for archive contents of the repository. * * @remarks * * Converts * from: https://qa.harness.io/ng/account/accountId/module/code/orgs/orgId/projects/projectName/repos/repoName/files/branch/~/fileName * to: https://qa.harness.io/gateway/code/api/v1/repos/accountId/orgId/projectName/repoName/+/archive/branch.zip?routingId=accountId * * @param url - A URL pointing to a repository/path * @param config - The relevant provider config * @public */ export declare function getHarnessArchiveUrl(config: HarnessIntegrationConfig, url: string): string; /** * Given a URL pointing to a repository branch, returns a URL * for latest commit information. * * @remarks * * Converts * from: https://app.harness.io/ng/account/accountId/module/code/orgs/orgName/projects/projectName/repos/repoName/files/branchName * to: https://app.harness.io/gateway/code/api/v1/repos/accountId/orgName/projectName/repoName/+/content?routingId=accountId&include_commit=true&git_ref=refs/heads/branchName * * @param url - A URL pointing to a repository branch * @param config - The relevant provider config * @public */ export declare function getHarnessLatestCommitUrl(config: HarnessIntegrationConfig, url: string): string; /** * Return request headers for a Harness Code provider. * * @param config - A Harness Code provider config * @public */ export declare function getHarnessRequestOptions(config: HarnessIntegrationConfig): { headers?: Record; }; /** * Return parsed git url properties. * * @param config - A Harness provider config * @param url - A URL pointing to a repository * @public */ export declare function parseHarnessUrl(config: HarnessIntegrationConfig, url: string): { baseUrl: string; accountId: string; orgName: string; projectName: string; refString: string; repoName: string; path: string; refDashStr: string; branch: string; };