@pnp/cli-microsoft365 6.7.0 → 6.8.0-beta.00c3a00
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/.eslintrc.js +2 -0
- package/.mocharc.json +1 -0
- package/README.md +6 -1
- package/dist/Command.js +6 -0
- package/dist/chili/chili.js +298 -0
- package/dist/chili/index.js +20 -0
- package/dist/cli/Cli.js +2 -2
- package/dist/m365/aad/commands/user/user-add.js +30 -21
- package/dist/m365/app/commands/permission/permission-add.js +279 -0
- package/dist/m365/app/commands.js +1 -0
- package/dist/m365/commands/commands.js +2 -0
- package/dist/m365/commands/docs.js +42 -0
- package/dist/m365/commands/login.js +1 -1
- package/dist/m365/commands/setup.js +180 -0
- package/dist/m365/commands/setupPresets.js +25 -0
- package/dist/m365/pa/commands/app/app-consent-set.js +101 -0
- package/dist/m365/pa/commands.js +1 -0
- package/dist/m365/planner/commands/roster/roster-plan-list.js +102 -0
- package/dist/m365/planner/commands.js +1 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +97 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +85 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +89 -0
- package/dist/m365/purview/commands.js +3 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +14 -30
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +146 -0
- package/dist/m365/spo/commands/file/file-checkin.js +8 -3
- package/dist/m365/spo/commands/file/file-checkout.js +8 -3
- package/dist/m365/spo/commands/file/file-copy.js +4 -4
- package/dist/m365/spo/commands/file/file-get.js +3 -1
- package/dist/m365/spo/commands/file/file-list.js +17 -6
- package/dist/m365/spo/commands/file/file-move.js +6 -7
- package/dist/m365/spo/commands/file/file-remove.js +6 -12
- package/dist/m365/spo/commands/file/file-rename.js +3 -3
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +2 -1
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +3 -3
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +2 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +2 -1
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -2
- package/dist/m365/spo/commands/file/file-version-clear.js +3 -1
- package/dist/m365/spo/commands/file/file-version-get.js +3 -1
- package/dist/m365/spo/commands/file/file-version-remove.js +3 -1
- package/dist/m365/spo/commands/file/file-version-restore.js +3 -1
- package/dist/m365/spo/commands/folder/folder-copy.js +4 -4
- package/dist/m365/spo/commands/folder/folder-get.js +5 -2
- package/dist/m365/spo/commands/folder/folder-move.js +3 -2
- package/dist/m365/spo/commands/folder/folder-rename.js +5 -2
- package/dist/m365/spo/commands/list/list-get.js +30 -3
- package/dist/m365/spo/commands/list/list-list.js +39 -2
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +308 -0
- package/dist/m365/spo/commands/page/page-section-add.js +2 -3
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +46 -1
- package/dist/m365/spo/commands/site/site-recyclebinitem-move.js +119 -0
- package/dist/m365/spo/commands/site/site-recyclebinitem-remove.js +106 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +30 -39
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +47 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +151 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +152 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +203 -0
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -0
- package/dist/m365/spo/commands/term/term-add.js +13 -4
- package/dist/m365/spo/commands/term/term-get.js +14 -5
- package/dist/m365/spo/commands/term/term-group-get.js +12 -3
- package/dist/m365/spo/commands/term/term-group-list.js +39 -4
- package/dist/m365/spo/commands/term/term-list.js +18 -9
- package/dist/m365/spo/commands/term/term-set-add.js +13 -4
- package/dist/m365/spo/commands/term/term-set-get.js +12 -3
- package/dist/m365/spo/commands/term/term-set-list.js +12 -3
- package/dist/m365/spo/commands.js +9 -0
- package/dist/m365/teams/commands/chat/chat-member-remove.js +137 -0
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +124 -0
- package/dist/m365/teams/commands.js +2 -0
- package/dist/utils/formatting.js +35 -11
- package/dist/utils/pid.js +5 -0
- package/dist/utils/spo.js +1 -1
- package/docs/docs/cmd/aad/o365group/o365group-get.md +0 -12
- package/docs/docs/cmd/aad/user/user-add.md +4 -0
- package/docs/docs/cmd/aad/user/user-set.md +2 -2
- package/docs/docs/cmd/app/permission/permission-add.md +53 -0
- package/docs/docs/cmd/cli/cli-consent.md +6 -0
- package/docs/docs/cmd/cli/cli-doctor.md +17 -0
- package/docs/docs/cmd/cli/cli-issue.md +6 -0
- package/docs/docs/cmd/cli/cli-reconsent.md +6 -0
- package/docs/docs/cmd/cli/completion/completion-sh-setup.md +6 -0
- package/docs/docs/cmd/cli/config/config-get.md +6 -0
- package/docs/docs/cmd/docs.md +51 -0
- package/docs/docs/cmd/flow/environment/environment-list.md +18 -0
- package/docs/docs/cmd/flow/flow-get.md +20 -0
- package/docs/docs/cmd/flow/flow-list.md +17 -0
- package/docs/docs/cmd/graph/changelog/changelog-list.md +52 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-add.md +61 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-get.md +61 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-list.md +61 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-remove.md +4 -0
- package/docs/docs/cmd/graph/schemaextension/schemaextension-set.md +4 -0
- package/docs/docs/cmd/graph/subscription/subscription-add.md +73 -0
- package/docs/docs/cmd/login.md +1 -1
- package/docs/docs/cmd/onedrive/onedrive-list.md +225 -0
- package/docs/docs/cmd/onedrive/report/report-activityfilecounts.md +39 -0
- package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +39 -0
- package/docs/docs/cmd/onedrive/report/report-activityuserdetail.md +43 -0
- package/docs/docs/cmd/onedrive/report/report-usageaccountcounts.md +38 -0
- package/docs/docs/cmd/onedrive/report/report-usageaccountdetail.md +43 -0
- package/docs/docs/cmd/onedrive/report/report-usagefilecounts.md +38 -0
- package/docs/docs/cmd/onedrive/report/report-usagestorage.md +37 -0
- package/docs/docs/cmd/onenote/notebook/notebook-list.md +79 -0
- package/docs/docs/cmd/pa/app/app-consent-set.md +47 -0
- package/docs/docs/cmd/planner/plan/plan-get.md +1 -1
- package/docs/docs/cmd/planner/plan/plan-list.md +1 -1
- package/docs/docs/cmd/planner/roster/roster-add.md +2 -1
- package/docs/docs/cmd/planner/roster/roster-get.md +1 -1
- package/docs/docs/cmd/planner/roster/roster-plan-list.md +109 -0
- package/docs/docs/cmd/planner/roster/roster-remove.md +2 -1
- package/docs/docs/cmd/planner/task/task-get.md +0 -6
- package/docs/docs/cmd/planner/task/task-set.md +1 -1
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +6 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +6 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +4 -4
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +4 -4
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +11 -11
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +10 -10
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +10 -10
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -12
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +8 -9
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +8 -9
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +8 -8
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +8 -8
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.md +118 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.md +111 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.md +97 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +17 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-list.md +17 -0
- package/docs/docs/cmd/setup.md +86 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.md +77 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-set.md +2 -2
- package/docs/docs/cmd/spo/customaction/customaction-add.md +1 -1
- package/docs/docs/cmd/spo/customaction/customaction-set.md +1 -1
- package/docs/docs/cmd/spo/feature/feature-enable.md +2 -2
- package/docs/docs/cmd/spo/file/file-add.md +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.md +1 -1
- package/docs/docs/cmd/spo/file/file-checkout.md +1 -1
- package/docs/docs/cmd/spo/file/file-copy.md +1 -1
- package/docs/docs/cmd/spo/file/file-get.md +1 -1
- package/docs/docs/cmd/spo/file/file-list.md +9 -6
- package/docs/docs/cmd/spo/file/file-move.md +3 -3
- package/docs/docs/cmd/spo/file/file-remove.md +12 -0
- package/docs/docs/cmd/spo/file/file-rename.md +1 -1
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.md +2 -2
- package/docs/docs/cmd/spo/file/file-roleassignment-add.md +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.md +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-add.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.md +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.md +2 -2
- package/docs/docs/cmd/spo/file/file-version-get.md +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.md +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.md +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.md +1 -1
- package/docs/docs/cmd/spo/folder/folder-add.md +9 -3
- package/docs/docs/cmd/spo/folder/folder-copy.md +2 -2
- package/docs/docs/cmd/spo/folder/folder-get.md +7 -7
- package/docs/docs/cmd/spo/folder/folder-list.md +11 -11
- package/docs/docs/cmd/spo/folder/folder-move.md +1 -1
- package/docs/docs/cmd/spo/folder/folder-remove.md +7 -7
- package/docs/docs/cmd/spo/folder/folder-rename.md +11 -5
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.md +3 -3
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.md +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.md +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +4 -4
- package/docs/docs/cmd/spo/list/list-get.md +10 -0
- package/docs/docs/cmd/spo/list/list-list.md +28 -0
- package/docs/docs/cmd/spo/listitem/listitem-batch-set.md +67 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +19 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +12 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +6 -0
- package/docs/docs/cmd/spo/page/page-column-get.md +15 -0
- package/docs/docs/cmd/spo/page/page-column-list.md +16 -0
- package/docs/docs/cmd/spo/page/page-control-get.md +18 -0
- package/docs/docs/cmd/spo/page/page-control-list.md +18 -0
- package/docs/docs/cmd/spo/page/page-copy.md +35 -0
- package/docs/docs/cmd/spo/page/page-get.md +39 -0
- package/docs/docs/cmd/spo/page/page-list.md +53 -0
- package/docs/docs/cmd/spo/page/page-section-get.md +12 -0
- package/docs/docs/cmd/spo/page/page-section-list.md +13 -0
- package/docs/docs/cmd/spo/page/page-template-list.md +31 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-get.md +6 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-list.md +13 -0
- package/docs/docs/cmd/spo/report/report-activityfilecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-activitypages.md +7 -0
- package/docs/docs/cmd/spo/report/report-activityusercounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-activityuserdetail.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagedetail.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagefilecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagepages.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagesitecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagestorage.md +7 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-get.md +20 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-list.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-add.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.md +18 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-approve.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-list.md +17 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.md +13 -0
- package/docs/docs/cmd/spo/site/site-recyclebinitem-move.md +43 -0
- package/docs/docs/cmd/spo/site/site-recyclebinitem-remove.md +45 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.md +103 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.md +49 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.md +49 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.md +57 -0
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +57 -54
- package/docs/docs/cmd/spo/term/term-add.md +107 -6
- package/docs/docs/cmd/spo/term/term-get.md +111 -10
- package/docs/docs/cmd/spo/term/term-group-get.md +71 -5
- package/docs/docs/cmd/spo/term/term-group-list.md +70 -2
- package/docs/docs/cmd/spo/term/term-list.md +80 -8
- package/docs/docs/cmd/spo/term/term-set-add.md +95 -11
- package/docs/docs/cmd/spo/term/term-set-get.md +92 -8
- package/docs/docs/cmd/spo/term/term-set-list.md +85 -5
- package/docs/docs/cmd/teams/app/app-list.md +17 -0
- package/docs/docs/cmd/teams/app/app-publish.md +18 -1
- package/docs/docs/cmd/teams/channel/channel-add.md +20 -0
- package/docs/docs/cmd/teams/channel/channel-get.md +21 -0
- package/docs/docs/cmd/teams/channel/channel-list.md +21 -0
- package/docs/docs/cmd/teams/channel/channel-member-list.md +20 -0
- package/docs/docs/cmd/teams/channel/channel-member-set.md +21 -0
- package/docs/docs/cmd/teams/chat/chat-get.md +22 -0
- package/docs/docs/cmd/teams/chat/chat-list.md +22 -0
- package/docs/docs/cmd/teams/chat/chat-member-list.md +20 -0
- package/docs/docs/cmd/teams/chat/chat-member-remove.md +52 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.md +23 -0
- package/docs/docs/cmd/teams/funsettings/funsettings-list.md +15 -0
- package/docs/docs/cmd/teams/guestsettings/guestsettings-list.md +13 -0
- package/docs/docs/cmd/teams/meeting/meeting-transcript-list.md +96 -0
- package/docs/docs/cmd/teams/membersettings/membersettings-list.md +17 -0
- package/docs/docs/cmd/teams/tab/tab-remove.md +1 -1
- package/docs/docs/cmd/version.md +1 -1
- package/docs/docs/cmd/yammer/group/group-list.md +42 -0
- package/docs/docs/cmd/yammer/message/message-add.md +32 -0
- package/docs/docs/cmd/yammer/message/message-get.md +32 -0
- package/docs/docs/cmd/yammer/message/message-list.md +34 -0
- package/docs/docs/cmd/yammer/network/network-list.md +70 -0
- package/docs/docs/cmd/yammer/report/report-activitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-activityuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.md +7 -0
- package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.md +7 -0
- package/docs/docs/cmd/yammer/user/user-get.md +55 -0
- package/docs/docs/cmd/yammer/user/user-list.md +55 -0
- package/docs/docs/cmd/yammer/yammer-search.md +15 -3
- package/npm-shrinkwrap.json +269 -336
- package/package.json +15 -13
|
@@ -44,22 +44,22 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
44
44
|
commandAction(logger, args) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
try {
|
|
47
|
-
const
|
|
48
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
47
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
48
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
49
49
|
if (this.verbose) {
|
|
50
50
|
logger.logToStderr(`Retrieving taxonomy term sets...`);
|
|
51
51
|
}
|
|
52
52
|
const termGroupQuery = args.options.termGroupId ? `<Method Id="77" ParentId="75" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="77" ParentId="75" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
53
53
|
const termSetQuery = args.options.termSetId ? `<Method Id="82" ParentId="80" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termSetId}}</Parameter></Parameters></Method>` : `<Method Id="82" ParentId="80" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName)}</Parameter></Parameters></Method>`;
|
|
54
54
|
const 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="70" ObjectPathId="69" /><ObjectIdentityQuery Id="71" ObjectPathId="69" /><ObjectPath Id="73" ObjectPathId="72" /><ObjectIdentityQuery Id="74" ObjectPathId="72" /><ObjectPath Id="76" ObjectPathId="75" /><ObjectPath Id="78" ObjectPathId="77" /><ObjectIdentityQuery Id="79" ObjectPathId="77" /><ObjectPath Id="81" ObjectPathId="80" /><ObjectPath Id="83" ObjectPathId="82" /><ObjectIdentityQuery Id="84" ObjectPathId="82" /><ObjectPath Id="86" ObjectPathId="85" /><Query Id="87" ObjectPathId="85"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="Name" ScalarProperty="true" /><Property Name="Id" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="69" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="72" ParentId="69" Name="GetDefaultSiteCollectionTermStore" /><Property Id="75" ParentId="72" Name="Groups" />${termGroupQuery}<Property Id="80" ParentId="77" Name="TermSets" />${termSetQuery}<Property Id="85" ParentId="82" Name="Terms" /></ObjectPaths></Request>`;
|
|
55
|
-
const result = yield this.executeCsomCall(data,
|
|
55
|
+
const result = yield this.executeCsomCall(data, spoWebUrl, res);
|
|
56
56
|
const terms = [];
|
|
57
57
|
if (result._Child_Items_ && result._Child_Items_.length > 0) {
|
|
58
58
|
for (const term of result._Child_Items_) {
|
|
59
59
|
this.setTermDetails(term);
|
|
60
60
|
terms.push(term);
|
|
61
61
|
if (args.options.includeChildTerms && term.TermsCount > 0) {
|
|
62
|
-
yield this.getChildTerms(
|
|
62
|
+
yield this.getChildTerms(spoWebUrl, res, term);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -108,17 +108,17 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
getChildTerms(
|
|
111
|
+
getChildTerms(spoWebUrl, res, parentTerm) {
|
|
112
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
113
|
parentTerm.Children = [];
|
|
114
114
|
const 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="20" ObjectPathId="19" /><Query Id="21" ObjectPathId="19"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="CustomSortOrder" ScalarProperty="true" /><Property Name="CustomProperties" ScalarProperty="true" /><Property Name="LocalCustomProperties" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><Property Id="19" ParentId="16" Name="Terms" /><Identity Id="16" Name="${parentTerm._ObjectIdentity_}" /></ObjectPaths></Request>`;
|
|
115
|
-
const result = yield this.executeCsomCall(data,
|
|
115
|
+
const result = yield this.executeCsomCall(data, spoWebUrl, res);
|
|
116
116
|
if (result._Child_Items_ && result._Child_Items_.length > 0) {
|
|
117
117
|
for (const term of result._Child_Items_) {
|
|
118
118
|
this.setTermDetails(term);
|
|
119
119
|
parentTerm.Children.push(term);
|
|
120
120
|
if (term.TermsCount > 0) {
|
|
121
|
-
yield this.getChildTerms(
|
|
121
|
+
yield this.getChildTerms(spoWebUrl, res, term);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -132,10 +132,10 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
132
132
|
parseTermDateToIsoString(dateAsString) {
|
|
133
133
|
return new Date(Number(dateAsString.replace('/Date(', '').replace(')/', ''))).toISOString();
|
|
134
134
|
}
|
|
135
|
-
executeCsomCall(data,
|
|
135
|
+
executeCsomCall(data, spoWebUrl, res) {
|
|
136
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
137
|
const requestOptions = {
|
|
138
|
-
url: `${
|
|
138
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
139
139
|
headers: {
|
|
140
140
|
'X-RequestDigest': res.FormDigestValue
|
|
141
141
|
},
|
|
@@ -154,6 +154,7 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
154
154
|
_SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry = function _SpoTermListCommand_initTelemetry() {
|
|
155
155
|
this.telemetry.push((args) => {
|
|
156
156
|
Object.assign(this.telemetryProperties, {
|
|
157
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
157
158
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
158
159
|
termGroupName: typeof args.options.termGroupName !== 'undefined',
|
|
159
160
|
termSetId: typeof args.options.termSetId !== 'undefined',
|
|
@@ -163,6 +164,8 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
163
164
|
});
|
|
164
165
|
}, _SpoTermListCommand_initOptions = function _SpoTermListCommand_initOptions() {
|
|
165
166
|
this.options.unshift({
|
|
167
|
+
option: '-u, --webUrl [webUrl]'
|
|
168
|
+
}, {
|
|
166
169
|
option: '--termGroupId [termGroupId]'
|
|
167
170
|
}, {
|
|
168
171
|
option: '--termGroupName [termGroupName]'
|
|
@@ -175,6 +178,12 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
175
178
|
});
|
|
176
179
|
}, _SpoTermListCommand_initValidators = function _SpoTermListCommand_initValidators() {
|
|
177
180
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
if (args.options.webUrl) {
|
|
182
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
183
|
+
if (isValidSharePointUrl !== true) {
|
|
184
|
+
return isValidSharePointUrl;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
178
187
|
if (args.options.termGroupId && !validation_1.validation.isValidGuid(args.options.termGroupId)) {
|
|
179
188
|
return `${args.options.termGroupId} is not a valid GUID`;
|
|
180
189
|
}
|
|
@@ -43,8 +43,8 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
43
43
|
let formDigest = '';
|
|
44
44
|
let termSet;
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
46
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
47
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
48
48
|
formDigest = res.FormDigestValue;
|
|
49
49
|
if (this.verbose) {
|
|
50
50
|
logger.logToStderr(`Adding taxonomy term set...`);
|
|
@@ -54,7 +54,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
54
54
|
`<Method Id="42" ParentId="40" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>`;
|
|
55
55
|
const termSetId = args.options.id || (0, uuid_1.v4)();
|
|
56
56
|
const requestOptionsQuery = {
|
|
57
|
-
url: `${
|
|
57
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
58
58
|
headers: {
|
|
59
59
|
'X-RequestDigest': res.FormDigestValue
|
|
60
60
|
},
|
|
@@ -96,7 +96,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
96
96
|
termSet.CustomProperties = customProperties;
|
|
97
97
|
}
|
|
98
98
|
const requestOptions = {
|
|
99
|
-
url: `${
|
|
99
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
100
100
|
headers: {
|
|
101
101
|
'X-RequestDigest': formDigest
|
|
102
102
|
},
|
|
@@ -127,6 +127,7 @@ class SpoTermSetAddCommand extends SpoCommand_1.default {
|
|
|
127
127
|
_SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelemetry = function _SpoTermSetAddCommand_initTelemetry() {
|
|
128
128
|
this.telemetry.push((args) => {
|
|
129
129
|
Object.assign(this.telemetryProperties, {
|
|
130
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
130
131
|
customProperties: typeof args.options.customProperties !== 'undefined',
|
|
131
132
|
description: typeof args.options.description !== 'undefined',
|
|
132
133
|
id: typeof args.options.id !== 'undefined',
|
|
@@ -137,6 +138,8 @@ _SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelem
|
|
|
137
138
|
}, _SpoTermSetAddCommand_initOptions = function _SpoTermSetAddCommand_initOptions() {
|
|
138
139
|
this.options.unshift({
|
|
139
140
|
option: '-n, --name <name>'
|
|
141
|
+
}, {
|
|
142
|
+
option: '-u, --webUrl [webUrl]'
|
|
140
143
|
}, {
|
|
141
144
|
option: '--termGroupId [termGroupId]'
|
|
142
145
|
}, {
|
|
@@ -150,6 +153,12 @@ _SpoTermSetAddCommand_instances = new WeakSet(), _SpoTermSetAddCommand_initTelem
|
|
|
150
153
|
});
|
|
151
154
|
}, _SpoTermSetAddCommand_initValidators = function _SpoTermSetAddCommand_initValidators() {
|
|
152
155
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
if (args.options.webUrl) {
|
|
157
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
158
|
+
if (isValidSharePointUrl !== true) {
|
|
159
|
+
return isValidSharePointUrl;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
153
162
|
if (args.options.id) {
|
|
154
163
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
155
164
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -40,15 +40,15 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
|
|
|
40
40
|
commandAction(logger, args) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
try {
|
|
43
|
-
const
|
|
44
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
43
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
44
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
45
45
|
if (this.verbose) {
|
|
46
46
|
logger.logToStderr(`Retrieving taxonomy term set...`);
|
|
47
47
|
}
|
|
48
48
|
const termGroupQuery = args.options.termGroupId ? `<Method Id="62" ParentId="60" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="62" ParentId="60" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
49
49
|
const termSetQuery = args.options.id ? `<Method Id="67" ParentId="65" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.id}}</Parameter></Parameters></Method>` : `<Method Id="67" ParentId="65" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method>`;
|
|
50
50
|
const requestOptions = {
|
|
51
|
-
url: `${
|
|
51
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
52
52
|
headers: {
|
|
53
53
|
'X-RequestDigest': res.FormDigestValue
|
|
54
54
|
},
|
|
@@ -77,6 +77,7 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
|
|
|
77
77
|
_SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelemetry = function _SpoTermSetGetCommand_initTelemetry() {
|
|
78
78
|
this.telemetry.push((args) => {
|
|
79
79
|
Object.assign(this.telemetryProperties, {
|
|
80
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
80
81
|
id: typeof args.options.id !== 'undefined',
|
|
81
82
|
name: typeof args.options.name !== 'undefined',
|
|
82
83
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
@@ -85,6 +86,8 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
|
|
|
85
86
|
});
|
|
86
87
|
}, _SpoTermSetGetCommand_initOptions = function _SpoTermSetGetCommand_initOptions() {
|
|
87
88
|
this.options.unshift({
|
|
89
|
+
option: '-u, --webUrl [webUrl]'
|
|
90
|
+
}, {
|
|
88
91
|
option: '-i, --id [id]'
|
|
89
92
|
}, {
|
|
90
93
|
option: '-n, --name [name]'
|
|
@@ -95,6 +98,12 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
|
|
|
95
98
|
});
|
|
96
99
|
}, _SpoTermSetGetCommand_initValidators = function _SpoTermSetGetCommand_initValidators() {
|
|
97
100
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
if (args.options.webUrl) {
|
|
102
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
103
|
+
if (isValidSharePointUrl !== true) {
|
|
104
|
+
return isValidSharePointUrl;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
98
107
|
if (args.options.id) {
|
|
99
108
|
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
100
109
|
return `${args.options.id} is not a valid GUID`;
|
|
@@ -43,14 +43,14 @@ class SpoTermSetListCommand extends SpoCommand_1.default {
|
|
|
43
43
|
commandAction(logger, args) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
const res = yield spo_1.spo.getRequestDigest(
|
|
46
|
+
const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
47
|
+
const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
|
|
48
48
|
if (this.verbose) {
|
|
49
49
|
logger.logToStderr(`Retrieving taxonomy term sets...`);
|
|
50
50
|
}
|
|
51
51
|
const query = args.options.termGroupId ? `<Method Id="62" ParentId="60" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="62" ParentId="60" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
52
52
|
const requestOptions = {
|
|
53
|
-
url: `${
|
|
53
|
+
url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
54
54
|
headers: {
|
|
55
55
|
'X-RequestDigest': res.FormDigestValue
|
|
56
56
|
},
|
|
@@ -82,18 +82,27 @@ class SpoTermSetListCommand extends SpoCommand_1.default {
|
|
|
82
82
|
_SpoTermSetListCommand_instances = new WeakSet(), _SpoTermSetListCommand_initTelemetry = function _SpoTermSetListCommand_initTelemetry() {
|
|
83
83
|
this.telemetry.push((args) => {
|
|
84
84
|
Object.assign(this.telemetryProperties, {
|
|
85
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
85
86
|
termGroupId: typeof args.options.termGroupId !== 'undefined',
|
|
86
87
|
termGroupName: typeof args.options.termGroupName !== 'undefined'
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
90
|
}, _SpoTermSetListCommand_initOptions = function _SpoTermSetListCommand_initOptions() {
|
|
90
91
|
this.options.unshift({
|
|
92
|
+
option: '-u, --webUrl [webUrl]'
|
|
93
|
+
}, {
|
|
91
94
|
option: '--termGroupId [termGroupId]'
|
|
92
95
|
}, {
|
|
93
96
|
option: '--termGroupName [termGroupName]'
|
|
94
97
|
});
|
|
95
98
|
}, _SpoTermSetListCommand_initValidators = function _SpoTermSetListCommand_initValidators() {
|
|
96
99
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
if (args.options.webUrl) {
|
|
101
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
102
|
+
if (isValidSharePointUrl !== true) {
|
|
103
|
+
return isValidSharePointUrl;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
97
106
|
if (args.options.termGroupId) {
|
|
98
107
|
if (!validation_1.validation.isValidGuid(args.options.termGroupId)) {
|
|
99
108
|
return `${args.options.termGroupId} is not a valid GUID`;
|
|
@@ -16,6 +16,7 @@ exports.default = {
|
|
|
16
16
|
APPLICATIONCUSTOMIZER_ADD: `${prefix} applicationcustomizer add`,
|
|
17
17
|
APPLICATIONCUSTOMIZER_GET: `${prefix} applicationcustomizer get`,
|
|
18
18
|
APPLICATIONCUSTOMIZER_LIST: `${prefix} applicationcustomizer list`,
|
|
19
|
+
APPLICATIONCUSTOMIZER_REMOVE: `${prefix} applicationcustomizer remove`,
|
|
19
20
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
20
21
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
21
22
|
CDN_GET: `${prefix} cdn get`,
|
|
@@ -158,6 +159,7 @@ exports.default = {
|
|
|
158
159
|
LISTITEM_ADD: `${prefix} listitem add`,
|
|
159
160
|
LISTITEM_ATTACHMENT_LIST: `${prefix} listitem attachment list`,
|
|
160
161
|
LISTITEM_BATCH_ADD: `${prefix} listitem batch add`,
|
|
162
|
+
LISTITEM_BATCH_SET: `${prefix} listitem batch set`,
|
|
161
163
|
LISTITEM_GET: `${prefix} listitem get`,
|
|
162
164
|
LISTITEM_ISRECORD: `${prefix} listitem isrecord`,
|
|
163
165
|
LISTITEM_LIST: `${prefix} listitem list`,
|
|
@@ -202,6 +204,7 @@ exports.default = {
|
|
|
202
204
|
PAGE_SECTION_GET: `${prefix} page section get`,
|
|
203
205
|
PAGE_SECTION_LIST: `${prefix} page section list`,
|
|
204
206
|
PAGE_TEMPLATE_LIST: `${prefix} page template list`,
|
|
207
|
+
PAGE_TEMPLATE_REMOVE: `${prefix} page template remove`,
|
|
205
208
|
PAGE_TEXT_ADD: `${prefix} page text add`,
|
|
206
209
|
PROPERTYBAG_GET: `${prefix} propertybag get`,
|
|
207
210
|
PROPERTYBAG_LIST: `${prefix} propertybag list`,
|
|
@@ -249,6 +252,8 @@ exports.default = {
|
|
|
249
252
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
250
253
|
SITE_RECYCLEBINITEM_CLEAR: `${prefix} site recyclebinitem clear`,
|
|
251
254
|
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
255
|
+
SITE_RECYCLEBINITEM_MOVE: `${prefix} site recyclebinitem move`,
|
|
256
|
+
SITE_RECYCLEBINITEM_REMOVE: `${prefix} site recyclebinitem remove`,
|
|
252
257
|
SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
|
|
253
258
|
SITE_REMOVE: `${prefix} site remove`,
|
|
254
259
|
SITE_RENAME: `${prefix} site rename`,
|
|
@@ -288,6 +293,10 @@ exports.default = {
|
|
|
288
293
|
TENANT_APPCATALOGURL_GET: `${prefix} tenant appcatalogurl get`,
|
|
289
294
|
TENANT_APPLICATIONCUSTOMIZER_ADD: `${prefix} tenant applicationcustomizer add`,
|
|
290
295
|
TENANT_APPLICATIONCUSTOMIZER_GET: `${prefix} tenant applicationcustomizer get`,
|
|
296
|
+
TENANT_APPLICATIONCUSTOMIZER_LIST: `${prefix} tenant applicationcustomizer list`,
|
|
297
|
+
TENANT_APPLICATIONCUSTOMIZER_REMOVE: `${prefix} tenant applicationcustomizer remove`,
|
|
298
|
+
TENANT_COMMANDSET_REMOVE: `${prefix} tenant commandset remove`,
|
|
299
|
+
TENANT_COMMANDSET_SET: `${prefix} tenant commandset set`,
|
|
291
300
|
TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
|
|
292
301
|
TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
|
|
293
302
|
TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _TeamsChatMemberRemoveCommand_instances, _TeamsChatMemberRemoveCommand_initTelemetry, _TeamsChatMemberRemoveCommand_initOptions, _TeamsChatMemberRemoveCommand_initValidators, _TeamsChatMemberRemoveCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const odata_1 = require("../../../../utils/odata");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
23
|
+
const request_1 = require("../../../../request");
|
|
24
|
+
class TeamsChatMemberRemoveCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.CHAT_MEMBER_REMOVE;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Removes a member from a Microsoft Teams chat conversation';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_TeamsChatMemberRemoveCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _TeamsChatMemberRemoveCommand_instances, "m", _TeamsChatMemberRemoveCommand_initOptionSets).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const removeUserFromChat = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Removing member ${args.options.id || args.options.userId || args.options.userName} from chat with id ${args.options.chatId}...`);
|
|
45
|
+
}
|
|
46
|
+
const memberId = yield this.getMemberId(args);
|
|
47
|
+
const chatMemberRemoveOptions = {
|
|
48
|
+
url: `${this.resource}/v1.0/chats/${args.options.chatId}/members/${memberId}`,
|
|
49
|
+
headers: {
|
|
50
|
+
accept: 'application/json;odata.metadata=none'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
yield request_1.default.delete(chatMemberRemoveOptions);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
this.handleRejectedODataJsonPromise(err);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
if (args.options.confirm) {
|
|
60
|
+
yield removeUserFromChat();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const result = yield Cli_1.Cli.prompt({
|
|
64
|
+
type: 'confirm',
|
|
65
|
+
name: 'continue',
|
|
66
|
+
default: false,
|
|
67
|
+
message: `Are you sure you want to remove member ${args.options.id || args.options.userId || args.options.userName} from chat with id ${args.options.chatId}?`
|
|
68
|
+
});
|
|
69
|
+
if (result.continue) {
|
|
70
|
+
yield removeUserFromChat();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
getMemberId(args) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
if (args.options.id) {
|
|
78
|
+
return args.options.id;
|
|
79
|
+
}
|
|
80
|
+
const memberRequestUrl = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
|
|
81
|
+
const members = yield odata_1.odata.getAllItems(memberRequestUrl);
|
|
82
|
+
if (args.options.userName) {
|
|
83
|
+
const matchingMember = members.find((memb) => memb.email.toLowerCase() === args.options.userName.toLowerCase());
|
|
84
|
+
if (!matchingMember) {
|
|
85
|
+
throw `Member with userName '${args.options.userName}' could not be found in the chat.`;
|
|
86
|
+
}
|
|
87
|
+
return matchingMember.id;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const matchingMember = members.find((memb) => memb.userId.toLowerCase() === args.options.userId.toLowerCase());
|
|
91
|
+
if (!matchingMember) {
|
|
92
|
+
throw `Member with userId '${args.options.userId}' could not be found in the chat.`;
|
|
93
|
+
}
|
|
94
|
+
return matchingMember.id;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_TeamsChatMemberRemoveCommand_instances = new WeakSet(), _TeamsChatMemberRemoveCommand_initTelemetry = function _TeamsChatMemberRemoveCommand_initTelemetry() {
|
|
100
|
+
this.telemetry.push((args) => {
|
|
101
|
+
Object.assign(this.telemetryProperties, {
|
|
102
|
+
id: typeof args.options.id !== 'undefined',
|
|
103
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
104
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
105
|
+
confirm: !!args.options.confirm
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}, _TeamsChatMemberRemoveCommand_initOptions = function _TeamsChatMemberRemoveCommand_initOptions() {
|
|
109
|
+
this.options.unshift({
|
|
110
|
+
option: '-i, --chatId <chatId>'
|
|
111
|
+
}, {
|
|
112
|
+
option: '--id [id]'
|
|
113
|
+
}, {
|
|
114
|
+
option: '--userId [userId]'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--userName [userName]'
|
|
117
|
+
}, {
|
|
118
|
+
option: '--confirm'
|
|
119
|
+
});
|
|
120
|
+
}, _TeamsChatMemberRemoveCommand_initValidators = function _TeamsChatMemberRemoveCommand_initValidators() {
|
|
121
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
if (!validation_1.validation.isValidTeamsChatId(args.options.chatId)) {
|
|
123
|
+
return `${args.options.chatId} is not a valid Teams chatId.`;
|
|
124
|
+
}
|
|
125
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
126
|
+
return `${args.options.userId} is not a valid userId.`;
|
|
127
|
+
}
|
|
128
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
129
|
+
return `${args.options.userName} is not a valid user principal name.`;
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}));
|
|
133
|
+
}, _TeamsChatMemberRemoveCommand_initOptionSets = function _TeamsChatMemberRemoveCommand_initOptionSets() {
|
|
134
|
+
this.optionSets.push({ options: ['id', 'userId', 'userName'] });
|
|
135
|
+
};
|
|
136
|
+
module.exports = new TeamsChatMemberRemoveCommand();
|
|
137
|
+
//# sourceMappingURL=chat-member-remove.js.map
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _TeamsMeetingTranscriptListCommand_instances, _TeamsMeetingTranscriptListCommand_initTelemetry, _TeamsMeetingTranscriptListCommand_initOptions, _TeamsMeetingTranscriptListCommand_initValidators, _TeamsMeetingTranscriptListCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const odata_1 = require("../../../../utils/odata");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
24
|
+
const aadUser_1 = require("../../../../utils/aadUser");
|
|
25
|
+
class TeamsMeetingTranscriptListCommand extends GraphCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.MEETING_TRANSCRIPT_LIST;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Lists all transcripts for a given meeting';
|
|
31
|
+
}
|
|
32
|
+
defaultProperties() {
|
|
33
|
+
return ['id', 'createdDateTime'];
|
|
34
|
+
}
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
_TeamsMeetingTranscriptListCommand_instances.add(this);
|
|
38
|
+
__classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initTelemetry).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptions).call(this);
|
|
40
|
+
__classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initValidators).call(this);
|
|
41
|
+
__classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptionSets).call(this);
|
|
42
|
+
}
|
|
43
|
+
commandAction(logger, args) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
try {
|
|
46
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
47
|
+
if (this.verbose) {
|
|
48
|
+
logger.logToStderr(`Retrieving transcript list for the given meeting...`);
|
|
49
|
+
}
|
|
50
|
+
let requestUrl = `${this.resource}/beta/`;
|
|
51
|
+
if (isAppOnlyAccessToken) {
|
|
52
|
+
if (!args.options.userId && !args.options.userName && !args.options.email) {
|
|
53
|
+
throw `The option 'userId', 'userName' or 'email' is required when retrieving meeting transcripts list using app only permissions`;
|
|
54
|
+
}
|
|
55
|
+
requestUrl += 'users/';
|
|
56
|
+
if (args.options.userId) {
|
|
57
|
+
requestUrl += args.options.userId;
|
|
58
|
+
}
|
|
59
|
+
else if (args.options.userName) {
|
|
60
|
+
requestUrl += args.options.userName;
|
|
61
|
+
}
|
|
62
|
+
else if (args.options.email) {
|
|
63
|
+
if (this.verbose) {
|
|
64
|
+
logger.logToStderr(`Getting user ID for user with email '${args.options.email}'.`);
|
|
65
|
+
}
|
|
66
|
+
const userId = yield aadUser_1.aadUser.getUserIdByEmail(args.options.email);
|
|
67
|
+
requestUrl += userId;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
if (args.options.userId || args.options.userName || args.options.email) {
|
|
72
|
+
throw `The options 'userId', 'userName' and 'email' cannot be used while retrieving meeting transcripts using delegated permissions`;
|
|
73
|
+
}
|
|
74
|
+
requestUrl += `me`;
|
|
75
|
+
}
|
|
76
|
+
requestUrl += `/onlineMeetings/${args.options.meetingId}/transcripts`;
|
|
77
|
+
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
78
|
+
logger.log(res);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
this.handleRejectedODataJsonPromise(err);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_TeamsMeetingTranscriptListCommand_instances = new WeakSet(), _TeamsMeetingTranscriptListCommand_initTelemetry = function _TeamsMeetingTranscriptListCommand_initTelemetry() {
|
|
87
|
+
this.telemetry.push((args) => {
|
|
88
|
+
Object.assign(this.telemetryProperties, {
|
|
89
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
90
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
91
|
+
email: typeof args.options.email !== 'undefined'
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}, _TeamsMeetingTranscriptListCommand_initOptions = function _TeamsMeetingTranscriptListCommand_initOptions() {
|
|
95
|
+
this.options.unshift({
|
|
96
|
+
option: '-u, --userId [userId]'
|
|
97
|
+
}, {
|
|
98
|
+
option: '-n, --userName [userName]'
|
|
99
|
+
}, {
|
|
100
|
+
option: '--email [email]'
|
|
101
|
+
}, {
|
|
102
|
+
option: '-m, --meetingId <meetingId>'
|
|
103
|
+
});
|
|
104
|
+
}, _TeamsMeetingTranscriptListCommand_initValidators = function _TeamsMeetingTranscriptListCommand_initValidators() {
|
|
105
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
107
|
+
return `${args.options.userId} is not a valid Guid`;
|
|
108
|
+
}
|
|
109
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
110
|
+
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
111
|
+
}
|
|
112
|
+
if (args.options.email && !validation_1.validation.isValidUserPrincipalName(args.options.email)) {
|
|
113
|
+
return `${args.options.email} is not a valid email`;
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}));
|
|
117
|
+
}, _TeamsMeetingTranscriptListCommand_initOptionSets = function _TeamsMeetingTranscriptListCommand_initOptionSets() {
|
|
118
|
+
this.optionSets.push({
|
|
119
|
+
options: ['userId', 'userName', 'email'],
|
|
120
|
+
runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
module.exports = new TeamsMeetingTranscriptListCommand();
|
|
124
|
+
//# sourceMappingURL=meeting-transcript-list.js.map
|
|
@@ -21,6 +21,7 @@ exports.default = {
|
|
|
21
21
|
CHAT_GET: `${prefix} chat get`,
|
|
22
22
|
CHAT_LIST: `${prefix} chat list`,
|
|
23
23
|
CHAT_MEMBER_LIST: `${prefix} chat member list`,
|
|
24
|
+
CHAT_MEMBER_REMOVE: `${prefix} chat member remove`,
|
|
24
25
|
CHAT_MESSAGE_LIST: `${prefix} chat message list`,
|
|
25
26
|
CHAT_MESSAGE_SEND: `${prefix} chat message send`,
|
|
26
27
|
FUNSETTINGS_LIST: `${prefix} funsettings list`,
|
|
@@ -30,6 +31,7 @@ exports.default = {
|
|
|
30
31
|
MEETING_ATTENDANCEREPORT_LIST: `${prefix} meeting attendancereport list`,
|
|
31
32
|
MEETING_GET: `${prefix} meeting get`,
|
|
32
33
|
MEETING_LIST: `${prefix} meeting list`,
|
|
34
|
+
MEETING_TRANSCRIPT_LIST: `${prefix} meeting transcript list`,
|
|
33
35
|
MEMBERSETTINGS_LIST: `${prefix} membersettings list`,
|
|
34
36
|
MEMBERSETTINGS_SET: `${prefix} membersettings set`,
|
|
35
37
|
MESSAGE_GET: `${prefix} message get`,
|
package/dist/utils/formatting.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatting = void 0;
|
|
3
|
+
exports.formatting = exports.CheckStatus = void 0;
|
|
4
|
+
const chalk = require("chalk");
|
|
4
5
|
const stripJsonComments = require("strip-json-comments");
|
|
5
6
|
const base_permissions_1 = require("../m365/spo/base-permissions");
|
|
6
7
|
const RoleType_1 = require("../m365/spo/commands/roledefinition/RoleType");
|
|
8
|
+
/**
|
|
9
|
+
* Has the particular check passed or failed
|
|
10
|
+
*/
|
|
11
|
+
var CheckStatus;
|
|
12
|
+
(function (CheckStatus) {
|
|
13
|
+
CheckStatus[CheckStatus["Success"] = 0] = "Success";
|
|
14
|
+
CheckStatus[CheckStatus["Failure"] = 1] = "Failure";
|
|
15
|
+
})(CheckStatus = exports.CheckStatus || (exports.CheckStatus = {}));
|
|
7
16
|
exports.formatting = {
|
|
8
17
|
escapeXml(s) {
|
|
9
18
|
if (!s) {
|
|
@@ -54,16 +63,23 @@ exports.formatting = {
|
|
|
54
63
|
const regex = new RegExp(`\\s*(${quoteChar})?(.*?)\\1\\s*(?:${delimiter}|$)`, 'gs');
|
|
55
64
|
const lines = s.split('\n');
|
|
56
65
|
const match = (line) => [...line.matchAll(regex)]
|
|
57
|
-
.map(m => m[2]) // we only want the second capture group
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
.map(m => m[2]); // we only want the second capture group
|
|
67
|
+
const heads = match(lines[0]).slice(0, -1);
|
|
68
|
+
return lines.slice(1)
|
|
69
|
+
.filter(text => text.trim() !== '')
|
|
70
|
+
.map(line => {
|
|
71
|
+
const lineMatch = match(line);
|
|
72
|
+
const obj = {};
|
|
73
|
+
heads.forEach((key, index) => {
|
|
74
|
+
const value = parseInt(lineMatch[index]);
|
|
75
|
+
if (isNaN(value) || value.toString() !== lineMatch[index]) {
|
|
76
|
+
obj[key] = lineMatch[index];
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
obj[key] = parseInt(lineMatch[index]);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return obj;
|
|
67
83
|
});
|
|
68
84
|
},
|
|
69
85
|
encodeQueryParameter(value) {
|
|
@@ -132,6 +148,14 @@ exports.formatting = {
|
|
|
132
148
|
}
|
|
133
149
|
xml = xml.replace(/<\/?[0-9]{1,}>/g, '');
|
|
134
150
|
return xml;
|
|
151
|
+
},
|
|
152
|
+
getStatus(result, message) {
|
|
153
|
+
const primarySupported = process.platform !== 'win32' ||
|
|
154
|
+
process.env.CI === 'true' ||
|
|
155
|
+
process.env.TERM === 'xterm-256color';
|
|
156
|
+
const success = primarySupported ? '✔' : '√';
|
|
157
|
+
const failure = primarySupported ? '✖' : '×';
|
|
158
|
+
return `${result === CheckStatus.Success ? chalk.green(success) : chalk.red(failure)} ${message}`;
|
|
135
159
|
}
|
|
136
160
|
};
|
|
137
161
|
//# sourceMappingURL=formatting.js.map
|