public async getItemText()

in api/GitApi.ts [2134:2189]


    public async getItemText(
        repositoryId: string,
        path: string,
        project?: string,
        scopePath?: string,
        recursionLevel?: GitInterfaces.VersionControlRecursionType,
        includeContentMetadata?: boolean,
        latestProcessedChange?: boolean,
        download?: boolean,
        versionDescriptor?: GitInterfaces.GitVersionDescriptor,
        includeContent?: boolean,
        resolveLfs?: boolean,
        sanitize?: boolean
        ): Promise<NodeJS.ReadableStream> {
        if (path == null) {
            throw new TypeError('path can not be null or undefined');
        }

        return new Promise<NodeJS.ReadableStream>(async (resolve, reject) => {
            let routeValues: any = {
                project: project,
                repositoryId: repositoryId
            };

            let queryValues: any = {
                path: path,
                scopePath: scopePath,
                recursionLevel: recursionLevel,
                includeContentMetadata: includeContentMetadata,
                latestProcessedChange: latestProcessedChange,
                download: download,
                versionDescriptor: versionDescriptor,
                includeContent: includeContent,
                resolveLfs: resolveLfs,
                sanitize: sanitize,
            };
            
            try {
                let verData: vsom.ClientVersioningData = await this.vsoClient.getVersioningData(
                    "6.1-preview.1",
                    "git",
                    "fb93c0db-47ed-4a31-8c20-47552878fb44",
                    routeValues,
                    queryValues);

                let url: string = verData.requestUrl!;
                
                let apiVersion: string = verData.apiVersion!;
                let accept: string = this.createAcceptHeader("text/plain", apiVersion);
                resolve((await this.http.get(url, { "Accept": accept })).message);
            }
            catch (err) {
                reject(err);
            }
        });
    }