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
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no-install commitlint --edit ""
package/README.md CHANGED
@@ -1,31 +1,11 @@
1
- ![Office 365 Developer Patterns and Practices](https://camo.githubusercontent.com/a732087ed949b0f2f84f5f02b8c79f1a9dd96f65/687474703a2f2f692e696d6775722e636f6d2f6c3031686876452e706e67)
2
-
3
- # JavaScript Provisioning Library
4
-
5
- This is the new home of code that started in the [core js library](https://github.com/SharePoint/PnP-JS-Core). It made sense to break it out so
6
- it can grow and develop independently. What is here has been heavily refactored to take advantage of the sp-pnp-js library so that it can work on nodejs.
7
-
8
- Moving forward the [PnP core team](https://dev.office.com/patterns-and-practices) is looking for folks who are interested in developing the provisioning capabilities in nodejs to
9
- work with us to realize that goal. Our recommendation remains using the [CSOM based provisioning engine](https://github.com/SharePoint/PnP-Sites-Core) and calling it from
10
- client script as a microservice. Alternatively you can make use of the [PowerShell wrappers](https://github.com/SharePoint/PnP-powershell) to automate your site provisioning.
11
-
12
- This library should currently be considered a work in progress
13
-
14
- ### Get Started
15
-
16
- **NPM**
17
-
18
- Add the npm packages to your project
19
-
20
- npm install sp-pnp-js sp-pnp-provisioning --save
21
-
22
- ### Authors
23
- This project's contributors include Microsoft and [community contributors](AUTHORS). Work is done as as open source community project.
24
-
25
- ### Code of Conduct
26
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
27
-
28
- ### "Sharing is Caring"
29
-
30
- ### Disclaimer
31
- **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
1
+ # sp-js-provisioning [![version](https://img.shields.io/badge/version-1.1.2-yellow.svg)](https://semver.org)
2
+
3
+ ## Get Started
4
+
5
+ ### NPM
6
+
7
+ Add the npm packages to your project
8
+
9
+ ```shell
10
+ npm install sp-js-provisioning --save
11
+ ```
@@ -1,8 +1,8 @@
1
- import { IClientSidePage } from "../schema";
2
- import { HandlerBase } from "./handlerbase";
3
- import { Web } from "@pnp/sp";
4
- import { ProvisioningContext } from "../provisioningcontext";
5
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { Web } from '@pnp/sp';
2
+ import { IProvisioningConfig } from '../provisioningconfig';
3
+ import { ProvisioningContext } from '../provisioningcontext';
4
+ import { IClientSidePage } from '../schema';
5
+ import { HandlerBase } from './handlerbase';
6
6
  /**
7
7
  * Describes the Composed Look Object Handler
8
8
  */
@@ -15,17 +15,17 @@ export declare class ClientSidePages extends HandlerBase {
15
15
  /**
16
16
  * Provisioning Client Side Pages
17
17
  *
18
- * @param {Web} web The web
19
- * @param {IClientSidePage[]} clientSidePages The client side pages to provision
20
- * @param {ProvisioningContext} context Provisioning context
18
+ * @param web - The web
19
+ * @param clientSidePages - The client side pages to provision
20
+ * @param context - Provisioning context
21
21
  */
22
- ProvisionObjects(web: Web, clientSidePages: IClientSidePage[], context: ProvisioningContext): Promise<void>;
22
+ ProvisionObjects(web: Web, clientSidePages: IClientSidePage[], context?: ProvisioningContext): Promise<void>;
23
23
  /**
24
24
  * Provision a client side page
25
25
  *
26
- * @param {Web} web The web
27
- * @param {IClientSidePage} clientSidePage Cient side page
28
- * @param {ClientSidePageComponent[]} partDefinitions Cient side web parts
26
+ * @param web - The web
27
+ * @param clientSidePage - Cient side page
28
+ * @param partDefinitions - Cient side web parts
29
29
  */
30
- private processClientSidePage(web, clientSidePage, partDefinitions);
30
+ private processClientSidePage;
31
31
  }
@@ -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,32 +47,32 @@ 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";
47
- import { ClientSideWebpart, ClientSidePage } from "@pnp/sp";
50
+ import { ClientSidePage, ClientSideWebpart } from '@pnp/sp';
51
+ import { replaceUrlTokens } from '../util';
48
52
  import { TokenHelper } from '../util/tokenhelper';
49
- import { replaceUrlTokens } from "../util";
53
+ import { HandlerBase } from './handlerbase';
50
54
  /**
51
55
  * Describes the Composed Look Object Handler
52
56
  */
53
- var ClientSidePages = (function (_super) {
57
+ var ClientSidePages = /** @class */ (function (_super) {
54
58
  __extends(ClientSidePages, _super);
55
59
  /**
56
60
  * Creates a new instance of the ObjectClientSidePages class
57
61
  */
58
62
  function ClientSidePages(config) {
59
- return _super.call(this, "ClientSidePages", config) || this;
63
+ return _super.call(this, ClientSidePages.name, config) || this;
60
64
  }
61
65
  /**
62
66
  * Provisioning Client Side Pages
63
67
  *
64
- * @param {Web} web The web
65
- * @param {IClientSidePage[]} clientSidePages The client side pages to provision
66
- * @param {ProvisioningContext} context Provisioning context
68
+ * @param web - The web
69
+ * @param clientSidePages - The client side pages to provision
70
+ * @param context - Provisioning context
67
71
  */
68
72
  ClientSidePages.prototype.ProvisionObjects = function (web, clientSidePages, context) {
69
73
  return __awaiter(this, void 0, void 0, function () {
70
- var _this = this;
71
74
  var partDefinitions_1, error_1;
75
+ var _this = this;
72
76
  return __generator(this, function (_a) {
73
77
  switch (_a.label) {
74
78
  case 0:
@@ -80,14 +84,17 @@ var ClientSidePages = (function (_super) {
80
84
  return [4 /*yield*/, web.getClientSideWebParts()];
81
85
  case 2:
82
86
  partDefinitions_1 = _a.sent();
83
- return [4 /*yield*/, clientSidePages.reduce(function (chain, clientSidePage) { return chain.then(function () { return _this.processClientSidePage(web, clientSidePage, partDefinitions_1); }); }, Promise.resolve())];
87
+ return [4 /*yield*/, clientSidePages.reduce(function (chain, clientSidePage) {
88
+ return chain.then(function () {
89
+ return _this.processClientSidePage(web, clientSidePage, partDefinitions_1);
90
+ });
91
+ }, Promise.resolve())];
84
92
  case 3:
85
93
  _a.sent();
86
94
  return [3 /*break*/, 5];
87
95
  case 4:
88
96
  error_1 = _a.sent();
89
- console.log(error_1);
90
- _super.prototype.scope_ended.call(this);
97
+ _super.prototype.scope_ended.call(this, error_1);
91
98
  throw error_1;
92
99
  case 5: return [2 /*return*/];
93
100
  }
@@ -97,60 +104,69 @@ var ClientSidePages = (function (_super) {
97
104
  /**
98
105
  * Provision a client side page
99
106
  *
100
- * @param {Web} web The web
101
- * @param {IClientSidePage} clientSidePage Cient side page
102
- * @param {ClientSidePageComponent[]} partDefinitions Cient side web parts
107
+ * @param web - The web
108
+ * @param clientSidePage - Cient side page
109
+ * @param partDefinitions - Cient side web parts
103
110
  */
104
111
  ClientSidePages.prototype.processClientSidePage = function (web, clientSidePage, partDefinitions) {
105
112
  return __awaiter(this, void 0, void 0, function () {
106
- var _this = this;
107
- var page;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
113
+ var page, sections, _i, sections_1, s, section, _a, _b, col, column, _loop_1, this_1, _c, _d, control;
114
+ return __generator(this, function (_e) {
115
+ switch (_e.label) {
110
116
  case 0:
111
- _super.prototype.log_info.call(this, "processClientSidePage", "Processing client side page " + clientSidePage.Name);
117
+ _super.prototype.log_info.call(this, 'processClientSidePage', "Processing client side page " + clientSidePage.Name);
112
118
  return [4 /*yield*/, ClientSidePage.create(web, clientSidePage.Name, clientSidePage.Title, clientSidePage.PageLayoutType)];
113
119
  case 1:
114
- page = _a.sent();
115
- if (!clientSidePage.Sections) return [3 /*break*/, 3];
116
- clientSidePage.Sections.forEach(function (s) {
117
- var section = page.addSection();
118
- s.Columns.forEach(function (col) {
119
- var column = section.addColumn(col.Factor);
120
- col.Controls.forEach(function (control) {
121
- var partDef = partDefinitions.filter(function (c) { return c.Id.toLowerCase().indexOf(control.Id.toLowerCase()) !== -1; })[0];
122
- if (partDef) {
123
- try {
124
- var properties = _this.tokenHelper.replaceTokens(JSON.stringify(control.Properties));
125
- properties = replaceUrlTokens(properties, _this.config);
126
- var part = ClientSideWebpart.fromComponentDef(partDef).setProperties(JSON.parse(properties));
127
- _super.prototype.log_info.call(_this, "processClientSidePage", "Adding " + partDef.Name + " to client side page " + clientSidePage.Name, { properties: properties });
128
- column.addControl(part);
129
- }
130
- catch (error) {
131
- console.log(error);
132
- _super.prototype.log_info.call(_this, "processClientSidePage", "Failed adding part " + partDef.Name + " to client side page " + clientSidePage.Name);
120
+ page = _e.sent();
121
+ sections = clientSidePage.Sections || [];
122
+ for (_i = 0, sections_1 = sections; _i < sections_1.length; _i++) {
123
+ s = sections_1[_i];
124
+ section = page.addSection();
125
+ for (_a = 0, _b = s.Columns; _a < _b.length; _a++) {
126
+ col = _b[_a];
127
+ column = section.addColumn(col.Factor);
128
+ _loop_1 = function (control) {
129
+ var partDef = partDefinitions.find(function (c) {
130
+ return c.Id.toLowerCase().includes(control.Id.toLowerCase());
131
+ });
132
+ if (!partDef) {
133
+ _super.prototype.log_warn.call(this_1, 'processClientSidePage', "Client side web part with definition id " + control.Id + " not found.");
134
+ return "continue";
135
+ }
136
+ try {
137
+ var properties = this_1.tokenHelper.replaceTokens(JSON.stringify(control.Properties));
138
+ properties = replaceUrlTokens(properties, this_1.config);
139
+ var part = ClientSideWebpart.fromComponentDef(partDef).setProperties(JSON.parse(properties));
140
+ if (control.ServerProcessedContent) {
141
+ var serverProcessedContent = this_1.tokenHelper.replaceTokens(JSON.stringify(control.ServerProcessedContent));
142
+ _super.prototype.log_info.call(this_1, 'processClientSidePage', "Adding serverProcessedContent " + serverProcessedContent + " to client side page " + clientSidePage.Name);
143
+ part.data.webPartData.serverProcessedContent = JSON.parse(serverProcessedContent);
133
144
  }
145
+ _super.prototype.log_info.call(this_1, 'processClientSidePage', "Adding " + partDef.Name + " to client side page " + clientSidePage.Name);
146
+ column.addControl(part);
134
147
  }
135
- else {
136
- _super.prototype.log_warn.call(_this, "processClientSidePage", "Client side web part with definition id " + control.Id + " not found.");
148
+ catch (_a) {
149
+ _super.prototype.log_info.call(this_1, 'processClientSidePage', "Failed adding part " + partDef.Name + " to client side page " + clientSidePage.Name);
137
150
  }
138
- });
139
- });
140
- });
141
- _super.prototype.log_info.call(this, "processClientSidePage", "Saving client side page " + clientSidePage.Name);
151
+ };
152
+ this_1 = this;
153
+ for (_c = 0, _d = col.Controls; _c < _d.length; _c++) {
154
+ control = _d[_c];
155
+ _loop_1(control);
156
+ }
157
+ }
158
+ }
159
+ _super.prototype.log_info.call(this, 'processClientSidePage', "Saving client side page " + clientSidePage.Name);
142
160
  return [4 /*yield*/, page.save()];
143
161
  case 2:
144
- _a.sent();
145
- _a.label = 3;
146
- case 3:
147
- if (!clientSidePage.CommentsDisabled) return [3 /*break*/, 5];
148
- _super.prototype.log_info.call(this, "processClientSidePage", "Disabling comments for client side page " + clientSidePage.Name);
162
+ _e.sent();
163
+ if (!clientSidePage.CommentsDisabled) return [3 /*break*/, 4];
164
+ _super.prototype.log_info.call(this, 'processClientSidePage', "Disabling comments for client side page " + clientSidePage.Name);
149
165
  return [4 /*yield*/, page.disableComments()];
150
- case 4:
151
- _a.sent();
152
- _a.label = 5;
153
- case 5: return [2 /*return*/];
166
+ case 3:
167
+ _e.sent();
168
+ _e.label = 4;
169
+ case 4: return [2 /*return*/];
154
170
  }
155
171
  });
156
172
  });
@@ -158,3 +174,4 @@ var ClientSidePages = (function (_super) {
158
174
  return ClientSidePages;
159
175
  }(HandlerBase));
160
176
  export { ClientSidePages };
177
+ //# sourceMappingURL=clientsidepages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clientsidepages.js","sourceRoot":"","sources":["../../src/handlers/clientsidepages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OA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A;4CACD,iBAAM,QAAQ,cACZ,uBAAuB,EACvB,mCAAiC,sBAAsB,6BAAwB,cAAc,CAAC,IAAM,CACrG,CAAA;4CACD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,sBAAsB,GAAG,IAAI,CAAC,KAAK,CACvD,sBAAsB,CACvB,CAAA;yCACF;wCACD,iBAAM,QAAQ,cACZ,uBAAuB,EACvB,YAAU,OAAO,CAAC,IAAI,6BAAwB,cAAc,CAAC,IAAM,CACpE,CAAA;wCACD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;qCACxB;oCAAC,WAAM;wCACN,iBAAM,QAAQ,cACZ,uBAAuB,EACvB,wBAAsB,OAAO,CAAC,IAAI,6BAAwB,cAAc,CAAC,IAAM,CAChF,CAAA;qCACF;;;gCAzCH,WAAkC,EAAZ,KAAA,GAAG,CAAC,QAAQ,EAAZ,cAAY,EAAZ,IAAY;oCAAvB,OAAO;4CAAP,OAAO;iCA0CjB;6BACF;yBACF;wBACD,iBAAM,QAAQ,YACZ,uBAAuB,EACvB,6BAA2B,cAAc,CAAC,IAAM,CACjD,CAAA;wBACD,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;;wBAAjB,SAAiB,CAAA;6BACb,cAAc,CAAC,gBAAgB,EAA/B,wBAA+B;wBACjC,iBAAM,QAAQ,YACZ,uBAAuB,EACvB,6CAA2C,cAAc,CAAC,IAAM,CACjE,CAAA;wBACD,qBAAM,IAAI,CAAC,eAAe,EAAE,EAAA;;wBAA5B,SAA4B,CAAA;;;;;;KAE/B;IACH,sBAAC;AAAD,CAAC,AA5HD,CAAqC,WAAW,GA4H/C"}
@@ -1,7 +1,7 @@
1
- import { IComposedLook } from "../schema";
2
- import { HandlerBase } from "./handlerbase";
3
- import { Web } from "@pnp/sp";
4
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { IComposedLook } from '../schema';
2
+ import { HandlerBase } from './handlerbase';
3
+ import { Web } from '@pnp/sp';
4
+ import { IProvisioningConfig } from '../provisioningconfig';
5
5
  /**
6
6
  * Describes the Composed Look Object Handler
7
7
  */
@@ -13,8 +13,8 @@ export declare class ComposedLook extends HandlerBase {
13
13
  /**
14
14
  * Provisioning Composed Look
15
15
  *
16
- * @param {Web} web The web
17
- * @param {IComposedLook} object The Composed Look to provision
16
+ * @param web - The web
17
+ * @param object - The Composed look to provision
18
18
  */
19
19
  ProvisionObjects(web: Web, composedLook: IComposedLook): Promise<void>;
20
20
  }
@@ -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,28 +47,28 @@ 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";
47
- import { replaceUrlTokens, makeUrlRelative } from "../util";
50
+ import { HandlerBase } from './handlerbase';
51
+ import { replaceUrlTokens, makeUrlRelative } from '../util';
48
52
  /**
49
53
  * Describes the Composed Look Object Handler
50
54
  */
51
- var ComposedLook = (function (_super) {
55
+ var ComposedLook = /** @class */ (function (_super) {
52
56
  __extends(ComposedLook, _super);
53
57
  /**
54
58
  * Creates a new instance of the ObjectComposedLook class
55
59
  */
56
60
  function ComposedLook(config) {
57
- return _super.call(this, "ComposedLook", config) || this;
61
+ return _super.call(this, ComposedLook.name, config) || this;
58
62
  }
59
63
  /**
60
64
  * Provisioning Composed Look
61
65
  *
62
- * @param {Web} web The web
63
- * @param {IComposedLook} object The Composed Look to provision
66
+ * @param web - The web
67
+ * @param object - The Composed look to provision
64
68
  */
65
69
  ComposedLook.prototype.ProvisionObjects = function (web, composedLook) {
66
70
  return __awaiter(this, void 0, void 0, function () {
67
- var err_1;
71
+ var error_1;
68
72
  return __generator(this, function (_a) {
69
73
  switch (_a.label) {
70
74
  case 0:
@@ -72,15 +76,17 @@ var ComposedLook = (function (_super) {
72
76
  _a.label = 1;
73
77
  case 1:
74
78
  _a.trys.push([1, 3, , 4]);
75
- return [4 /*yield*/, web.applyTheme(makeUrlRelative(replaceUrlTokens(composedLook.ColorPaletteUrl, this.config)), makeUrlRelative(replaceUrlTokens(composedLook.FontSchemeUrl, this.config)), composedLook.BackgroundImageUrl ? makeUrlRelative(replaceUrlTokens(composedLook.BackgroundImageUrl, this.config)) : null, false)];
79
+ return [4 /*yield*/, web.applyTheme(makeUrlRelative(replaceUrlTokens(composedLook.ColorPaletteUrl, this.config)), makeUrlRelative(replaceUrlTokens(composedLook.FontSchemeUrl, this.config)), composedLook.BackgroundImageUrl
80
+ ? makeUrlRelative(replaceUrlTokens(composedLook.BackgroundImageUrl, this.config))
81
+ : null, false)];
76
82
  case 2:
77
83
  _a.sent();
78
84
  _super.prototype.scope_ended.call(this);
79
85
  return [3 /*break*/, 4];
80
86
  case 3:
81
- err_1 = _a.sent();
82
- _super.prototype.scope_ended.call(this);
83
- throw err_1;
87
+ error_1 = _a.sent();
88
+ _super.prototype.scope_ended.call(this, error_1);
89
+ throw error_1;
84
90
  case 4: return [2 /*return*/];
85
91
  }
86
92
  });
@@ -89,3 +95,4 @@ var ComposedLook = (function (_super) {
89
95
  return ComposedLook;
90
96
  }(HandlerBase));
91
97
  export { ComposedLook };
98
+ //# sourceMappingURL=composedlook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composedlook.js","sourceRoot":"","sources":["../../src/handlers/composedlook.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG3D;;GAEG;AACH;IAAkC,gCAAW;IAC3C;;OAEG;IACH,sBAAY,MAA2B;eACrC,kBAAM,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACU,uCAAgB,GAA7B,UACE,GAAQ,EACR,YAA2B;;;;;;wBAE3B,iBAAM,aAAa,WAAE,CAAA;;;;wBAEnB,qBAAM,GAAG,CAAC,UAAU,CAClB,eAAe,CACb,gBAAgB,CAAC,YAAY,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,CAC5D,EACD,eAAe,CACb,gBAAgB,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAC1D,EACD,YAAY,CAAC,kBAAkB;gCAC7B,CAAC,CAAC,eAAe,CACb,gBAAgB,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,CAC/D;gCACH,CAAC,CAAC,IAAI,EACR,KAAK,CACN,EAAA;;wBAbD,SAaC,CAAA;wBACD,iBAAM,WAAW,WAAE,CAAA;;;;wBAEnB,iBAAM,WAAW,YAAC,OAAK,CAAC,CAAA;wBACxB,MAAM,OAAK,CAAA;;;;;KAEd;IACH,mBAAC;AAAD,CAAC,AAxCD,CAAkC,WAAW,GAwC5C"}
@@ -1,8 +1,8 @@
1
- import { JsomContext } from "spfx-jsom";
2
- import { HandlerBase } from "./handlerbase";
3
- import { Web } from "@pnp/sp";
4
- import { ProvisioningContext } from "../provisioningcontext";
5
- import { IProvisioningConfig } from "../provisioningconfig";
1
+ import { JsomContext } from 'spfx-jsom';
2
+ import { HandlerBase } from './handlerbase';
3
+ import { Web } from '@pnp/sp';
4
+ import { ProvisioningContext } from '../provisioningcontext';
5
+ import { IProvisioningConfig } from '../provisioningconfig';
6
6
  import { IContentType } from '../schema';
7
7
  /**
8
8
  * Describes the Content Types Object Handler
@@ -17,30 +17,30 @@ export declare class ContentTypes extends HandlerBase {
17
17
  /**
18
18
  * Provisioning Content Types
19
19
  *
20
- * @param {Web} web The web
21
- * @param {IContentType[]} contentTypes The content types
22
- * @param {ProvisioningContext} context Provisioning context
20
+ * @param web - The web
21
+ * @param contentTypes - The content types
22
+ * @param context - Provisioning context
23
23
  */
24
24
  ProvisionObjects(web: Web, contentTypes: IContentType[], context: ProvisioningContext): Promise<void>;
25
25
  /**
26
26
  * Provision a content type
27
27
  *
28
- * @param {Web} web The web
29
- * @param {IContentType} contentType Content type
28
+ * @param web - The web
29
+ * @param contentType - Content type
30
30
  */
31
- private processContentType(web, contentType);
31
+ private processContentType;
32
32
  /**
33
33
  * Add a content type
34
34
  *
35
- * @param {Web} web The web
36
- * @param {IContentType} contentType Content type
35
+ * @param web - The web
36
+ * @param contentType - Content type
37
37
  */
38
- private addContentType(web, contentType);
38
+ private addContentType;
39
39
  /**
40
- * Adding content type field refs
41
- *
42
- * @param {IContentType} contentType Content type
43
- * @param {SP.ContentType} spContentType Content type
44
- */
45
- private processContentTypeFieldRefs(contentType, spContentType);
40
+ * Adding content type field refs
41
+ *
42
+ * @param contentType - Content type
43
+ * @param spContentType - SP content type
44
+ */
45
+ private processContentTypeFieldRefs;
46
46
  }