@pnp/cli-microsoft365 6.8.0-beta.f473be5 → 6.8.0
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/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/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-doctor/doctor-1.17.2.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001035_DEP_fluentui_react.js +18 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021009_PKG_no_duplicate_oui_deps.js +11 -4
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001035_DEP_fluentui_react.js +18 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.2.js +61 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +29 -30
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +146 -0
- package/dist/m365/spo/commands/file/file-list.js +15 -4
- package/dist/m365/spo/commands/file/file-remove.js +3 -0
- 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/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/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.js +1 -0
- package/dist/utils/formatting.js +35 -11
- package/dist/utils/pid.js +5 -0
- 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/adaptivecard/adaptivecard-send.md +13 -13
- package/docs/docs/cmd/app/app-get.md +25 -6
- package/docs/docs/cmd/app/app-open.md +8 -2
- package/docs/docs/cmd/app/permission/permission-add.md +53 -0
- package/docs/docs/cmd/app/permission/permission-list.md +19 -19
- package/docs/docs/cmd/booking/business/business-get.md +30 -8
- package/docs/docs/cmd/booking/business/business-list.md +17 -8
- 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-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/spfx/project/project-doctor.md +1 -1
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- 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/file/file-list.md +9 -6
- package/docs/docs/cmd/spo/file/file-remove.md +12 -0
- package/docs/docs/cmd/spo/folder/folder-copy.md +1 -1
- 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/listitem/listitem-list.md +1 -1
- 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/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/membersettings/membersettings-list.md +17 -0
- package/docs/docs/cmd/teams/tab/tab-remove.md +1 -1
- package/docs/docs/cmd/todo/list/list-add.md +18 -0
- package/docs/docs/cmd/todo/list/list-get.md +18 -0
- package/docs/docs/cmd/todo/list/list-list.md +18 -0
- package/docs/docs/cmd/todo/task/task-get.md +21 -0
- package/docs/docs/cmd/todo/task/task-list.md +21 -0
- package/docs/docs/cmd/util/accesstoken/accesstoken-get.md +6 -0
- package/docs/docs/cmd/version.md +1 -1
- package/docs/docs/cmd/viva/connections/connections-app-create.md +3 -3
- 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/package.json +3 -2
|
@@ -15,19 +15,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpfxDoctorCommand_instances, _SpfxDoctorCommand_initTelemetry, _SpfxDoctorCommand_initOptions, _SpfxDoctorCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const chalk = require("chalk");
|
|
19
18
|
const child_process = require("child_process");
|
|
20
19
|
const semver_1 = require("semver");
|
|
20
|
+
const formatting_1 = require("../../../utils/formatting");
|
|
21
21
|
const commands_1 = require("../commands");
|
|
22
22
|
const base_project_command_1 = require("./project/base-project-command");
|
|
23
|
-
/**
|
|
24
|
-
* Has the particular check passed or failed
|
|
25
|
-
*/
|
|
26
|
-
var CheckStatus;
|
|
27
|
-
(function (CheckStatus) {
|
|
28
|
-
CheckStatus[CheckStatus["Success"] = 0] = "Success";
|
|
29
|
-
CheckStatus[CheckStatus["Failure"] = 1] = "Failure";
|
|
30
|
-
})(CheckStatus || (CheckStatus = {}));
|
|
31
23
|
/**
|
|
32
24
|
* Where to search for the particular npm package: only in the current project,
|
|
33
25
|
* in global packages or both
|
|
@@ -497,6 +489,21 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
497
489
|
range: '^4',
|
|
498
490
|
fix: 'npm i -g yo@4'
|
|
499
491
|
}
|
|
492
|
+
},
|
|
493
|
+
'1.17.2': {
|
|
494
|
+
gulpCli: {
|
|
495
|
+
range: '^1 || ^2',
|
|
496
|
+
fix: 'npm i -g gulp-cli@2'
|
|
497
|
+
},
|
|
498
|
+
node: {
|
|
499
|
+
range: '>=16.13.0 <17.0.0',
|
|
500
|
+
fix: 'Install Node.js >=16.13.0 <17.0.0'
|
|
501
|
+
},
|
|
502
|
+
sp: SharePointVersion.SPO,
|
|
503
|
+
yo: {
|
|
504
|
+
range: '^4',
|
|
505
|
+
fix: 'npm i -g yo@4'
|
|
506
|
+
}
|
|
500
507
|
}
|
|
501
508
|
};
|
|
502
509
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
@@ -520,12 +527,12 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
520
527
|
try {
|
|
521
528
|
spfxVersion = (_a = args.options.spfxVersion) !== null && _a !== void 0 ? _a : yield this.getSharePointFrameworkVersion(logger);
|
|
522
529
|
if (!spfxVersion) {
|
|
523
|
-
logger.log(
|
|
530
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `SharePoint Framework`));
|
|
524
531
|
throw `SharePoint Framework not found`;
|
|
525
532
|
}
|
|
526
533
|
prerequisites = this.versions[spfxVersion];
|
|
527
534
|
if (!prerequisites) {
|
|
528
|
-
logger.log(
|
|
535
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `SharePoint Framework v${spfxVersion}`));
|
|
529
536
|
throw `spfx doctor doesn't support SPFx v${spfxVersion} at this moment`;
|
|
530
537
|
}
|
|
531
538
|
if (args.options.spfxVersion) {
|
|
@@ -533,7 +540,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
533
540
|
}
|
|
534
541
|
else {
|
|
535
542
|
// spfx was detected and if we are here, it means that we support it
|
|
536
|
-
logger.log(
|
|
543
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `SharePoint Framework v${spfxVersion}`));
|
|
537
544
|
}
|
|
538
545
|
yield this.checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger);
|
|
539
546
|
yield this.checkNodeVersion(prerequisites, fixes, logger);
|
|
@@ -566,11 +573,11 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
566
573
|
if (args.options.env) {
|
|
567
574
|
const sp = this.spVersionStringToEnum(args.options.env);
|
|
568
575
|
if ((prerequisites.sp & sp) === sp) {
|
|
569
|
-
logger.log(
|
|
576
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `Supported in ${SharePointVersion[sp]}`));
|
|
570
577
|
resolve();
|
|
571
578
|
}
|
|
572
579
|
else {
|
|
573
|
-
logger.log(
|
|
580
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
|
|
574
581
|
fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
|
|
575
582
|
reject(`SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`);
|
|
576
583
|
}
|
|
@@ -601,7 +608,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
601
608
|
this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck, OptionalOrRequired.Required, fixes, logger);
|
|
602
609
|
}
|
|
603
610
|
else {
|
|
604
|
-
logger.log(
|
|
611
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `SharePoint Framework v${spfxVersionRequested} not found`));
|
|
605
612
|
fixes.push(versionCheck.fix);
|
|
606
613
|
}
|
|
607
614
|
});
|
|
@@ -614,7 +621,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
614
621
|
this.checkStatus('yo', yoVersion, prerequisites.yo, OptionalOrRequired.Required, fixes, logger);
|
|
615
622
|
}
|
|
616
623
|
else {
|
|
617
|
-
logger.log(
|
|
624
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `yo not found`));
|
|
618
625
|
fixes.push(prerequisites.yo.fix);
|
|
619
626
|
}
|
|
620
627
|
});
|
|
@@ -627,7 +634,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
627
634
|
this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli, OptionalOrRequired.Required, fixes, logger);
|
|
628
635
|
}
|
|
629
636
|
else {
|
|
630
|
-
logger.log(
|
|
637
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `gulp-cli not found`));
|
|
631
638
|
fixes.push(prerequisites.gulpCli.fix);
|
|
632
639
|
}
|
|
633
640
|
});
|
|
@@ -637,7 +644,7 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
637
644
|
.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger)
|
|
638
645
|
.then((gulpVersion) => {
|
|
639
646
|
if (gulpVersion) {
|
|
640
|
-
logger.log(
|
|
647
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `gulp should be removed`));
|
|
641
648
|
fixes.push('npm un -g gulp');
|
|
642
649
|
}
|
|
643
650
|
});
|
|
@@ -647,11 +654,11 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
647
654
|
.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger)
|
|
648
655
|
.then((typeScriptVersion) => {
|
|
649
656
|
if (typeScriptVersion) {
|
|
650
|
-
logger.log(
|
|
657
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `typescript v${typeScriptVersion} installed in the project`));
|
|
651
658
|
fixes.push('npm un typescript');
|
|
652
659
|
}
|
|
653
660
|
else {
|
|
654
|
-
logger.log(
|
|
661
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `bundled typescript used`));
|
|
655
662
|
}
|
|
656
663
|
});
|
|
657
664
|
}
|
|
@@ -775,22 +782,14 @@ class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
|
775
782
|
checkStatus(what, versionFound, versionCheck, optionalOrRequired, fixes, logger) {
|
|
776
783
|
if (versionFound) {
|
|
777
784
|
if ((0, semver_1.satisfies)(versionFound, versionCheck.range)) {
|
|
778
|
-
logger.log(
|
|
785
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Success, `${what} v${versionFound}`));
|
|
779
786
|
}
|
|
780
787
|
else {
|
|
781
|
-
logger.log(
|
|
788
|
+
logger.log(formatting_1.formatting.getStatus(formatting_1.CheckStatus.Failure, `${what} v${versionFound} found, v${versionCheck.range} required`));
|
|
782
789
|
fixes.push(versionCheck.fix);
|
|
783
790
|
}
|
|
784
791
|
}
|
|
785
792
|
}
|
|
786
|
-
getStatus(result, message) {
|
|
787
|
-
const primarySupported = process.platform !== 'win32' ||
|
|
788
|
-
process.env.CI === 'true' ||
|
|
789
|
-
process.env.TERM === 'xterm-256color';
|
|
790
|
-
const success = primarySupported ? '✔' : '√';
|
|
791
|
-
const failure = primarySupported ? '✖' : '×';
|
|
792
|
-
return `${result === CheckStatus.Success ? chalk.green(success) : chalk.red(failure)} ${message}`;
|
|
793
|
-
}
|
|
794
793
|
}
|
|
795
794
|
_SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry = function _SpfxDoctorCommand_initTelemetry() {
|
|
796
795
|
this.telemetry.push((args) => {
|
|
@@ -0,0 +1,146 @@
|
|
|
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 _SpoApplicationCustomizerRemoveCommand_instances, _SpoApplicationCustomizerRemoveCommand_initOptions, _SpoApplicationCustomizerRemoveCommand_initTelemetry, _SpoApplicationCustomizerRemoveCommand_initValidators, _SpoApplicationCustomizerRemoveCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
const spo_1 = require("../../../../utils/spo");
|
|
24
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
25
|
+
const os = require("os");
|
|
26
|
+
class SpoApplicationCustomizerRemoveCommand extends SpoCommand_1.default {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands_1.default.APPLICATIONCUSTOMIZER_REMOVE;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return 'Removes an application customizer that is added to a site';
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
_SpoApplicationCustomizerRemoveCommand_instances.add(this);
|
|
36
|
+
this.allowedScopes = ['Site', 'Web', 'All'];
|
|
37
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerRemoveCommand_instances, "m", _SpoApplicationCustomizerRemoveCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerRemoveCommand_instances, "m", _SpoApplicationCustomizerRemoveCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerRemoveCommand_instances, "m", _SpoApplicationCustomizerRemoveCommand_initValidators).call(this);
|
|
40
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerRemoveCommand_instances, "m", _SpoApplicationCustomizerRemoveCommand_initOptionSets).call(this);
|
|
41
|
+
}
|
|
42
|
+
commandAction(logger, args) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
if (args.options.confirm) {
|
|
46
|
+
return yield this.removeApplicationCustomizer(logger, args.options);
|
|
47
|
+
}
|
|
48
|
+
const result = yield Cli_1.Cli.prompt({
|
|
49
|
+
type: 'confirm',
|
|
50
|
+
name: 'continue',
|
|
51
|
+
default: false,
|
|
52
|
+
message: `Are you sure you want to remove the application customizer '${args.options.clientSideComponentId || args.options.title || args.options.id}'?`
|
|
53
|
+
});
|
|
54
|
+
if (result.continue) {
|
|
55
|
+
yield this.removeApplicationCustomizer(logger, args.options);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
removeApplicationCustomizer(logger, options) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const applicationCustomizer = yield this.getApplicationCustomizer(options);
|
|
66
|
+
if (this.verbose) {
|
|
67
|
+
logger.logToStderr(`Removing application customizer '${options.clientSideComponentId || options.title || options.id}' from the site '${options.webUrl}'...`);
|
|
68
|
+
}
|
|
69
|
+
const requestOptions = {
|
|
70
|
+
url: `${options.webUrl}/_api/${applicationCustomizer.Scope.toString() === '2' ? 'Site' : 'Web'}/UserCustomActions('${applicationCustomizer.Id}')`,
|
|
71
|
+
headers: {
|
|
72
|
+
accept: 'application/json;odata=nometadata'
|
|
73
|
+
},
|
|
74
|
+
responseType: 'json'
|
|
75
|
+
};
|
|
76
|
+
yield request_1.default.delete(requestOptions);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
getApplicationCustomizer(options) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const resolvedScope = options.scope || 'All';
|
|
82
|
+
let appCustomizers = [];
|
|
83
|
+
if (options.id) {
|
|
84
|
+
const appCustomizer = yield spo_1.spo.getCustomActionById(options.webUrl, options.id, resolvedScope);
|
|
85
|
+
if (appCustomizer) {
|
|
86
|
+
appCustomizers.push(appCustomizer);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (options.title) {
|
|
90
|
+
appCustomizers = yield spo_1.spo.getCustomActions(options.webUrl, resolvedScope, `(Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
appCustomizers = yield spo_1.spo.getCustomActions(options.webUrl, resolvedScope, `(ClientSideComponentId eq guid'${options.clientSideComponentId}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
94
|
+
}
|
|
95
|
+
if (appCustomizers.length === 0) {
|
|
96
|
+
throw `No application customizer with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
97
|
+
}
|
|
98
|
+
if (appCustomizers.length > 1) {
|
|
99
|
+
throw `Multiple application customizer with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found. Please disambiguate using IDs: ${os.EOL}${appCustomizers.map(a => `- ${a.Id}`).join(os.EOL)}`;
|
|
100
|
+
}
|
|
101
|
+
return appCustomizers[0];
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_SpoApplicationCustomizerRemoveCommand_instances = new WeakSet(), _SpoApplicationCustomizerRemoveCommand_initOptions = function _SpoApplicationCustomizerRemoveCommand_initOptions() {
|
|
106
|
+
this.options.unshift({
|
|
107
|
+
option: '-u, --webUrl <webUrl>'
|
|
108
|
+
}, {
|
|
109
|
+
option: '-t, --title [title]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --id [id]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
116
|
+
}, {
|
|
117
|
+
option: '--confirm'
|
|
118
|
+
});
|
|
119
|
+
}, _SpoApplicationCustomizerRemoveCommand_initTelemetry = function _SpoApplicationCustomizerRemoveCommand_initTelemetry() {
|
|
120
|
+
this.telemetry.push((args) => {
|
|
121
|
+
Object.assign(this.telemetryProperties, {
|
|
122
|
+
title: typeof args.options.title !== 'undefined',
|
|
123
|
+
id: typeof args.options.id !== 'undefined',
|
|
124
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
125
|
+
scope: typeof args.options.scope !== 'undefined',
|
|
126
|
+
confirm: !!args.options.confirm
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}, _SpoApplicationCustomizerRemoveCommand_initValidators = function _SpoApplicationCustomizerRemoveCommand_initValidators() {
|
|
130
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
132
|
+
return `${args.options.id} is not a valid GUID`;
|
|
133
|
+
}
|
|
134
|
+
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
135
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
136
|
+
}
|
|
137
|
+
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
138
|
+
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
139
|
+
}
|
|
140
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
141
|
+
}));
|
|
142
|
+
}, _SpoApplicationCustomizerRemoveCommand_initOptionSets = function _SpoApplicationCustomizerRemoveCommand_initOptionSets() {
|
|
143
|
+
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
144
|
+
};
|
|
145
|
+
module.exports = new SpoApplicationCustomizerRemoveCommand();
|
|
146
|
+
//# sourceMappingURL=applicationcustomizer-remove.js.map
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpoFileListCommand_instances, _SpoFileListCommand_initTelemetry, _SpoFileListCommand_initOptions, _SpoFileListCommand_initValidators;
|
|
16
|
+
var _SpoFileListCommand_instances, _SpoFileListCommand_initTelemetry, _SpoFileListCommand_initOptions, _SpoFileListCommand_initValidators, _SpoFileListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -34,6 +34,7 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
34
34
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initTelemetry).call(this);
|
|
35
35
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initOptions).call(this);
|
|
36
36
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initOptionSets).call(this);
|
|
37
38
|
}
|
|
38
39
|
commandAction(logger, args) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41,11 +42,15 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
41
42
|
logger.logToStderr(`Retrieving all files in folder '${args.options.folder}' at site '${args.options.webUrl}'${args.options.recursive ? ' (recursive)' : ''}...`);
|
|
42
43
|
}
|
|
43
44
|
try {
|
|
45
|
+
if (args.options.folder) {
|
|
46
|
+
args.options.folderUrl = args.options.folder;
|
|
47
|
+
this.warn(logger, `Option 'folder' is deprecated. Please use 'folderUrl' instead`);
|
|
48
|
+
}
|
|
44
49
|
const fieldProperties = this.formatSelectProperties(args.options.fields, args.options.output);
|
|
45
50
|
const allFiles = [];
|
|
46
51
|
const allFolders = args.options.recursive
|
|
47
|
-
? [...yield this.getFolders(args.options.
|
|
48
|
-
: [args.options.
|
|
52
|
+
? [...yield this.getFolders(args.options.folderUrl, args, logger), args.options.folderUrl]
|
|
53
|
+
: [args.options.folderUrl];
|
|
49
54
|
for (const folder of allFolders) {
|
|
50
55
|
const files = yield this.getFiles(folder, fieldProperties, args, logger);
|
|
51
56
|
files.forEach((file) => allFiles.push(file));
|
|
@@ -152,6 +157,8 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
152
157
|
_SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry = function _SpoFileListCommand_initTelemetry() {
|
|
153
158
|
this.telemetry.push((args) => {
|
|
154
159
|
Object.assign(this.telemetryProperties, {
|
|
160
|
+
folder: typeof args.options.folder !== 'undefined',
|
|
161
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
155
162
|
recursive: args.options.recursive,
|
|
156
163
|
fields: typeof args.options.fields !== 'undefined',
|
|
157
164
|
filter: typeof args.options.filter !== 'undefined'
|
|
@@ -161,7 +168,9 @@ _SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry
|
|
|
161
168
|
this.options.unshift({
|
|
162
169
|
option: '-u, --webUrl <webUrl>'
|
|
163
170
|
}, {
|
|
164
|
-
option: '-f, --folder
|
|
171
|
+
option: '-f, --folder [folder]'
|
|
172
|
+
}, {
|
|
173
|
+
option: '-f, --folderUrl [folderUrl]'
|
|
165
174
|
}, {
|
|
166
175
|
option: '--fields [fields]'
|
|
167
176
|
}, {
|
|
@@ -171,6 +180,8 @@ _SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry
|
|
|
171
180
|
});
|
|
172
181
|
}, _SpoFileListCommand_initValidators = function _SpoFileListCommand_initValidators() {
|
|
173
182
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
183
|
+
}, _SpoFileListCommand_initOptionSets = function _SpoFileListCommand_initOptionSets() {
|
|
184
|
+
this.optionSets.push({ options: ['folder', 'folderUrl'] });
|
|
174
185
|
};
|
|
175
186
|
SpoFileListCommand.pageSize = 5000;
|
|
176
187
|
module.exports = new SpoFileListCommand();
|
|
@@ -29,6 +29,9 @@ class SpoFileRemoveCommand extends SpoCommand_1.default {
|
|
|
29
29
|
get description() {
|
|
30
30
|
return 'Removes the specified file';
|
|
31
31
|
}
|
|
32
|
+
alias() {
|
|
33
|
+
return [commands_1.default.PAGE_TEMPLATE_REMOVE];
|
|
34
|
+
}
|
|
32
35
|
constructor() {
|
|
33
36
|
super();
|
|
34
37
|
_SpoFileRemoveCommand_instances.add(this);
|
|
@@ -53,10 +53,17 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
53
53
|
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.url);
|
|
54
54
|
requestUrl += `GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const fieldsProperties = this.formatSelectProperties(args.options.properties, args.options.withPermissions);
|
|
57
|
+
const queryParams = [];
|
|
58
|
+
if (fieldsProperties.selectProperties.length > 0) {
|
|
59
|
+
queryParams.push(`$select=${fieldsProperties.selectProperties.join(',')}`);
|
|
60
|
+
}
|
|
61
|
+
if (fieldsProperties.expandProperties.length > 0) {
|
|
62
|
+
queryParams.push(`$expand=${fieldsProperties.expandProperties.join(',')}`);
|
|
63
|
+
}
|
|
64
|
+
const querystring = queryParams.length > 0 ? `?${queryParams.join('&')}` : ``;
|
|
58
65
|
const requestOptions = {
|
|
59
|
-
url: requestUrl
|
|
66
|
+
url: `${requestUrl}${querystring}`,
|
|
60
67
|
headers: {
|
|
61
68
|
'accept': 'application/json;odata=nometadata'
|
|
62
69
|
},
|
|
@@ -76,6 +83,26 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
76
83
|
}
|
|
77
84
|
});
|
|
78
85
|
}
|
|
86
|
+
formatSelectProperties(properties, withPermissions) {
|
|
87
|
+
const selectProperties = [];
|
|
88
|
+
let expandProperties = [];
|
|
89
|
+
if (withPermissions) {
|
|
90
|
+
expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings'];
|
|
91
|
+
}
|
|
92
|
+
if (properties) {
|
|
93
|
+
properties.split(',').forEach((property) => {
|
|
94
|
+
const subparts = property.trim().split('/');
|
|
95
|
+
if (subparts.length > 1) {
|
|
96
|
+
expandProperties.push(subparts[0]);
|
|
97
|
+
}
|
|
98
|
+
selectProperties.push(property.trim());
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
selectProperties: [...new Set(selectProperties)],
|
|
103
|
+
expandProperties: [...new Set(expandProperties)]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
79
106
|
}
|
|
80
107
|
_SpoListGetCommand_instances = new WeakSet(), _SpoListGetCommand_initTelemetry = function _SpoListGetCommand_initTelemetry() {
|
|
81
108
|
this.telemetry.push((args) => {
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpoListListCommand_instances, _SpoListListCommand_initOptions, _SpoListListCommand_initValidators;
|
|
16
|
+
var _SpoListListCommand_instances, _SpoListListCommand_initOptions, _SpoListListCommand_initValidators, _SpoListListCommand_initTelemetry;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const odata_1 = require("../../../../utils/odata");
|
|
19
19
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -34,6 +34,7 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
34
34
|
_SpoListListCommand_instances.add(this);
|
|
35
35
|
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initOptions).call(this);
|
|
36
36
|
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoListListCommand_instances, "m", _SpoListListCommand_initTelemetry).call(this);
|
|
37
38
|
}
|
|
38
39
|
commandAction(logger, args) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41,7 +42,12 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
41
42
|
logger.logToStderr(`Retrieving all lists in site at ${args.options.webUrl}...`);
|
|
42
43
|
}
|
|
43
44
|
try {
|
|
44
|
-
const
|
|
45
|
+
const fieldProperties = this.formatSelectProperties(args.options.properties);
|
|
46
|
+
const queryParams = [`$expand=${fieldProperties.expandProperties.join(',')}`, `$select=${fieldProperties.selectProperties.join(',')}`];
|
|
47
|
+
if (args.options.filter) {
|
|
48
|
+
queryParams.push(`$filter=${args.options.filter}`);
|
|
49
|
+
}
|
|
50
|
+
const listInstances = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/lists?${queryParams.join('&')}`);
|
|
45
51
|
listInstances.forEach(l => {
|
|
46
52
|
l.Url = l.RootFolder.ServerRelativeUrl;
|
|
47
53
|
});
|
|
@@ -52,13 +58,44 @@ class SpoListListCommand extends SpoCommand_1.default {
|
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
}
|
|
61
|
+
formatSelectProperties(fields) {
|
|
62
|
+
const selectProperties = ['RootFolder/ServerRelativeUrl'];
|
|
63
|
+
const expandProperties = ['RootFolder'];
|
|
64
|
+
if (!fields) {
|
|
65
|
+
selectProperties.push('*');
|
|
66
|
+
}
|
|
67
|
+
if (fields) {
|
|
68
|
+
fields.split(',').forEach((field) => {
|
|
69
|
+
const subparts = field.trim().split('/');
|
|
70
|
+
if (subparts.length > 1) {
|
|
71
|
+
expandProperties.push(subparts[0]);
|
|
72
|
+
}
|
|
73
|
+
selectProperties.push(field.trim());
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
selectProperties: [...new Set(selectProperties)],
|
|
78
|
+
expandProperties: [...new Set(expandProperties)]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
55
81
|
}
|
|
56
82
|
_SpoListListCommand_instances = new WeakSet(), _SpoListListCommand_initOptions = function _SpoListListCommand_initOptions() {
|
|
57
83
|
this.options.unshift({
|
|
58
84
|
option: '-u, --webUrl <webUrl>'
|
|
85
|
+
}, {
|
|
86
|
+
option: '-p, --properties [properties]'
|
|
87
|
+
}, {
|
|
88
|
+
option: '-f, --filter [filter]'
|
|
59
89
|
});
|
|
60
90
|
}, _SpoListListCommand_initValidators = function _SpoListListCommand_initValidators() {
|
|
61
91
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
92
|
+
}, _SpoListListCommand_initTelemetry = function _SpoListListCommand_initTelemetry() {
|
|
93
|
+
this.telemetry.push((args) => {
|
|
94
|
+
Object.assign(this.telemetryProperties, {
|
|
95
|
+
properties: typeof args.options.properties !== 'undefined',
|
|
96
|
+
filter: typeof args.options.filter !== 'undefined'
|
|
97
|
+
});
|
|
98
|
+
});
|
|
62
99
|
};
|
|
63
100
|
module.exports = new SpoListListCommand();
|
|
64
101
|
//# sourceMappingURL=list-list.js.map
|