sp-js-provisioning 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,67 @@
1
- # sp-js-provisioning [![version](https://img.shields.io/badge/version-1.2.0-green.svg)](https://semver.org)
1
+ # sp-js-provisioning [![version](https://img.shields.io/badge/version-1.2.2-green.svg)](https://semver.org)
2
2
 
3
- ## Get Started
3
+ ## Description
4
4
 
5
- ### NPM
5
+ This project is a SharePoint provisioning tool that uses the SharePoint Framework (SPFx) and Patterns & Practices (PnP) to provision SharePoint sites. It includes various handlers for provisioning different SharePoint components such as files, custom actions, and more.
6
+
7
+ ## Installation
8
+
9
+ To install the project, you need to have Node.js and npm installed on your machine. After that, you can clone the repository and install the dependencies:
10
+
11
+ ```sh
12
+ git clone git://github.com/Puzzlepart/pnp-js-provisioning
13
+ cd pnp-js-provisioning
14
+ npm install
15
+ ```
16
+
17
+ ### Usage
6
18
 
7
19
  Add the npm packages to your project
8
20
 
9
21
  ```shell
10
22
  npm install sp-js-provisioning --save
11
- ```
23
+ ```
24
+
25
+ Here is an example of how you might define navigation in a provisioning template, first in XML and then in JSON (used by sp-js-provisioning).
26
+
27
+ **XML:**
28
+
29
+ ```xml
30
+ <pnp:Navigation>
31
+ <pnp:CurrentNavigation NavigationType="Structural">
32
+ <pnp:StructuralNavigation RemoveExistingNodes="true">
33
+ <pnp:NavigationNode Title="Home" Url="{site}" />
34
+ <pnp:NavigationNode Title="About" Url="{site}/about" />
35
+ </pnp:StructuralNavigation>
36
+ </pnp:CurrentNavigation>
37
+ </pnp:Navigation>
38
+ ```
39
+
40
+ **JSON:**
41
+
42
+ ```json
43
+ {
44
+ "Navigation": {
45
+ "CurrentNavigation": {
46
+ "NavigationType": "Structural",
47
+ "StructuralNavigation": {
48
+ "RemoveExistingNodes": true,
49
+ "NavigationNode": [
50
+ {
51
+ "Title": "Home",
52
+ "Url": "{site}"
53
+ },
54
+ {
55
+ "Title": "About",
56
+ "Url": "{site}/about"
57
+ }
58
+ ]
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ## Contributing
66
+
67
+ Contributions are welcome. Please open an issue or submit a pull request on the [GitHub repository](https://github.com/Puzzlepart/pnp-js-provisioning).
@@ -76,103 +76,115 @@ var Hooks = /** @class */ (function (_super) {
76
76
  _super.prototype.scope_started.call(this);
77
77
  promises = [];
78
78
  // eslint-disable-next-line unicorn/no-array-for-each
79
- hooks.forEach(function (hook, index) {
80
- if (hook.Method === 'GET') {
81
- _super.prototype.log_info.call(_this, 'processHooks', "Starting GET request: '" + hook.Title + "'.");
82
- var getRequest = {
83
- method: 'GET',
84
- headers: hook.Headers || {}
85
- };
86
- promises.push(fetch(hook.Url, getRequest).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
87
- var result;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0: return [4 /*yield*/, Hooks.getJsonResult(response)];
91
- case 1:
92
- result = _a.sent();
93
- if (!response.ok) {
94
- throw new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title);
79
+ hooks.forEach(function (hook, index) { return __awaiter(_this, void 0, void 0, function () {
80
+ var getRequest, _a, postRequest;
81
+ var _this = this;
82
+ return __generator(this, function (_b) {
83
+ switch (_b.label) {
84
+ case 0:
85
+ if (!(hook.Method === 'GET')) return [3 /*break*/, 1];
86
+ _super.prototype.log_info.call(this, 'processHooks', "Starting GET request: '" + hook.Title + "'.");
87
+ getRequest = {
88
+ method: 'GET',
89
+ headers: hook.Headers || {}
90
+ };
91
+ promises.push(fetch(hook.Url, getRequest).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
92
+ var result;
93
+ return __generator(this, function (_a) {
94
+ switch (_a.label) {
95
+ case 0: return [4 /*yield*/, Hooks.getJsonResult(response)];
96
+ case 1:
97
+ result = _a.sent();
98
+ if (!response.ok) {
99
+ throw new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title);
100
+ }
101
+ return [2 /*return*/];
95
102
  }
96
- return [2 /*return*/];
97
- }
98
- });
99
- }); }));
100
- }
101
- else if (hook.Method === 'POST') {
102
- _super.prototype.log_info.call(_this, 'processHooks', "Starting POST request: '" + hook.Title + "'.");
103
- hook.Body['pp_webUrl'] = web['_parentUrl'];
104
- var postRequest = {
105
- method: 'POST',
106
- body: JSON.stringify(hook.Body) || '',
107
- headers: hook.Headers || {}
108
- };
109
- promises.push(fetch(hook.Url, postRequest).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
110
- var result, getPendingRequest_1, getPendingResult_1, pendingResultLocation;
111
- var _this = this;
112
- return __generator(this, function (_a) {
113
- switch (_a.label) {
114
- case 0:
115
- if (!!response.ok) return [3 /*break*/, 2];
116
- return [4 /*yield*/, Hooks.getJsonResult(response)];
117
- case 1:
118
- result = _a.sent();
119
- throw new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title);
120
- case 2:
121
- if (!(response.status === 202)) return [3 /*break*/, 4];
122
- getPendingRequest_1 = {
123
- method: 'GET',
124
- headers: hook.Headers || {}
125
- };
126
- getPendingResult_1 = function (url) {
127
- return new Promise(function (resolvePending, reject) {
128
- setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
129
- var _this = this;
130
- return __generator(this, function (_a) {
131
- switch (_a.label) {
132
- case 0: return [4 /*yield*/, fetch(url, getPendingRequest_1).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
133
- var result;
134
- return __generator(this, function (_a) {
135
- switch (_a.label) {
136
- case 0:
137
- if (!!response.ok) return [3 /*break*/, 2];
138
- return [4 /*yield*/, Hooks.getJsonResult(response)];
139
- case 1:
140
- result = _a.sent();
141
- reject(new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title));
142
- return [3 /*break*/, 3];
143
- case 2:
144
- if (response.status === 202) {
145
- resolvePending(getPendingResult_1(url));
103
+ });
104
+ }); }));
105
+ return [3 /*break*/, 4];
106
+ case 1:
107
+ if (!(hook.Method === 'POST')) return [3 /*break*/, 3];
108
+ _super.prototype.log_info.call(this, 'processHooks', "Starting POST request: '" + hook.Title + "'.");
109
+ _a = hook;
110
+ return [4 /*yield*/, web.allProperties()];
111
+ case 2:
112
+ _a.Body = _b.sent();
113
+ postRequest = {
114
+ method: 'POST',
115
+ body: JSON.stringify(hook.Body) || '',
116
+ headers: hook.Headers || {}
117
+ };
118
+ promises.push(fetch(hook.Url, postRequest).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
119
+ var result, getPendingRequest_1, getPendingResult_1, pendingResultLocation;
120
+ var _this = this;
121
+ return __generator(this, function (_a) {
122
+ switch (_a.label) {
123
+ case 0:
124
+ if (!!response.ok) return [3 /*break*/, 2];
125
+ return [4 /*yield*/, Hooks.getJsonResult(response)];
126
+ case 1:
127
+ result = _a.sent();
128
+ throw new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title);
129
+ case 2:
130
+ if (!(response.status === 202)) return [3 /*break*/, 4];
131
+ getPendingRequest_1 = {
132
+ method: 'GET',
133
+ headers: hook.Headers || {}
134
+ };
135
+ getPendingResult_1 = function (url) {
136
+ return new Promise(function (resolvePending, reject) {
137
+ setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
138
+ var _this = this;
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0: return [4 /*yield*/, fetch(url, getPendingRequest_1).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
142
+ var result;
143
+ return __generator(this, function (_a) {
144
+ switch (_a.label) {
145
+ case 0:
146
+ if (!!response.ok) return [3 /*break*/, 2];
147
+ return [4 /*yield*/, Hooks.getJsonResult(response)];
148
+ case 1:
149
+ result = _a.sent();
150
+ reject(new Error((result ? " | " + result + " \n\n" : '') + "- Hook " + (index + 1) + "/" + hooks.length + ": " + hook.Title));
151
+ return [3 /*break*/, 3];
152
+ case 2:
153
+ if (response.status === 202) {
154
+ resolvePending(getPendingResult_1(url));
155
+ }
156
+ _a.label = 3;
157
+ case 3: return [2 /*return*/];
146
158
  }
147
- _a.label = 3;
148
- case 3: return [2 /*return*/];
149
- }
150
- });
151
- }); })];
152
- case 1:
153
- _a.sent();
154
- return [2 /*return*/];
155
- }
159
+ });
160
+ }); })];
161
+ case 1:
162
+ _a.sent();
163
+ return [2 /*return*/];
164
+ }
165
+ });
166
+ }); }, 5000);
167
+ }).catch(function (error) {
168
+ throw error;
156
169
  });
157
- }); }, 5000);
158
- }).catch(function (error) {
159
- throw error;
160
- });
161
- };
162
- pendingResultLocation = response.headers.get('location');
163
- return [4 /*yield*/, getPendingResult_1(pendingResultLocation)];
164
- case 3:
165
- _a.sent();
166
- _a.label = 4;
167
- case 4: return [2 /*return*/];
168
- }
169
- });
170
- }); }));
171
- }
172
- else {
173
- _super.prototype.log_info.call(_this, 'processHooks', "Method: '" + hook.Method + "' not supported.");
174
- }
175
- });
170
+ };
171
+ pendingResultLocation = response.headers.get('location');
172
+ return [4 /*yield*/, getPendingResult_1(pendingResultLocation)];
173
+ case 3:
174
+ _a.sent();
175
+ _a.label = 4;
176
+ case 4: return [2 /*return*/];
177
+ }
178
+ });
179
+ }); }));
180
+ return [3 /*break*/, 4];
181
+ case 3:
182
+ _super.prototype.log_info.call(this, 'processHooks', "Method: '" + hook.Method + "' not supported.");
183
+ _b.label = 4;
184
+ case 4: return [2 /*return*/];
185
+ }
186
+ });
187
+ }); });
176
188
  _a.label = 1;
177
189
  case 1:
178
190
  _a.trys.push([1, 3, , 4]);
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/handlers/hooks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAA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CAAC,CACH,CAAA;;;wCAED,iBAAM,QAAQ,YACZ,cAAc,EACd,cAAY,IAAI,CAAC,MAAM,qBAAkB,CAC1C,CAAA;;;;;6BAEJ,CAAC,CAAA;;;;wBAGA,qBAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAA;;wBAA3B,SAA2B,CAAA;wBAC3B,iBAAM,WAAW,WAAE,CAAA;;;;wBAEnB,iBAAM,WAAW,YAAC,OAAK,CAAC,CAAA;wBACxB,MAAM,OAAK,CAAA;;;;;KAEd;IAEa,mBAAa,GAA3B,UAA4B,QAAa;QAAzC,iBAkBC;QAjBC,OAAO,IAAI,OAAO,CAAC,UAAO,OAAO;;;;;6BAC3B,CAAC,QAAQ,CAAC,EAAE,EAAZ,wBAAY;;;;wBAES,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wBAApC,YAAY,GAAG,SAAqB;wBAC1C,OAAO,CACL,KAAG,QAAQ,CAAC,MAAM,IAChB,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,QAAM,QAAQ,CAAC,UAAY,CAAC,CAAC,CAAC,EAAE,KACrD,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAM,YAAY,CAAC,OAAO,CAAG,CAAC,CAAC,CAAC,EAAE,CAAE,CAChE,CAAA;;;;;;wBAGL,OAAO,CACL,KAAG,QAAQ,CAAC,MAAM,IAChB,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,QAAM,QAAQ,CAAC,UAAY,CAAC,CAAC,CAAC,EAAE,CACtD,CACH,CAAA;;;;aACF,CAAC,CAAA;IACJ,CAAC;IACH,YAAC;AAAD,CAAC,AAzID,CAA2B,WAAW,GAyIrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sp-js-provisioning",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "SharePoint provisioning with pure JavaScript",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
package/schema.json ADDED
@@ -0,0 +1,722 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "additionalProperties": {},
4
+ "definitions": {
5
+ "Body": {
6
+ "properties": {
7
+ "body": {
8
+ "$ref": "#/definitions/ReadableStream<Uint8Array>"
9
+ },
10
+ "bodyUsed": {
11
+ "type": "boolean"
12
+ }
13
+ },
14
+ "type": "object"
15
+ },
16
+ "Headers": {
17
+ "type": "object"
18
+ },
19
+ "IClientSideControl": {
20
+ "properties": {
21
+ "Id": {
22
+ "type": "string"
23
+ },
24
+ "Properties": {
25
+ "additionalProperties": {},
26
+ "type": "object"
27
+ },
28
+ "ServerProcessedContent": {
29
+ "properties": {
30
+ "htmlStrings": {
31
+ "$ref": "#/definitions/Record<string,string>"
32
+ },
33
+ "imageSources": {
34
+ "$ref": "#/definitions/Record<string,string>"
35
+ },
36
+ "links": {
37
+ "$ref": "#/definitions/Record<string,string>"
38
+ },
39
+ "searchablePlainTexts": {
40
+ "$ref": "#/definitions/Record<string,string>"
41
+ }
42
+ },
43
+ "type": "object"
44
+ }
45
+ },
46
+ "type": "object"
47
+ },
48
+ "IClientSidePage": {
49
+ "properties": {
50
+ "CommentsDisabled": {
51
+ "type": "boolean"
52
+ },
53
+ "Name": {
54
+ "type": "string"
55
+ },
56
+ "PageLayoutType": {},
57
+ "Sections": {
58
+ "items": {
59
+ "$ref": "#/definitions/IClientSidePageSection"
60
+ },
61
+ "type": "array"
62
+ },
63
+ "Title": {
64
+ "type": "string"
65
+ },
66
+ "VerticalSection": {
67
+ "items": {
68
+ "$ref": "#/definitions/IClientSideControl"
69
+ },
70
+ "type": "array"
71
+ }
72
+ },
73
+ "type": "object"
74
+ },
75
+ "IClientSidePageColumn": {
76
+ "properties": {
77
+ "Controls": {
78
+ "items": {
79
+ "$ref": "#/definitions/IClientSideControl"
80
+ },
81
+ "type": "array"
82
+ },
83
+ "Factor": {}
84
+ },
85
+ "type": "object"
86
+ },
87
+ "IClientSidePageSection": {
88
+ "properties": {
89
+ "Columns": {
90
+ "items": {
91
+ "$ref": "#/definitions/IClientSidePageColumn"
92
+ },
93
+ "type": "array"
94
+ }
95
+ },
96
+ "type": "object"
97
+ },
98
+ "IComposedLook": {
99
+ "properties": {
100
+ "BackgroundImageUrl": {
101
+ "type": "string"
102
+ },
103
+ "ColorPaletteUrl": {
104
+ "type": "string"
105
+ },
106
+ "FontSchemeUrl": {
107
+ "type": "string"
108
+ }
109
+ },
110
+ "type": "object"
111
+ },
112
+ "IContentType": {
113
+ "properties": {
114
+ "Description": {
115
+ "type": "string"
116
+ },
117
+ "FieldRefs": {
118
+ "items": {
119
+ "$ref": "#/definitions/IFieldReference"
120
+ },
121
+ "type": "array"
122
+ },
123
+ "Group": {
124
+ "type": "string"
125
+ },
126
+ "ID": {
127
+ "type": "string"
128
+ },
129
+ "Name": {
130
+ "type": "string"
131
+ }
132
+ },
133
+ "type": "object"
134
+ },
135
+ "IContentTypeBinding": {
136
+ "properties": {
137
+ "ContentTypeID": {
138
+ "type": "string"
139
+ },
140
+ "Name": {
141
+ "type": "string"
142
+ }
143
+ },
144
+ "type": "object"
145
+ },
146
+ "ICustomAction": {
147
+ "additionalProperties": {
148
+ "type": "string"
149
+ },
150
+ "properties": {
151
+ "Description": {
152
+ "type": "string"
153
+ },
154
+ "Location": {
155
+ "type": "string"
156
+ },
157
+ "Name": {
158
+ "type": "string"
159
+ },
160
+ "Title": {
161
+ "type": "string"
162
+ },
163
+ "Url": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "type": "object"
168
+ },
169
+ "IFeature": {
170
+ "properties": {
171
+ "deactivate": {
172
+ "type": "boolean"
173
+ },
174
+ "force": {
175
+ "type": "boolean"
176
+ },
177
+ "id": {
178
+ "type": "string"
179
+ }
180
+ },
181
+ "type": "object"
182
+ },
183
+ "IFieldReference": {
184
+ "properties": {
185
+ "Hidden": {
186
+ "type": "boolean"
187
+ },
188
+ "ID": {
189
+ "type": "string"
190
+ },
191
+ "Name": {
192
+ "type": "string"
193
+ },
194
+ "Required": {
195
+ "type": "boolean"
196
+ }
197
+ },
198
+ "type": "object"
199
+ },
200
+ "IFileObject": {
201
+ "properties": {
202
+ "Folder": {
203
+ "type": "string"
204
+ },
205
+ "Overwrite": {
206
+ "type": "boolean"
207
+ },
208
+ "Properties": {
209
+ "additionalProperties": {
210
+ "type": [
211
+ "string",
212
+ "number"
213
+ ]
214
+ },
215
+ "type": "object"
216
+ },
217
+ "RemoveExistingWebParts": {
218
+ "type": "boolean"
219
+ },
220
+ "Src": {
221
+ "type": "string"
222
+ },
223
+ "Url": {
224
+ "type": "string"
225
+ },
226
+ "WebParts": {
227
+ "items": {
228
+ "$ref": "#/definitions/IWebPart"
229
+ },
230
+ "type": "array"
231
+ }
232
+ },
233
+ "type": "object"
234
+ },
235
+ "IHooks": {
236
+ "properties": {
237
+ "Body": {
238
+ "$ref": "#/definitions/Body"
239
+ },
240
+ "Headers": {
241
+ "$ref": "#/definitions/Headers"
242
+ },
243
+ "Method": {
244
+ "type": "string"
245
+ },
246
+ "Title": {
247
+ "type": "string"
248
+ },
249
+ "Url": {
250
+ "type": "string"
251
+ }
252
+ },
253
+ "type": "object"
254
+ },
255
+ "IListInstance": {
256
+ "properties": {
257
+ "AdditionalSettings": {
258
+ "additionalProperties": {
259
+ "type": [
260
+ "string",
261
+ "number",
262
+ "boolean"
263
+ ]
264
+ },
265
+ "properties": {
266
+ "DefaultContentApprovalWorkflowId": {
267
+ "type": "string"
268
+ },
269
+ "DefaultDisplayFormUrl": {
270
+ "type": "string"
271
+ },
272
+ "DefaultEditFormUrl": {
273
+ "type": "string"
274
+ },
275
+ "DefaultNewFormUrl": {
276
+ "type": "string"
277
+ },
278
+ "Description": {
279
+ "type": "string"
280
+ },
281
+ "Direction": {
282
+ "type": "string"
283
+ },
284
+ "DocumentTemplateUrl": {
285
+ "type": "string"
286
+ },
287
+ "DraftVersionVisibility": {
288
+ "description": "Reader = 0; Author = 1; Approver = 2.",
289
+ "type": "number"
290
+ },
291
+ "EnableAttachments": {
292
+ "type": "boolean"
293
+ },
294
+ "EnableFolderCreation": {
295
+ "type": "boolean"
296
+ },
297
+ "EnableMinorVersions": {
298
+ "type": "boolean"
299
+ },
300
+ "EnableModeration": {
301
+ "type": "boolean"
302
+ },
303
+ "EnableVersioning": {
304
+ "type": "boolean"
305
+ },
306
+ "ForceCheckout": {
307
+ "type": "boolean"
308
+ },
309
+ "Hidden": {
310
+ "type": "boolean"
311
+ },
312
+ "IrmEnabled": {
313
+ "type": "boolean"
314
+ },
315
+ "IrmExpire": {
316
+ "type": "boolean"
317
+ },
318
+ "IrmReject": {
319
+ "type": "boolean"
320
+ },
321
+ "IsApplicationList": {
322
+ "type": "boolean"
323
+ },
324
+ "NoCrawl": {
325
+ "type": "boolean"
326
+ },
327
+ "OnQuickLaunch": {
328
+ "type": "boolean"
329
+ },
330
+ "Title": {
331
+ "type": "string"
332
+ },
333
+ "ValidationFormula": {
334
+ "type": "string"
335
+ },
336
+ "ValidationMessage": {
337
+ "type": "string"
338
+ }
339
+ },
340
+ "type": "object"
341
+ },
342
+ "ContentTypeBindings": {
343
+ "items": {
344
+ "$ref": "#/definitions/IContentTypeBinding"
345
+ },
346
+ "type": "array"
347
+ },
348
+ "ContentTypesEnabled": {
349
+ "type": "boolean"
350
+ },
351
+ "Description": {
352
+ "type": "string"
353
+ },
354
+ "FieldRefs": {
355
+ "items": {
356
+ "$ref": "#/definitions/IListInstanceFieldReference"
357
+ },
358
+ "type": "array"
359
+ },
360
+ "Fields": {
361
+ "items": {
362
+ "type": "string"
363
+ },
364
+ "type": "array"
365
+ },
366
+ "RemoveExistingContentTypes": {
367
+ "type": "boolean"
368
+ },
369
+ "Security": {
370
+ "$ref": "#/definitions/IListSecurity"
371
+ },
372
+ "Template": {
373
+ "type": "number"
374
+ },
375
+ "Title": {
376
+ "type": "string"
377
+ },
378
+ "Views": {
379
+ "items": {
380
+ "$ref": "#/definitions/IListView"
381
+ },
382
+ "type": "array"
383
+ }
384
+ },
385
+ "type": "object"
386
+ },
387
+ "IListInstanceFieldReference": {
388
+ "properties": {
389
+ "DisplayName": {
390
+ "type": "string"
391
+ },
392
+ "Hidden": {
393
+ "type": "boolean"
394
+ },
395
+ "ID": {
396
+ "type": "string"
397
+ },
398
+ "Name": {
399
+ "type": "string"
400
+ },
401
+ "Required": {
402
+ "type": "boolean"
403
+ }
404
+ },
405
+ "type": "object"
406
+ },
407
+ "IListSecurity": {
408
+ "properties": {
409
+ "BreakRoleInheritance": {
410
+ "type": "boolean"
411
+ },
412
+ "ClearSubscopes": {
413
+ "type": "boolean"
414
+ },
415
+ "CopyRoleAssignments": {
416
+ "type": "boolean"
417
+ },
418
+ "RoleAssignments": {
419
+ "items": {
420
+ "$ref": "#/definitions/IRoleAssignment"
421
+ },
422
+ "type": "array"
423
+ }
424
+ },
425
+ "type": "object"
426
+ },
427
+ "IListView": {
428
+ "properties": {
429
+ "AdditionalSettings": {
430
+ "properties": {
431
+ "DefaultView": {
432
+ "type": "boolean"
433
+ },
434
+ "Hidden": {
435
+ "type": "boolean"
436
+ },
437
+ "JSLink": {
438
+ "type": "string"
439
+ },
440
+ "Paged": {
441
+ "type": "boolean"
442
+ },
443
+ "RowLimit": {
444
+ "type": "number"
445
+ },
446
+ "Scope": {
447
+ "enum": [
448
+ 0,
449
+ 1
450
+ ],
451
+ "type": "number"
452
+ },
453
+ "ViewQuery": {
454
+ "type": "string"
455
+ }
456
+ },
457
+ "type": "object"
458
+ },
459
+ "PersonalView": {
460
+ "type": "boolean"
461
+ },
462
+ "Title": {
463
+ "type": "string"
464
+ },
465
+ "ViewFields": {
466
+ "items": {
467
+ "type": "string"
468
+ },
469
+ "type": "array"
470
+ }
471
+ },
472
+ "type": "object"
473
+ },
474
+ "INavigation": {
475
+ "properties": {
476
+ "QuickLaunch": {
477
+ "items": {
478
+ "$ref": "#/definitions/INavigationNode"
479
+ },
480
+ "type": "array"
481
+ },
482
+ "TopNavigationBar": {
483
+ "items": {
484
+ "$ref": "#/definitions/INavigationNode"
485
+ },
486
+ "type": "array"
487
+ }
488
+ },
489
+ "type": "object"
490
+ },
491
+ "INavigationNode": {
492
+ "properties": {
493
+ "Children": {
494
+ "items": {
495
+ "$ref": "#/definitions/INavigationNode"
496
+ },
497
+ "type": "array"
498
+ },
499
+ "IgnoreExisting": {
500
+ "type": "boolean"
501
+ },
502
+ "Title": {
503
+ "type": "string"
504
+ },
505
+ "Url": {
506
+ "type": "string"
507
+ }
508
+ },
509
+ "type": "object"
510
+ },
511
+ "IPropertyBagEntry": {
512
+ "properties": {
513
+ "Indexed": {
514
+ "type": "boolean"
515
+ },
516
+ "Key": {
517
+ "type": "string"
518
+ },
519
+ "Overwrite": {
520
+ "type": "boolean"
521
+ },
522
+ "Value": {
523
+ "type": "string"
524
+ }
525
+ },
526
+ "type": "object"
527
+ },
528
+ "IRoleAssignment": {
529
+ "properties": {
530
+ "Principal": {
531
+ "type": "string"
532
+ },
533
+ "RoleDefinition": {
534
+ "type": "string"
535
+ }
536
+ },
537
+ "type": "object"
538
+ },
539
+ "IWebPart": {
540
+ "properties": {
541
+ "Contents": {
542
+ "$ref": "#/definitions/IWebPartContents"
543
+ },
544
+ "ListView": {
545
+ "properties": {
546
+ "List": {
547
+ "type": "string"
548
+ },
549
+ "View": {
550
+ "$ref": "#/definitions/IListView"
551
+ }
552
+ },
553
+ "type": "object"
554
+ },
555
+ "Order": {
556
+ "type": "number"
557
+ },
558
+ "PropertyOverrides": {
559
+ "items": {
560
+ "$ref": "#/definitions/IWebPartPropertyOverride"
561
+ },
562
+ "type": "array"
563
+ },
564
+ "Title": {
565
+ "type": "string"
566
+ },
567
+ "Zone": {
568
+ "type": "string"
569
+ }
570
+ },
571
+ "type": "object"
572
+ },
573
+ "IWebPartContents": {
574
+ "properties": {
575
+ "FileSrc": {
576
+ "type": "string"
577
+ },
578
+ "Xml": {
579
+ "type": "string"
580
+ }
581
+ },
582
+ "type": "object"
583
+ },
584
+ "IWebPartPropertyOverride": {
585
+ "properties": {
586
+ "name": {
587
+ "type": "string"
588
+ },
589
+ "type": {
590
+ "type": "string"
591
+ },
592
+ "value": {
593
+ "type": "string"
594
+ }
595
+ },
596
+ "type": "object"
597
+ },
598
+ "IWebSettings": {
599
+ "additionalProperties": {
600
+ "type": [
601
+ "string",
602
+ "boolean"
603
+ ]
604
+ },
605
+ "properties": {
606
+ "AlternateCssUrl": {
607
+ "type": "string"
608
+ },
609
+ "CustomMasterUrl": {
610
+ "type": "string"
611
+ },
612
+ "MasterUrl": {
613
+ "type": "string"
614
+ },
615
+ "QuickLaunchEnabled": {
616
+ "type": "boolean"
617
+ },
618
+ "RecycleBinEnabled": {
619
+ "type": "boolean"
620
+ },
621
+ "SaveSiteAsTemplateEnabled": {
622
+ "type": "boolean"
623
+ },
624
+ "SiteLogoUrl": {
625
+ "type": "string"
626
+ },
627
+ "TreeViewEnabled": {
628
+ "type": "boolean"
629
+ },
630
+ "WelcomePage": {
631
+ "type": "string"
632
+ }
633
+ },
634
+ "type": "object"
635
+ },
636
+ "ReadableStream<Uint8Array>": {
637
+ "properties": {
638
+ "locked": {
639
+ "type": "boolean"
640
+ }
641
+ },
642
+ "type": "object"
643
+ },
644
+ "Record<string,string>": {
645
+ "type": "object"
646
+ }
647
+ },
648
+ "properties": {
649
+ "ClientSidePages": {
650
+ "items": {
651
+ "$ref": "#/definitions/IClientSidePage"
652
+ },
653
+ "title": "Client Side Pages",
654
+ "type": "array"
655
+ },
656
+ "ComposedLook": {
657
+ "$ref": "#/definitions/IComposedLook"
658
+ },
659
+ "ContentTypes": {
660
+ "items": {
661
+ "$ref": "#/definitions/IContentType"
662
+ },
663
+ "type": "array"
664
+ },
665
+ "CustomActions": {
666
+ "items": {
667
+ "$ref": "#/definitions/ICustomAction"
668
+ },
669
+ "type": "array"
670
+ },
671
+ "Features": {
672
+ "items": {
673
+ "$ref": "#/definitions/IFeature"
674
+ },
675
+ "type": "array"
676
+ },
677
+ "Files": {
678
+ "items": {
679
+ "$ref": "#/definitions/IFileObject"
680
+ },
681
+ "type": "array"
682
+ },
683
+ "Hooks": {
684
+ "items": {
685
+ "$ref": "#/definitions/IHooks"
686
+ },
687
+ "type": "array"
688
+ },
689
+ "Lists": {
690
+ "items": {
691
+ "$ref": "#/definitions/IListInstance"
692
+ },
693
+ "type": "array"
694
+ },
695
+ "Navigation": {
696
+ "$ref": "#/definitions/INavigation"
697
+ },
698
+ "Parameters": {
699
+ "$ref": "#/definitions/Record<string,string>"
700
+ },
701
+ "PropertyBagEntries": {
702
+ "items": {
703
+ "$ref": "#/definitions/IPropertyBagEntry"
704
+ },
705
+ "type": "array"
706
+ },
707
+ "SiteFields": {
708
+ "items": {
709
+ "type": "string"
710
+ },
711
+ "type": "array"
712
+ },
713
+ "Version": {
714
+ "type": "string"
715
+ },
716
+ "WebSettings": {
717
+ "$ref": "#/definitions/IWebSettings"
718
+ }
719
+ },
720
+ "type": "object"
721
+ }
722
+