@pnp/cli-microsoft365 6.11.0-beta.7edcad2 → 6.11.0-beta.b75e15f
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/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 +19 -70
- 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/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/aadGroup.js +20 -0
- package/dist/utils/planner.js +6 -3
- package/dist/utils/spo.js +601 -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 +2 -2
- 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 +683 -344
- 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.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
|
|
@@ -16,14 +16,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoSiteEnsureCommand_instances, _SpoSiteEnsureCommand_initOptions, _SpoSiteEnsureCommand_initTypes, _SpoSiteEnsureCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const chalk = require("chalk");
|
|
19
|
-
const Cli_1 = require("../../../../cli/Cli");
|
|
20
19
|
const validation_1 = require("../../../../utils/validation");
|
|
21
20
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
21
|
const commands_1 = require("../../commands");
|
|
23
|
-
const spoWebGetCommand = require("../web/web-get");
|
|
24
22
|
const SharingCapabilities_1 = require("./SharingCapabilities");
|
|
25
|
-
const
|
|
26
|
-
const spoSiteSetCommand = require("./site-set");
|
|
23
|
+
const spo_1 = require("../../../../utils/spo");
|
|
27
24
|
class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
28
25
|
get name() {
|
|
29
26
|
return commands_1.default.SITE_ENSURE;
|
|
@@ -42,10 +39,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
42
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
40
|
try {
|
|
44
41
|
const res = yield this.ensureSite(logger, args);
|
|
45
|
-
|
|
46
|
-
logger.logToStderr(res.stderr);
|
|
47
|
-
}
|
|
48
|
-
logger.log(res.stdout);
|
|
42
|
+
logger.log(res);
|
|
49
43
|
if (this.verbose) {
|
|
50
44
|
logger.logToStderr(chalk.green('DONE'));
|
|
51
45
|
}
|
|
@@ -63,9 +57,9 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
63
57
|
}
|
|
64
58
|
catch (err) {
|
|
65
59
|
if (this.debug) {
|
|
66
|
-
logger.logToStderr(err
|
|
60
|
+
logger.logToStderr(err);
|
|
67
61
|
}
|
|
68
|
-
if (err.error
|
|
62
|
+
if (err.error !== '404 FILE NOT FOUND') {
|
|
69
63
|
throw err;
|
|
70
64
|
}
|
|
71
65
|
if (this.verbose) {
|
|
@@ -74,12 +68,15 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
74
68
|
return this.createSite(args, logger);
|
|
75
69
|
}
|
|
76
70
|
if (this.debug) {
|
|
77
|
-
logger.logToStderr(getWebOutput
|
|
71
|
+
logger.logToStderr(getWebOutput);
|
|
78
72
|
}
|
|
79
73
|
if (this.verbose) {
|
|
80
74
|
logger.logToStderr(`Site found at ${args.options.url}. Checking if site matches conditions...`);
|
|
81
75
|
}
|
|
82
|
-
const web =
|
|
76
|
+
const web = {
|
|
77
|
+
Configuration: getWebOutput.Configuration,
|
|
78
|
+
WebTemplate: getWebOutput.WebTemplate
|
|
79
|
+
};
|
|
83
80
|
if (args.options.type) {
|
|
84
81
|
// type was specified so we need to check if the existing site matches
|
|
85
82
|
// it. If not, we throw an error and stop
|
|
@@ -93,7 +90,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
93
90
|
expectedWebTemplate = 'SITEPAGEPUBLISHING#0';
|
|
94
91
|
break;
|
|
95
92
|
case 'ClassicSite':
|
|
96
|
-
expectedWebTemplate = args.options.webTemplate;
|
|
93
|
+
expectedWebTemplate = args.options.webTemplate || 'STS#0';
|
|
97
94
|
break;
|
|
98
95
|
default:
|
|
99
96
|
throw `${args.options.type} is not a valid site type. Allowed types are TeamSite,CommunicationSite,ClassicSite`;
|
|
@@ -112,51 +109,20 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
111
|
getWeb(args, logger) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
debug: this.debug,
|
|
122
|
-
verbose: this.verbose
|
|
123
|
-
};
|
|
124
|
-
return Cli_1.Cli.executeCommandWithOutput(spoWebGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
if (this.verbose) {
|
|
114
|
+
logger.logToStderr(`Checking if site ${args.options.url} exists...`);
|
|
115
|
+
}
|
|
116
|
+
return yield spo_1.spo.getWeb(args.options.url, logger, this.verbose);
|
|
117
|
+
});
|
|
125
118
|
}
|
|
126
119
|
createSite(args, logger) {
|
|
127
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
121
|
if (this.verbose) {
|
|
129
122
|
logger.logToStderr(`Creating site...`);
|
|
130
123
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
title: args.options.title,
|
|
134
|
-
alias: args.options.alias,
|
|
135
|
-
description: args.options.description,
|
|
136
|
-
classification: args.options.classification,
|
|
137
|
-
isPublic: args.options.isPublic,
|
|
138
|
-
lcid: args.options.lcid,
|
|
139
|
-
url: typeof args.options.type === 'undefined' || args.options.type === 'TeamSite' ? undefined : args.options.url,
|
|
140
|
-
owners: args.options.owners,
|
|
141
|
-
shareByEmailEnabled: args.options.shareByEmailEnabled,
|
|
142
|
-
siteDesign: args.options.siteDesign,
|
|
143
|
-
siteDesignId: args.options.siteDesignId,
|
|
144
|
-
timeZone: args.options.timeZone,
|
|
145
|
-
webTemplate: args.options.webTemplate,
|
|
146
|
-
resourceQuota: args.options.resourceQuota,
|
|
147
|
-
resourceQuotaWarningLevel: args.options.resourceQuotaWarningLevel,
|
|
148
|
-
storageQuota: args.options.storageQuota,
|
|
149
|
-
storageQuotaWarningLevel: args.options.storageQuotaWarningLevel,
|
|
150
|
-
removeDeletedSite: args.options.removeDeletedSite,
|
|
151
|
-
wait: args.options.wait,
|
|
152
|
-
verbose: this.verbose,
|
|
153
|
-
debug: this.debug
|
|
154
|
-
};
|
|
155
|
-
const validationResult = yield spoSiteAddCommand.validate({ options: options }, Cli_1.Cli.getCommandInfo(spoSiteAddCommand));
|
|
156
|
-
if (validationResult !== true) {
|
|
157
|
-
return Promise.reject(validationResult);
|
|
158
|
-
}
|
|
159
|
-
return Cli_1.Cli.executeCommandWithOutput(spoSiteAddCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
124
|
+
const url = typeof args.options.type === 'undefined' || args.options.type === 'TeamSite' ? undefined : args.options.url;
|
|
125
|
+
return yield spo_1.spo.addSite(args.options.title, logger, this.verbose, args.options.wait, args.options.type, args.options.alias, args.options.description, args.options.owners, args.options.shareByEmailEnabled, args.options.removeDeletedSite, args.options.classification, args.options.isPublic, args.options.lcid, url, args.options.siteDesign, args.options.siteDesignId, args.options.timeZone, args.options.webTemplate, args.options.resourceQuota, args.options.resourceQuotaWarningLevel, args.options.storageQuota, args.options.storageQuotaWarningLevel);
|
|
160
126
|
});
|
|
161
127
|
}
|
|
162
128
|
updateSite(args, logger) {
|
|
@@ -164,24 +130,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
164
130
|
if (this.verbose) {
|
|
165
131
|
logger.logToStderr(`Updating site...`);
|
|
166
132
|
}
|
|
167
|
-
|
|
168
|
-
classification: args.options.classification,
|
|
169
|
-
disableFlows: args.options.disableFlows,
|
|
170
|
-
isPublic: args.options.isPublic,
|
|
171
|
-
owners: args.options.owners,
|
|
172
|
-
shareByEmailEnabled: args.options.shareByEmailEnabled,
|
|
173
|
-
siteDesignId: args.options.siteDesignId,
|
|
174
|
-
title: args.options.title,
|
|
175
|
-
url: args.options.url,
|
|
176
|
-
sharingCapability: args.options.sharingCapability,
|
|
177
|
-
verbose: this.verbose,
|
|
178
|
-
debug: this.debug
|
|
179
|
-
};
|
|
180
|
-
const validationResult = yield spoSiteSetCommand.validate({ options: options }, Cli_1.Cli.getCommandInfo(spoSiteSetCommand));
|
|
181
|
-
if (validationResult !== true) {
|
|
182
|
-
return Promise.reject(validationResult);
|
|
183
|
-
}
|
|
184
|
-
return Cli_1.Cli.executeCommandWithOutput(spoSiteSetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
133
|
+
return yield spo_1.spo.updateSite(args.options.url, logger, this.verbose, args.options.title, args.options.classification, args.options.disableFlows, args.options.isPublic, args.options.owners, args.options.shareByEmailEnabled, args.options.siteDesignId, args.options.sharingCapability);
|
|
185
134
|
});
|
|
186
135
|
}
|
|
187
136
|
/**
|
|
@@ -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) {
|