Skip to content

Commit 62d48cc

Browse files
authored
Update lib_prototypes.gs
1 parent f91c4ed commit 62d48cc

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

src/lib_prototypes.gs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* ScriptSync Library
3-
* @version 2.0.5
3+
* @version 2.0.6
44
* @description This script performs an update,
55
* adding new files from the template project
66
* to the current user script.
@@ -36,6 +36,7 @@ ScriptSync.prototype.drop = function(...args) { return drop.apply(this,[...args]
3636
* @memberof {ScriptSync}
3737
* @param {boolean} ignoreErrors **optional**: Whether to perform a forced
3838
* commit operation, even in case of errors.
39+
* Default - true.
3940
* @returns {boolean} Result of the function execution.
4041
*/
4142
function commit(ignoreErrors=true) { return this._commit(...arguments) }
@@ -188,3 +189,42 @@ ScriptSync.prototype.deleteFile = function(...args) { return deleteFile.apply(th
188189
function addFileToUserJson(savedFileName, newJson) { return this._addFileToUserJson(...arguments) }
189190
ScriptSync.prototype.addFileToUserJson = function(...args) { return addFileToUserJson.apply(this,[...args]) };
190191

192+
193+
/**
194+
* Retrieves information about a library based on its ID or user-defined name.
195+
* @memberof {ScriptSync}
196+
* @param {string} target - The target environment, either '**script**' or '**template**'.
197+
* This determines whether to fetch information from the
198+
* script or the template file.
199+
* @param {string} libraryId - __Optional__: The unique identifier of the library to retrieve.
200+
* If provided, the function will search for a library with
201+
* this ID.
202+
* @param {string} libraryName - __Optional__: The user-defined name (userSymbol) of the library to retrieve.
203+
* If provided, the function will search for a library with
204+
* this user-defined name.
205+
* @returns {LibraryInfo|null} - Returns an object containing information about the library
206+
* if found, or null if the library is not found.
207+
*/
208+
function getLibraryInfo(target, libraryId, libraryName) { return this._getLibraryInfo(...arguments) }
209+
ScriptSync.prototype.getLibraryInfo = function(...args) { return getLibraryInfo.apply(this,[...args]) };
210+
211+
212+
/**
213+
* Update library information.
214+
* @memberof {ScriptSync}
215+
* @param {LibraryInfo} libraryInfo - A structured JSON object: `{ userSymbol: 'string',
216+
* libraryId: 'string', version: 'number',
217+
* developmentMode: boolean }`.\
218+
* It will be used to update the library information.
219+
* @param {string} libraryId - The unique ID of the library.\
220+
* __Optional parameter__. If this parameter is provided,
221+
* it will be used to identify the library in the update process.
222+
* @param {string} libraryName - User-defined library name (userSymbol).\
223+
* __Optional parameter__. If '`libraryId`' is not provided,
224+
* and this parameter is present, it will be used
225+
* to identify the library in the update process.
226+
* @returns {ScriptSync} Returns an instance of ScriptSync for method chaining.
227+
*/
228+
function updateLibraryInfo(libraryInfo, libraryId, libraryName) { return this._updateLibraryInfo(...arguments) }
229+
ScriptSync.prototype.updateLibraryInfo = function(...args) { return updateLibraryInfo.apply(this,[...args]) };
230+

0 commit comments

Comments
 (0)