sp-js-provisioning 1.0.4 → 1.1.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.
Files changed (85) hide show
  1. package/.husky/commit-msg +4 -0
  2. package/README.md +11 -31
  3. package/lib/handlers/clientsidepages.d.ts +13 -13
  4. package/lib/handlers/clientsidepages.js +77 -60
  5. package/lib/handlers/clientsidepages.js.map +1 -0
  6. package/lib/handlers/composedlook.d.ts +6 -6
  7. package/lib/handlers/composedlook.js +24 -17
  8. package/lib/handlers/composedlook.js.map +1 -0
  9. package/lib/handlers/contenttypes.d.ts +20 -20
  10. package/lib/handlers/contenttypes.js +77 -59
  11. package/lib/handlers/contenttypes.js.map +1 -0
  12. package/lib/handlers/customactions.d.ts +7 -7
  13. package/lib/handlers/customactions.js +24 -17
  14. package/lib/handlers/customactions.js.map +1 -0
  15. package/lib/handlers/exports.d.ts +3 -3
  16. package/lib/handlers/exports.js +15 -11
  17. package/lib/handlers/exports.js.map +1 -0
  18. package/lib/handlers/features.d.ts +7 -7
  19. package/lib/handlers/features.js +24 -22
  20. package/lib/handlers/features.js.map +1 -0
  21. package/lib/handlers/files.d.ts +44 -44
  22. package/lib/handlers/files.js +229 -159
  23. package/lib/handlers/files.js.map +1 -0
  24. package/lib/handlers/handlerbase.d.ts +21 -11
  25. package/lib/handlers/handlerbase.js +51 -16
  26. package/lib/handlers/handlerbase.js.map +1 -0
  27. package/lib/handlers/hooks.d.ts +22 -0
  28. package/lib/handlers/hooks.js +230 -0
  29. package/lib/handlers/hooks.js.map +1 -0
  30. package/lib/handlers/lists.d.ts +45 -45
  31. package/lib/handlers/lists.js +184 -150
  32. package/lib/handlers/lists.js.map +1 -0
  33. package/lib/handlers/navigation.d.ts +10 -10
  34. package/lib/handlers/navigation.js +40 -31
  35. package/lib/handlers/navigation.js.map +1 -0
  36. package/lib/handlers/propertybagentries.d.ts +7 -7
  37. package/lib/handlers/propertybagentries.js +30 -25
  38. package/lib/handlers/propertybagentries.js.map +1 -0
  39. package/lib/handlers/sitefields.d.ts +11 -11
  40. package/lib/handlers/sitefields.js +40 -29
  41. package/lib/handlers/sitefields.js.map +1 -0
  42. package/lib/handlers/websettings.d.ts +7 -7
  43. package/lib/handlers/websettings.js +36 -33
  44. package/lib/handlers/websettings.js.map +1 -0
  45. package/lib/index.d.ts +3 -3
  46. package/lib/index.js +3 -2
  47. package/lib/index.js.map +1 -0
  48. package/lib/provisioningconfig.d.ts +2 -2
  49. package/lib/provisioningconfig.js +2 -0
  50. package/lib/provisioningconfig.js.map +1 -0
  51. package/lib/provisioningcontext.d.ts +1 -5
  52. package/lib/provisioningcontext.js +2 -4
  53. package/lib/provisioningcontext.js.map +1 -0
  54. package/lib/schema.d.ts +18 -4
  55. package/lib/schema.js +2 -0
  56. package/lib/schema.js.map +1 -0
  57. package/lib/util/index.d.ts +3 -6
  58. package/lib/util/index.js +20 -29
  59. package/lib/util/index.js.map +1 -0
  60. package/lib/util/tokenhelper.d.ts +3 -3
  61. package/lib/util/tokenhelper.js +30 -29
  62. package/lib/util/tokenhelper.js.map +1 -0
  63. package/lib/webprovisioner.d.ts +16 -16
  64. package/lib/webprovisioner.js +42 -29
  65. package/lib/webprovisioner.js.map +1 -0
  66. package/package.json +118 -36
  67. package/sample-schemas/all-simple.ts +85 -76
  68. package/AUTHORS +0 -3
  69. package/LICENSE +0 -25
  70. package/debug/debug.ts +0 -68
  71. package/debug/example.ts +0 -42
  72. package/gulptasks/@configuration.js +0 -58
  73. package/gulptasks/build.js +0 -84
  74. package/gulptasks/clean.js +0 -23
  75. package/gulptasks/docs.js +0 -11
  76. package/gulptasks/index.js +0 -8
  77. package/gulptasks/lint.js +0 -18
  78. package/gulptasks/package.js +0 -44
  79. package/gulptasks/publish.js +0 -232
  80. package/gulptasks/test.js +0 -40
  81. package/gulptasks/watch.js +0 -15
  82. package/jsdoc.json +0 -26
  83. package/pnpm-lock.yaml +0 -6582
  84. package/shrinkwrap.yaml +0 -6513
  85. package/webpack.config.js +0 -58
@@ -1,7 +1,10 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = Object.setPrototypeOf ||
3
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
5
8
  return function (d, b) {
6
9
  extendStatics(d, b);
7
10
  function __() { this.constructor = d; }
@@ -9,10 +12,11 @@ var __extends = (this && this.__extends) || (function () {
9
12
  };
10
13
  })();
11
14
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
16
  return new (P || (P = Promise))(function (resolve, reject) {
13
17
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
18
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
20
  step((generator = generator.apply(thisArg, _arguments || [])).next());
17
21
  });
18
22
  };
@@ -23,8 +27,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
23
27
  function step(op) {
24
28
  if (f) throw new TypeError("Generator is already executing.");
25
29
  while (_) try {
26
- if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
27
- if (y = 0, t) op = [0, t.value];
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
28
32
  switch (op[0]) {
29
33
  case 0: case 1: t = op; break;
30
34
  case 4: _.label++; return { value: op[1], done: false };
@@ -43,30 +47,30 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
43
47
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
44
48
  }
45
49
  };
46
- import initSpfxJsom, { ExecuteJsomQuery } from "spfx-jsom";
47
- import { HandlerBase } from "./handlerbase";
50
+ import initSpfxJsom, { ExecuteJsomQuery } from 'spfx-jsom';
51
+ import { HandlerBase } from './handlerbase';
48
52
  /**
49
53
  * Describes the Content Types Object Handler
50
54
  */
51
- var ContentTypes = (function (_super) {
55
+ var ContentTypes = /** @class */ (function (_super) {
52
56
  __extends(ContentTypes, _super);
53
57
  /**
54
58
  * Creates a new instance of the ObjectSiteFields class
55
59
  */
56
60
  function ContentTypes(config) {
57
- return _super.call(this, "ContentTypes", config) || this;
61
+ return _super.call(this, ContentTypes.name, config) || this;
58
62
  }
59
63
  /**
60
64
  * Provisioning Content Types
61
65
  *
62
- * @param {Web} web The web
63
- * @param {IContentType[]} contentTypes The content types
64
- * @param {ProvisioningContext} context Provisioning context
66
+ * @param web - The web
67
+ * @param contentTypes - The content types
68
+ * @param context - Provisioning context
65
69
  */
66
70
  ContentTypes.prototype.ProvisionObjects = function (web, contentTypes, context) {
67
71
  return __awaiter(this, void 0, void 0, function () {
72
+ var _a, _b, error_1;
68
73
  var _this = this;
69
- var _a, _b, err_1;
70
74
  return __generator(this, function (_c) {
71
75
  switch (_c.label) {
72
76
  case 0:
@@ -80,20 +84,23 @@ var ContentTypes = (function (_super) {
80
84
  case 2:
81
85
  _c.trys.push([2, 5, , 6]);
82
86
  _b = this.context;
83
- return [4 /*yield*/, web.contentTypes.select('Id', 'Name', 'FieldLinks').expand('FieldLinks').get()];
87
+ return [4 /*yield*/, web.contentTypes
88
+ .select('Id', 'Name', 'FieldLinks')
89
+ .expand('FieldLinks')
90
+ .get()];
84
91
  case 3:
85
- _b.contentTypes = (_c.sent()).reduce(function (obj, contentType) {
86
- obj[contentType.Name] = {
92
+ _b.contentTypes = (_c.sent()).reduce(function (object, contentType) {
93
+ object[contentType.Name] = {
87
94
  ID: contentType.Id.StringValue,
88
95
  Name: contentType.Name,
89
96
  FieldRefs: contentType.FieldLinks.map(function (fieldLink) { return ({
90
97
  ID: fieldLink.Id,
91
98
  Name: fieldLink.Name,
92
99
  Required: fieldLink.Required,
93
- Hidden: fieldLink.Hidden,
94
- }); }),
100
+ Hidden: fieldLink.Hidden
101
+ }); })
95
102
  };
96
- return obj;
103
+ return object;
97
104
  }, {});
98
105
  return [4 /*yield*/, contentTypes
99
106
  .sort(function (a, b) {
@@ -105,14 +112,16 @@ var ContentTypes = (function (_super) {
105
112
  }
106
113
  return 0;
107
114
  })
108
- .reduce(function (chain, contentType) { return chain.then(function () { return _this.processContentType(web, contentType); }); }, Promise.resolve())];
115
+ .reduce(function (chain, contentType) {
116
+ return chain.then(function () { return _this.processContentType(web, contentType); });
117
+ }, Promise.resolve())];
109
118
  case 4:
110
119
  _c.sent();
111
120
  return [3 /*break*/, 6];
112
121
  case 5:
113
- err_1 = _c.sent();
114
- _super.prototype.scope_ended.call(this);
115
- throw err_1;
122
+ error_1 = _c.sent();
123
+ _super.prototype.scope_ended.call(this, error_1);
124
+ throw error_1;
116
125
  case 6: return [2 /*return*/];
117
126
  }
118
127
  });
@@ -121,12 +130,12 @@ var ContentTypes = (function (_super) {
121
130
  /**
122
131
  * Provision a content type
123
132
  *
124
- * @param {Web} web The web
125
- * @param {IContentType} contentType Content type
133
+ * @param web - The web
134
+ * @param contentType - Content type
126
135
  */
127
136
  ContentTypes.prototype.processContentType = function (web, contentType) {
128
137
  return __awaiter(this, void 0, void 0, function () {
129
- var contentTypeId, contentTypeAddResult, spContentType, err_2;
138
+ var contentTypeId, contentTypeAddResult, spContentType, error_2;
130
139
  return __generator(this, function (_a) {
131
140
  switch (_a.label) {
132
141
  case 0:
@@ -139,8 +148,10 @@ var ContentTypes = (function (_super) {
139
148
  contentTypeId = contentTypeAddResult.data.Id;
140
149
  _a.label = 2;
141
150
  case 2:
142
- _super.prototype.log_info.call(this, "processContentType", "Processing content type [" + contentType.Name + "] (" + contentTypeId + ")");
143
- spContentType = this.jsomContext.web.get_contentTypes().getById(contentTypeId);
151
+ _super.prototype.log_info.call(this, 'processContentType', "Processing content type [" + contentType.Name + "] (" + contentTypeId + ")");
152
+ spContentType = this.jsomContext.web
153
+ .get_contentTypes()
154
+ .getById(contentTypeId);
144
155
  if (contentType.Description) {
145
156
  spContentType.set_description(contentType.Description);
146
157
  }
@@ -158,8 +169,8 @@ var ContentTypes = (function (_super) {
158
169
  _a.label = 5;
159
170
  case 5: return [3 /*break*/, 7];
160
171
  case 6:
161
- err_2 = _a.sent();
162
- throw err_2;
172
+ error_2 = _a.sent();
173
+ throw error_2;
163
174
  case 7: return [2 /*return*/];
164
175
  }
165
176
  });
@@ -168,74 +179,80 @@ var ContentTypes = (function (_super) {
168
179
  /**
169
180
  * Add a content type
170
181
  *
171
- * @param {Web} web The web
172
- * @param {IContentType} contentType Content type
182
+ * @param web - The web
183
+ * @param contentType - Content type
173
184
  */
174
185
  ContentTypes.prototype.addContentType = function (web, contentType) {
175
186
  return __awaiter(this, void 0, void 0, function () {
176
- var err_3;
187
+ var error_3;
177
188
  return __generator(this, function (_a) {
178
189
  switch (_a.label) {
179
190
  case 0:
180
191
  _a.trys.push([0, 2, , 3]);
181
- _super.prototype.log_info.call(this, "addContentType", "Adding content type [" + contentType.Name + "] (" + contentType.ID + ")");
192
+ _super.prototype.log_info.call(this, 'addContentType', "Adding content type [" + contentType.Name + "] (" + contentType.ID + ")");
182
193
  return [4 /*yield*/, web.contentTypes.add(contentType.ID, contentType.Name, contentType.Description, contentType.Group)];
183
194
  case 1: return [2 /*return*/, _a.sent()];
184
195
  case 2:
185
- err_3 = _a.sent();
186
- throw err_3;
196
+ error_3 = _a.sent();
197
+ throw error_3;
187
198
  case 3: return [2 /*return*/];
188
199
  }
189
200
  });
190
201
  });
191
202
  };
192
203
  /**
193
- * Adding content type field refs
194
- *
195
- * @param {IContentType} contentType Content type
196
- * @param {SP.ContentType} spContentType Content type
197
- */
204
+ * Adding content type field refs
205
+ *
206
+ * @param contentType - Content type
207
+ * @param spContentType - SP content type
208
+ */
198
209
  ContentTypes.prototype.processContentTypeFieldRefs = function (contentType, spContentType) {
199
210
  return __awaiter(this, void 0, void 0, function () {
200
- var _loop_1, this_1, i, error_1;
211
+ var _loop_1, this_1, index, error_4;
201
212
  return __generator(this, function (_a) {
202
213
  switch (_a.label) {
203
214
  case 0:
204
215
  _a.trys.push([0, 2, , 3]);
205
- _loop_1 = function (i) {
206
- var fieldRef = contentType.FieldRefs[i];
207
- var existingFieldLink = this_1.context.contentTypes[contentType.Name].FieldRefs.filter(function (fr) { return fr.Name === fieldRef.Name; })[0];
216
+ _loop_1 = function (index) {
217
+ var fieldReference = contentType.FieldRefs[index];
218
+ var existingFieldLink = this_1.context.contentTypes[contentType.Name].FieldRefs.find(function (fr) { return fr.Name === fieldReference.Name; });
208
219
  var fieldLink = void 0;
209
220
  if (existingFieldLink) {
210
- fieldLink = spContentType.get_fieldLinks().getById(new SP.Guid(existingFieldLink.ID));
221
+ fieldLink = spContentType
222
+ .get_fieldLinks()
223
+ .getById(new SP.Guid(existingFieldLink.ID));
211
224
  }
212
225
  else {
213
- _super.prototype.log_info.call(this_1, "processContentTypeFieldRefs", "Adding field ref " + fieldRef.Name + " to content type [" + contentType.Name + "] (" + contentType.ID + ")");
214
- var siteField = this_1.jsomContext.web.get_fields().getByInternalNameOrTitle(fieldRef.Name);
226
+ _super.prototype.log_info.call(this_1, 'processContentTypeFieldRefs', "Adding field ref " + fieldReference.Name + " to content type [" + contentType.Name + "] (" + contentType.ID + ")");
227
+ var siteField = this_1.jsomContext.web
228
+ .get_fields()
229
+ .getByInternalNameOrTitle(fieldReference.Name);
215
230
  var fieldLinkCreationInformation = new SP.FieldLinkCreationInformation();
216
231
  fieldLinkCreationInformation.set_field(siteField);
217
- fieldLink = spContentType.get_fieldLinks().add(fieldLinkCreationInformation);
232
+ fieldLink = spContentType
233
+ .get_fieldLinks()
234
+ .add(fieldLinkCreationInformation);
218
235
  }
219
- if (contentType.FieldRefs[i].hasOwnProperty("Required")) {
220
- fieldLink.set_required(contentType.FieldRefs[i].Required);
236
+ if (contentType.FieldRefs[index].hasOwnProperty('Required')) {
237
+ fieldLink.set_required(contentType.FieldRefs[index].Required);
221
238
  }
222
- if (contentType.FieldRefs[i].hasOwnProperty("Hidden")) {
223
- fieldLink.set_hidden(contentType.FieldRefs[i].Hidden);
239
+ if (contentType.FieldRefs[index].hasOwnProperty('Hidden')) {
240
+ fieldLink.set_hidden(contentType.FieldRefs[index].Hidden);
224
241
  }
225
242
  };
226
243
  this_1 = this;
227
- for (i = 0; i < contentType.FieldRefs.length; i++) {
228
- _loop_1(i);
244
+ for (index = 0; index < contentType.FieldRefs.length; index++) {
245
+ _loop_1(index);
229
246
  }
230
247
  spContentType.update(true);
231
248
  return [4 /*yield*/, ExecuteJsomQuery(this.jsomContext)];
232
249
  case 1:
233
250
  _a.sent();
234
- _super.prototype.log_info.call(this, "processContentTypeFieldRefs", "Successfully processed field refs for content type [" + contentType.Name + "] (" + contentType.ID + ")");
251
+ _super.prototype.log_info.call(this, 'processContentTypeFieldRefs', "Successfully processed field refs for content type [" + contentType.Name + "] (" + contentType.ID + ")");
235
252
  return [3 /*break*/, 3];
236
253
  case 2:
237
- error_1 = _a.sent();
238
- _super.prototype.log_info.call(this, "processContentTypeFieldRefs", "Failed to process field refs for content type [" + contentType.Name + "] (" + contentType.ID + ")", { error: error_1.args && error_1.args.get_message() });
254
+ error_4 = _a.sent();
255
+ _super.prototype.log_info.call(this, 'processContentTypeFieldRefs', "Failed to process field refs for content type [" + contentType.Name + "] (" + contentType.ID + ")", { error: error_4.args && error_4.args.get_message() });
239
256
  return [3 /*break*/, 3];
240
257
  case 3: return [2 /*return*/];
241
258
  }
@@ -245,3 +262,4 @@ var ContentTypes = (function (_super) {
245
262
  return ContentTypes;
246
263
  }(HandlerBase));
247
264
  export { ContentTypes };
265
+ //# sourceMappingURL=contenttypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contenttypes.js","sourceRoot":"","sources":["../../src/handlers/contenttypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAe,MAAM,WAAW,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAM3C;;GAEG;AACH;IAAkC,gCAAW;IAI3C;;OAEG;IACH,sBAAY,MAA2B;eACrC,kBAAM,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;IAClC,CAAC;IAED;;;;;;OAMG;IACU,uCAAgB,GAA7B,UACE,GAAQ,EACR,YAA4B,EAC5B,OAA4B;;;;;;;wBAE5B,KAAA,IAAI,CAAA;wBACF,qBAAM,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAA;;wBADnD,GAAK,WAAW,GAAG,CACjB,SAAiD,CAClD,CAAC,WAAW,CAAA;wBACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;wBACtB,iBAAM,aAAa,WAAE,CAAA;;;;wBAEnB,KAAA,IAAI,CAAC,OAAO,CAAA;wBACV,qBAAM,GAAG,CAAC,YAAY;iCACnB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC;iCAClC,MAAM,CAAC,YAAY,CAAC;iCACpB,GAAG,EAAS,EAAA;;wBAJjB,GAAa,YAAY,GAAG,CAC1B,SAGe,CAChB,CAAC,MAAM,CAAC,UAAC,MAAM,EAAE,WAAW;4BAC3B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG;gCACzB,EAAE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AAC,QAAQ,CAAC,CAAA;6BAC9D;4BACD,IAAI,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;gCACzD,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;6BAC1D;;;wBA7BH,KAAS,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;oCAAxD,KAAK;yBA8Bb;wBACD,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;wBAC1B,qBAAM,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAA;;wBAAxC,SAAwC,CAAA;wBACxC,iBAAM,QAAQ,YACZ,6BAA6B,EAC7B,yDAAuD,WAAW,CAAC,IAAI,WAAM,WAAW,CAAC,EAAE,MAAG,CAC/F,CAAA;;;;wBAED,iBAAM,QAAQ,YACZ,6BAA6B,EAC7B,oDAAkD,WAAW,CAAC,IAAI,WAAM,WAAW,CAAC,EAAE,MAAG,EACzF,EAAE,KAAK,EAAE,OAAK,CAAC,IAAI,IAAI,OAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAClD,CAAA;;;;;;KAEJ;IACH,mBAAC;AAAD,CAAC,AA7LD,CAAkC,WAAW,GA6L5C"}
@@ -1,7 +1,7 @@
1
- import { HandlerBase } from "./handlerbase";
2
- import { ICustomAction } from "../schema";
3
- import { Web } from "@pnp/sp";
4
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { HandlerBase } from './handlerbase';
2
+ import { ICustomAction } from '../schema';
3
+ import { Web } from '@pnp/sp';
4
+ import { IProvisioningConfig } from '../provisioningconfig';
5
5
  /**
6
6
  * Describes the Custom Actions Object Handler
7
7
  */
@@ -9,14 +9,14 @@ export declare class CustomActions extends HandlerBase {
9
9
  /**
10
10
  * Creates a new instance of the ObjectCustomActions class
11
11
  *
12
- * @param {IProvisioningConfig} config Provisioning config
12
+ * @param config - Provisioning config
13
13
  */
14
14
  constructor(config: IProvisioningConfig);
15
15
  /**
16
16
  * Provisioning Custom Actions
17
17
  *
18
- * @param {Web} web The web
19
- * @param {Array<ICustomAction>} customactions The Custom Actions to provision
18
+ * @param web - The web
19
+ * @param customactions - The Custom Actions to provision
20
20
  */
21
21
  ProvisionObjects(web: Web, customActions: ICustomAction[]): Promise<void>;
22
22
  }
@@ -1,7 +1,10 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = Object.setPrototypeOf ||
3
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
5
8
  return function (d, b) {
6
9
  extendStatics(d, b);
7
10
  function __() { this.constructor = d; }
@@ -9,10 +12,11 @@ var __extends = (this && this.__extends) || (function () {
9
12
  };
10
13
  })();
11
14
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
16
  return new (P || (P = Promise))(function (resolve, reject) {
13
17
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
18
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
20
  step((generator = generator.apply(thisArg, _arguments || [])).next());
17
21
  });
18
22
  };
@@ -23,8 +27,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
23
27
  function step(op) {
24
28
  if (f) throw new TypeError("Generator is already executing.");
25
29
  while (_) try {
26
- if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
27
- if (y = 0, t) op = [0, t.value];
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
28
32
  switch (op[0]) {
29
33
  case 0: case 1: t = op; break;
30
34
  case 4: _.label++; return { value: op[1], done: false };
@@ -43,29 +47,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
43
47
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
44
48
  }
45
49
  };
46
- import { HandlerBase } from "./handlerbase";
50
+ import { HandlerBase } from './handlerbase';
47
51
  /**
48
52
  * Describes the Custom Actions Object Handler
49
53
  */
50
- var CustomActions = (function (_super) {
54
+ var CustomActions = /** @class */ (function (_super) {
51
55
  __extends(CustomActions, _super);
52
56
  /**
53
57
  * Creates a new instance of the ObjectCustomActions class
54
58
  *
55
- * @param {IProvisioningConfig} config Provisioning config
59
+ * @param config - Provisioning config
56
60
  */
57
61
  function CustomActions(config) {
58
- return _super.call(this, "CustomActions", config) || this;
62
+ return _super.call(this, CustomActions.name, config) || this;
59
63
  }
60
64
  /**
61
65
  * Provisioning Custom Actions
62
66
  *
63
- * @param {Web} web The web
64
- * @param {Array<ICustomAction>} customactions The Custom Actions to provision
67
+ * @param web - The web
68
+ * @param customactions - The Custom Actions to provision
65
69
  */
66
70
  CustomActions.prototype.ProvisionObjects = function (web, customActions) {
67
71
  return __awaiter(this, void 0, void 0, function () {
68
- var existingActions_1, batch_1, err_1;
72
+ var existingActions_1, batch_1, error_1;
69
73
  return __generator(this, function (_a) {
70
74
  switch (_a.label) {
71
75
  case 0:
@@ -73,7 +77,9 @@ var CustomActions = (function (_super) {
73
77
  _a.label = 1;
74
78
  case 1:
75
79
  _a.trys.push([1, 4, , 5]);
76
- return [4 /*yield*/, web.userCustomActions.select("Title").get()];
80
+ return [4 /*yield*/, web.userCustomActions
81
+ .select('Title')
82
+ .get()];
77
83
  case 2:
78
84
  existingActions_1 = _a.sent();
79
85
  batch_1 = web.createBatch();
@@ -90,9 +96,9 @@ var CustomActions = (function (_super) {
90
96
  _super.prototype.scope_ended.call(this);
91
97
  return [3 /*break*/, 5];
92
98
  case 4:
93
- err_1 = _a.sent();
94
- _super.prototype.scope_ended.call(this);
95
- throw err_1;
99
+ error_1 = _a.sent();
100
+ _super.prototype.scope_ended.call(this, error_1);
101
+ throw error_1;
96
102
  case 5: return [2 /*return*/];
97
103
  }
98
104
  });
@@ -101,3 +107,4 @@ var CustomActions = (function (_super) {
101
107
  return CustomActions;
102
108
  }(HandlerBase));
103
109
  export { CustomActions };
110
+ //# sourceMappingURL=customactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customactions.js","sourceRoot":"","sources":["../../src/handlers/customactions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAK3C;;GAEG;AACH;IAAmC,iCAAW;IAC5C;;;;OAIG;IACH,uBAAY,MAA2B;eACrC,kBAAM,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACU,wCAAgB,GAA7B,UACE,GAAQ,EACR,aAA8B;;;;;;wBAE9B,iBAAM,aAAa,WAAE,CAAA;;;;wBAEK,qBAAM,GAAG,CAAC,iBAAiB;iCAChD,MAAM,CAAC,OAAO,CAAC;iCACf,GAAG,EAAuB,EAAA;;wBAFvB,oBAAkB,SAEK;wBAEvB,UAAQ,GAAG,CAAC,WAAW,EAAE,CAAA;wBAE/B,aAAa;6BACV,MAAM,CAAC,UAAC,MAAM;4BACb,OAAO,CAAC,iBAAe,CAAC,IAAI,CAC1B,UAAC,cAAc,IAAK,OAAA,cAAc,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,EAArC,CAAqC,CAC1D,CAAA;wBACH,CAAC,CAAC;6BACD,GAAG,CAAC,UAAC,MAAM;4BACV,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;wBAClD,CAAC,CAAC,CAAA;wBAEJ,qBAAM,OAAK,CAAC,OAAO,EAAE,EAAA;;wBAArB,SAAqB,CAAA;wBACrB,iBAAM,WAAW,WAAE,CAAA;;;;wBAEnB,iBAAM,WAAW,YAAC,OAAK,CAAC,CAAA;wBACxB,MAAM,OAAK,CAAA;;;;;KAEd;IACH,oBAAC;AAAD,CAAC,AA7CD,CAAmC,WAAW,GA6C7C"}
@@ -1,5 +1,5 @@
1
- import { TypedHash } from "@pnp/common";
2
- import { HandlerBase } from "./handlerbase";
3
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { TypedHash } from '@pnp/common';
2
+ import { HandlerBase } from './handlerbase';
3
+ import { IProvisioningConfig } from '../provisioningconfig';
4
4
  export declare const DefaultHandlerMap: (config: IProvisioningConfig) => TypedHash<HandlerBase>;
5
5
  export declare const DefaultHandlerSort: TypedHash<number>;
@@ -1,14 +1,15 @@
1
- import { ComposedLook } from "./composedlook";
2
- import { CustomActions } from "./customactions";
3
- import { Features } from "./features";
4
- import { WebSettings } from "./websettings";
5
- import { Navigation } from "./navigation";
6
- import { Lists } from "./lists";
7
- import { Files } from "./files";
8
- import { ClientSidePages } from "./clientsidepages";
9
- import { PropertyBagEntries } from "./propertybagentries";
10
- import { SiteFields } from "./sitefields";
11
- import { ContentTypes } from "./contenttypes";
1
+ import { ComposedLook } from './composedlook';
2
+ import { CustomActions } from './customactions';
3
+ import { Features } from './features';
4
+ import { WebSettings } from './websettings';
5
+ import { Hooks } from './hooks';
6
+ import { Navigation } from './navigation';
7
+ import { Lists } from './lists';
8
+ import { Files } from './files';
9
+ import { ClientSidePages } from './clientsidepages';
10
+ import { PropertyBagEntries } from './propertybagentries';
11
+ import { SiteFields } from './sitefields';
12
+ import { ContentTypes } from './contenttypes';
12
13
  export var DefaultHandlerMap = function (config) { return ({
13
14
  ClientSidePages: new ClientSidePages(config),
14
15
  ComposedLook: new ComposedLook(config),
@@ -21,6 +22,7 @@ export var DefaultHandlerMap = function (config) { return ({
21
22
  PropertyBagEntries: new PropertyBagEntries(config),
22
23
  WebSettings: new WebSettings(config),
23
24
  SiteFields: new SiteFields(config),
25
+ Hooks: new Hooks(config)
24
26
  }); };
25
27
  export var DefaultHandlerSort = {
26
28
  ClientSidePages: 7,
@@ -34,4 +36,6 @@ export var DefaultHandlerSort = {
34
36
  PropertyBagEntries: 8,
35
37
  WebSettings: 10,
36
38
  SiteFields: 0,
39
+ Hooks: 11
37
40
  };
41
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/handlers/exports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAC/B,MAA2B,IACA,OAAA,CAAC;IAC5B,eAAe,EAAE,IAAI,eAAe,CAAC,MAAM,CAAC;IAC5C,YAAY,EAAE,IAAI,YAAY,CAAC,MAAM,CAAC;IACtC,YAAY,EAAE,IAAI,YAAY,CAAC,MAAM,CAAC;IACtC,aAAa,EAAE,IAAI,aAAa,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;IACxB,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;IACxB,UAAU,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC;IAClC,kBAAkB,EAAE,IAAI,kBAAkB,CAAC,MAAM,CAAC;IAClD,WAAW,EAAE,IAAI,WAAW,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC;CACzB,CAAC,EAb2B,CAa3B,CAAA;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAsB;IACnD,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAC;IACb,kBAAkB,EAAE,CAAC;IACrB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,CAAC;IACb,KAAK,EAAE,EAAE;CACV,CAAA"}
@@ -1,7 +1,7 @@
1
- import { HandlerBase } from "./handlerbase";
2
- import { IFeature } from "../schema";
3
- import { Web } from "@pnp/sp";
4
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { HandlerBase } from './handlerbase';
2
+ import { IFeature } from '../schema';
3
+ import { Web } from '@pnp/sp';
4
+ import { IProvisioningConfig } from '../provisioningconfig';
5
5
  /**
6
6
  * Describes the Features Object Handler
7
7
  */
@@ -9,14 +9,14 @@ export declare class Features extends HandlerBase {
9
9
  /**
10
10
  * Creates a new instance of the ObjectFeatures class
11
11
  *
12
- * @param {IProvisioningConfig} config Provisioning config
12
+ * @param config - Provisioning config
13
13
  */
14
14
  constructor(config: IProvisioningConfig);
15
15
  /**
16
16
  * Provisioning features
17
17
  *
18
- * @param {Web} web The web
19
- * @param {Array<IFeature>} features The features to provision
18
+ * @param web - The web
19
+ * @param features - The features to provision
20
20
  */
21
21
  ProvisionObjects(web: Web, features: IFeature[]): Promise<void>;
22
22
  }
@@ -1,7 +1,10 @@
1
1
  var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = Object.setPrototypeOf ||
3
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
5
8
  return function (d, b) {
6
9
  extendStatics(d, b);
7
10
  function __() { this.constructor = d; }
@@ -9,10 +12,11 @@ var __extends = (this && this.__extends) || (function () {
9
12
  };
10
13
  })();
11
14
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
16
  return new (P || (P = Promise))(function (resolve, reject) {
13
17
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14
18
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
15
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16
20
  step((generator = generator.apply(thisArg, _arguments || [])).next());
17
21
  });
18
22
  };
@@ -23,8 +27,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
23
27
  function step(op) {
24
28
  if (f) throw new TypeError("Generator is already executing.");
25
29
  while (_) try {
26
- if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
27
- if (y = 0, t) op = [0, t.value];
30
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
28
32
  switch (op[0]) {
29
33
  case 0: case 1: t = op; break;
30
34
  case 4: _.label++; return { value: op[1], done: false };
@@ -43,29 +47,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
43
47
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
44
48
  }
45
49
  };
46
- import { HandlerBase } from "./handlerbase";
50
+ import { HandlerBase } from './handlerbase';
47
51
  /**
48
52
  * Describes the Features Object Handler
49
53
  */
50
- var Features = (function (_super) {
54
+ var Features = /** @class */ (function (_super) {
51
55
  __extends(Features, _super);
52
56
  /**
53
57
  * Creates a new instance of the ObjectFeatures class
54
58
  *
55
- * @param {IProvisioningConfig} config Provisioning config
59
+ * @param config - Provisioning config
56
60
  */
57
61
  function Features(config) {
58
- return _super.call(this, "Features", config) || this;
62
+ return _super.call(this, Features.name, config) || this;
59
63
  }
60
64
  /**
61
65
  * Provisioning features
62
66
  *
63
- * @param {Web} web The web
64
- * @param {Array<IFeature>} features The features to provision
67
+ * @param web - The web
68
+ * @param features - The features to provision
65
69
  */
66
70
  Features.prototype.ProvisionObjects = function (web, features) {
67
71
  return __awaiter(this, void 0, void 0, function () {
68
- var err_1;
72
+ var error_1;
69
73
  return __generator(this, function (_a) {
70
74
  switch (_a.label) {
71
75
  case 0:
@@ -74,21 +78,18 @@ var Features = (function (_super) {
74
78
  case 1:
75
79
  _a.trys.push([1, 3, , 4]);
76
80
  return [4 /*yield*/, features.reduce(function (chain, feature) {
77
- if (feature.deactivate) {
78
- return chain.then(function () { return web.features.remove(feature.id, feature.force); });
79
- }
80
- else {
81
- return chain.then(function () { return web.features.add(feature.id, feature.force); });
82
- }
81
+ return feature.deactivate
82
+ ? chain.then(function () { return web.features.remove(feature.id, feature.force); })
83
+ : chain.then(function () { return web.features.add(feature.id, feature.force); });
83
84
  }, Promise.resolve({}))];
84
85
  case 2:
85
86
  _a.sent();
86
87
  _super.prototype.scope_ended.call(this);
87
88
  return [3 /*break*/, 4];
88
89
  case 3:
89
- err_1 = _a.sent();
90
- _super.prototype.scope_ended.call(this);
91
- throw err_1;
90
+ error_1 = _a.sent();
91
+ _super.prototype.scope_ended.call(this, error_1);
92
+ throw error_1;
92
93
  case 4: return [2 /*return*/];
93
94
  }
94
95
  });
@@ -97,3 +98,4 @@ var Features = (function (_super) {
97
98
  return Features;
98
99
  }(HandlerBase));
99
100
  export { Features };
101
+ //# sourceMappingURL=features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.js","sourceRoot":"","sources":["../../src/handlers/features.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAK3C;;GAEG;AACH;IAA8B,4BAAW;IACvC;;;;OAIG;IACH,kBAAY,MAA2B;eACrC,kBAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACU,mCAAgB,GAA7B,UAA8B,GAAQ,EAAE,QAAoB;;;;;;wBAC1D,iBAAM,aAAa,WAAE,CAAA;;;;wBAEnB,qBAAM,QAAQ,CAAC,MAAM,CAAC,UAAC,KAAK,EAAE,OAAO;gCACnC,OAAO,OAAO,CAAC,UAAU;oCACvB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,cAAM,OAAA,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,EAA9C,CAA8C,CAAC;oCAClE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,cAAM,OAAA,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAAA;4BACnE,CAAC,EAAE,OAAO,CAAC,OAAO,CAAM,EAAE,CAAC,CAAC,EAAA;;wBAJ5B,SAI4B,CAAA;wBAC5B,iBAAM,WAAW,WAAE,CAAA;;;;wBAEnB,iBAAM,WAAW,YAAC,OAAK,CAAC,CAAA;wBACxB,MAAM,OAAK,CAAA;;;;;KAEd;IACH,eAAC;AAAD,CAAC,AA9BD,CAA8B,WAAW,GA8BxC"}