Merge pull request #17859 from overleaf/mj-project-history-ranges-at-version

[overleaf-editor-core+project-history] Add endpoint to fetch ranges from version

GitOrigin-RevId: fbe8e8ef3636b344006375a92057cfc580a74616
This commit is contained in:
Mathias Jakobsen
2024-04-22 08:04:11 +00:00
committed by Copybot
parent 635d0525eb
commit 5b8d8fa39f
8 changed files with 594 additions and 0 deletions
@@ -17,6 +17,7 @@ const StringFileData = require('./file_data/string_file_data')
* @typedef {import("./types").CommentRawData} CommentRawData
* @typedef {import("./file_data/comment_list")} CommentList
* @typedef {import("./operation/text_operation")} TextOperation
* @typedef {import("./file_data/tracked_change_list")} TrackedChangeList
* @typedef {{filterTrackedDeletes?: boolean}} FileGetContentOptions
*/
@@ -210,6 +211,14 @@ class File {
return this.data.getComments()
}
/**
* Get the tracked changes for this file.
* @return {TrackedChangeList}
*/
getTrackedChanges() {
return this.data.getTrackedChanges()
}
/**
* Clone a file.
*
@@ -21,6 +21,7 @@ let StringFileData = null
* @typedef {import("../operation/edit_operation")} EditOperation
* @typedef {import("../file_data/comment_list")} CommentList
* @typedef {import("../types").CommentRawData} CommentRawData
* @typedef {import("../file_data/tracked_change_list")} TrackedChangeList
*/
/**
@@ -199,6 +200,18 @@ class FileData {
getComments() {
throw new Error('getComments not implemented for ' + JSON.stringify(this))
}
/**
* @see File#getTrackedChanges
* @function
* @return {TrackedChangeList}
* @abstract
*/
getTrackedChanges() {
throw new Error(
'getTrackedChanges not implemented for ' + JSON.stringify(this)
)
}
}
module.exports = FileData
@@ -112,6 +112,11 @@ class StringFileData extends FileData {
return this.comments
}
/** @inheritdoc */
getTrackedChanges() {
return this.trackedChanges
}
/**
* @inheritdoc
* @returns {Promise<StringFileData>}