@pnp/cli-microsoft365 11.0.0 → 11.1.0-beta.111c36f
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/.devproxy/api-specs/sharepoint.yaml +41 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -7
- package/dist/Command.js +2 -2
- package/dist/auth/msalCachePlugin.js +6 -2
- package/dist/autocomplete.js +6 -2
- package/dist/chili/chili.js +2 -1
- package/dist/cli/cli.js +4 -2
- package/dist/config.js +0 -1
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +2 -2
- package/dist/m365/app/commands/permission/permission-list.js +4 -2
- package/dist/m365/booking/commands/business/business-list.js +5 -0
- package/dist/m365/commands/setup.js +6 -3
- package/dist/m365/commands/status.js +5 -1
- package/dist/m365/connection/commands/connection-list.js +5 -1
- package/dist/m365/entra/commands/app/app-role-add.js +1 -1
- package/dist/m365/entra/commands/group/group-add.js +1 -1
- package/dist/m365/entra/commands/group/group-set.js +1 -1
- package/dist/m365/entra/commands/license/license-list.js +5 -0
- package/dist/m365/entra/commands/m365group/m365group-add.js +0 -1
- package/dist/m365/file/commands/convert/convert-pdf.js +1 -6
- package/dist/m365/flow/commands/environment/environment-list.js +5 -0
- package/dist/m365/flow/commands/flow-export.js +8 -5
- package/dist/m365/flow/commands/run/run-get.js +3 -3
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +1 -1
- package/dist/m365/onedrive/commands/onedrive-list.js +5 -0
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +5 -0
- package/dist/m365/pa/commands/app/app-export.js +1 -1
- package/dist/m365/pa/commands/app/app-get.js +1 -1
- package/dist/m365/pa/commands/environment/environment-list.js +5 -0
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/pp/commands/environment/environment-list.js +10 -23
- package/dist/m365/pp/commands/solution/solution-publisher-get.js +1 -1
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +5 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
- package/dist/m365/spfx/commands/package/package-generate.js +3 -1
- package/dist/m365/spfx/commands/project/base-project-command.js +13 -5
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +6 -4
- package/dist/m365/spfx/commands/project/project-model/ScssFile.js +3 -1
- package/dist/m365/spfx/commands/project/project-model/TsFile.js +6 -2
- 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.16.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.18.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.19.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.21.0.js +2 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +5 -5
- package/dist/m365/spo/commands/file/file-add.js +4 -2
- package/dist/m365/spo/commands/file/file-rename.js +3 -4
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +9 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +12 -12
- package/dist/m365/spo/commands/page/page-add.js +4 -2
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -0
- package/dist/m365/spo/commands/page/page-set.js +4 -2
- package/dist/m365/spo/commands/page/page-text-add.js +1 -0
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +34 -54
- package/dist/m365/spo/commands/site/site-alert-list.js +107 -0
- package/dist/m365/spo/commands/site/site-alert-remove.js +59 -0
- package/dist/m365/spo/commands/theme/theme-apply.js +1 -1
- package/dist/m365/spo/commands/web/web-reindex.js +17 -27
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/tab/tab-add.js +9 -3
- package/dist/m365/viva/commands/connections/connections-app-create.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +1 -1
- package/dist/telemetry.js +3 -1
- package/dist/utils/accessToken.js +4 -0
- package/dist/utils/cache.js +3 -2
- package/dist/utils/customAppScope.js +1 -1
- package/dist/utils/directoryExtension.js +1 -1
- package/dist/utils/entraAdministrativeUnit.js +1 -1
- package/dist/utils/entraApp.js +2 -2
- package/dist/utils/entraDevice.js +1 -1
- package/dist/utils/entraServicePrincipal.js +2 -2
- package/dist/utils/formatting.js +1 -1
- package/dist/utils/md.js +2 -2
- package/dist/utils/odata.js +2 -0
- package/dist/utils/planner.js +1 -1
- package/dist/utils/powerPlatform.js +2 -2
- package/dist/utils/roleDefinition.js +2 -2
- package/dist/utils/spo.js +10 -11
- package/dist/utils/urlUtil.js +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/utils/vivaEngage.js +3 -3
- package/docs/docs/cmd/booking/business/business-get.mdx +18 -1
- package/docs/docs/cmd/booking/business/business-list.mdx +18 -1
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +19 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-remove.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +21 -0
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-roleassignment-add.mdx +19 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +18 -0
- package/docs/docs/cmd/entra/app/app-get.mdx +19 -1
- package/docs/docs/cmd/entra/app/app-list.mdx +18 -1
- package/docs/docs/cmd/entra/app/app-remove.mdx +20 -0
- package/docs/docs/cmd/entra/app/app-set.mdx +20 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +18 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +18 -0
- package/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +20 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +15 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +14 -0
- package/docs/docs/cmd/entra/group/group-add.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-get.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-list.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-member-add.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-member-list.mdx +18 -0
- package/docs/docs/cmd/entra/group/group-member-remove.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-member-set.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-remove.mdx +20 -0
- package/docs/docs/cmd/entra/group/group-set.mdx +20 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +21 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx +14 -0
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx +14 -0
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +18 -0
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +19 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +18 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-get.mdx +18 -1
- package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +20 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +17 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +20 -0
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +20 -0
- package/docs/docs/cmd/entra/organization/organization-list.mdx +19 -2
- package/docs/docs/cmd/entra/pim/pim-role-assignment-add.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-remove.mdx +18 -0
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-add.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-get.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-list.mdx +18 -0
- package/docs/docs/cmd/graph/directoryextension/directoryextension-remove.mdx +20 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-add.mdx +18 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-get.mdx +18 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-list.mdx +19 -1
- package/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx +20 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-set.mdx +23 -3
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +27 -6
- package/docs/docs/cmd/outlook/mail/mail-send.mdx +21 -0
- package/docs/docs/cmd/outlook/mailbox/mailbox-settings-get.mdx +20 -1
- package/docs/docs/cmd/outlook/mailbox/mailbox-settings-set.mdx +20 -1
- package/docs/docs/cmd/outlook/room/room-list.mdx +19 -0
- package/docs/docs/cmd/outlook/roomlist/roomlist-list.mdx +19 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +18 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +20 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +18 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +21 -1
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +21 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +11 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +12 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +12 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +14 -1
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +13 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.mdx +18 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.mdx +18 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.mdx +18 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-add.mdx +12 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +19 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-list.mdx +19 -0
- package/docs/docs/cmd/spo/site/site-alert-list.mdx +187 -0
- package/docs/docs/cmd/spo/site/site-alert-remove.mdx +65 -0
- package/eslint-rules/lib/rules/correct-command-class-name.js +18 -2
- package/eslint.config.mjs +270 -0
- package/npm-shrinkwrap.json +1281 -2306
- package/package.json +31 -24
- package/.eslintrc.cjs +0 -289
|
@@ -25,28 +25,23 @@ export class SpoPropertyBagBaseCommand extends SpoCommand {
|
|
|
25
25
|
},
|
|
26
26
|
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.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>`
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
37
|
-
}
|
|
38
|
-
const propertiesObj = json.find(x => { return x['Properties']; });
|
|
39
|
-
if (propertiesObj) {
|
|
40
|
-
return propertiesObj['Properties'];
|
|
41
|
-
}
|
|
42
|
-
throw 'Cannot proceed. Properties not found'; // this is not suppose to happen
|
|
28
|
+
const res = await request.post(requestOptions);
|
|
29
|
+
if (this.verbose) {
|
|
30
|
+
await logger.logToStderr('Attempt to get Properties key values');
|
|
31
|
+
}
|
|
32
|
+
const json = JSON.parse(res);
|
|
33
|
+
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
34
|
+
if (contents && contents.ErrorInfo) {
|
|
35
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
43
36
|
}
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const propertiesObj = json.find(x => { return x['Properties']; });
|
|
38
|
+
if (propertiesObj) {
|
|
39
|
+
return propertiesObj['Properties'];
|
|
46
40
|
}
|
|
41
|
+
throw 'Cannot proceed. Properties not found'; // this is not suppose to happen
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
49
|
-
* Gets property bag for site or
|
|
44
|
+
* Gets property bag for site or site collection where return type is "_ObjectType_\":\"SP.Web\".
|
|
50
45
|
* This method is executed when no folder specified. PnP PowerShell behaves the same way.
|
|
51
46
|
*/
|
|
52
47
|
async getWebPropertyBag(identityResp, webUrl, logger) {
|
|
@@ -57,25 +52,20 @@ export class SpoPropertyBagBaseCommand extends SpoCommand {
|
|
|
57
52
|
},
|
|
58
53
|
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.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>`
|
|
59
54
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await logger.logToStderr('Attempt to get AllProperties key values');
|
|
64
|
-
}
|
|
65
|
-
const json = JSON.parse(res);
|
|
66
|
-
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
67
|
-
if (contents && contents.ErrorInfo) {
|
|
68
|
-
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
69
|
-
}
|
|
70
|
-
const allPropertiesObj = json.find(x => { return x['AllProperties']; });
|
|
71
|
-
if (allPropertiesObj) {
|
|
72
|
-
return allPropertiesObj['AllProperties'];
|
|
73
|
-
}
|
|
74
|
-
throw 'Cannot proceed. AllProperties not found'; // this is not supposed to happen
|
|
55
|
+
const res = await request.post(requestOptions);
|
|
56
|
+
if (this.verbose) {
|
|
57
|
+
await logger.logToStderr('Attempt to get AllProperties key values');
|
|
75
58
|
}
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
const json = JSON.parse(res);
|
|
60
|
+
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
61
|
+
if (contents && contents.ErrorInfo) {
|
|
62
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
78
63
|
}
|
|
64
|
+
const allPropertiesObj = json.find(x => { return x['AllProperties']; });
|
|
65
|
+
if (allPropertiesObj) {
|
|
66
|
+
return allPropertiesObj['AllProperties'];
|
|
67
|
+
}
|
|
68
|
+
throw 'Cannot proceed. AllProperties not found'; // this is not supposed to happen
|
|
79
69
|
}
|
|
80
70
|
/**
|
|
81
71
|
* The property bag item data returned from the client.svc/ProcessQuery response
|
|
@@ -122,19 +112,14 @@ export class SpoPropertyBagBaseCommand extends SpoCommand {
|
|
|
122
112
|
},
|
|
123
113
|
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><Method Name="SetFieldValue" Id="206" ObjectPathId="205"><Parameters><Parameter Type="String">${formatting.escapeXml(name)}</Parameter><Parameter Type="String">${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>`
|
|
124
114
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
return res;
|
|
134
|
-
}
|
|
115
|
+
const res = await request.post(requestOptions);
|
|
116
|
+
const json = JSON.parse(res);
|
|
117
|
+
const contents = json.find(x => { return x['ErrorInfo']; });
|
|
118
|
+
if (contents && contents.ErrorInfo) {
|
|
119
|
+
throw contents.ErrorInfo.ErrorMessage || 'ClientSvc unknown error';
|
|
135
120
|
}
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
else {
|
|
122
|
+
return res;
|
|
138
123
|
}
|
|
139
124
|
}
|
|
140
125
|
/**
|
|
@@ -146,13 +131,8 @@ export class SpoPropertyBagBaseCommand extends SpoCommand {
|
|
|
146
131
|
* @param cmd command instance
|
|
147
132
|
*/
|
|
148
133
|
static async isNoScriptSite(webUrl, formDigest, webIdentityResp, logger, debug) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return basePermissionsResp.has(PermissionKind.AddAndCustomizePages) === false;
|
|
152
|
-
}
|
|
153
|
-
catch (err) {
|
|
154
|
-
throw err;
|
|
155
|
-
}
|
|
134
|
+
const basePermissionsResp = await spo.getEffectiveBasePermissions(webIdentityResp.objectIdentity, webUrl, formDigest, logger, debug);
|
|
135
|
+
return basePermissionsResp.has(PermissionKind.AddAndCustomizePages) === false;
|
|
156
136
|
}
|
|
157
137
|
}
|
|
158
138
|
//# sourceMappingURL=propertybag-base.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { spo } from '../../../../utils/spo.js';
|
|
8
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { odata } from '../../../../utils/odata.js';
|
|
11
|
+
import { cli } from '../../../../cli/cli.js';
|
|
12
|
+
export const options = globalOptionsZod
|
|
13
|
+
.extend({
|
|
14
|
+
webUrl: zod.alias('u', z.string()
|
|
15
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
16
|
+
message: `'${url}' is not a valid SharePoint site URL.`
|
|
17
|
+
}))),
|
|
18
|
+
listId: z.string()
|
|
19
|
+
.refine(id => validation.isValidGuid(id), id => ({
|
|
20
|
+
message: `'${id}' is not a valid GUID.`
|
|
21
|
+
})).optional(),
|
|
22
|
+
listUrl: z.string().optional(),
|
|
23
|
+
listTitle: z.string().optional(),
|
|
24
|
+
userName: z.string().refine(upn => validation.isValidUserPrincipalName(upn), upn => ({
|
|
25
|
+
message: `'${upn}' is not a valid UPN.`
|
|
26
|
+
})).optional(),
|
|
27
|
+
userId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
28
|
+
message: `'${id}' is not a valid GUID.`
|
|
29
|
+
})).optional()
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
class SpoSiteAlertListCommand extends SpoCommand {
|
|
33
|
+
get name() {
|
|
34
|
+
return commands.SITE_ALERT_LIST;
|
|
35
|
+
}
|
|
36
|
+
get description() {
|
|
37
|
+
return 'Lists all SharePoint list alerts';
|
|
38
|
+
}
|
|
39
|
+
defaultProperties() {
|
|
40
|
+
return ['ID', 'Title', 'UserPrincipalName'];
|
|
41
|
+
}
|
|
42
|
+
get schema() {
|
|
43
|
+
return options;
|
|
44
|
+
}
|
|
45
|
+
getRefinedSchema(schema) {
|
|
46
|
+
return schema
|
|
47
|
+
.refine(options => [options.listId, options.listUrl, options.listTitle].filter(x => x !== undefined).length <= 1, {
|
|
48
|
+
message: `Specify either listId, listUrl, or listTitle, but not more than one.`
|
|
49
|
+
})
|
|
50
|
+
.refine(options => [options.userName, options.userId].filter(x => x !== undefined).length <= 1, {
|
|
51
|
+
message: `Specify either userName or userId, but not both.`
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async commandAction(logger, args) {
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
const listParams = args.options.listId || args.options.listTitle || args.options.listUrl;
|
|
57
|
+
const userParams = args.options.userName || args.options.userId;
|
|
58
|
+
let message = `Retrieving alerts from site '${args.options.webUrl}'`;
|
|
59
|
+
if (listParams) {
|
|
60
|
+
message += ` for list '${listParams}'`;
|
|
61
|
+
}
|
|
62
|
+
if (userParams) {
|
|
63
|
+
message += `${listParams ? ' and' : ''} for user '${userParams}'`;
|
|
64
|
+
}
|
|
65
|
+
await logger.logToStderr(`${message}...`);
|
|
66
|
+
}
|
|
67
|
+
let requestUrl = `${args.options.webUrl}/_api/web/alerts?$expand=List,User,List/Rootfolder,Item&$select=*,List/Id,List/Title,List/Rootfolder/ServerRelativeUrl,Item/ID,Item/FileRef,Item/Guid`;
|
|
68
|
+
const filters = [];
|
|
69
|
+
let listId;
|
|
70
|
+
if (args.options.listId) {
|
|
71
|
+
listId = args.options.listId;
|
|
72
|
+
}
|
|
73
|
+
else if (args.options.listUrl || args.options.listTitle) {
|
|
74
|
+
listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
|
|
75
|
+
}
|
|
76
|
+
if (listId) {
|
|
77
|
+
filters.push(`List/Id eq guid'${formatting.encodeQueryParameter(listId)}'`);
|
|
78
|
+
}
|
|
79
|
+
if (args.options.userName) {
|
|
80
|
+
filters.push(`User/UserPrincipalName eq '${formatting.encodeQueryParameter(args.options.userName)}'`);
|
|
81
|
+
}
|
|
82
|
+
else if (args.options.userId) {
|
|
83
|
+
const userPrincipalName = await entraUser.getUpnByUserId(args.options.userId);
|
|
84
|
+
filters.push(`User/UserPrincipalName eq '${formatting.encodeQueryParameter(userPrincipalName)}'`);
|
|
85
|
+
}
|
|
86
|
+
if (filters.length > 0) {
|
|
87
|
+
requestUrl += `&$filter=${filters.join(' and ')}`;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const res = await odata.getAllItems(requestUrl);
|
|
91
|
+
res.forEach(alert => {
|
|
92
|
+
if (alert.Item) {
|
|
93
|
+
delete alert.Item['ID'];
|
|
94
|
+
}
|
|
95
|
+
if (cli.shouldTrimOutput(args.options.output)) {
|
|
96
|
+
alert.UserPrincipalName = alert.User?.UserPrincipalName;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
await logger.log(res);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
this.handleRejectedODataJsonPromise(err);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export default new SpoSiteAlertListCommand();
|
|
107
|
+
//# sourceMappingURL=site-alert-list.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { cli } from '../../../../cli/cli.js';
|
|
10
|
+
const options = globalOptionsZod
|
|
11
|
+
.extend({
|
|
12
|
+
webUrl: zod.alias('u', z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
14
|
+
message: `'${url}' is not a valid SharePoint URL.`
|
|
15
|
+
}))),
|
|
16
|
+
id: z.string()
|
|
17
|
+
.refine(id => validation.isValidGuid(id), id => ({
|
|
18
|
+
message: `'${id}' is not a valid GUID.`
|
|
19
|
+
})),
|
|
20
|
+
force: zod.alias('f', z.boolean().optional())
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
class SpoSiteAlertRemoveCommand extends SpoCommand {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands.SITE_ALERT_REMOVE;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Removes an alert from a SharePoint list';
|
|
29
|
+
}
|
|
30
|
+
get schema() {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
async commandAction(logger, args) {
|
|
34
|
+
if (!args.options.force) {
|
|
35
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the alert with id '${args.options.id}' from site '${args.options.webUrl}'?` });
|
|
36
|
+
if (!result) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
if (this.verbose) {
|
|
42
|
+
await logger.logToStderr(`Removing alert with ID '${args.options.id}' from site '${args.options.webUrl}'...`);
|
|
43
|
+
}
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
url: `${args.options.webUrl}/_api/web/Alerts/DeleteAlert('${formatting.encodeQueryParameter(args.options.id)}')`,
|
|
46
|
+
headers: {
|
|
47
|
+
accept: 'application/json;odata=nometadata'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json'
|
|
50
|
+
};
|
|
51
|
+
await request.delete(requestOptions);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export default new SpoSiteAlertRemoveCommand();
|
|
59
|
+
//# sourceMappingURL=site-alert-remove.js.map
|
|
@@ -67,24 +67,19 @@ class SpoWebReindexCommand extends SpoCommand {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async reindexLists(webUrl, requestDigest, logger, webIdentityResp) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
await logger.logToStderr(`Retrieving information about lists...`);
|
|
73
|
-
}
|
|
74
|
-
const requestOptions = {
|
|
75
|
-
url: `${webUrl}/_api/web/lists?$select=NoCrawl,Title,RootFolder/Properties,RootFolder/ServerRelativeUrl&$expand=RootFolder/Properties`,
|
|
76
|
-
headers: {
|
|
77
|
-
'accept': 'application/json;odata=nometadata'
|
|
78
|
-
},
|
|
79
|
-
responseType: 'json'
|
|
80
|
-
};
|
|
81
|
-
const lists = await request.get(requestOptions);
|
|
82
|
-
const promises = lists.value.map(l => this.reindexList(l, webUrl, requestDigest, webIdentityResp, logger));
|
|
83
|
-
await Promise.all(promises);
|
|
84
|
-
}
|
|
85
|
-
catch (err) {
|
|
86
|
-
throw err;
|
|
70
|
+
if (this.debug) {
|
|
71
|
+
await logger.logToStderr(`Retrieving information about lists...`);
|
|
87
72
|
}
|
|
73
|
+
const requestOptions = {
|
|
74
|
+
url: `${webUrl}/_api/web/lists?$select=NoCrawl,Title,RootFolder/Properties,RootFolder/ServerRelativeUrl&$expand=RootFolder/Properties`,
|
|
75
|
+
headers: {
|
|
76
|
+
'accept': 'application/json;odata=nometadata'
|
|
77
|
+
},
|
|
78
|
+
responseType: 'json'
|
|
79
|
+
};
|
|
80
|
+
const lists = await request.get(requestOptions);
|
|
81
|
+
const promises = lists.value.map(l => this.reindexList(l, webUrl, requestDigest, webIdentityResp, logger));
|
|
82
|
+
await Promise.all(promises);
|
|
88
83
|
}
|
|
89
84
|
async reindexList(list, webUrl, requestDigest, webIdentityResp, logger) {
|
|
90
85
|
if (list.NoCrawl) {
|
|
@@ -93,16 +88,11 @@ class SpoWebReindexCommand extends SpoCommand {
|
|
|
93
88
|
}
|
|
94
89
|
return;
|
|
95
90
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
throw (err);
|
|
105
|
-
}
|
|
91
|
+
const folderIdentityResp = await spo.getFolderIdentity(webIdentityResp.objectIdentity, webUrl, list.RootFolder.ServerRelativeUrl, requestDigest);
|
|
92
|
+
let searchversion = list.RootFolder.Properties.vti_x005f_searchversion || 0;
|
|
93
|
+
searchversion++;
|
|
94
|
+
await SpoPropertyBagBaseCommand.setProperty('vti_searchversion', searchversion.toString(), webUrl, requestDigest, folderIdentityResp, logger, this.debug, list.RootFolder.ServerRelativeUrl);
|
|
95
|
+
return;
|
|
106
96
|
}
|
|
107
97
|
}
|
|
108
98
|
_SpoWebReindexCommand_instances = new WeakSet(), _SpoWebReindexCommand_initOptions = function _SpoWebReindexCommand_initOptions() {
|
|
@@ -257,6 +257,8 @@ export default {
|
|
|
257
257
|
SITE_ADMIN_ADD: `${prefix} site admin add`,
|
|
258
258
|
SITE_ADMIN_LIST: `${prefix} site admin list`,
|
|
259
259
|
SITE_ADMIN_REMOVE: `${prefix} site admin remove`,
|
|
260
|
+
SITE_ALERT_LIST: `${prefix} site alert list`,
|
|
261
|
+
SITE_ALERT_REMOVE: `${prefix} site alert remove`,
|
|
260
262
|
SITE_APPCATALOG_ADD: `${prefix} site appcatalog add`,
|
|
261
263
|
SITE_APPCATALOG_LIST: `${prefix} site appcatalog list`,
|
|
262
264
|
SITE_APPCATALOG_REMOVE: `${prefix} site appcatalog remove`,
|
|
@@ -70,9 +70,15 @@ class TeamsTabAddCommand extends GraphCommand {
|
|
|
70
70
|
if (options.contentUrl) {
|
|
71
71
|
requestBody.configuration.contentUrl = options.contentUrl;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
if (options.entityId) {
|
|
74
|
+
requestBody.configuration.entityId = options.entityId;
|
|
75
|
+
}
|
|
76
|
+
if (options.removeUrl) {
|
|
77
|
+
requestBody.configuration.removeUrl = options.removeUrl;
|
|
78
|
+
}
|
|
79
|
+
if (options.websiteUrl) {
|
|
80
|
+
requestBody.configuration.websiteUrl = options.websiteUrl;
|
|
81
|
+
}
|
|
76
82
|
Object.keys(options).forEach(key => {
|
|
77
83
|
if (excludeOptions.indexOf(key) === -1) {
|
|
78
84
|
requestBody.configuration[key] = `${options[key]}`;
|
|
@@ -44,7 +44,7 @@ class VivaConnectionsAppCreateCommand extends AnonymousCommand {
|
|
|
44
44
|
const appPortalUrl = `${args.options.portalUrl}${args.options.portalUrl.indexOf('?') > -1 ? '&' : '?'}app=portals`;
|
|
45
45
|
let searchUrlPath = portalUrl.hostname;
|
|
46
46
|
if (portalUrl.pathname.indexOf('/teams') > -1 || portalUrl.pathname.indexOf('/sites') > -1) {
|
|
47
|
-
const firstTwoUrlSegments = portalUrl.pathname.match(/^\/[
|
|
47
|
+
const firstTwoUrlSegments = portalUrl.pathname.match(/^\/[^/]+\/[^/]+/);
|
|
48
48
|
if (firstTwoUrlSegments) {
|
|
49
49
|
searchUrlPath += firstTwoUrlSegments[0];
|
|
50
50
|
}
|
|
@@ -48,7 +48,7 @@ class VivaEngageCommunityUserAddCommand extends GraphCommand {
|
|
|
48
48
|
.refine(options => options.ids || options.userNames, {
|
|
49
49
|
message: 'Specify either of ids or userNames.'
|
|
50
50
|
})
|
|
51
|
-
.refine(options =>
|
|
51
|
+
.refine(options => options.userNames !== undefined || options.ids !== undefined, {
|
|
52
52
|
message: 'Specify either ids or userNames, but not both.'
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -48,7 +48,7 @@ class VivaEngageCommunityUserRemoveCommand extends GraphCommand {
|
|
|
48
48
|
.refine(options => options.id || options.userName, {
|
|
49
49
|
message: 'Specify either of id or userName.'
|
|
50
50
|
})
|
|
51
|
-
.refine(options =>
|
|
51
|
+
.refine(options => options.userName !== undefined || options.id !== undefined, {
|
|
52
52
|
message: 'Specify either id or userName, but not both.'
|
|
53
53
|
});
|
|
54
54
|
}
|
package/dist/telemetry.js
CHANGED
|
@@ -16,6 +16,7 @@ export const accessToken = {
|
|
|
16
16
|
isAppOnlyAccessToken = token.idtyp === 'app';
|
|
17
17
|
}
|
|
18
18
|
catch {
|
|
19
|
+
// Do nothing
|
|
19
20
|
}
|
|
20
21
|
return isAppOnlyAccessToken;
|
|
21
22
|
},
|
|
@@ -34,6 +35,7 @@ export const accessToken = {
|
|
|
34
35
|
tenantId = token.tid;
|
|
35
36
|
}
|
|
36
37
|
catch {
|
|
38
|
+
// Do nothing
|
|
37
39
|
}
|
|
38
40
|
return tenantId;
|
|
39
41
|
},
|
|
@@ -54,6 +56,7 @@ export const accessToken = {
|
|
|
54
56
|
userName = token.upn || token.app_displayname;
|
|
55
57
|
}
|
|
56
58
|
catch {
|
|
59
|
+
// Do nothing
|
|
57
60
|
}
|
|
58
61
|
return userName;
|
|
59
62
|
},
|
|
@@ -72,6 +75,7 @@ export const accessToken = {
|
|
|
72
75
|
userId = token.oid;
|
|
73
76
|
}
|
|
74
77
|
catch {
|
|
78
|
+
// Do nothing
|
|
75
79
|
}
|
|
76
80
|
return userId;
|
|
77
81
|
},
|
package/dist/utils/cache.js
CHANGED
|
@@ -28,7 +28,9 @@ export const cache = {
|
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29
29
|
fs.writeFile(cacheFilePath, value, () => { });
|
|
30
30
|
}
|
|
31
|
-
catch {
|
|
31
|
+
catch {
|
|
32
|
+
// Do nothing
|
|
33
|
+
}
|
|
32
34
|
},
|
|
33
35
|
clearExpired(cb) {
|
|
34
36
|
// we don't need to wait for this to complete
|
|
@@ -58,7 +60,6 @@ export const cache = {
|
|
|
58
60
|
// remove files that haven't been accessed in the last 24 hours
|
|
59
61
|
if (stats.atime.getTime() < Date.now() - 24 * 60 * 60 * 1000) {
|
|
60
62
|
// we don't need to wait for the file to be deleted
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
62
63
|
fs.unlink(path.join(cacheFolderPath, file), () => {
|
|
63
64
|
if (cb && index === numFiles - 1) {
|
|
64
65
|
cb();
|
|
@@ -16,7 +16,7 @@ export const customAppScope = {
|
|
|
16
16
|
}
|
|
17
17
|
const customAppScopes = await odata.getAllItems(url);
|
|
18
18
|
if (customAppScopes.length === 0) {
|
|
19
|
-
throw `The specified custom application scope '${displayName}' does not exist
|
|
19
|
+
throw new Error(`The specified custom application scope '${displayName}' does not exist.`);
|
|
20
20
|
}
|
|
21
21
|
if (customAppScopes.length > 1) {
|
|
22
22
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', customAppScopes);
|
|
@@ -16,7 +16,7 @@ export const directoryExtension = {
|
|
|
16
16
|
}
|
|
17
17
|
const extensionProperties = await odata.getAllItems(url);
|
|
18
18
|
if (extensionProperties.length === 0) {
|
|
19
|
-
throw `The specified directory extension '${name}' does not exist
|
|
19
|
+
throw new Error(`The specified directory extension '${name}' does not exist.`);
|
|
20
20
|
}
|
|
21
21
|
// there can be only one directory extension with a given name
|
|
22
22
|
return extensionProperties[0];
|
|
@@ -24,7 +24,7 @@ export const entraAdministrativeUnit = {
|
|
|
24
24
|
const graphResource = 'https://graph.microsoft.com';
|
|
25
25
|
const administrativeUnits = await odata.getAllItems(`${graphResource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'${queryString}`);
|
|
26
26
|
if (administrativeUnits.length === 0) {
|
|
27
|
-
throw `The specified administrative unit '${displayName}' does not exist
|
|
27
|
+
throw new Error(`The specified administrative unit '${displayName}' does not exist.`);
|
|
28
28
|
}
|
|
29
29
|
if (administrativeUnits.length > 1) {
|
|
30
30
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', administrativeUnits);
|
package/dist/utils/entraApp.js
CHANGED
|
@@ -305,7 +305,7 @@ export const entraApp = {
|
|
|
305
305
|
}
|
|
306
306
|
const apps = await odata.getAllItems(url);
|
|
307
307
|
if (apps.length === 0) {
|
|
308
|
-
throw `App with appId '${appId}' not found in Microsoft Entra ID
|
|
308
|
+
throw new Error(`App with appId '${appId}' not found in Microsoft Entra ID.`);
|
|
309
309
|
}
|
|
310
310
|
return apps[0];
|
|
311
311
|
},
|
|
@@ -316,7 +316,7 @@ export const entraApp = {
|
|
|
316
316
|
}
|
|
317
317
|
const apps = await odata.getAllItems(url);
|
|
318
318
|
if (apps.length === 0) {
|
|
319
|
-
throw `App with name '${appName}' not found in Microsoft Entra ID
|
|
319
|
+
throw new Error(`App with name '${appName}' not found in Microsoft Entra ID.`);
|
|
320
320
|
}
|
|
321
321
|
if (apps.length > 1) {
|
|
322
322
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', apps);
|
|
@@ -12,7 +12,7 @@ export const entraDevice = {
|
|
|
12
12
|
async getDeviceByDisplayName(displayName) {
|
|
13
13
|
const devices = await odata.getAllItems(`${graphResource}/v1.0/devices?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
14
14
|
if (devices.length === 0) {
|
|
15
|
-
throw `The specified device '${displayName}' does not exist
|
|
15
|
+
throw new Error(`The specified device '${displayName}' does not exist.`);
|
|
16
16
|
}
|
|
17
17
|
if (devices.length > 1) {
|
|
18
18
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', devices);
|
|
@@ -17,7 +17,7 @@ export const entraServicePrincipal = {
|
|
|
17
17
|
}
|
|
18
18
|
const apps = await odata.getAllItems(url);
|
|
19
19
|
if (apps.length === 0) {
|
|
20
|
-
throw `Service principal with appId '${appId}' not found in Microsoft Entra ID
|
|
20
|
+
throw new Error(`Service principal with appId '${appId}' not found in Microsoft Entra ID.`);
|
|
21
21
|
}
|
|
22
22
|
return apps[0];
|
|
23
23
|
},
|
|
@@ -35,7 +35,7 @@ export const entraServicePrincipal = {
|
|
|
35
35
|
}
|
|
36
36
|
const apps = await odata.getAllItems(url);
|
|
37
37
|
if (apps.length === 0) {
|
|
38
|
-
throw `Service principal with name '${appName}' not found in Microsoft Entra ID
|
|
38
|
+
throw new Error(`Service principal with name '${appName}' not found in Microsoft Entra ID.`);
|
|
39
39
|
}
|
|
40
40
|
if (apps.length > 1) {
|
|
41
41
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', apps);
|
package/dist/utils/formatting.js
CHANGED
package/dist/utils/md.js
CHANGED
|
@@ -32,7 +32,7 @@ function convertDd(md) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function convertHyperlinks(md) {
|
|
35
|
-
return md.replace(/(?!\[1m)(?!\[22m)\[([^\]]+)\]\(([
|
|
35
|
+
return md.replace(/(?!\[1m)(?!\[22m)\[([^\]]+)\]\(([^)]+)\)/gm, (match, label, url) => {
|
|
36
36
|
// if the link is the same as the content, return just the link
|
|
37
37
|
if (label === url) {
|
|
38
38
|
return url;
|
|
@@ -54,7 +54,7 @@ function convertContentTabs(md) {
|
|
|
54
54
|
.trim();
|
|
55
55
|
}
|
|
56
56
|
function convertCodeFences(md) {
|
|
57
|
-
const regex =
|
|
57
|
+
const regex = /^```.*?(?:\r?\n)(.*?)```(?:\r?\n)/gms;
|
|
58
58
|
return md.replace(regex, (match, code) => {
|
|
59
59
|
return `${code.replace(/^(.+)$/gm, ' $1')}${EOL}`;
|
|
60
60
|
});
|
package/dist/utils/odata.js
CHANGED
package/dist/utils/planner.js
CHANGED
|
@@ -39,7 +39,7 @@ export const powerPlatform = {
|
|
|
39
39
|
const response = await request.get(requestOptions);
|
|
40
40
|
return response;
|
|
41
41
|
}
|
|
42
|
-
catch
|
|
42
|
+
catch {
|
|
43
43
|
throw Error(`The specified Power Page website with id '${id}' does not exist.`);
|
|
44
44
|
}
|
|
45
45
|
},
|
|
@@ -97,7 +97,7 @@ export const powerPlatform = {
|
|
|
97
97
|
*/
|
|
98
98
|
async getSolutionByName(dynamicsApiUrl, name) {
|
|
99
99
|
const requestOptions = {
|
|
100
|
-
url: `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq
|
|
100
|
+
url: `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq '${name}'&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`,
|
|
101
101
|
headers: {
|
|
102
102
|
accept: 'application/json;odata.metadata=none'
|
|
103
103
|
},
|