@pnp/cli-microsoft365 6.3.0-beta.c3dc921 → 6.3.0-beta.cefe20e
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 +8 -0
- package/dist/Auth.js +0 -18
- package/dist/Command.js +12 -1
- package/dist/appInsights.js +2 -1
- package/dist/cli/Cli.js +74 -3
- package/dist/m365/aad/commands/group/group-list.js +2 -1
- package/dist/m365/aad/commands/license/license-list.js +41 -0
- package/dist/m365/aad/commands/user/user-add.js +223 -0
- package/dist/m365/aad/commands/user/user-license-add.js +88 -0
- package/dist/m365/aad/commands/user/user-license-list.js +99 -0
- package/dist/m365/aad/commands/user/user-license-remove.js +114 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +103 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-list.js +41 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +92 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +77 -0
- package/dist/m365/aad/commands/user/user-remove.js +107 -0
- package/dist/m365/aad/commands.js +10 -0
- package/dist/m365/base/O365MgmtCommand.js +10 -0
- package/dist/m365/context/commands/option/option-list.js +54 -0
- package/dist/m365/context/commands.js +1 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +7 -6
- package/dist/m365/flow/commands/environment/FlowEnvironmentDetails.js +3 -0
- package/dist/m365/flow/commands/environment/environment-get.js +26 -11
- package/dist/m365/flow/commands/run/run-list.js +55 -3
- package/dist/m365/graph/commands/changelog/changelog-list.js +3 -2
- package/dist/m365/onenote/commands/notebook/notebook-list.js +50 -53
- package/dist/m365/onenote/commands/page/page-list.js +2 -16
- package/dist/m365/outlook/commands/mail/mail-send.js +3 -2
- package/dist/m365/outlook/commands/message/message-get.js +4 -3
- package/dist/m365/pa/commands/environment/environment-get.js +13 -5
- package/dist/m365/planner/commands/plan/plan-add.js +20 -6
- package/dist/m365/planner/commands/plan/plan-get.js +40 -26
- package/dist/m365/planner/commands/plan/plan-list.js +24 -14
- package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
- package/dist/m365/planner/commands/plan/plan-set.js +21 -10
- package/dist/m365/planner/commands/roster/roster-add.js +47 -0
- package/dist/m365/planner/commands/roster/roster-get.js +61 -0
- package/dist/m365/planner/commands/roster/roster-member-add.js +113 -0
- package/dist/m365/planner/commands/roster/roster-member-list.js +54 -0
- package/dist/m365/planner/commands/roster/roster-member-remove.js +140 -0
- package/dist/m365/planner/commands/roster/roster-remove.js +88 -0
- package/dist/m365/planner/commands/task/task-add.js +3 -0
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +2 -1
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +2 -1
- package/dist/m365/planner/commands.js +6 -0
- package/dist/m365/pp/commands/environment/environment-get.js +18 -9
- package/dist/m365/pp/commands/solution/solution-get.js +2 -1
- package/dist/m365/pp/commands/solution/solution-list.js +2 -1
- package/dist/m365/purview/commands/auditlog/auditlog-list.js +205 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +75 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +46 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +97 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +77 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +75 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +43 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +97 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +90 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +11 -1
- package/dist/m365/purview/commands.js +9 -0
- package/dist/m365/spfx/commands/project/WebApiPermissionRequests.js +3 -0
- package/dist/m365/spfx/commands/project/project-permissions-grant.js +81 -0
- package/dist/m365/spfx/commands.js +3 -2
- package/dist/m365/spo/commands/app/app-add.js +2 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +95 -0
- package/dist/m365/spo/commands/customaction/customaction-get.js +17 -66
- package/dist/m365/spo/commands/customaction/customaction-list.js +2 -36
- package/dist/m365/spo/commands/customaction/customaction-remove.js +11 -18
- package/dist/m365/spo/commands/file/GraphFileDetails.js +0 -1
- package/dist/m365/spo/commands/file/file-move.js +0 -2
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +2 -1
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +2 -22
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +137 -0
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +2 -25
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +9 -29
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +2 -25
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +104 -0
- package/dist/m365/spo/commands/folder/folder-copy.js +0 -2
- package/dist/m365/spo/commands/folder/folder-move.js +0 -2
- package/dist/m365/spo/commands/group/group-list.js +2 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-add.js +2 -1
- package/dist/m365/spo/commands/listitem/listitem-list.js +2 -1
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +17 -3
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +73 -0
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +4 -7
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +118 -0
- package/dist/m365/spo/commands/page/page-column-get.js +2 -1
- package/dist/m365/spo/commands/page/page-column-list.js +2 -1
- package/dist/m365/spo/commands/page/page-section-get.js +2 -1
- package/dist/m365/spo/commands/page/page-section-list.js +2 -1
- package/dist/m365/spo/commands/site/site-add.js +0 -3
- package/dist/m365/spo/commands/site/site-apppermission-add.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-get.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-list.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-set.js +2 -14
- package/dist/m365/spo/commands/site/site-remove.js +0 -3
- package/dist/m365/spo/commands/site/site-set.js +0 -2
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +6 -0
- package/dist/m365/spo/commands/spo-search.js +2 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +179 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +0 -1
- package/dist/m365/spo/commands/term/term-list.js +2 -1
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +2 -2
- package/dist/m365/spo/commands/web/web-set.js +11 -4
- package/dist/m365/spo/commands.js +6 -0
- package/dist/m365/teams/commands/chat/chat-list.js +4 -4
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-get.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-list.js +5 -4
- package/dist/m365/teams/commands/team/team-add.js +3 -8
- package/dist/m365/teams/commands/team/team-app-list.js +1 -1
- package/dist/m365/teams/commands/user/user-app-list.js +2 -1
- package/dist/m365/todo/commands/task/task-get.js +2 -1
- package/dist/m365/todo/commands/task/task-list.js +2 -1
- package/dist/m365/yammer/commands/yammer-search.js +2 -1
- package/dist/utils/aadUser.js +38 -0
- package/dist/utils/accessToken.js +1 -1
- package/dist/utils/planner.js +16 -5
- package/dist/utils/session.js +18 -0
- package/dist/utils/spo.js +119 -12
- package/docs/docs/cmd/aad/app/app-list.md +3 -0
- package/docs/docs/cmd/aad/license/license-list.md +87 -0
- package/docs/docs/cmd/aad/user/user-add.md +168 -0
- package/docs/docs/cmd/aad/user/user-license-add.md +108 -0
- package/docs/docs/cmd/aad/user/user-license-list.md +98 -0
- package/docs/docs/cmd/aad/user/user-license-remove.md +43 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-clear.md +42 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-list.md +82 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-remove.md +45 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-restore.md +99 -0
- package/docs/docs/cmd/aad/user/user-remove.md +51 -0
- package/docs/docs/cmd/aad/user/user-set.md +2 -2
- package/docs/docs/cmd/context/option/option-list.md +63 -0
- package/docs/docs/cmd/flow/environment/environment-get.md +31 -3
- package/docs/docs/cmd/flow/run/run-list.md +21 -0
- package/docs/docs/cmd/login.md +26 -0
- package/docs/docs/cmd/logout.md +4 -0
- package/docs/docs/cmd/pa/app/app-get.md +24 -0
- package/docs/docs/cmd/pa/app/app-list.md +21 -0
- package/docs/docs/cmd/pa/connector/connector-list.md +17 -0
- package/docs/docs/cmd/pa/environment/environment-get.md +26 -2
- package/docs/docs/cmd/pa/environment/environment-list.md +19 -0
- package/docs/docs/cmd/planner/plan/plan-add.md +17 -6
- package/docs/docs/cmd/planner/plan/plan-get.md +21 -7
- package/docs/docs/cmd/planner/plan/plan-list.md +16 -2
- package/docs/docs/cmd/planner/plan/plan-remove.md +4 -0
- package/docs/docs/cmd/planner/plan/plan-set.md +10 -4
- package/docs/docs/cmd/planner/roster/roster-add.md +60 -0
- package/docs/docs/cmd/planner/roster/roster-get.md +73 -0
- package/docs/docs/cmd/planner/roster/roster-member-add.md +87 -0
- package/docs/docs/cmd/planner/roster/roster-member-list.md +76 -0
- package/docs/docs/cmd/planner/roster/roster-member-remove.md +51 -0
- package/docs/docs/cmd/planner/roster/roster-remove.md +48 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.md +43 -0
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.md +43 -0
- package/docs/docs/cmd/pp/card/card-clone.md +12 -0
- package/docs/docs/cmd/pp/card/card-get.md +49 -0
- package/docs/docs/cmd/pp/card/card-list.md +49 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-get.md +55 -0
- package/docs/docs/cmd/pp/chatbot/chatbot-list.md +36 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-get.md +30 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +30 -0
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.md +30 -0
- package/docs/docs/cmd/pp/environment/environment-get.md +19 -0
- package/docs/docs/cmd/pp/environment/environment-list.md +19 -0
- package/docs/docs/cmd/pp/gateway/gateway-get.md +19 -0
- package/docs/docs/cmd/pp/gateway/gateway-list.md +19 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-add.md +12 -0
- package/docs/docs/cmd/pp/managementapp/managementapp-list.md +12 -0
- package/docs/docs/cmd/pp/solution/solution-get.md +14 -0
- package/docs/docs/cmd/pp/solution/solution-list.md +14 -0
- package/docs/docs/cmd/pp/solution/solution-publisher-get.md +20 -1
- package/docs/docs/cmd/pp/solution/solution-publisher-list.md +18 -0
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +21 -0
- package/docs/docs/cmd/purview/auditlog/auditlog-list.md +123 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +132 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +107 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +45 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +106 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +103 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +97 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +43 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +43 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +3 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +3 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +3 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +3 -0
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +3 -0
- package/docs/docs/cmd/request.md +74 -0
- package/docs/docs/cmd/spfx/project/project-permissions-grant.md +65 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +56 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.md +46 -0
- package/docs/docs/cmd/spo/file/file-sharinglink-list.md +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.md +104 -0
- package/docs/docs/cmd/spo/homesite/homesite-get.md +20 -1
- package/docs/docs/cmd/spo/homesite/homesite-remove.md +8 -2
- package/docs/docs/cmd/spo/homesite/homesite-set.md +8 -2
- package/docs/docs/cmd/spo/hubsite/hubsite-connect.md +9 -9
- package/docs/docs/cmd/spo/hubsite/hubsite-data-get.md +34 -5
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +6 -6
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +36 -19
- package/docs/docs/cmd/spo/hubsite/hubsite-list.md +59 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-register.md +30 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.md +6 -6
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.md +4 -4
- package/docs/docs/cmd/spo/hubsite/hubsite-set.md +40 -15
- package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +4 -4
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +7 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +9 -3
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +8 -2
- package/docs/docs/cmd/spo/list/list-add.md +123 -57
- package/docs/docs/cmd/spo/list/list-contenttype-add.md +50 -5
- package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +4 -4
- package/docs/docs/cmd/spo/list/list-contenttype-list.md +49 -4
- package/docs/docs/cmd/spo/list/list-contenttype-remove.md +6 -6
- package/docs/docs/cmd/spo/list/list-get.md +70 -4
- package/docs/docs/cmd/spo/list/list-list.md +70 -2
- package/docs/docs/cmd/spo/list/list-remove.md +6 -6
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +2 -2
- package/docs/docs/cmd/spo/list/list-retentionlabel-get.md +36 -3
- package/docs/docs/cmd/spo/list/list-retentionlabel-remove.md +3 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +6 -6
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +3 -3
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -9
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +7 -7
- package/docs/docs/cmd/spo/list/list-set.md +61 -61
- package/docs/docs/cmd/spo/list/list-sitescript-get.md +35 -3
- package/docs/docs/cmd/spo/list/list-view-add.md +66 -5
- package/docs/docs/cmd/spo/list/list-view-field-add.md +10 -10
- package/docs/docs/cmd/spo/list/list-view-get.md +61 -0
- package/docs/docs/cmd/spo/list/list-view-list.md +61 -0
- package/docs/docs/cmd/spo/list/list-view-set.md +1 -1
- package/docs/docs/cmd/spo/list/list-webhook-add.md +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-get.md +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-list.md +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.md +29 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +19 -4
- package/docs/docs/cmd/spo/listitem/listitem-get.md +57 -0
- package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +8 -2
- package/docs/docs/cmd/spo/listitem/listitem-list.md +28 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.md +15 -0
- package/docs/docs/cmd/spo/listitem/listitem-set.md +30 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +40 -3
- package/docs/docs/cmd/spo/navigation/navigation-node-get.md +91 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-list.md +30 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-remove.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +59 -0
- package/docs/docs/cmd/spo/sitedesign/sitedesign-add.md +3 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +59 -0
- package/docs/docs/cmd/spo/web/web-set.md +9 -0
- package/docs/docs/cmd/status.md +46 -0
- package/docs/docs/cmd/version.md +26 -0
- package/npm-shrinkwrap.json +912 -876
- package/package.json +13 -12
|
@@ -0,0 +1,179 @@
|
|
|
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 _SpoTenantApplicationCustomizerAddCommand_instances, _SpoTenantApplicationCustomizerAddCommand_initTelemetry, _SpoTenantApplicationCustomizerAddCommand_initOptions, _SpoTenantApplicationCustomizerAddCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const validation_1 = require("../../../../utils/validation");
|
|
19
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
22
|
+
const spoTenantAppCatalogUrlGetCommand = require("../tenant/tenant-appcatalogurl-get");
|
|
23
|
+
const spoListItemAddCommand = require("../listitem/listitem-add");
|
|
24
|
+
const spoListItemListCommand = require("../listitem/listitem-list");
|
|
25
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
26
|
+
class SpoTenantApplicationCustomizerAddCommand extends SpoCommand_1.default {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands_1.default.TENANT_APPLICATIONCUSTOMIZER_ADD;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return 'Add an application customizer as a tenant wide extension.';
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
_SpoTenantApplicationCustomizerAddCommand_instances.add(this);
|
|
36
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initTelemetry).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initOptions).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initValidators).call(this);
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
const appCatalogUrl = yield this.getAppCatalogUrl(logger);
|
|
44
|
+
const componentManifest = yield this.getComponentManifest(appCatalogUrl, args.options.clientSideComponentId, logger);
|
|
45
|
+
const clientComponentManifest = JSON.parse(componentManifest.ClientComponentManifest);
|
|
46
|
+
if (clientComponentManifest.extensionType !== "ApplicationCustomizer") {
|
|
47
|
+
throw `The extension type of this component is not of type 'ApplicationCustomizer' but of type '${clientComponentManifest.extensionType}'`;
|
|
48
|
+
}
|
|
49
|
+
const solution = yield this.getSolutionFromAppCatalog(appCatalogUrl, componentManifest.SolutionId, logger);
|
|
50
|
+
if (!solution.ContainsTenantWideExtension) {
|
|
51
|
+
throw `The solution does not contain an extension that can be deployed to all sites. Make sure that you've entered the correct component Id.`;
|
|
52
|
+
}
|
|
53
|
+
else if (!solution.SkipFeatureDeployment) {
|
|
54
|
+
throw 'The solution has not been deployed to all sites. Make sure to deploy this solution to all sites.';
|
|
55
|
+
}
|
|
56
|
+
yield this.addTenantWideExtension(appCatalogUrl, args.options, logger);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
getAppCatalogUrl(logger) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const spoTenantAppCatalogUrlGetCommandOutput = yield Cli_1.Cli.executeCommandWithOutput(spoTenantAppCatalogUrlGetCommand, { options: { output: 'text', _: [] } });
|
|
66
|
+
if (this.verbose) {
|
|
67
|
+
logger.logToStderr(spoTenantAppCatalogUrlGetCommandOutput.stderr);
|
|
68
|
+
}
|
|
69
|
+
const appCatalogUrl = spoTenantAppCatalogUrlGetCommandOutput.stdout;
|
|
70
|
+
if (!appCatalogUrl) {
|
|
71
|
+
throw 'Cannot add tenant-wide application customizer as app catalog cannot be found';
|
|
72
|
+
}
|
|
73
|
+
if (this.verbose) {
|
|
74
|
+
logger.logToStderr(`Got tenant app catalog url: ${appCatalogUrl}`);
|
|
75
|
+
}
|
|
76
|
+
return appCatalogUrl;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
getComponentManifest(appCatalogUrl, clientSideComponentId, logger) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
if (this.verbose) {
|
|
82
|
+
logger.logToStderr('Retrieving component manifest item from the ComponentManifests list on the app catalog site so that we get the solution id');
|
|
83
|
+
}
|
|
84
|
+
const camlQuery = `<View><ViewFields><FieldRef Name='ClientComponentId'></FieldRef><FieldRef Name='SolutionId'></FieldRef><FieldRef Name='ClientComponentManifest'></FieldRef></ViewFields><Query><Where><Eq><FieldRef Name='ClientComponentId' /><Value Type='Guid'>${clientSideComponentId}</Value></Eq></Where></Query></View>`;
|
|
85
|
+
const commandOptions = {
|
|
86
|
+
webUrl: appCatalogUrl,
|
|
87
|
+
listUrl: `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(appCatalogUrl)}/Lists/ComponentManifests`,
|
|
88
|
+
camlQuery: camlQuery,
|
|
89
|
+
verbose: this.verbose,
|
|
90
|
+
debug: this.debug,
|
|
91
|
+
output: 'json'
|
|
92
|
+
};
|
|
93
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(spoListItemListCommand, { options: Object.assign(Object.assign({}, commandOptions), { _: [] }) });
|
|
94
|
+
if (this.verbose) {
|
|
95
|
+
logger.logToStderr(output.stderr);
|
|
96
|
+
}
|
|
97
|
+
const outputParsed = JSON.parse(output.stdout);
|
|
98
|
+
if (outputParsed.length === 0) {
|
|
99
|
+
throw 'No component found with the specified clientSideComponentId found in the component manifest list. Make sure that the application is added to the application catalog';
|
|
100
|
+
}
|
|
101
|
+
return outputParsed[0];
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
getSolutionFromAppCatalog(appCatalogUrl, solutionId, logger) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (this.verbose) {
|
|
107
|
+
logger.logToStderr(`Retrieving solution with id ${solutionId} from the application catalog`);
|
|
108
|
+
}
|
|
109
|
+
const camlQuery = `<View><ViewFields><FieldRef Name='SkipFeatureDeployment'></FieldRef><FieldRef Name='ContainsTenantWideExtension'></FieldRef></ViewFields><Query><Where><Eq><FieldRef Name='AppProductID' /><Value Type='Guid'>${solutionId}</Value></Eq></Where></Query></View>`;
|
|
110
|
+
const commandOptions = {
|
|
111
|
+
webUrl: appCatalogUrl,
|
|
112
|
+
listUrl: `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(appCatalogUrl)}/AppCatalog`,
|
|
113
|
+
camlQuery: camlQuery,
|
|
114
|
+
verbose: this.verbose,
|
|
115
|
+
debug: this.debug,
|
|
116
|
+
output: 'json'
|
|
117
|
+
};
|
|
118
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(spoListItemListCommand, { options: Object.assign(Object.assign({}, commandOptions), { _: [] }) });
|
|
119
|
+
if (this.verbose) {
|
|
120
|
+
logger.logToStderr(output.stderr);
|
|
121
|
+
}
|
|
122
|
+
const outputParsed = JSON.parse(output.stdout);
|
|
123
|
+
if (outputParsed.length === 0) {
|
|
124
|
+
throw `No component found with the solution id ${solutionId}. Make sure that the solution is available in the app catalog`;
|
|
125
|
+
}
|
|
126
|
+
return outputParsed[0];
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
addTenantWideExtension(appCatalogUrl, options, logger) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
if (this.verbose) {
|
|
132
|
+
logger.logToStderr('Pre-checks finished. Adding tenant wide extension to the TenantWideExtensions list');
|
|
133
|
+
}
|
|
134
|
+
const commandOptions = {
|
|
135
|
+
webUrl: appCatalogUrl,
|
|
136
|
+
listUrl: `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(appCatalogUrl)}/Lists/TenantWideExtensions`,
|
|
137
|
+
Title: options.title,
|
|
138
|
+
TenantWideExtensionComponentId: options.clientSideComponentId,
|
|
139
|
+
TenantWideExtensionLocation: 'ClientSideExtension.ApplicationCustomizer',
|
|
140
|
+
TenantWideExtensionSequence: 0,
|
|
141
|
+
TenantWideExtensionListTemplate: 0,
|
|
142
|
+
TenantWideExtensionComponentProperties: options.clientSideComponentProperties || '',
|
|
143
|
+
TenantWideExtensionWebTemplate: options.webTemplate || '',
|
|
144
|
+
TenantWideExtensionDisabled: false,
|
|
145
|
+
verbose: this.verbose,
|
|
146
|
+
debug: this.debug,
|
|
147
|
+
output: options.output
|
|
148
|
+
};
|
|
149
|
+
yield Cli_1.Cli.executeCommand(spoListItemAddCommand, { options: Object.assign(Object.assign({}, commandOptions), { _: [] }) });
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
_SpoTenantApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoTenantApplicationCustomizerAddCommand_initTelemetry = function _SpoTenantApplicationCustomizerAddCommand_initTelemetry() {
|
|
154
|
+
this.telemetry.push((args) => {
|
|
155
|
+
Object.assign(this.telemetryProperties, {
|
|
156
|
+
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
157
|
+
webTemplate: typeof args.options.webTemplate !== 'undefined'
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}, _SpoTenantApplicationCustomizerAddCommand_initOptions = function _SpoTenantApplicationCustomizerAddCommand_initOptions() {
|
|
161
|
+
this.options.unshift({
|
|
162
|
+
option: '-t, --title <title>'
|
|
163
|
+
}, {
|
|
164
|
+
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
165
|
+
}, {
|
|
166
|
+
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
167
|
+
}, {
|
|
168
|
+
option: '-w, --webTemplate [webTemplate]'
|
|
169
|
+
});
|
|
170
|
+
}, _SpoTenantApplicationCustomizerAddCommand_initValidators = function _SpoTenantApplicationCustomizerAddCommand_initValidators() {
|
|
171
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
if (!validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
173
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}));
|
|
177
|
+
};
|
|
178
|
+
module.exports = new SpoTenantApplicationCustomizerAddCommand();
|
|
179
|
+
//# sourceMappingURL=tenant-applicationcustomizer-add.js.map
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoTermListCommand_instances, _SpoTermListCommand_initTelemetry, _SpoTermListCommand_initOptions, _SpoTermListCommand_initValidators, _SpoTermListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const config_1 = require("../../../../config");
|
|
19
20
|
const request_1 = require("../../../../request");
|
|
20
21
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -62,7 +63,7 @@ class SpoTermListCommand extends SpoCommand_1.default {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
if (!args.options.output || args.options.output
|
|
66
|
+
if (!args.options.output || !Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
66
67
|
logger.log(terms);
|
|
67
68
|
}
|
|
68
69
|
else if (!args.options.includeChildTerms) {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoUserProfileGetCommand_instances, _SpoUserProfileGetCommand_initOptions, _SpoUserProfileGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
20
21
|
const spo_1 = require("../../../../utils/spo");
|
|
@@ -47,8 +48,7 @@ class SpoUserProfileGetCommand extends SpoCommand_1.default {
|
|
|
47
48
|
responseType: 'json'
|
|
48
49
|
};
|
|
49
50
|
const res = yield request_1.default.get(requestOptions);
|
|
50
|
-
if (!args.options.output ||
|
|
51
|
-
args.options.output === 'text') {
|
|
51
|
+
if (!args.options.output || Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
52
52
|
res.UserProfileProperties = JSON.stringify(res.UserProfileProperties);
|
|
53
53
|
}
|
|
54
54
|
logger.log(res);
|
|
@@ -62,6 +62,9 @@ class SpoWebSetCommand extends SpoCommand_1.default {
|
|
|
62
62
|
if (typeof args.options.footerEnabled !== 'undefined') {
|
|
63
63
|
payload.FooterEnabled = args.options.footerEnabled;
|
|
64
64
|
}
|
|
65
|
+
if (typeof args.options.navAudienceTargetingEnabled !== 'undefined') {
|
|
66
|
+
payload.NavAudienceTargetingEnabled = args.options.navAudienceTargetingEnabled;
|
|
67
|
+
}
|
|
65
68
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
66
69
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
67
70
|
payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
|
|
@@ -96,11 +99,12 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
96
99
|
description: typeof args.options.description !== 'undefined',
|
|
97
100
|
headerEmphasis: typeof args.options.headerEmphasis !== 'undefined',
|
|
98
101
|
headerLayout: typeof args.options.headerLayout !== 'undefined',
|
|
99
|
-
megaMenuEnabled: args.options.megaMenuEnabled,
|
|
102
|
+
megaMenuEnabled: typeof args.options.megaMenuEnabled !== 'undefined',
|
|
100
103
|
siteLogoUrl: typeof args.options.siteLogoUrl !== 'undefined',
|
|
101
104
|
title: typeof args.options.title !== 'undefined',
|
|
102
|
-
quickLaunchEnabled: args.options.quickLaunchEnabled,
|
|
103
|
-
footerEnabled: args.options.footerEnabled,
|
|
105
|
+
quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
|
|
106
|
+
footerEnabled: typeof args.options.footerEnabled !== 'undefined',
|
|
107
|
+
navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
|
|
104
108
|
searchScope: args.options.searchScope !== 'undefined'
|
|
105
109
|
});
|
|
106
110
|
this.trackUnknownOptions(this.telemetryProperties, args.options);
|
|
@@ -129,12 +133,15 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
129
133
|
}, {
|
|
130
134
|
option: '--footerEnabled [footerEnabled]',
|
|
131
135
|
autocomplete: ['true', 'false']
|
|
136
|
+
}, {
|
|
137
|
+
option: '--navAudienceTargetingEnabled [navAudienceTargetingEnabled]',
|
|
138
|
+
autocomplete: ['true', 'false']
|
|
132
139
|
}, {
|
|
133
140
|
option: '--searchScope [searchScope]',
|
|
134
141
|
autocomplete: SpoWebSetCommand.searchScopeOptions
|
|
135
142
|
});
|
|
136
143
|
}, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
|
|
137
|
-
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled');
|
|
144
|
+
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
|
|
138
145
|
}, _SpoWebSetCommand_initValidators = function _SpoWebSetCommand_initValidators() {
|
|
139
146
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
140
147
|
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.url);
|
|
@@ -13,6 +13,7 @@ exports.default = {
|
|
|
13
13
|
APP_TEAMSPACKAGE_DOWNLOAD: `${prefix} app teamspackage download`,
|
|
14
14
|
APP_UNINSTALL: `${prefix} app uninstall`,
|
|
15
15
|
APP_UPGRADE: `${prefix} app upgrade`,
|
|
16
|
+
APPLICATIONCUSTOMIZER_ADD: `${prefix} applicationcustomizer add`,
|
|
16
17
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
17
18
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
18
19
|
CDN_GET: `${prefix} cdn get`,
|
|
@@ -65,9 +66,11 @@ exports.default = {
|
|
|
65
66
|
FILE_ROLEINHERITANCE_RESET: `${prefix} file roleinheritance reset`,
|
|
66
67
|
FILE_SHARINGINFO_GET: `${prefix} file sharinginfo get`,
|
|
67
68
|
FILE_SHARINGLINK_ADD: `${prefix} file sharinglink add`,
|
|
69
|
+
FILE_SHARINGLINK_CLEAR: `${prefix} file sharinglink clear`,
|
|
68
70
|
FILE_SHARINGLINK_GET: `${prefix} file sharinglink get`,
|
|
69
71
|
FILE_SHARINGLINK_LIST: `${prefix} file sharinglink list`,
|
|
70
72
|
FILE_SHARINGLINK_REMOVE: `${prefix} file sharinglink remove`,
|
|
73
|
+
FILE_SHARINGLINK_SET: `${prefix} file sharinglink set`,
|
|
71
74
|
FILE_VERSION_CLEAR: `${prefix} file version clear`,
|
|
72
75
|
FILE_VERSION_GET: `${prefix} file version get`,
|
|
73
76
|
FILE_VERSION_LIST: `${prefix} file version list`,
|
|
@@ -165,8 +168,10 @@ exports.default = {
|
|
|
165
168
|
LISTITEM_SET: `${prefix} listitem set`,
|
|
166
169
|
MAIL_SEND: `${prefix} mail send`,
|
|
167
170
|
NAVIGATION_NODE_ADD: `${prefix} navigation node add`,
|
|
171
|
+
NAVIGATION_NODE_GET: `${prefix} navigation node get`,
|
|
168
172
|
NAVIGATION_NODE_LIST: `${prefix} navigation node list`,
|
|
169
173
|
NAVIGATION_NODE_REMOVE: `${prefix} navigation node remove`,
|
|
174
|
+
NAVIGATION_NODE_SET: `${prefix} navigation node set`,
|
|
170
175
|
ORGASSETSLIBRARY_ADD: `${prefix} orgassetslibrary add`,
|
|
171
176
|
ORGASSETSLIBRARY_LIST: `${prefix} orgassetslibrary list`,
|
|
172
177
|
ORGASSETSLIBRARY_REMOVE: `${prefix} orgassetslibrary remove`,
|
|
@@ -273,6 +278,7 @@ exports.default = {
|
|
|
273
278
|
STORAGEENTITY_REMOVE: `${prefix} storageentity remove`,
|
|
274
279
|
TENANT_APPCATALOG_ADD: `${prefix} tenant appcatalog add`,
|
|
275
280
|
TENANT_APPCATALOGURL_GET: `${prefix} tenant appcatalogurl get`,
|
|
281
|
+
TENANT_APPLICATIONCUSTOMIZER_ADD: `${prefix} tenant applicationcustomizer add`,
|
|
276
282
|
TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
|
|
277
283
|
TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
|
|
278
284
|
TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
|
|
@@ -41,14 +41,14 @@ class TeamsChatListCommand extends GraphCommand_1.default {
|
|
|
41
41
|
}
|
|
42
42
|
commandAction(logger, args) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
44
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
45
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
|
|
46
46
|
throw `The option 'userId' or 'userName' is required when obtaining chats using app only permissions`;
|
|
47
47
|
}
|
|
48
|
-
else if (!
|
|
48
|
+
else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName)) {
|
|
49
49
|
throw `The options 'userId' or 'userName' cannot be used when obtaining chats using delegated permissions`;
|
|
50
50
|
}
|
|
51
|
-
let requestUrl = `${this.resource}/v1.0/${!
|
|
51
|
+
let requestUrl = `${this.resource}/v1.0/${!isAppOnlyAccessToken ? 'me' : `users/${args.options.userId || args.options.userName}`}/chats`;
|
|
52
52
|
if (args.options.type) {
|
|
53
53
|
requestUrl += `?$filter=chatType eq '${args.options.type}'`;
|
|
54
54
|
}
|
|
@@ -42,19 +42,19 @@ class TeamsMeetingAttendancereportListCommand extends GraphCommand_1.default {
|
|
|
42
42
|
}
|
|
43
43
|
commandAction(logger, args) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
46
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName && !args.options.email) {
|
|
47
47
|
this.handleError(`The option 'userId', 'userName' or 'email' is required when retrieving meeting attendance report using app only permissions`);
|
|
48
48
|
}
|
|
49
|
-
else if (!
|
|
49
|
+
else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName || args.options.email)) {
|
|
50
50
|
this.handleError(`The options 'userId', 'userName' and 'email' cannot be used when retrieving meeting attendance reports using delegated permissions`);
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
53
|
if (this.verbose) {
|
|
54
|
-
logger.logToStderr(`Retrieving attendance report for ${
|
|
54
|
+
logger.logToStderr(`Retrieving attendance report for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
55
55
|
}
|
|
56
56
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
57
|
-
if (
|
|
57
|
+
if (isAppOnlyAccessToken) {
|
|
58
58
|
requestUrl += 'users/';
|
|
59
59
|
if (args.options.userId) {
|
|
60
60
|
requestUrl += args.options.userId;
|
|
@@ -53,23 +53,23 @@ class TeamsMeetingGetCommand extends GraphCommand_1.default {
|
|
|
53
53
|
}
|
|
54
54
|
commandAction(logger, args) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
56
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
57
|
+
if (isAppOnlyAccessToken) {
|
|
58
58
|
if (!args.options.userId && !args.options.userName && !args.options.email) {
|
|
59
59
|
this.handleError(`The option 'userId', 'userName' or 'email' is required when retrieving meetings using app only permissions`);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
if (!
|
|
63
|
+
if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName || args.options.email)) {
|
|
64
64
|
this.handleError(`The options 'userId', 'userName' and 'email' cannot be used when retrieving meetings using delegated permissions`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (this.verbose) {
|
|
68
|
-
logger.logToStderr(`Retrieving meeting for ${
|
|
68
|
+
logger.logToStderr(`Retrieving meeting for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
71
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
72
|
-
if (
|
|
72
|
+
if (isAppOnlyAccessToken) {
|
|
73
73
|
requestUrl += 'users/';
|
|
74
74
|
if (args.options.userId) {
|
|
75
75
|
requestUrl += args.options.userId;
|
|
@@ -22,6 +22,7 @@ const commands_1 = require("../../commands");
|
|
|
22
22
|
const odata_1 = require("../../../../utils/odata");
|
|
23
23
|
const validation_1 = require("../../../../utils/validation");
|
|
24
24
|
const AadUserGetCommand = require("../../../aad/commands/user/user-get");
|
|
25
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
25
26
|
class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
26
27
|
get name() {
|
|
27
28
|
return commands_1.default.MEETING_LIST;
|
|
@@ -42,12 +43,12 @@ class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
|
42
43
|
commandAction(logger, args) {
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
try {
|
|
45
|
-
const
|
|
46
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
46
47
|
if (this.verbose) {
|
|
47
|
-
logger.logToStderr(`Retrieving meetings for ${
|
|
48
|
+
logger.logToStderr(`Retrieving meetings for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
48
49
|
}
|
|
49
50
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
50
|
-
if (
|
|
51
|
+
if (isAppOnlyAccessToken) {
|
|
51
52
|
if (!args.options.userId && !args.options.userName && !args.options.email) {
|
|
52
53
|
throw `The option 'userId', 'userName' or 'email' is required when retrieving meetings using app only permissions`;
|
|
53
54
|
}
|
|
@@ -78,7 +79,7 @@ class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
|
78
79
|
}
|
|
79
80
|
const res = yield odata_1.odata.getAllItems(requestUrl);
|
|
80
81
|
const resFiltered = res.filter(y => y.isOnlineMeeting);
|
|
81
|
-
if (!args.options.output || args.options.output
|
|
82
|
+
if (!args.options.output || !Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
82
83
|
logger.log(resFiltered);
|
|
83
84
|
}
|
|
84
85
|
else {
|
|
@@ -44,7 +44,6 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
44
44
|
}
|
|
45
45
|
commandAction(logger, args) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
this.dots = '';
|
|
48
47
|
let requestBody;
|
|
49
48
|
if (args.options.template) {
|
|
50
49
|
if (this.verbose) {
|
|
@@ -95,7 +94,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
95
94
|
}
|
|
96
95
|
else {
|
|
97
96
|
setTimeout(() => {
|
|
98
|
-
this.waitUntilFinished(requestOptions, resolve, reject, logger
|
|
97
|
+
this.waitUntilFinished(requestOptions, resolve, reject, logger);
|
|
99
98
|
}, this.pollingInterval);
|
|
100
99
|
}
|
|
101
100
|
}));
|
|
@@ -113,11 +112,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
|
-
waitUntilFinished(requestOptions, resolve, reject, logger
|
|
117
|
-
if (!this.debug && this.verbose) {
|
|
118
|
-
dots += '.';
|
|
119
|
-
process.stdout.write(`\r${dots}`);
|
|
120
|
-
}
|
|
115
|
+
waitUntilFinished(requestOptions, resolve, reject, logger) {
|
|
121
116
|
request_1.default
|
|
122
117
|
.get(requestOptions)
|
|
123
118
|
.then((teamsAsyncOperation) => {
|
|
@@ -133,7 +128,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
133
128
|
return;
|
|
134
129
|
}
|
|
135
130
|
setTimeout(() => {
|
|
136
|
-
this.waitUntilFinished(requestOptions, resolve, reject, logger
|
|
131
|
+
this.waitUntilFinished(requestOptions, resolve, reject, logger);
|
|
137
132
|
}, this.pollingInterval);
|
|
138
133
|
}).catch(err => reject(err));
|
|
139
134
|
}
|
|
@@ -47,7 +47,7 @@ class TeamsTeamAppListCommand extends GraphCommand_1.default {
|
|
|
47
47
|
}
|
|
48
48
|
const teamId = yield this.getTeamId(args);
|
|
49
49
|
const res = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/teams/${teamId}/installedApps?$expand=teamsApp,teamsAppDefinition`);
|
|
50
|
-
if (args.options.output
|
|
50
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
51
51
|
logger.log(res);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TeamsUserAppListCommand_instances, _TeamsUserAppListCommand_initTelemetry, _TeamsUserAppListCommand_initOptions, _TeamsUserAppListCommand_initValidators, _TeamsUserAppListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const formatting_1 = require("../../../../utils/formatting");
|
|
20
21
|
const odata_1 = require("../../../../utils/odata");
|
|
@@ -47,7 +48,7 @@ class TeamsUserAppListCommand extends GraphCommand_1.default {
|
|
|
47
48
|
const appId = userAppId.substr(userAppId.indexOf("##") + 2, userAppId.length - userId.length - 2);
|
|
48
49
|
i.appId = appId;
|
|
49
50
|
});
|
|
50
|
-
if (args.options.output
|
|
51
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
51
52
|
logger.log(items);
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TodoTaskGetCommand_instances, _TodoTaskGetCommand_initTelemetry, _TodoTaskGetCommand_initOptions, _TodoTaskGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
21
|
const commands_1 = require("../../commands");
|
|
@@ -67,7 +68,7 @@ class TodoTaskGetCommand extends GraphCommand_1.default {
|
|
|
67
68
|
responseType: 'json'
|
|
68
69
|
};
|
|
69
70
|
const item = yield request_1.default.get(requestOptions);
|
|
70
|
-
if (args.options.output
|
|
71
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
71
72
|
logger.log(item);
|
|
72
73
|
}
|
|
73
74
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TodoTaskListCommand_instances, _TodoTaskListCommand_initTelemetry, _TodoTaskListCommand_initOptions, _TodoTaskListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../../request");
|
|
19
20
|
const odata_1 = require("../../../../utils/odata");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
@@ -62,7 +63,7 @@ class TodoTaskListCommand extends GraphCommand_1.default {
|
|
|
62
63
|
const listId = yield this.getTodoListId(args);
|
|
63
64
|
const endpoint = `${this.resource}/v1.0/me/todo/lists/${listId}/tasks`;
|
|
64
65
|
const items = yield odata_1.odata.getAllItems(endpoint);
|
|
65
|
-
if (args.options.output
|
|
66
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
66
67
|
logger.log(items);
|
|
67
68
|
}
|
|
68
69
|
else {
|
|
@@ -15,6 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _YammerSearchCommand_instances, _YammerSearchCommand_initTelemetry, _YammerSearchCommand_initOptions, _YammerSearchCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../cli/Cli");
|
|
18
19
|
const request_1 = require("../../../request");
|
|
19
20
|
const formatting_1 = require("../../../utils/formatting");
|
|
20
21
|
const YammerCommand_1 = require("../../base/YammerCommand");
|
|
@@ -129,7 +130,7 @@ class YammerSearchCommand extends YammerCommand_1.default {
|
|
|
129
130
|
this.users = [];
|
|
130
131
|
try {
|
|
131
132
|
yield this.getAllItems(logger, args, 1);
|
|
132
|
-
if (args.options.output
|
|
133
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
133
134
|
logger.log({
|
|
134
135
|
summary: this.summary,
|
|
135
136
|
messages: this.messages,
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.aadUser = void 0;
|
|
13
|
+
const request_1 = require("../request");
|
|
14
|
+
const formatting_1 = require("./formatting");
|
|
15
|
+
const graphResource = 'https://graph.microsoft.com';
|
|
16
|
+
exports.aadUser = {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve the id of a user by its UPN.
|
|
19
|
+
* @param upn User UPN.
|
|
20
|
+
*/
|
|
21
|
+
getUserIdByUpn(upn) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const requestOptions = {
|
|
24
|
+
url: `${graphResource}/v1.0/users?$filter=userPrincipalName eq '${formatting_1.formatting.encodeQueryParameter(upn)}'&$select=Id`,
|
|
25
|
+
headers: {
|
|
26
|
+
accept: 'application/json;odata.metadata=none'
|
|
27
|
+
},
|
|
28
|
+
responseType: 'json'
|
|
29
|
+
};
|
|
30
|
+
const res = yield request_1.default.get(requestOptions);
|
|
31
|
+
if (res.value.length === 0) {
|
|
32
|
+
throw Error(`The specified user with user name ${upn} does not exist.`);
|
|
33
|
+
}
|
|
34
|
+
return res.value[0].id;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=aadUser.js.map
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.accessToken = void 0;
|
|
4
4
|
exports.accessToken = {
|
|
5
5
|
isAppOnlyAccessToken(accessToken) {
|
|
6
|
-
let isAppOnlyAccessToken
|
|
6
|
+
let isAppOnlyAccessToken;
|
|
7
7
|
if (!accessToken || accessToken.length === 0) {
|
|
8
8
|
return isAppOnlyAccessToken;
|
|
9
9
|
}
|
package/dist/utils/planner.js
CHANGED
|
@@ -41,17 +41,28 @@ exports.planner = {
|
|
|
41
41
|
* Get all Planner plans for a specific group.
|
|
42
42
|
* @param groupId Group ID.
|
|
43
43
|
*/
|
|
44
|
-
getPlansByGroupId(groupId) {
|
|
45
|
-
return odata_1.odata.getAllItems(`${graphResource}/v1.0/groups/${groupId}/planner/plans`,
|
|
44
|
+
getPlansByGroupId(groupId, metadata = 'none') {
|
|
45
|
+
return odata_1.odata.getAllItems(`${graphResource}/v1.0/groups/${groupId}/planner/plans`, metadata);
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Get all Planner plans for a specific roster.
|
|
49
|
+
* @param rosterId Roster ID.
|
|
50
|
+
*/
|
|
51
|
+
getPlansByRosterId(rosterId, metadata = 'none') {
|
|
52
|
+
return odata_1.odata.getAllItems(`${graphResource}/beta/planner/rosters/${rosterId}/plans`, metadata);
|
|
46
53
|
},
|
|
47
54
|
/**
|
|
48
55
|
* Get Planner plan by title in a specific group.
|
|
49
56
|
* @param title Title of the Planner plan. Case insensitive.
|
|
50
|
-
* @param groupId Owner group ID
|
|
57
|
+
* @param groupId Owner group ID.
|
|
58
|
+
* @param rosterId Roster ID.
|
|
51
59
|
*/
|
|
52
|
-
getPlanByTitle(title, groupId) {
|
|
60
|
+
getPlanByTitle(title, groupId, metadata = 'none') {
|
|
53
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
|
|
62
|
+
let plans = [];
|
|
63
|
+
if (groupId) {
|
|
64
|
+
plans = yield this.getPlansByGroupId(groupId, metadata);
|
|
65
|
+
}
|
|
55
66
|
const filteredPlans = plans.filter(p => p.title && p.title.toLowerCase() === title.toLowerCase());
|
|
56
67
|
if (!filteredPlans.length) {
|
|
57
68
|
throw Error(`The specified plan '${title}' does not exist.`);
|