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.
- package/.husky/commit-msg +4 -0
- package/README.md +11 -31
- package/lib/handlers/clientsidepages.d.ts +13 -13
- package/lib/handlers/clientsidepages.js +77 -60
- package/lib/handlers/clientsidepages.js.map +1 -0
- package/lib/handlers/composedlook.d.ts +6 -6
- package/lib/handlers/composedlook.js +24 -17
- package/lib/handlers/composedlook.js.map +1 -0
- package/lib/handlers/contenttypes.d.ts +20 -20
- package/lib/handlers/contenttypes.js +77 -59
- package/lib/handlers/contenttypes.js.map +1 -0
- package/lib/handlers/customactions.d.ts +7 -7
- package/lib/handlers/customactions.js +24 -17
- package/lib/handlers/customactions.js.map +1 -0
- package/lib/handlers/exports.d.ts +3 -3
- package/lib/handlers/exports.js +15 -11
- package/lib/handlers/exports.js.map +1 -0
- package/lib/handlers/features.d.ts +7 -7
- package/lib/handlers/features.js +24 -22
- package/lib/handlers/features.js.map +1 -0
- package/lib/handlers/files.d.ts +44 -44
- package/lib/handlers/files.js +229 -159
- package/lib/handlers/files.js.map +1 -0
- package/lib/handlers/handlerbase.d.ts +21 -11
- package/lib/handlers/handlerbase.js +51 -16
- package/lib/handlers/handlerbase.js.map +1 -0
- package/lib/handlers/hooks.d.ts +22 -0
- package/lib/handlers/hooks.js +230 -0
- package/lib/handlers/hooks.js.map +1 -0
- package/lib/handlers/lists.d.ts +45 -45
- package/lib/handlers/lists.js +184 -150
- package/lib/handlers/lists.js.map +1 -0
- package/lib/handlers/navigation.d.ts +10 -10
- package/lib/handlers/navigation.js +40 -31
- package/lib/handlers/navigation.js.map +1 -0
- package/lib/handlers/propertybagentries.d.ts +7 -7
- package/lib/handlers/propertybagentries.js +30 -25
- package/lib/handlers/propertybagentries.js.map +1 -0
- package/lib/handlers/sitefields.d.ts +11 -11
- package/lib/handlers/sitefields.js +40 -29
- package/lib/handlers/sitefields.js.map +1 -0
- package/lib/handlers/websettings.d.ts +7 -7
- package/lib/handlers/websettings.js +36 -33
- package/lib/handlers/websettings.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -0
- package/lib/provisioningconfig.d.ts +2 -2
- package/lib/provisioningconfig.js +2 -0
- package/lib/provisioningconfig.js.map +1 -0
- package/lib/provisioningcontext.d.ts +1 -5
- package/lib/provisioningcontext.js +2 -4
- package/lib/provisioningcontext.js.map +1 -0
- package/lib/schema.d.ts +18 -4
- package/lib/schema.js +2 -0
- package/lib/schema.js.map +1 -0
- package/lib/util/index.d.ts +3 -6
- package/lib/util/index.js +20 -29
- package/lib/util/index.js.map +1 -0
- package/lib/util/tokenhelper.d.ts +3 -3
- package/lib/util/tokenhelper.js +30 -29
- package/lib/util/tokenhelper.js.map +1 -0
- package/lib/webprovisioner.d.ts +16 -16
- package/lib/webprovisioner.js +42 -29
- package/lib/webprovisioner.js.map +1 -0
- package/package.json +118 -36
- package/sample-schemas/all-simple.ts +85 -76
- package/AUTHORS +0 -3
- package/LICENSE +0 -25
- package/debug/debug.ts +0 -68
- package/debug/example.ts +0 -42
- package/gulptasks/@configuration.js +0 -58
- package/gulptasks/build.js +0 -84
- package/gulptasks/clean.js +0 -23
- package/gulptasks/docs.js +0 -11
- package/gulptasks/index.js +0 -8
- package/gulptasks/lint.js +0 -18
- package/gulptasks/package.js +0 -44
- package/gulptasks/publish.js +0 -232
- package/gulptasks/test.js +0 -40
- package/gulptasks/watch.js +0 -15
- package/jsdoc.json +0 -26
- package/pnpm-lock.yaml +0 -6582
- package/shrinkwrap.yaml +0 -6513
- package/webpack.config.js +0 -58
package/README.md
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
. 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 [](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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
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
|
|
22
|
+
ProvisionObjects(web: Web, clientSidePages: IClientSidePage[], context?: ProvisioningContext): Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* Provision a client side page
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
26
|
+
* @param web - The web
|
|
27
|
+
* @param clientSidePage - Cient side page
|
|
28
|
+
* @param partDefinitions - Cient side web parts
|
|
29
29
|
*/
|
|
30
|
-
private processClientSidePage
|
|
30
|
+
private processClientSidePage;
|
|
31
31
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics =
|
|
3
|
-
|
|
4
|
-
|
|
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) :
|
|
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 =
|
|
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 {
|
|
47
|
-
import {
|
|
50
|
+
import { ClientSidePage, ClientSideWebpart } from '@pnp/sp';
|
|
51
|
+
import { replaceUrlTokens } from '../util';
|
|
48
52
|
import { TokenHelper } from '../util/tokenhelper';
|
|
49
|
-
import {
|
|
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,
|
|
63
|
+
return _super.call(this, ClientSidePages.name, config) || this;
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
62
66
|
* Provisioning Client Side Pages
|
|
63
67
|
*
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
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) {
|
|
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
|
-
|
|
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
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
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
|
|
107
|
-
|
|
108
|
-
|
|
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,
|
|
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 =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
col
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
136
|
-
_super.prototype.
|
|
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
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
case
|
|
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,OAAO,EACL,cAAc,EAA2B,iBAAiB,EAC3D,MAAM,SAAS,CAAA;AAIhB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;GAEG;AACH;IAAqC,mCAAW;IAG9C;;OAEG;IACH,yBAAY,MAA2B;eACrC,kBAAM,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC;IACrC,CAAC;IAED;;;;;;OAMG;IACU,0CAAgB,GAA7B,UACE,GAAQ,EACR,eAAkC,EAClC,OAA6B;;;;;;;wBAE7B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;wBACxD,iBAAM,aA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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
|
|
2
|
-
import { HandlerBase } from
|
|
3
|
-
import { Web } from
|
|
4
|
-
import { IProvisioningConfig } from
|
|
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
|
|
17
|
-
* @param
|
|
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 =
|
|
3
|
-
|
|
4
|
-
|
|
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) :
|
|
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 =
|
|
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
|
|
47
|
-
import { replaceUrlTokens, makeUrlRelative } from
|
|
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,
|
|
61
|
+
return _super.call(this, ComposedLook.name, config) || this;
|
|
58
62
|
}
|
|
59
63
|
/**
|
|
60
64
|
* Provisioning Composed Look
|
|
61
65
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
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
|
|
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
|
|
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
|
-
|
|
82
|
-
_super.prototype.scope_ended.call(this);
|
|
83
|
-
throw
|
|
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
|
|
2
|
-
import { HandlerBase } from
|
|
3
|
-
import { Web } from
|
|
4
|
-
import { ProvisioningContext } from
|
|
5
|
-
import { IProvisioningConfig } from
|
|
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
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
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
|
|
29
|
-
* @param
|
|
28
|
+
* @param web - The web
|
|
29
|
+
* @param contentType - Content type
|
|
30
30
|
*/
|
|
31
|
-
private processContentType
|
|
31
|
+
private processContentType;
|
|
32
32
|
/**
|
|
33
33
|
* Add a content type
|
|
34
34
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
35
|
+
* @param web - The web
|
|
36
|
+
* @param contentType - Content type
|
|
37
37
|
*/
|
|
38
|
-
private addContentType
|
|
38
|
+
private addContentType;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
private processContentTypeFieldRefs
|
|
40
|
+
* Adding content type field refs
|
|
41
|
+
*
|
|
42
|
+
* @param contentType - Content type
|
|
43
|
+
* @param spContentType - SP content type
|
|
44
|
+
*/
|
|
45
|
+
private processContentTypeFieldRefs;
|
|
46
46
|
}
|