1 | import { _SPQueryable } from "../spqueryable.js";
|
2 | import { extractWebUrl } from "../utils/extract-web-url.js";
|
3 | import { headers, body } from "@pnp/queryable";
|
4 | import { spPost } from "../operations.js";
|
5 | import { combine, hOP } from "@pnp/core";
|
6 | export class _SiteDesigns extends _SPQueryable {
|
7 | constructor(base, methodName = "") {
|
8 | super(base);
|
9 | this._url = combine(extractWebUrl(this._url), `_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.${methodName}`);
|
10 | }
|
11 | run(props) {
|
12 | return spPost(this, body(props, headers({ "Content-Type": "application/json;charset=utf-8" })));
|
13 | }
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | createSiteDesign(creationInfo) {
|
20 | return SiteDesignsCloneFactory(this, "CreateSiteDesign").run({ info: creationInfo });
|
21 | }
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | applySiteDesign(siteDesignId, webUrl) {
|
29 | return SiteDesignsCloneFactory(this, "ApplySiteDesign").run({ siteDesignId: siteDesignId, "webUrl": webUrl });
|
30 | }
|
31 | |
32 |
|
33 |
|
34 | getSiteDesigns() {
|
35 | return SiteDesignsCloneFactory(this, "GetSiteDesigns").run({});
|
36 | }
|
37 | |
38 |
|
39 |
|
40 |
|
41 | getSiteDesignMetadata(id) {
|
42 | return SiteDesignsCloneFactory(this, "GetSiteDesignMetadata").run({ id: id });
|
43 | }
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 | updateSiteDesign(updateInfo) {
|
50 | return SiteDesignsCloneFactory(this, "UpdateSiteDesign").run({ updateInfo: updateInfo });
|
51 | }
|
52 | |
53 |
|
54 |
|
55 |
|
56 | deleteSiteDesign(id) {
|
57 | return SiteDesignsCloneFactory(this, "DeleteSiteDesign").run({ id: id });
|
58 | }
|
59 | |
60 |
|
61 |
|
62 |
|
63 | getSiteDesignRights(id) {
|
64 | return SiteDesignsCloneFactory(this, "GetSiteDesignRights").run({ id: id });
|
65 | }
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | grantSiteDesignRights(id, principalNames, grantedRights = 1) {
|
74 | return SiteDesignsCloneFactory(this, "GrantSiteDesignRights").run({
|
75 | "grantedRights": grantedRights.toString(),
|
76 | id,
|
77 | principalNames,
|
78 | });
|
79 | }
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | revokeSiteDesignRights(id, principalNames) {
|
87 | return SiteDesignsCloneFactory(this, "RevokeSiteDesignRights").run({
|
88 | id,
|
89 | principalNames,
|
90 | });
|
91 | }
|
92 | |
93 |
|
94 |
|
95 |
|
96 |
|
97 | addSiteDesignTask(webUrl, siteDesignId) {
|
98 | return SiteDesignsCloneFactory(this, "AddSiteDesignTask").run({ webUrl, siteDesignId });
|
99 | }
|
100 | |
101 |
|
102 |
|
103 |
|
104 | addSiteDesignTaskToCurrentWeb(siteDesignId) {
|
105 | return SiteDesignsCloneFactory(this, "AddSiteDesignTaskToCurrentWeb").run({ siteDesignId });
|
106 | }
|
107 | |
108 |
|
109 |
|
110 |
|
111 | async getSiteDesignTask(id) {
|
112 | const task = await SiteDesignsCloneFactory(this, "GetSiteDesignTask").run({ "taskId": id });
|
113 | return hOP(task, "ID") ? task : null;
|
114 | }
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 | getSiteDesignRun(webUrl, siteDesignId) {
|
121 | return SiteDesignsCloneFactory(this, "GetSiteDesignRun").run({ webUrl, siteDesignId });
|
122 | }
|
123 | |
124 |
|
125 |
|
126 |
|
127 |
|
128 | getSiteDesignRunStatus(webUrl, runId) {
|
129 | return SiteDesignsCloneFactory(this, "GetSiteDesignRunStatus").run({ webUrl, runId });
|
130 | }
|
131 | }
|
132 | export const SiteDesigns = (baseUrl, methodName) => new _SiteDesigns(baseUrl, methodName);
|
133 | const SiteDesignsCloneFactory = (baseUrl, methodName = "") => SiteDesigns(baseUrl, methodName);
|
134 | export var TemplateDesignType;
|
135 | (function (TemplateDesignType) {
|
136 |
|
137 |
|
138 |
|
139 | TemplateDesignType[TemplateDesignType["Site"] = 0] = "Site";
|
140 |
|
141 |
|
142 |
|
143 | TemplateDesignType[TemplateDesignType["List"] = 1] = "List";
|
144 | })(TemplateDesignType || (TemplateDesignType = {}));
|
145 | export var ListDesignColor;
|
146 | (function (ListDesignColor) {
|
147 | ListDesignColor[ListDesignColor["DarkRed"] = 0] = "DarkRed";
|
148 | ListDesignColor[ListDesignColor["Red"] = 1] = "Red";
|
149 | ListDesignColor[ListDesignColor["Orange"] = 2] = "Orange";
|
150 | ListDesignColor[ListDesignColor["Green"] = 3] = "Green";
|
151 | ListDesignColor[ListDesignColor["DarkGreen"] = 4] = "DarkGreen";
|
152 | ListDesignColor[ListDesignColor["Teal"] = 5] = "Teal";
|
153 | ListDesignColor[ListDesignColor["Blue"] = 6] = "Blue";
|
154 | ListDesignColor[ListDesignColor["NavyBlue"] = 7] = "NavyBlue";
|
155 | ListDesignColor[ListDesignColor["BluePurple"] = 8] = "BluePurple";
|
156 | ListDesignColor[ListDesignColor["DarkBlue"] = 9] = "DarkBlue";
|
157 | ListDesignColor[ListDesignColor["Lavendar"] = 10] = "Lavendar";
|
158 | ListDesignColor[ListDesignColor["Pink"] = 11] = "Pink";
|
159 | })(ListDesignColor || (ListDesignColor = {}));
|
160 | export var ListDesignIcon;
|
161 | (function (ListDesignIcon) {
|
162 | ListDesignIcon[ListDesignIcon["Bug"] = 0] = "Bug";
|
163 | ListDesignIcon[ListDesignIcon["Calendar"] = 1] = "Calendar";
|
164 | ListDesignIcon[ListDesignIcon["BullseyeTarget"] = 2] = "BullseyeTarget";
|
165 | ListDesignIcon[ListDesignIcon["ClipboardList"] = 3] = "ClipboardList";
|
166 | ListDesignIcon[ListDesignIcon["Airplane"] = 4] = "Airplane";
|
167 | ListDesignIcon[ListDesignIcon["Rocket"] = 5] = "Rocket";
|
168 | ListDesignIcon[ListDesignIcon["Color"] = 6] = "Color";
|
169 | ListDesignIcon[ListDesignIcon["Insights"] = 7] = "Insights";
|
170 | ListDesignIcon[ListDesignIcon["CubeShape"] = 8] = "CubeShape";
|
171 | ListDesignIcon[ListDesignIcon["TestBeakerSolid"] = 9] = "TestBeakerSolid";
|
172 | ListDesignIcon[ListDesignIcon["Robot"] = 10] = "Robot";
|
173 | ListDesignIcon[ListDesignIcon["Savings"] = 11] = "Savings";
|
174 | })(ListDesignIcon || (ListDesignIcon = {}));
|
175 |
|
\ | No newline at end of file |