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/lib/webprovisioner.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) ||
|
|
2
|
-
|
|
3
|
-
s = arguments
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
8
11
|
};
|
|
9
12
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
15
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
16
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
18
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
19
|
});
|
|
16
20
|
};
|
|
@@ -21,8 +25,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
21
25
|
function step(op) {
|
|
22
26
|
if (f) throw new TypeError("Generator is already executing.");
|
|
23
27
|
while (_) try {
|
|
24
|
-
if (f = 1, y && (t =
|
|
25
|
-
if (y = 0, t) op = [0, t.value];
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
30
|
switch (op[0]) {
|
|
27
31
|
case 0: case 1: t = op; break;
|
|
28
32
|
case 4: _.label++; return { value: op[1], done: false };
|
|
@@ -41,19 +45,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
41
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
46
|
}
|
|
43
47
|
};
|
|
44
|
-
import { sp } from
|
|
45
|
-
import { Logger, ConsoleListener } from
|
|
46
|
-
import { DefaultHandlerMap, DefaultHandlerSort } from
|
|
47
|
-
import { ProvisioningContext } from
|
|
48
|
+
import { sp } from '@pnp/sp';
|
|
49
|
+
import { Logger, ConsoleListener } from '@pnp/logging';
|
|
50
|
+
import { DefaultHandlerMap, DefaultHandlerSort } from './handlers/exports';
|
|
51
|
+
import { ProvisioningContext } from './provisioningcontext';
|
|
48
52
|
/**
|
|
49
53
|
* Root class of Provisioning
|
|
50
54
|
*/
|
|
51
|
-
var WebProvisioner = (function () {
|
|
55
|
+
var WebProvisioner = /** @class */ (function () {
|
|
52
56
|
/**
|
|
53
57
|
* Creates a new instance of the Provisioner class
|
|
54
58
|
*
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
59
|
+
* @param web - The Web instance to which we want to apply templates
|
|
60
|
+
* @param handlermap - A set of handlers we want to apply. The keys of the map need to match the property names in the template
|
|
57
61
|
*/
|
|
58
62
|
function WebProvisioner(web, handlerSort) {
|
|
59
63
|
if (handlerSort === void 0) { handlerSort = DefaultHandlerSort; }
|
|
@@ -87,28 +91,36 @@ var WebProvisioner = (function () {
|
|
|
87
91
|
/**
|
|
88
92
|
* Applies the supplied template to the web used to create this Provisioner instance
|
|
89
93
|
*
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
94
|
+
* @param template - The template to apply
|
|
95
|
+
* @param handlers - A set of handlers we want to apply
|
|
96
|
+
* @param progressCallback - Callback for progress updates
|
|
93
97
|
*/
|
|
94
98
|
WebProvisioner.prototype.applyTemplate = function (template, handlers, progressCallback) {
|
|
95
99
|
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
-
var _this = this;
|
|
97
100
|
var operations, error_1;
|
|
101
|
+
var _this = this;
|
|
98
102
|
return __generator(this, function (_a) {
|
|
99
103
|
switch (_a.label) {
|
|
100
104
|
case 0:
|
|
101
|
-
Logger.log({
|
|
105
|
+
Logger.log({
|
|
106
|
+
message: this.config.logging.prefix + " (WebProvisioner): (applyTemplate): Applying template to web",
|
|
107
|
+
data: { handlers: handlers },
|
|
108
|
+
level: 1 /* Info */
|
|
109
|
+
});
|
|
102
110
|
return [4 /*yield*/, this.onSetup()];
|
|
103
111
|
case 1:
|
|
104
112
|
_a.sent();
|
|
105
113
|
operations = Object.getOwnPropertyNames(template).sort(function (name1, name2) {
|
|
106
|
-
var sort1 = _this.handlerSort.hasOwnProperty(name1)
|
|
107
|
-
|
|
114
|
+
var sort1 = _this.handlerSort.hasOwnProperty(name1)
|
|
115
|
+
? _this.handlerSort[name1]
|
|
116
|
+
: 99;
|
|
117
|
+
var sort2 = _this.handlerSort.hasOwnProperty(name2)
|
|
118
|
+
? _this.handlerSort[name2]
|
|
119
|
+
: 99;
|
|
108
120
|
return sort1 - sort2;
|
|
109
121
|
});
|
|
110
122
|
if (handlers) {
|
|
111
|
-
operations = operations.filter(function (op) { return handlers.
|
|
123
|
+
operations = operations.filter(function (op) { return handlers.includes(op); });
|
|
112
124
|
}
|
|
113
125
|
operations = operations.filter(function (name) { return _this.handlerMap[name]; });
|
|
114
126
|
_a.label = 2;
|
|
@@ -135,10 +147,10 @@ var WebProvisioner = (function () {
|
|
|
135
147
|
});
|
|
136
148
|
};
|
|
137
149
|
/**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
150
|
+
* Sets up the web provisioner
|
|
151
|
+
*
|
|
152
|
+
* @param config - Provisioning config
|
|
153
|
+
*/
|
|
142
154
|
WebProvisioner.prototype.setup = function (config) {
|
|
143
155
|
this.config = config;
|
|
144
156
|
return this;
|
|
@@ -146,3 +158,4 @@ var WebProvisioner = (function () {
|
|
|
146
158
|
return WebProvisioner;
|
|
147
159
|
}());
|
|
148
160
|
export { WebProvisioner };
|
|
161
|
+
//# sourceMappingURL=webprovisioner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U,EAAE,IAAY;gCAC/C,IAAM,OAAO,GAAG,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;gCACrC,OAAO,KAAK,CAAC,IAAI,CAAC;oCAChB,IAAI,gBAAgB,EAAE;wCACpB,gBAAgB,CAAC,IAAI,CAAC,CAAA;qCACvB;oCACD,OAAO,OAAO,CAAC,gBAAgB,CAC7B,KAAI,CAAC,GAAG,EACR,QAAQ,CAAC,IAAI,CAAC,EACd,KAAI,CAAC,OAAO,CACb,CAAA;gCACH,CAAC,CAAC,CAAA;4BACJ,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,EAAA;;wBAZrB,SAYqB,CAAA;;;;wBAErB,MAAM,OAAK,CAAA;;;;;KAEd;IAED;;;;OAIG;IACI,8BAAK,GAAZ,UAAa,MAA2B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IACH,qBAAC;AAAD,CAAC,AAhGD,IAgGC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sp-js-provisioning",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "SharePoint provisioning with pure JavaScript",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
@@ -15,49 +15,131 @@
|
|
|
15
15
|
"xml-js": "1.6.11"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@types/chai": "^4.0.4",
|
|
20
|
-
"@types/chai-as-promised": "^7.1.0",
|
|
18
|
+
"@commitlint/config-conventional": "^12.0.1",
|
|
21
19
|
"@types/es6-promise": "0.0.33",
|
|
22
|
-
"@types/mocha": "^2.2.32",
|
|
23
20
|
"@types/node": "^8.0.28",
|
|
24
21
|
"@types/sharepoint": "^2016.1.2",
|
|
25
22
|
"@types/webpack-env": "1.13.1",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"gulp-sourcemaps": "2.6.1",
|
|
38
|
-
"gulp-tslint": "8.1.2",
|
|
39
|
-
"gulp-util": "3.0.8",
|
|
40
|
-
"gulp-watch": "^5.0.1",
|
|
41
|
-
"jsdoc": "3.5.5",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "4.6.1",
|
|
24
|
+
"@typescript-eslint/parser": "4.6.1",
|
|
25
|
+
"commitlint": "^12.0.1",
|
|
26
|
+
"eslint": "^6.8.0",
|
|
27
|
+
"eslint-config-prettier": "7.2.0",
|
|
28
|
+
"eslint-plugin-prettier": "3.3.1",
|
|
29
|
+
"eslint-plugin-react": "7.22.0",
|
|
30
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
31
|
+
"eslint-plugin-tsdoc": "0.2.11",
|
|
32
|
+
"eslint-plugin-unicorn": "^28.0.2",
|
|
33
|
+
"husky": "^5.2.0",
|
|
42
34
|
"merge": "1.2.0",
|
|
43
35
|
"merge2": "^1.0.2",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"run-sequence": "^2.2.1",
|
|
47
|
-
"semver": "5.4.1",
|
|
48
|
-
"ts-loader": "^2.3.7",
|
|
49
|
-
"tslint": "^5.9.1",
|
|
50
|
-
"tslint-microsoft-contrib": "^6.0.0",
|
|
51
|
-
"typescript": "2.4.2",
|
|
52
|
-
"gulp-typescript": "^3.2.2",
|
|
53
|
-
"webpack": "3.6.0",
|
|
54
|
-
"yargs": "9.0.1"
|
|
36
|
+
"prettier": "2.2.1",
|
|
37
|
+
"typescript": "4.0.7"
|
|
55
38
|
},
|
|
56
39
|
"scripts": {
|
|
57
|
-
"build": "
|
|
58
|
-
"package": "gulp package",
|
|
40
|
+
"build": "tsc",
|
|
59
41
|
"watch": "tsc --watch",
|
|
60
|
-
"
|
|
42
|
+
"lint": "eslint --ext .ts ./src --color --fix && prettier '**/*.ts*' --write --loglevel silent",
|
|
43
|
+
"prepare": "husky install",
|
|
44
|
+
"postversion": "tsc && npm publish"
|
|
45
|
+
},
|
|
46
|
+
"commitlint": {
|
|
47
|
+
"extends": [
|
|
48
|
+
"@commitlint/config-conventional"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"eslintConfig": {
|
|
52
|
+
"env": {
|
|
53
|
+
"browser": true,
|
|
54
|
+
"node": true
|
|
55
|
+
},
|
|
56
|
+
"parser": "@typescript-eslint/parser",
|
|
57
|
+
"extends": [
|
|
58
|
+
"prettier",
|
|
59
|
+
"plugin:react/recommended",
|
|
60
|
+
"plugin:@typescript-eslint/recommended",
|
|
61
|
+
"plugin:unicorn/recommended"
|
|
62
|
+
],
|
|
63
|
+
"plugins": [
|
|
64
|
+
"prettier",
|
|
65
|
+
"react-hooks",
|
|
66
|
+
"eslint-plugin-tsdoc",
|
|
67
|
+
"unicorn"
|
|
68
|
+
],
|
|
69
|
+
"parserOptions": {
|
|
70
|
+
"ecmaVersion": 2018,
|
|
71
|
+
"sourceType": "module",
|
|
72
|
+
"ecmaFeatures": {
|
|
73
|
+
"jsx": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"rules": {
|
|
77
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
78
|
+
"@typescript-eslint/member-delimiter-style": 0,
|
|
79
|
+
"@typescript-eslint/explicit-function-return-type": 0,
|
|
80
|
+
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
81
|
+
"@typescript-eslint/no-inferrable-types": 0,
|
|
82
|
+
"react/prop-types": 0,
|
|
83
|
+
"no-inferrable-types": 0,
|
|
84
|
+
"react/display-name": 0,
|
|
85
|
+
"no-compare-neg-zero": 1,
|
|
86
|
+
"no-console": 2,
|
|
87
|
+
"eqeqeq": 1,
|
|
88
|
+
"max-classes-per-file": 1,
|
|
89
|
+
"jsx-quotes": [
|
|
90
|
+
"error",
|
|
91
|
+
"prefer-single"
|
|
92
|
+
],
|
|
93
|
+
"quotes": [
|
|
94
|
+
"error",
|
|
95
|
+
"single"
|
|
96
|
+
],
|
|
97
|
+
"yoda": 2,
|
|
98
|
+
"require-await": 2,
|
|
99
|
+
"semi": [
|
|
100
|
+
"error",
|
|
101
|
+
"never",
|
|
102
|
+
{}
|
|
103
|
+
],
|
|
104
|
+
"default-case": 0,
|
|
105
|
+
"react-hooks/rules-of-hooks": "error",
|
|
106
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
107
|
+
"tsdoc/syntax": "warn",
|
|
108
|
+
"unicorn/filename-case": 0,
|
|
109
|
+
"unicorn/no-array-reduce": 0,
|
|
110
|
+
"unicorn/no-null": 0,
|
|
111
|
+
"unicorn/prevent-abbreviations": [
|
|
112
|
+
2,
|
|
113
|
+
{
|
|
114
|
+
"checkDefaultAndNamespaceImports": true,
|
|
115
|
+
"checkProperties": false,
|
|
116
|
+
"replacements": {
|
|
117
|
+
"args": false,
|
|
118
|
+
"props": false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"unicorn/no-process-exit": 0
|
|
123
|
+
},
|
|
124
|
+
"settings": {
|
|
125
|
+
"react": {
|
|
126
|
+
"version": "detect"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"eslintIgnore": [
|
|
131
|
+
"src/**/*.d.ts"
|
|
132
|
+
],
|
|
133
|
+
"prettier": {
|
|
134
|
+
"tabWidth": 2,
|
|
135
|
+
"singleQuote": true,
|
|
136
|
+
"semi": false,
|
|
137
|
+
"arrowParens": "always",
|
|
138
|
+
"printWidth": 80,
|
|
139
|
+
"trailingComma": "none",
|
|
140
|
+
"bracketSpacing": true,
|
|
141
|
+
"jsxBracketSameLine": true,
|
|
142
|
+
"jsxSingleQuote": true
|
|
61
143
|
},
|
|
62
144
|
"repository": {
|
|
63
145
|
"type": "git",
|
|
@@ -1,76 +1,85 @@
|
|
|
1
|
-
import Schema from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
import Schema from '../src/schema'
|
|
2
|
+
|
|
3
|
+
const template: Schema = {
|
|
4
|
+
CustomActions: [
|
|
5
|
+
{
|
|
6
|
+
Name: 'Test',
|
|
7
|
+
Title: 'Test Title',
|
|
8
|
+
Location: 'EditControlBlock',
|
|
9
|
+
Url: 'https://someurl'
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
|
|
13
|
+
Features: [
|
|
14
|
+
{
|
|
15
|
+
id: '87294c72-f260-42f3-a41b-981a2ffce37a',
|
|
16
|
+
deactivate: true,
|
|
17
|
+
force: false
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
WebSettings: {
|
|
22
|
+
TreeViewEnabled: true
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
Navigation: {
|
|
26
|
+
QuickLaunch: [
|
|
27
|
+
{
|
|
28
|
+
Title: 'First One',
|
|
29
|
+
Url: 'https://bing.com'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
Title: 'Second One',
|
|
33
|
+
Url: 'https://bing.com',
|
|
34
|
+
Children: [
|
|
35
|
+
{
|
|
36
|
+
Title: 'Child - 1',
|
|
37
|
+
Url: 'https://bing.com'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
Title: 'Child - 2',
|
|
41
|
+
Url: 'https://bing.com'
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
TopNavigationBar: [
|
|
47
|
+
{
|
|
48
|
+
Title: 'First One',
|
|
49
|
+
Url: 'https://bing.com'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
Title: 'Second One',
|
|
53
|
+
Url: 'https://bing.com',
|
|
54
|
+
Children: [
|
|
55
|
+
{
|
|
56
|
+
Title: 'Child!',
|
|
57
|
+
Url: 'https://bing.com'
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
Lists: [
|
|
65
|
+
{
|
|
66
|
+
Title: 'Prov List 1',
|
|
67
|
+
ContentTypesEnabled: true,
|
|
68
|
+
Description: 'This is the description',
|
|
69
|
+
Template: 100
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
Title: 'Documents',
|
|
73
|
+
ContentTypesEnabled: true,
|
|
74
|
+
Description: 'This is the description',
|
|
75
|
+
Template: 101,
|
|
76
|
+
AdditionalSettings: {
|
|
77
|
+
Description: "I've updated the description",
|
|
78
|
+
EnableFolderCreation: true,
|
|
79
|
+
ForceCheckout: true
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default template
|
package/AUTHORS
DELETED
package/LICENSE
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Office 365 Developer Patterns and Practices (PnP)
|
|
2
|
-
|
|
3
|
-
The MIT License (MIT)
|
|
4
|
-
|
|
5
|
-
Copyright (c) Microsoft Corporation
|
|
6
|
-
|
|
7
|
-
All rights reserved.
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
-
in the Software without restriction, including without limitation the rights
|
|
12
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
furnished to do so, subject to the following conditions:
|
|
15
|
-
|
|
16
|
-
The above copyright notice and this permission notice shall be included in all
|
|
17
|
-
copies or substantial portions of the Software.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
SOFTWARE.
|
package/debug/debug.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare var require: any;
|
|
2
|
-
import { sp, Web } from "@pnp/sp";
|
|
3
|
-
import { Logger, LogLevel, ConsoleListener } from "@pnp/logging";
|
|
4
|
-
import { SPFetchClient } from "@pnp/nodejs";
|
|
5
|
-
|
|
6
|
-
// setup the connection to SharePoint using the settings file, you can
|
|
7
|
-
// override any of the values as you want here, just be sure not to commit
|
|
8
|
-
// your account details :)
|
|
9
|
-
// if you don't have a settings file defined this will error
|
|
10
|
-
// you can comment it out and put the values here directly, or better yet
|
|
11
|
-
// create a settings file using settings.example.js as a template
|
|
12
|
-
let settings = require("../../settings.js");
|
|
13
|
-
|
|
14
|
-
// configure your node options
|
|
15
|
-
sp.setup({
|
|
16
|
-
sp: {
|
|
17
|
-
fetchClientFactory: () => {
|
|
18
|
-
return new SPFetchClient(settings.testing.siteUrl, settings.testing.clientId, settings.testing.clientSecret);
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// setup console logger
|
|
24
|
-
Logger.subscribe(new ConsoleListener());
|
|
25
|
-
Logger.activeLogLevel = LogLevel.Verbose;
|
|
26
|
-
|
|
27
|
-
import { Example } from "./example";
|
|
28
|
-
|
|
29
|
-
cleanUpAllSubsites().then(() => {
|
|
30
|
-
|
|
31
|
-
// importing the example debug scenario and running it
|
|
32
|
-
// adding your debugging to other files and importing them will keep them out of git
|
|
33
|
-
// PRs updating the debug.ts or example.ts will not be accepted unless they are fixing bugs
|
|
34
|
-
// add your debugging imports here and prior to submitting a PR git checkout debug/debug.ts
|
|
35
|
-
// will allow you to keep all your debugging files locally
|
|
36
|
-
// comment out the example
|
|
37
|
-
Example();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// you can also set break points inside the src folder to examine how things are working
|
|
42
|
-
// within the library while debugging!
|
|
43
|
-
|
|
44
|
-
// this can be used to clean up lots of test sub webs :)
|
|
45
|
-
function cleanUpAllSubsites(): Promise<void> {
|
|
46
|
-
|
|
47
|
-
return new Promise<void>((resolve, reject) => {
|
|
48
|
-
|
|
49
|
-
sp.site.rootWeb.webs.select("Title").get().then((w) => {
|
|
50
|
-
return Promise.all(w.map((element: any) => {
|
|
51
|
-
console.log(element["odata.id"]);
|
|
52
|
-
let web = new Web(element["odata.id"], "");
|
|
53
|
-
return web.webs.select("Title").get().then((sw: any[]) => {
|
|
54
|
-
return Promise.all(sw.map((value) => {
|
|
55
|
-
console.log(value["odata.id"]);
|
|
56
|
-
let web2 = new Web(value["odata.id"], "");
|
|
57
|
-
return web2.delete().catch(e => { console.error("unable to delete web"); });
|
|
58
|
-
}));
|
|
59
|
-
}).then(() => { web.delete(); }).catch(e => { console.error("unable to delete web"); });
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
}).catch(e => {
|
|
63
|
-
reject(e);
|
|
64
|
-
}).then(() => {
|
|
65
|
-
resolve();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
package/debug/example.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// use of relative paths to the modules
|
|
2
|
-
import { sp } from "@pnp/sp";
|
|
3
|
-
import { getGUID } from "@pnp/common";
|
|
4
|
-
import { WebProvisioner } from "../src/webprovisioner";
|
|
5
|
-
import { default as template } from "../sample-schemas/all-simple";
|
|
6
|
-
|
|
7
|
-
export function Example() {
|
|
8
|
-
|
|
9
|
-
sp.web.webs.add(`Provisioning Debug ${Date.now().toLocaleString()}`, getGUID()).then(war => {
|
|
10
|
-
let provisioner = new WebProvisioner(war.web);
|
|
11
|
-
|
|
12
|
-
provisioner.applyTemplate(template).then(() => {
|
|
13
|
-
|
|
14
|
-
console.log("Template Applied, checking work...");
|
|
15
|
-
|
|
16
|
-
// review the user custom actions
|
|
17
|
-
war.web.userCustomActions.get().then(uca => {
|
|
18
|
-
console.log(`UCA: ${JSON.stringify(uca)}`);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// review the features to see if ours was deactivated
|
|
22
|
-
war.web.features.get().then(features => {
|
|
23
|
-
console.log(`Features: ${JSON.stringify(features)}`);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// review the quick launch
|
|
27
|
-
war.web.navigation.quicklaunch.get().then(ql => {
|
|
28
|
-
console.log(`Quick Launch: ${JSON.stringify(ql)}`);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// review the top navigation
|
|
32
|
-
war.web.navigation.topNavigationBar.get().then(tb => {
|
|
33
|
-
console.log(`Top Navigation Bar: ${JSON.stringify(tb)}`);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// review the lists
|
|
37
|
-
war.web.lists.get().then(tb => {
|
|
38
|
-
console.log(`Lists: ${JSON.stringify(tb)}`);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}
|