1 | import { __decorate } from "tslib";
|
2 | import { _SPCollection, spInvokableFactory, deleteable, _SPInstance, } from "../spqueryable.js";
|
3 | import { body } from "@pnp/queryable";
|
4 | import { defaultPath } from "../decorators.js";
|
5 | import { spPost, spPostMerge } from "../operations.js";
|
6 | let _UserCustomActions = class _UserCustomActions extends _SPCollection {
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 | getById(id) {
|
13 | return UserCustomAction(this).concat(`('${id}')`);
|
14 | }
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 | async add(properties) {
|
21 | const data = await spPost(this, body(properties));
|
22 | return {
|
23 | action: this.getById(data.Id),
|
24 | data,
|
25 | };
|
26 | }
|
27 | |
28 |
|
29 |
|
30 | clear() {
|
31 | return spPost(UserCustomActions(this, "clear"));
|
32 | }
|
33 | };
|
34 | _UserCustomActions = __decorate([
|
35 | defaultPath("usercustomactions")
|
36 | ], _UserCustomActions);
|
37 | export { _UserCustomActions };
|
38 | export const UserCustomActions = spInvokableFactory(_UserCustomActions);
|
39 | export class _UserCustomAction extends _SPInstance {
|
40 | constructor() {
|
41 | super(...arguments);
|
42 | this.delete = deleteable();
|
43 | }
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 | async update(props) {
|
50 | const data = await spPostMerge(this, body(props));
|
51 | return {
|
52 | data,
|
53 | action: this,
|
54 | };
|
55 | }
|
56 | }
|
57 | export const UserCustomAction = spInvokableFactory(_UserCustomAction);
|
58 | export var UserCustomActionRegistrationType;
|
59 | (function (UserCustomActionRegistrationType) {
|
60 | UserCustomActionRegistrationType[UserCustomActionRegistrationType["None"] = 0] = "None";
|
61 | UserCustomActionRegistrationType[UserCustomActionRegistrationType["List"] = 1] = "List";
|
62 | UserCustomActionRegistrationType[UserCustomActionRegistrationType["ContentType"] = 2] = "ContentType";
|
63 | UserCustomActionRegistrationType[UserCustomActionRegistrationType["ProgId"] = 3] = "ProgId";
|
64 | UserCustomActionRegistrationType[UserCustomActionRegistrationType["FileType"] = 4] = "FileType";
|
65 | })(UserCustomActionRegistrationType || (UserCustomActionRegistrationType = {}));
|
66 | export var UserCustomActionScope;
|
67 | (function (UserCustomActionScope) {
|
68 | UserCustomActionScope[UserCustomActionScope["Unknown"] = 0] = "Unknown";
|
69 | UserCustomActionScope[UserCustomActionScope["Site"] = 2] = "Site";
|
70 | UserCustomActionScope[UserCustomActionScope["Web"] = 3] = "Web";
|
71 | UserCustomActionScope[UserCustomActionScope["List"] = 4] = "List";
|
72 | })(UserCustomActionScope || (UserCustomActionScope = {}));
|
73 |
|
\ | No newline at end of file |