sp-js-provisioning 1.1.2 → 1.1.4
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/lib/handlers/clientsidepages.js +1 -1
- package/lib/handlers/clientsidepages.js.map +1 -1
- package/lib/handlers/composedlook.js +1 -1
- package/lib/handlers/composedlook.js.map +1 -1
- package/lib/handlers/contenttypes.d.ts +3 -3
- package/lib/handlers/contenttypes.js +18 -22
- package/lib/handlers/contenttypes.js.map +1 -1
- package/lib/handlers/customactions.d.ts +2 -2
- package/lib/handlers/customactions.js +1 -1
- package/lib/handlers/customactions.js.map +1 -1
- package/lib/handlers/exports.d.ts +4 -4
- package/lib/handlers/exports.js +5 -5
- package/lib/handlers/exports.js.map +1 -1
- package/lib/handlers/features.d.ts +2 -2
- package/lib/handlers/features.js +1 -1
- package/lib/handlers/features.js.map +1 -1
- package/lib/handlers/files.js +1 -1
- package/lib/handlers/files.js.map +1 -1
- package/lib/handlers/handlerbase.d.ts +3 -2
- package/lib/handlers/handlerbase.js +9 -3
- package/lib/handlers/handlerbase.js.map +1 -1
- package/lib/handlers/hooks.d.ts +1 -1
- package/lib/handlers/hooks.js +122 -130
- package/lib/handlers/hooks.js.map +1 -1
- package/lib/handlers/lists.js +4 -8
- package/lib/handlers/lists.js.map +1 -1
- package/lib/handlers/navigation.d.ts +2 -2
- package/lib/handlers/navigation.js +2 -2
- package/lib/handlers/navigation.js.map +1 -1
- package/lib/handlers/propertybagentries.d.ts +2 -2
- package/lib/handlers/propertybagentries.js +3 -3
- package/lib/handlers/propertybagentries.js.map +1 -1
- package/lib/handlers/sitefields.d.ts +2 -2
- package/lib/handlers/sitefields.js +2 -2
- package/lib/handlers/sitefields.js.map +1 -1
- package/lib/handlers/websettings.js +1 -1
- package/lib/handlers/websettings.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/provisioningerror.d.ts +7 -0
- package/lib/provisioningerror.js +27 -0
- package/lib/provisioningerror.js.map +1 -0
- package/lib/webprovisioner.d.ts +8 -7
- package/lib/webprovisioner.js +7 -6
- package/lib/webprovisioner.js.map +1 -1
- package/package.json +1 -4
- package/.husky/commit-msg +0 -4
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
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
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
/**
|
|
15
|
+
* Describes the Provisioning Error
|
|
16
|
+
*/
|
|
17
|
+
var ProvisioningError = /** @class */ (function (_super) {
|
|
18
|
+
__extends(ProvisioningError, _super);
|
|
19
|
+
function ProvisioningError(handler, error) {
|
|
20
|
+
var _this = _super.call(this, error.message) || this;
|
|
21
|
+
_this.handler = handler;
|
|
22
|
+
return _this;
|
|
23
|
+
}
|
|
24
|
+
return ProvisioningError;
|
|
25
|
+
}(Error));
|
|
26
|
+
export { ProvisioningError };
|
|
27
|
+
//# sourceMappingURL=provisioningerror.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provisioningerror.js","sourceRoot":"","sources":["../src/provisioningerror.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;GAEG;AACH;IAAuC,qCAAK;IAC1C,2BAAmB,OAAe,EAAE,KAAY;QAAhD,YACE,kBAAM,KAAK,CAAC,OAAO,CAAC,SACrB;QAFkB,aAAO,GAAP,OAAO,CAAQ;;IAElC,CAAC;IACH,wBAAC;AAAD,CAAC,AAJD,CAAuC,KAAK,GAI3C"}
|
package/lib/webprovisioner.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Schema } from './schema';
|
|
2
|
-
import { HandlerBase } from './handlers/handlerbase';
|
|
3
|
-
import { Web } from '@pnp/sp';
|
|
4
1
|
import { TypedHash } from '@pnp/common';
|
|
2
|
+
import { Web } from '@pnp/sp';
|
|
3
|
+
import { Handler } from './handlers/exports';
|
|
4
|
+
import { HandlerBase } from './handlers/handlerbase';
|
|
5
5
|
import { IProvisioningConfig } from './provisioningconfig';
|
|
6
|
+
import { Schema } from './schema';
|
|
6
7
|
/**
|
|
7
8
|
* Root class of Provisioning
|
|
8
9
|
*/
|
|
9
10
|
export declare class WebProvisioner {
|
|
10
11
|
private web;
|
|
11
|
-
handlerSort:
|
|
12
|
+
handlerSort: Record<Handler, number>;
|
|
12
13
|
handlerMap: TypedHash<HandlerBase>;
|
|
13
14
|
private context;
|
|
14
15
|
private config;
|
|
@@ -16,9 +17,9 @@ export declare class WebProvisioner {
|
|
|
16
17
|
* Creates a new instance of the Provisioner class
|
|
17
18
|
*
|
|
18
19
|
* @param web - The Web instance to which we want to apply templates
|
|
19
|
-
* @param
|
|
20
|
+
* @param handlerSort - A set of handlers we want to apply. The keys of the map need to match the property names in the template
|
|
20
21
|
*/
|
|
21
|
-
constructor(web: Web, handlerSort?:
|
|
22
|
+
constructor(web: Web, handlerSort?: Record<Handler, number>);
|
|
22
23
|
private onSetup;
|
|
23
24
|
/**
|
|
24
25
|
* Applies the supplied template to the web used to create this Provisioner instance
|
|
@@ -27,7 +28,7 @@ export declare class WebProvisioner {
|
|
|
27
28
|
* @param handlers - A set of handlers we want to apply
|
|
28
29
|
* @param progressCallback - Callback for progress updates
|
|
29
30
|
*/
|
|
30
|
-
applyTemplate(template: Schema, handlers?: string[], progressCallback?: (
|
|
31
|
+
applyTemplate(template: Schema, handlers?: string[], progressCallback?: (handler: Handler) => void): Promise<any>;
|
|
31
32
|
/**
|
|
32
33
|
* Sets up the web provisioner
|
|
33
34
|
*
|
package/lib/webprovisioner.js
CHANGED
|
@@ -45,10 +45,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
import { ConsoleListener, Logger } from '@pnp/logging';
|
|
48
49
|
import { sp } from '@pnp/sp';
|
|
49
|
-
import { Logger, ConsoleListener } from '@pnp/logging';
|
|
50
50
|
import { DefaultHandlerMap, DefaultHandlerSort } from './handlers/exports';
|
|
51
51
|
import { ProvisioningContext } from './provisioningcontext';
|
|
52
|
+
import { ProvisioningError } from './provisioningerror';
|
|
52
53
|
/**
|
|
53
54
|
* Root class of Provisioning
|
|
54
55
|
*/
|
|
@@ -57,7 +58,7 @@ var WebProvisioner = /** @class */ (function () {
|
|
|
57
58
|
* Creates a new instance of the Provisioner class
|
|
58
59
|
*
|
|
59
60
|
* @param web - The Web instance to which we want to apply templates
|
|
60
|
-
* @param
|
|
61
|
+
* @param handlerSort - A set of handlers we want to apply. The keys of the map need to match the property names in the template
|
|
61
62
|
*/
|
|
62
63
|
function WebProvisioner(web, handlerSort) {
|
|
63
64
|
if (handlerSort === void 0) { handlerSort = DefaultHandlerSort; }
|
|
@@ -97,7 +98,7 @@ var WebProvisioner = /** @class */ (function () {
|
|
|
97
98
|
*/
|
|
98
99
|
WebProvisioner.prototype.applyTemplate = function (template, handlers, progressCallback) {
|
|
99
100
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
var operations, error_1;
|
|
101
|
+
var operations, currentHandler, error_1;
|
|
101
102
|
var _this = this;
|
|
102
103
|
return __generator(this, function (_a) {
|
|
103
104
|
switch (_a.label) {
|
|
@@ -119,9 +120,8 @@ var WebProvisioner = /** @class */ (function () {
|
|
|
119
120
|
: 99;
|
|
120
121
|
return sort1 - sort2;
|
|
121
122
|
});
|
|
122
|
-
if (handlers)
|
|
123
|
+
if (handlers)
|
|
123
124
|
operations = operations.filter(function (op) { return handlers.includes(op); });
|
|
124
|
-
}
|
|
125
125
|
operations = operations.filter(function (name) { return _this.handlerMap[name]; });
|
|
126
126
|
_a.label = 2;
|
|
127
127
|
case 2:
|
|
@@ -132,6 +132,7 @@ var WebProvisioner = /** @class */ (function () {
|
|
|
132
132
|
if (progressCallback) {
|
|
133
133
|
progressCallback(name);
|
|
134
134
|
}
|
|
135
|
+
currentHandler = name;
|
|
135
136
|
return handler.ProvisionObjects(_this.web, template[name], _this.context);
|
|
136
137
|
});
|
|
137
138
|
}, Promise.resolve())];
|
|
@@ -140,7 +141,7 @@ var WebProvisioner = /** @class */ (function () {
|
|
|
140
141
|
return [3 /*break*/, 5];
|
|
141
142
|
case 4:
|
|
142
143
|
error_1 = _a.sent();
|
|
143
|
-
throw error_1;
|
|
144
|
+
throw new ProvisioningError(currentHandler, error_1);
|
|
144
145
|
case 5: return [2 /*return*/];
|
|
145
146
|
}
|
|
146
147
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webprovisioner.js","sourceRoot":"","sources":["../src/webprovisioner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"webprovisioner.js","sourceRoot":"","sources":["../src/webprovisioner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAY,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,EAAE,EAAO,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAW,MAAM,oBAAoB,CAAA;AAGnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3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AAC,CAAA;4BACJ,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAbrB,SAaqB,CAAA;;;;wBAErB,MAAM,IAAI,iBAAiB,CAAC,cAAc,EAAE,OAAK,CAAC,CAAA;;;;;KAErD;IAED;;;;OAIG;IACI,8BAAK,GAAZ,UAAa,MAA2B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IACH,qBAAC;AAAD,CAAC,AA/FD,IA+FC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sp-js-provisioning",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "SharePoint provisioning with pure JavaScript",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"xml-js": "1.6.11"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@commitlint/config-conventional": "^12.0.1",
|
|
19
18
|
"@types/es6-promise": "0.0.33",
|
|
20
19
|
"@types/node": "^8.0.28",
|
|
21
20
|
"@types/sharepoint": "^2016.1.2",
|
|
@@ -30,7 +29,6 @@
|
|
|
30
29
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
31
30
|
"eslint-plugin-tsdoc": "0.2.11",
|
|
32
31
|
"eslint-plugin-unicorn": "^28.0.2",
|
|
33
|
-
"husky": "^5.2.0",
|
|
34
32
|
"merge": "1.2.0",
|
|
35
33
|
"merge2": "^1.0.2",
|
|
36
34
|
"prettier": "2.2.1",
|
|
@@ -40,7 +38,6 @@
|
|
|
40
38
|
"build": "tsc",
|
|
41
39
|
"watch": "tsc --watch",
|
|
42
40
|
"lint": "eslint --ext .ts ./src --color --fix && prettier '**/*.ts*' --write --loglevel silent",
|
|
43
|
-
"prepare": "husky install",
|
|
44
41
|
"postversion": "tsc && npm publish"
|
|
45
42
|
},
|
|
46
43
|
"commitlint": {
|
package/.husky/commit-msg
DELETED