UNPKG

2.03 kBJavaScriptView Raw
1import { __decorate } from "tslib";
2import { _SPCollection, spInvokableFactory, SPQueryable, _SPInstance, } from "../spqueryable.js";
3import { defaultPath } from "../decorators.js";
4import { spPost } from "../operations.js";
5/**
6 * Describes a recycle bin item
7 *
8 */
9export class _RecycleBinItem extends _SPInstance {
10 /**
11 * Delete's the Recycle Bin item
12 *
13 */
14 delete() {
15 return spPost(SPQueryable(this, "DeleteObject"));
16 }
17 /**
18 * Moves Recycle Bin item to the Second-stage Recycle Bin
19 *
20 */
21 moveToSecondStage() {
22 return spPost(SPQueryable(this, "MoveToSecondStage"));
23 }
24 /**
25 * Restore the the Recycle Bin item
26 *
27 */
28 restore() {
29 return spPost(SPQueryable(this, "Restore"));
30 }
31}
32export const RecycleBinItem = spInvokableFactory(_RecycleBinItem);
33/**
34 * Describes a collection of recycle bin items
35 *
36 */
37let _RecycleBin = class _RecycleBin extends _SPCollection {
38 /**
39 * Gets a Recycle Bin Item by id
40 *
41 * @param id The string id of the recycle bin item
42 */
43 getById(id) {
44 return RecycleBinItem(this).concat(`(${id})`);
45 }
46 /**
47 * Delete's all items in the Recycle Bin
48 *
49 */
50 deleteAll() {
51 return spPost(SPQueryable(this, "DeleteAll"));
52 }
53 /**
54 * Delete's all items in the Second-stage Recycle Bin
55 *
56 */
57 deleteAllSecondStageItems() {
58 return spPost(SPQueryable(this, "DeleteAllSecondStageItems"));
59 }
60 /**
61 * Moves all items in the Recycle Bin to the Second-stage Recycle Bin
62 *
63 */
64 moveAllToSecondStage() {
65 return spPost(SPQueryable(this, "MoveAllToSecondStage"));
66 }
67 /**
68 * Restore all items in the Recycle Bin
69 *
70 */
71 restoreAll() {
72 return spPost(SPQueryable(this, "RestoreAll"));
73 }
74};
75_RecycleBin = __decorate([
76 defaultPath("RecycleBin")
77], _RecycleBin);
78export { _RecycleBin };
79export const RecycleBin = spInvokableFactory(_RecycleBin);
80//# sourceMappingURL=types.js.map
\No newline at end of file