Adding types to github sync export handler and up the stack (#31390)

* Adding types to github sync export handler and up the stack

* promsifying file and addressing review comments

* reverting tsconfig and updating response type

* importing correct type

* reverting Jenkinsfile to main

GitOrigin-RevId: 96496920b8faf38fc32ffedb6fc4b8d6596d4112
This commit is contained in:
l-obrien-overleaf
2026-03-03 12:48:28 +00:00
committed by Copybot
parent c1c9b9e1b7
commit 92d7077878
2 changed files with 27 additions and 0 deletions

View File

@@ -6,6 +6,12 @@ import { callbackifyAll } from '@overleaf/promise-utils'
import OError from '@overleaf/o-error'
import { iterablePaths } from './IterablePath.mjs'
/** @import {ProjectDoc, ProjectFile} from './types' */
/**
* @param {string} projectId
* @returns {Promise<Record<string, ProjectDoc>>}
*/
async function getAllDocs(projectId) {
// We get the path and name info from the project, and the lines and
// version info from the doc store.
@@ -37,6 +43,10 @@ async function getAllDocs(projectId) {
return docs
}
/**
* @param {string} projectId
* @returns {Promise<Record<string, ProjectFile>>}
*/
async function getAllFiles(projectId) {
const folders = await _getAllFolders(projectId)
const files = {}

View File

@@ -5,6 +5,7 @@ import {
ProjectAccessLevel,
UserRef,
} from '../../../../types/project/dashboard/api'
import { Folder } from '../../../../types/folder'
import { ObjectId } from 'mongodb-legacy'
import { Source } from '../Authorization/types'
@@ -62,3 +63,19 @@ export type FormattedProject = {
accessLevel: ProjectAccessLevel
source: Source
}
export type ProjectDoc = {
_id: ObjectId
name: string
lines: string[]
rev: number
folder: Folder
}
export type ProjectFile = {
_id: ObjectId
name: string
hash: string
rev: number
folder: Folder
}