@pnp/sp
Version:
pnp - provides a fluent api for working with SharePoint REST
80 lines • 2.03 kB
JavaScript
import { __decorate } from "tslib";
import { _SPCollection, spInvokableFactory, SPQueryable, _SPInstance, } from "../spqueryable.js";
import { defaultPath } from "../decorators.js";
import { spPost } from "../operations.js";
/**
* Describes a recycle bin item
*
*/
export class _RecycleBinItem extends _SPInstance {
/**
* Delete's the Recycle Bin item
*
*/
delete() {
return spPost(SPQueryable(this, "DeleteObject"));
}
/**
* Moves Recycle Bin item to the Second-stage Recycle Bin
*
*/
moveToSecondStage() {
return spPost(SPQueryable(this, "MoveToSecondStage"));
}
/**
* Restore the the Recycle Bin item
*
*/
restore() {
return spPost(SPQueryable(this, "Restore"));
}
}
export const RecycleBinItem = spInvokableFactory(_RecycleBinItem);
/**
* Describes a collection of recycle bin items
*
*/
let _RecycleBin = class _RecycleBin extends _SPCollection {
/**
* Gets a Recycle Bin Item by id
*
* @param id The string id of the recycle bin item
*/
getById(id) {
return RecycleBinItem(this).concat(`(${id})`);
}
/**
* Delete's all items in the Recycle Bin
*
*/
deleteAll() {
return spPost(SPQueryable(this, "DeleteAll"));
}
/**
* Delete's all items in the Second-stage Recycle Bin
*
*/
deleteAllSecondStageItems() {
return spPost(SPQueryable(this, "DeleteAllSecondStageItems"));
}
/**
* Moves all items in the Recycle Bin to the Second-stage Recycle Bin
*
*/
moveAllToSecondStage() {
return spPost(SPQueryable(this, "MoveAllToSecondStage"));
}
/**
* Restore all items in the Recycle Bin
*
*/
restoreAll() {
return spPost(SPQueryable(this, "RestoreAll"));
}
};
_RecycleBin = __decorate([
defaultPath("RecycleBin")
], _RecycleBin);
export { _RecycleBin };
export const RecycleBin = spInvokableFactory(_RecycleBin);
//# sourceMappingURL=types.js.map