2023-04-26 13:47:47 +02:00
|
|
|
|
using Umbraco.Cms.Core.Models;
|
|
|
|
|
|
using Umbraco.Cms.Core.Services.OperationStatus;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Cms.Core.Services;
|
|
|
|
|
|
|
|
|
|
|
|
public interface IScriptService : IBasicFileService<IScript>
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates a new script.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="createModel"><see cref="ScriptCreateModel"/> containing the information about the script being created.</param>
|
2023-08-17 08:35:48 +02:00
|
|
|
|
/// <param name="userKey">The key of the user performing the operation.</param>
|
2023-04-26 13:47:47 +02:00
|
|
|
|
/// <returns>An attempt indicating if the operation was a success as well as a more detailed <see cref="ScriptOperationStatus"/>.</returns>
|
2023-08-17 08:35:48 +02:00
|
|
|
|
Task<Attempt<IScript?, ScriptOperationStatus>> CreateAsync(ScriptCreateModel createModel, Guid userKey);
|
2023-04-26 13:47:47 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Updates an existing script.
|
|
|
|
|
|
/// </summary>
|
2024-01-22 08:20:45 +01:00
|
|
|
|
/// <param name="path">The path of the script to update.</param>
|
2023-04-26 13:47:47 +02:00
|
|
|
|
/// <param name="updateModel">A <see cref="ScriptUpdateModel"/> with the changes.</param>
|
2023-08-17 08:35:48 +02:00
|
|
|
|
/// <param name="userKey">The key of the user performing the operation.</param>
|
2023-04-26 13:47:47 +02:00
|
|
|
|
/// <returns>An attempt indicating if the operation was a success as well as a more detailed <see cref="ScriptOperationStatus"/>.</returns>
|
2024-01-22 08:20:45 +01:00
|
|
|
|
Task<Attempt<IScript?, ScriptOperationStatus>> UpdateAsync(string path, ScriptUpdateModel updateModel, Guid userKey);
|
2023-04-26 13:47:47 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Deletes a Script.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path">The path of the script to delete.</param>
|
2023-08-17 08:35:48 +02:00
|
|
|
|
/// <param name="userKey">The key of the user performing the operation.</param>
|
2023-04-26 13:47:47 +02:00
|
|
|
|
/// <returns>An operation status.</returns>
|
2023-08-17 08:35:48 +02:00
|
|
|
|
Task<ScriptOperationStatus> DeleteAsync(string path, Guid userKey);
|
2024-01-22 08:20:45 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Renames a script.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="path">The path of the script to rename.</param>
|
|
|
|
|
|
/// <param name="renameModel">A <see cref="ScriptRenameModel"/> with the changes.</param>
|
|
|
|
|
|
/// <param name="userKey">The key of the user performing the operation.</param>
|
|
|
|
|
|
/// <returns>An attempt indicating if the operation was a success as well as a more detailed <see cref="ScriptOperationStatus"/>.</returns>
|
|
|
|
|
|
Task<Attempt<IScript?, ScriptOperationStatus>> RenameAsync(string path, ScriptRenameModel renameModel, Guid userKey);
|
2023-04-26 13:47:47 +02:00
|
|
|
|
}
|