mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
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:
committed by
Copybot
parent
c1c9b9e1b7
commit
92d7077878
@@ -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 = {}
|
||||
|
||||
17
services/web/app/src/Features/Project/types.d.ts
vendored
17
services/web/app/src/Features/Project/types.d.ts
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user