@pnp/cli-microsoft365 6.10.0-beta.f43fa4d → 6.11.0-beta.259c884
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/dist/Auth.js +2 -1
- package/dist/Command.js +1 -1
- package/dist/m365/cli/commands/config/config-list.js +29 -0
- package/dist/m365/cli/commands.js +1 -0
- package/dist/m365/pa/commands/app/app-permission-ensure.js +177 -0
- package/dist/m365/pa/commands/app/app-permission-remove.js +170 -0
- package/dist/m365/pa/commands.js +2 -0
- package/dist/m365/planner/commands/bucket/bucket-add.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-remove.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
- package/dist/m365/planner/commands/plan/plan-get.js +1 -2
- package/dist/m365/planner/commands/plan/plan-list.js +4 -5
- package/dist/m365/planner/commands/plan/plan-set.js +2 -2
- package/dist/m365/planner/commands/roster/roster-member-add.js +3 -14
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +34 -23
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +35 -51
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +26 -14
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/file/file-add.js +13 -13
- package/dist/m365/spo/commands/file/file-checkin.js +1 -1
- package/dist/m365/spo/commands/file/file-checkout.js +1 -1
- package/dist/m365/spo/commands/file/file-copy.js +38 -4
- package/dist/m365/spo/commands/file/file-list.js +4 -4
- package/dist/m365/spo/commands/file/file-move.js +2 -2
- package/dist/m365/spo/commands/file/file-remove.js +6 -6
- package/dist/m365/spo/commands/file/file-rename.js +2 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
- package/dist/m365/spo/commands/file/file-version-get.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +1 -1
- package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
- package/dist/m365/spo/commands/folder/folder-add.js +2 -4
- package/dist/m365/spo/commands/folder/folder-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-list.js +2 -2
- package/dist/m365/spo/commands/folder/folder-remove.js +7 -4
- package/dist/m365/spo/commands/folder/folder-rename.js +13 -17
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/group/group-list.js +0 -1
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +32 -3
- package/dist/m365/spo/commands/page/Page.js +24 -32
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +75 -54
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +41 -40
- package/dist/m365/spo/commands/site/FlowsPolicy.js +10 -0
- package/dist/m365/spo/commands/site/site-ensure.js +3 -3
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +24 -22
- package/dist/m365/spo/commands/site/site-list.js +28 -36
- package/dist/m365/spo/commands/site/site-set.js +52 -39
- package/dist/m365/spo/commands/theme/theme-remove.js +26 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +29 -27
- package/dist/m365/spo/commands/web/web-reindex.js +17 -20
- package/dist/m365/spo/commands/web/web-remove.js +23 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +45 -52
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +58 -61
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +20 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +21 -19
- package/dist/m365/teams/commands/meeting/meeting-get.js +16 -24
- package/dist/m365/teams/commands/meeting/meeting-list.js +2 -15
- package/dist/m365/yammer/commands/message/message-like-set.js +29 -28
- package/dist/m365/yammer/commands/message/message-list.js +9 -26
- package/dist/m365/yammer/commands/message/message-remove.js +20 -18
- package/dist/m365/yammer/commands/yammer-search.js +42 -56
- package/dist/utils/planner.js +6 -3
- package/dist/utils/spo.js +1 -1
- package/docs/docs/cmd/aad/user/user-set.mdx +1 -1
- package/docs/docs/cmd/cli/config/config-list.mdx +78 -0
- package/docs/docs/cmd/flow/flow-enable.mdx +2 -2
- package/docs/docs/cmd/login.mdx +6 -0
- package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -9
- package/docs/docs/cmd/spo/file/file-checkout.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +20 -16
- package/docs/docs/cmd/spo/file/file-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-move.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-remove.mdx +8 -8
- package/docs/docs/cmd/spo/file/file-rename.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-add.mdx +76 -1
- package/docs/docs/cmd/spo/folder/folder-get.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-rename.mdx +5 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/docs/docs/cmd/yammer/network/network-list.mdx +1 -1
- package/npm-shrinkwrap.json +685 -346
- package/package.json +13 -13
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.Page = exports.supportedPromoteAs = exports.supportedPageLayouts = void 0;
|
|
4
13
|
const request_1 = require("../../../../request");
|
|
@@ -10,7 +19,7 @@ exports.supportedPageLayouts = ['Article', 'Home', 'SingleWebPartAppPage', 'Repo
|
|
|
10
19
|
exports.supportedPromoteAs = ['HomePage', 'NewsPage', 'Template'];
|
|
11
20
|
class Page {
|
|
12
21
|
static getPage(name, webUrl, logger, debug, verbose) {
|
|
13
|
-
return
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
23
|
if (verbose) {
|
|
15
24
|
logger.logToStderr(`Retrieving information about the page...`);
|
|
16
25
|
}
|
|
@@ -23,26 +32,15 @@ class Page {
|
|
|
23
32
|
},
|
|
24
33
|
responseType: 'json'
|
|
25
34
|
};
|
|
26
|
-
request_1.default
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
resolve(clientsidepages_1.ClientSidePage.fromHtml(res.ListItemAllFields.CanvasContent1));
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
}, (error) => {
|
|
40
|
-
reject(error);
|
|
41
|
-
});
|
|
35
|
+
const res = yield request_1.default.get(requestOptions);
|
|
36
|
+
if (res.ListItemAllFields.ClientSideApplicationId !== 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec') {
|
|
37
|
+
throw `Page ${name} is not a modern page.`;
|
|
38
|
+
}
|
|
39
|
+
return clientsidepages_1.ClientSidePage.fromHtml(res.ListItemAllFields.CanvasContent1);
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
42
|
static checkout(name, webUrl, logger, debug, verbose) {
|
|
45
|
-
return
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
44
|
if (verbose) {
|
|
47
45
|
logger.log(`Checking out ${name} page...`);
|
|
48
46
|
}
|
|
@@ -54,20 +52,14 @@ class Page {
|
|
|
54
52
|
},
|
|
55
53
|
responseType: 'json'
|
|
56
54
|
};
|
|
57
|
-
request_1.default
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
logger.log(`Page ${name} is now checked out`);
|
|
66
|
-
}
|
|
67
|
-
resolve(pageData);
|
|
68
|
-
}, (error) => {
|
|
69
|
-
reject(error);
|
|
70
|
-
});
|
|
55
|
+
const pageData = yield request_1.default.post(requestOptions);
|
|
56
|
+
if (!pageData) {
|
|
57
|
+
throw `Page ${name} information not retrieved with the checkout`;
|
|
58
|
+
}
|
|
59
|
+
if (verbose) {
|
|
60
|
+
logger.log(`Page ${name} is now checked out`);
|
|
61
|
+
}
|
|
62
|
+
return pageData;
|
|
71
63
|
});
|
|
72
64
|
}
|
|
73
65
|
static getControlsInformation(control, isJSONOutput) {
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.SpoPropertyBagBaseCommand = void 0;
|
|
4
13
|
const config_1 = require("../../../../config");
|
|
@@ -17,35 +26,37 @@ class SpoPropertyBagBaseCommand extends SpoCommand_1.default {
|
|
|
17
26
|
* This method is executed when folder option is specified. PnP PowerShell behaves the same way.
|
|
18
27
|
*/
|
|
19
28
|
getFolderPropertyBag(identityResp, webUrl, folder, logger) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.post(requestOptions)
|
|
34
|
-
.then((res) => {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
let serverRelativeUrl = folder;
|
|
31
|
+
if (identityResp.serverRelativeUrl !== '/') {
|
|
32
|
+
serverRelativeUrl = `${identityResp.serverRelativeUrl}${serverRelativeUrl}`;
|
|
33
|
+
}
|
|
34
|
+
const requestOptions = {
|
|
35
|
+
url: `${webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
36
|
+
headers: {
|
|
37
|
+
'X-RequestDigest': this.formDigestValue
|
|
38
|
+
},
|
|
39
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="10" ObjectPathId="9" /><ObjectIdentityQuery Id="11" ObjectPathId="9" /><Query Id="12" ObjectPathId="9"><Query SelectAllProperties="false"><Properties><Property Name="Properties" SelectAll="true"><Query SelectAllProperties="false"><Properties /></Query></Property></Properties></Query></Query></Actions><ObjectPaths><Method Id="9" ParentId="5" Name="GetFolderByServerRelativeUrl"><Parameters><Parameter Type="String">${serverRelativeUrl}</Parameter></Parameters></Method><Identity Id="5" Name="${identityResp.objectIdentity}" /></ObjectPaths></Request>`
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
const res = yield request_1.default.post(requestOptions);
|
|
35
43
|
if (this.debug) {
|
|
36
44
|
logger.logToStderr('Attempt to get Properties key values');
|
|
37
45
|
}
|
|
38
46
|
const json = JSON.parse(res);
|
|
39
47
|
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
40
48
|
if (contents && contents.ErrorInfo) {
|
|
41
|
-
|
|
49
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
42
50
|
}
|
|
43
51
|
const propertiesObj = json.find(x => { return x['Properties']; });
|
|
44
52
|
if (propertiesObj) {
|
|
45
|
-
return
|
|
53
|
+
return propertiesObj['Properties'];
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
}
|
|
55
|
+
throw 'Cannot proceed. Properties not found'; // this is not suppose to happen
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
throw err;
|
|
59
|
+
}
|
|
49
60
|
});
|
|
50
61
|
}
|
|
51
62
|
/**
|
|
@@ -53,29 +64,33 @@ class SpoPropertyBagBaseCommand extends SpoCommand_1.default {
|
|
|
53
64
|
* This method is executed when no folder specified. PnP PowerShell behaves the same way.
|
|
54
65
|
*/
|
|
55
66
|
getWebPropertyBag(identityResp, webUrl, logger) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const requestOptions = {
|
|
69
|
+
url: `${webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
70
|
+
headers: {
|
|
71
|
+
'X-RequestDigest': this.formDigestValue
|
|
72
|
+
},
|
|
73
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><Query Id="97" ObjectPathId="5"><Query SelectAllProperties="false"><Properties><Property Name="ServerRelativeUrl" ScalarProperty="true" /><Property Name="AllProperties" SelectAll="true"><Query SelectAllProperties="false"><Properties /></Query></Property></Properties></Query></Query></Actions><ObjectPaths><Identity Id="5" Name="${identityResp.objectIdentity}" /></ObjectPaths></Request>`
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
const res = yield request_1.default.post(requestOptions);
|
|
65
77
|
if (this.debug) {
|
|
66
78
|
logger.logToStderr('Attempt to get AllProperties key values');
|
|
67
79
|
}
|
|
68
80
|
const json = JSON.parse(res);
|
|
69
81
|
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
70
82
|
if (contents && contents.ErrorInfo) {
|
|
71
|
-
|
|
83
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
72
84
|
}
|
|
73
85
|
const allPropertiesObj = json.find(x => { return x['AllProperties']; });
|
|
74
86
|
if (allPropertiesObj) {
|
|
75
|
-
return
|
|
87
|
+
return allPropertiesObj['AllProperties'];
|
|
76
88
|
}
|
|
77
|
-
|
|
78
|
-
}
|
|
89
|
+
throw 'Cannot proceed. AllProperties not found'; // this is not supposed to happen
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
79
94
|
});
|
|
80
95
|
}
|
|
81
96
|
/**
|
|
@@ -112,28 +127,32 @@ class SpoPropertyBagBaseCommand extends SpoCommand_1.default {
|
|
|
112
127
|
return { key: objKey, value: objValue };
|
|
113
128
|
}
|
|
114
129
|
static setProperty(name, value, webUrl, formDigest, identityResp, logger, debug, folder) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
let objectType = 'AllProperties';
|
|
132
|
+
if (folder) {
|
|
133
|
+
objectType = 'Properties';
|
|
134
|
+
}
|
|
135
|
+
const requestOptions = {
|
|
136
|
+
url: `${webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
137
|
+
headers: {
|
|
138
|
+
'X-RequestDigest': formDigest
|
|
139
|
+
},
|
|
140
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><Method Name="SetFieldValue" Id="206" ObjectPathId="205"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(name)}</Parameter><Parameter Type="String">${formatting_1.formatting.escapeXml(value)}</Parameter></Parameters></Method><Method Name="Update" Id="207" ObjectPathId="198" /></Actions><ObjectPaths><Property Id="205" ParentId="198" Name="${objectType}" /><Identity Id="198" Name="${identityResp.objectIdentity}" /></ObjectPaths></Request>`
|
|
141
|
+
};
|
|
142
|
+
try {
|
|
143
|
+
const res = yield request_1.default.post(requestOptions);
|
|
128
144
|
const json = JSON.parse(res);
|
|
129
145
|
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
130
146
|
if (contents && contents.ErrorInfo) {
|
|
131
|
-
|
|
147
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
132
148
|
}
|
|
133
149
|
else {
|
|
134
|
-
|
|
150
|
+
return res;
|
|
135
151
|
}
|
|
136
|
-
}
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
throw err;
|
|
155
|
+
}
|
|
137
156
|
});
|
|
138
157
|
}
|
|
139
158
|
/**
|
|
@@ -145,12 +164,14 @@ class SpoPropertyBagBaseCommand extends SpoCommand_1.default {
|
|
|
145
164
|
* @param cmd command instance
|
|
146
165
|
*/
|
|
147
166
|
static isNoScriptSite(webUrl, formDigest, webIdentityResp, logger, debug) {
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
.
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
try {
|
|
169
|
+
const basePermissionsResp = yield spo_1.spo.getEffectiveBasePermissions(webIdentityResp.objectIdentity, webUrl, formDigest, logger, debug);
|
|
170
|
+
return basePermissionsResp.has(base_permissions_1.PermissionKind.AddAndCustomizePages) === false;
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
throw err;
|
|
174
|
+
}
|
|
154
175
|
});
|
|
155
176
|
}
|
|
156
177
|
}
|
|
@@ -39,24 +39,8 @@ class SpoPropertyBagRemoveCommand extends propertybag_base_1.SpoPropertyBagBaseC
|
|
|
39
39
|
}
|
|
40
40
|
commandAction(logger, args) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const removeProperty = () => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
try {
|
|
44
|
-
const contextResponse = yield spo_1.spo.getRequestDigest(args.options.webUrl);
|
|
45
|
-
this.formDigestValue = contextResponse.FormDigestValue;
|
|
46
|
-
let identityResp = yield spo_1.spo.getCurrentWebIdentity(args.options.webUrl, this.formDigestValue);
|
|
47
|
-
const opts = args.options;
|
|
48
|
-
if (opts.folder) {
|
|
49
|
-
// get the folder guid instead of the web guid
|
|
50
|
-
identityResp = yield spo_1.spo.getFolderIdentity(identityResp.objectIdentity, opts.webUrl, opts.folder, this.formDigestValue);
|
|
51
|
-
}
|
|
52
|
-
yield this.removeProperty(identityResp, args.options);
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
this.handleRejectedPromise(err);
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
42
|
if (args.options.confirm) {
|
|
59
|
-
yield removeProperty();
|
|
43
|
+
yield this.removeProperty(args);
|
|
60
44
|
}
|
|
61
45
|
else {
|
|
62
46
|
const result = yield Cli_1.Cli.prompt({
|
|
@@ -66,34 +50,51 @@ class SpoPropertyBagRemoveCommand extends propertybag_base_1.SpoPropertyBagBaseC
|
|
|
66
50
|
message: `Are you sure you want to remove the ${args.options.key} property?`
|
|
67
51
|
});
|
|
68
52
|
if (result.continue) {
|
|
69
|
-
yield removeProperty();
|
|
53
|
+
yield this.removeProperty(args);
|
|
70
54
|
}
|
|
71
55
|
}
|
|
72
56
|
});
|
|
73
57
|
}
|
|
74
|
-
removeProperty(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><Method Name="SetFieldValue" Id="206" ObjectPathId="205"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(options.key)}</Parameter><Parameter Type="Null" /></Parameters></Method><Method Name="Update" Id="207" ObjectPathId="198" /></Actions><ObjectPaths><Property Id="205" ParentId="198" Name="${objectType}" /><Identity Id="198" Name="${identityResp.objectIdentity}" /></ObjectPaths></Request>`
|
|
85
|
-
};
|
|
86
|
-
return new Promise((resolve, reject) => {
|
|
87
|
-
request_1.default.post(requestOptions).then((res) => {
|
|
88
|
-
const json = JSON.parse(res);
|
|
89
|
-
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
90
|
-
if (contents && contents.ErrorInfo) {
|
|
91
|
-
reject(contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error');
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
resolve(res);
|
|
58
|
+
removeProperty(args) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
const contextResponse = yield spo_1.spo.getRequestDigest(args.options.webUrl);
|
|
62
|
+
this.formDigestValue = contextResponse.FormDigestValue;
|
|
63
|
+
let identityResp = yield spo_1.spo.getCurrentWebIdentity(args.options.webUrl, this.formDigestValue);
|
|
64
|
+
const opts = args.options;
|
|
65
|
+
if (opts.folder) {
|
|
66
|
+
// get the folder guid instead of the web guid
|
|
67
|
+
identityResp = yield spo_1.spo.getFolderIdentity(identityResp.objectIdentity, opts.webUrl, opts.folder, this.formDigestValue);
|
|
95
68
|
}
|
|
96
|
-
|
|
69
|
+
yield this.removePropertyWithIdentityResp(identityResp, args.options);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
this.handleRejectedPromise(err);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
removePropertyWithIdentityResp(identityResp, options) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
let objectType = 'AllProperties';
|
|
79
|
+
if (options.folder) {
|
|
80
|
+
objectType = 'Properties';
|
|
81
|
+
}
|
|
82
|
+
const requestOptions = {
|
|
83
|
+
url: `${options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
84
|
+
headers: {
|
|
85
|
+
'X-RequestDigest': this.formDigestValue
|
|
86
|
+
},
|
|
87
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><Method Name="SetFieldValue" Id="206" ObjectPathId="205"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(options.key)}</Parameter><Parameter Type="Null" /></Parameters></Method><Method Name="Update" Id="207" ObjectPathId="198" /></Actions><ObjectPaths><Property Id="205" ParentId="198" Name="${objectType}" /><Identity Id="198" Name="${identityResp.objectIdentity}" /></ObjectPaths></Request>`
|
|
88
|
+
};
|
|
89
|
+
const res = yield request_1.default.post(requestOptions);
|
|
90
|
+
const json = JSON.parse(res);
|
|
91
|
+
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
92
|
+
if (contents && contents.ErrorInfo) {
|
|
93
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return res;
|
|
97
|
+
}
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowsPolicy = void 0;
|
|
4
|
+
var FlowsPolicy;
|
|
5
|
+
(function (FlowsPolicy) {
|
|
6
|
+
FlowsPolicy[FlowsPolicy["Unknown"] = 0] = "Unknown";
|
|
7
|
+
FlowsPolicy[FlowsPolicy["Disabled"] = 1] = "Disabled";
|
|
8
|
+
FlowsPolicy[FlowsPolicy["Enabled"] = 2] = "Enabled";
|
|
9
|
+
})(FlowsPolicy = exports.FlowsPolicy || (exports.FlowsPolicy = {}));
|
|
10
|
+
//# sourceMappingURL=FlowsPolicy.js.map
|
|
@@ -93,7 +93,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
93
93
|
expectedWebTemplate = 'SITEPAGEPUBLISHING#0';
|
|
94
94
|
break;
|
|
95
95
|
case 'ClassicSite':
|
|
96
|
-
expectedWebTemplate = args.options.webTemplate;
|
|
96
|
+
expectedWebTemplate = args.options.webTemplate || 'STS#0';
|
|
97
97
|
break;
|
|
98
98
|
default:
|
|
99
99
|
throw `${args.options.type} is not a valid site type. Allowed types are TeamSite,CommunicationSite,ClassicSite`;
|
|
@@ -154,7 +154,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
154
154
|
};
|
|
155
155
|
const validationResult = yield spoSiteAddCommand.validate({ options: options }, Cli_1.Cli.getCommandInfo(spoSiteAddCommand));
|
|
156
156
|
if (validationResult !== true) {
|
|
157
|
-
|
|
157
|
+
throw validationResult;
|
|
158
158
|
}
|
|
159
159
|
return Cli_1.Cli.executeCommandWithOutput(spoSiteAddCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
160
160
|
});
|
|
@@ -179,7 +179,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
179
179
|
};
|
|
180
180
|
const validationResult = yield spoSiteSetCommand.validate({ options: options }, Cli_1.Cli.getCommandInfo(spoSiteSetCommand));
|
|
181
181
|
if (validationResult !== true) {
|
|
182
|
-
|
|
182
|
+
throw validationResult;
|
|
183
183
|
}
|
|
184
184
|
return Cli_1.Cli.executeCommandWithOutput(spoSiteSetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
185
185
|
});
|
|
@@ -37,28 +37,8 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand_1.default {
|
|
|
37
37
|
}
|
|
38
38
|
commandAction(logger, args) {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const disconnectHubSite = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
try {
|
|
42
|
-
const res = yield spo_1.spo.getRequestDigest(args.options.siteUrl);
|
|
43
|
-
if (this.verbose) {
|
|
44
|
-
logger.logToStderr(`Disconnecting site collection ${args.options.siteUrl} from its hubsite...`);
|
|
45
|
-
}
|
|
46
|
-
const requestOptions = {
|
|
47
|
-
url: `${args.options.siteUrl}/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`,
|
|
48
|
-
headers: {
|
|
49
|
-
'X-RequestDigest': res.FormDigestValue,
|
|
50
|
-
accept: 'application/json;odata=nometadata'
|
|
51
|
-
},
|
|
52
|
-
responseType: 'json'
|
|
53
|
-
};
|
|
54
|
-
yield request_1.default.post(requestOptions);
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
this.handleRejectedODataJsonPromise(err);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
40
|
if (args.options.confirm) {
|
|
61
|
-
yield disconnectHubSite();
|
|
41
|
+
yield this.disconnectHubSite(logger, args);
|
|
62
42
|
}
|
|
63
43
|
else {
|
|
64
44
|
const result = yield Cli_1.Cli.prompt({
|
|
@@ -68,8 +48,30 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand_1.default {
|
|
|
68
48
|
message: `Are you sure you want to disconnect the site collection ${args.options.siteUrl} from its hub site?`
|
|
69
49
|
});
|
|
70
50
|
if (result.continue) {
|
|
71
|
-
yield disconnectHubSite();
|
|
51
|
+
yield this.disconnectHubSite(logger, args);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
disconnectHubSite(logger, args) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
try {
|
|
59
|
+
const res = yield spo_1.spo.getRequestDigest(args.options.siteUrl);
|
|
60
|
+
if (this.verbose) {
|
|
61
|
+
logger.logToStderr(`Disconnecting site collection ${args.options.siteUrl} from its hubsite...`);
|
|
72
62
|
}
|
|
63
|
+
const requestOptions = {
|
|
64
|
+
url: `${args.options.siteUrl}/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`,
|
|
65
|
+
headers: {
|
|
66
|
+
'X-RequestDigest': res.FormDigestValue,
|
|
67
|
+
accept: 'application/json;odata=nometadata'
|
|
68
|
+
},
|
|
69
|
+
responseType: 'json'
|
|
70
|
+
};
|
|
71
|
+
yield request_1.default.post(requestOptions);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
this.handleRejectedODataJsonPromise(err);
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
77
|
}
|
|
@@ -58,43 +58,35 @@ class SpoSiteListCommand extends SpoCommand_1.default {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
getAllSites(spoAdminUrl, filter, startIndex, personalSite, webTemplate, formDigest, deleted, logger) {
|
|
61
|
-
return
|
|
62
|
-
spo_1.spo
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.allSites.push(...sites._Child_Items_);
|
|
88
|
-
if (sites.NextStartIndexFromSharePoint) {
|
|
89
|
-
this
|
|
90
|
-
.getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, personalSite, webTemplate, formDigest, deleted, logger)
|
|
91
|
-
.then(_ => resolve(), err => reject(err));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
resolve();
|
|
95
|
-
}
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const res = yield spo_1.spo.ensureFormDigest(spoAdminUrl, logger, formDigest, this.debug);
|
|
63
|
+
let requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="2" ObjectPathId="1" /><ObjectPath Id="4" ObjectPathId="3" /><Query Id="5" ObjectPathId="3"><Query SelectAllProperties="true"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="3" ParentId="1" Name="GetSitePropertiesFromSharePointByFilters"><Parameters><Parameter TypeId="{b92aeee2-c92c-4b67-abcc-024e471bc140}"><Property Name="Filter" Type="String">${filter}</Property><Property Name="IncludeDetail" Type="Boolean">false</Property><Property Name="IncludePersonalSite" Type="Enum">${personalSite}</Property><Property Name="StartIndex" Type="String">${startIndex}</Property><Property Name="Template" Type="String">${webTemplate}</Property></Parameter></Parameters></Method></ObjectPaths></Request>`;
|
|
64
|
+
if (deleted) {
|
|
65
|
+
requestBody = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="4" ObjectPathId="3" /><ObjectPath Id="6" ObjectPathId="5" /><Query Id="7" ObjectPathId="5"><Query SelectAllProperties="true"><Properties><Property Name="NextStartIndexFromSharePoint" ScalarProperty="true" /></Properties></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><Constructor Id="3" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="5" ParentId="3" Name="GetDeletedSitePropertiesFromSharePoint"><Parameters><Parameter Type="String">${startIndex}</Parameter></Parameters></Method></ObjectPaths></Request>`;
|
|
66
|
+
}
|
|
67
|
+
const requestOptions = {
|
|
68
|
+
url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
69
|
+
headers: {
|
|
70
|
+
'X-RequestDigest': res.FormDigestValue
|
|
71
|
+
},
|
|
72
|
+
data: requestBody
|
|
73
|
+
};
|
|
74
|
+
const res1 = yield request_1.default.post(requestOptions);
|
|
75
|
+
const json = JSON.parse(res1);
|
|
76
|
+
const response = json[0];
|
|
77
|
+
logger.log(response);
|
|
78
|
+
if (response.ErrorInfo) {
|
|
79
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const sites = json[json.length - 1];
|
|
83
|
+
logger.log(sites);
|
|
84
|
+
this.allSites.push(...sites._Child_Items_);
|
|
85
|
+
if (sites.NextStartIndexFromSharePoint) {
|
|
86
|
+
yield this.getAllSites(spoAdminUrl, filter, sites.NextStartIndexFromSharePoint, personalSite, webTemplate, formDigest, deleted, logger);
|
|
96
87
|
}
|
|
97
|
-
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
98
90
|
});
|
|
99
91
|
}
|
|
100
92
|
getWebTemplateId(options) {
|