@pnp/cli-microsoft365 7.0.0-beta.4ebf3ad → 7.0.0-beta.5fdb9e3
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.cjs +1 -1
- package/dist/Auth.js +2 -1
- package/dist/Command.js +1 -1
- package/dist/cli/Cli.js +19 -2
- package/dist/m365/aad/commands/{o365group/o365group-add.js → m365group/m365group-add.js} +17 -17
- package/dist/m365/aad/commands/{o365group/o365group-conversation-list.js → m365group/m365group-conversation-list.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-conversation-post-list.js → m365group/m365group-conversation-post-list.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-get.js → m365group/m365group-get.js} +13 -10
- package/dist/m365/aad/commands/{o365group/o365group-list.js → m365group/m365group-list.js} +13 -28
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-clear.js → m365group/m365group-recyclebinitem-clear.js} +15 -15
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-list.js → m365group/m365group-recyclebinitem-list.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-remove.js → m365group/m365group-recyclebinitem-remove.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-restore.js → m365group/m365group-recyclebinitem-restore.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-remove.js → m365group/m365group-remove.js} +12 -12
- package/dist/m365/aad/commands/{o365group/o365group-renew.js → m365group/m365group-renew.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-report-activitycounts.js → m365group/m365group-report-activitycounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitydetail.js → m365group/m365group-report-activitydetail.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activityfilecounts.js → m365group/m365group-report-activityfilecounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitygroupcounts.js → m365group/m365group-report-activitygroupcounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitystorage.js → m365group/m365group-report-activitystorage.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-set.js → m365group/m365group-set.js} +17 -17
- package/dist/m365/aad/commands/{o365group/o365group-teamify.js → m365group/m365group-teamify.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-add.js → m365group/m365group-user-add.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-list.js → m365group/m365group-user-list.js} +12 -12
- package/dist/m365/aad/commands/{o365group/o365group-user-remove.js → m365group/m365group-user-remove.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-set.js → m365group/m365group-user-set.js} +15 -15
- package/dist/m365/aad/commands.js +22 -22
- package/dist/m365/cli/commands/config/config-list.js +16 -0
- package/dist/m365/cli/commands.js +1 -0
- package/dist/m365/pa/commands/app/app-permission-ensure.js +162 -0
- package/dist/m365/pa/commands/app/app-permission-list.js +2 -2
- package/dist/m365/pa/commands/app/app-permission-remove.js +153 -0
- package/dist/m365/pa/commands.js +2 -0
- package/dist/m365/planner/commands/bucket/bucket-add.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-remove.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
- package/dist/m365/planner/commands/plan/plan-get.js +1 -2
- package/dist/m365/planner/commands/plan/plan-list.js +4 -5
- package/dist/m365/planner/commands/plan/plan-set.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +76 -106
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +27 -26
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/file/file-add.js +13 -13
- package/dist/m365/spo/commands/file/file-checkin.js +1 -1
- package/dist/m365/spo/commands/file/file-checkout.js +1 -1
- package/dist/m365/spo/commands/file/file-copy.js +36 -4
- package/dist/m365/spo/commands/file/file-list.js +4 -4
- package/dist/m365/spo/commands/file/file-move.js +74 -98
- package/dist/m365/spo/commands/file/file-remove.js +6 -6
- package/dist/m365/spo/commands/file/file-rename.js +2 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
- package/dist/m365/spo/commands/file/file-version-get.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +1 -1
- package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
- package/dist/m365/spo/commands/folder/folder-add.js +2 -4
- package/dist/m365/spo/commands/folder/folder-copy.js +89 -45
- package/dist/m365/spo/commands/folder/folder-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-list.js +2 -2
- package/dist/m365/spo/commands/folder/folder-move.js +89 -47
- package/dist/m365/spo/commands/folder/folder-remove.js +7 -4
- package/dist/m365/spo/commands/folder/folder-rename.js +13 -17
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/group/group-list.js +0 -1
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +32 -3
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +63 -59
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +28 -31
- package/dist/m365/spo/commands/site/FlowsPolicy.js +7 -0
- package/dist/m365/spo/commands/site/site-ensure.js +3 -3
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +22 -22
- package/dist/m365/spo/commands/site/site-list.js +29 -39
- package/dist/m365/spo/commands/site/site-set.js +60 -49
- package/dist/m365/spo/commands/theme/theme-list.js +1 -9
- package/dist/m365/spo/commands/theme/theme-remove.js +24 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +27 -27
- package/dist/m365/spo/commands/web/web-reindex.js +35 -42
- package/dist/m365/spo/commands/web/web-remove.js +21 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +16 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +33 -44
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +18 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +19 -19
- package/dist/m365/yammer/commands/message/message-like-set.js +27 -28
- package/dist/m365/yammer/commands/message/message-list.js +62 -81
- package/dist/m365/yammer/commands/message/message-remove.js +18 -18
- package/dist/m365/yammer/commands/yammer-search.js +53 -69
- package/dist/utils/planner.js +4 -3
- package/dist/utils/spo.js +13 -54
- package/docs/docs/cmd/aad/{o365group/o365group-add.mdx → m365group/m365group-add.mdx} +13 -13
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-list.mdx → m365group/m365group-conversation-list.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-post-list.mdx → m365group/m365group-conversation-post-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-get.mdx → m365group/m365group-get.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-list.mdx → m365group/m365group-list.mdx} +12 -29
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-clear.mdx → m365group/m365group-recyclebinitem-clear.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-list.mdx → m365group/m365group-recyclebinitem-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-remove.mdx → m365group/m365group-recyclebinitem-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-restore.mdx → m365group/m365group-recyclebinitem-restore.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-remove.mdx → m365group/m365group-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-renew.mdx → m365group/m365group-renew.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitycounts.mdx → m365group/m365group-report-activitycounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitydetail.mdx → m365group/m365group-report-activitydetail.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-report-activityfilecounts.mdx → m365group/m365group-report-activityfilecounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitygroupcounts.mdx → m365group/m365group-report-activitygroupcounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitystorage.mdx → m365group/m365group-report-activitystorage.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-set.mdx → m365group/m365group-set.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-teamify.mdx → m365group/m365group-teamify.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-add.mdx → m365group/m365group-user-add.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-list.mdx → m365group/m365group-user-list.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-user-remove.mdx → m365group/m365group-user-remove.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-set.mdx → m365group/m365group-user-set.mdx} +5 -5
- package/docs/docs/cmd/aad/user/user-set.mdx +1 -1
- package/docs/docs/cmd/cli/config/config-list.mdx +78 -0
- package/docs/docs/cmd/flow/flow-enable.mdx +2 -2
- package/docs/docs/cmd/login.mdx +6 -0
- package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
- package/docs/docs/cmd/planner/plan/plan-add.mdx +1 -1
- package/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -9
- package/docs/docs/cmd/spo/file/file-checkout.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +20 -16
- package/docs/docs/cmd/spo/file/file-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-move.mdx +36 -18
- package/docs/docs/cmd/spo/file/file-remove.mdx +8 -8
- package/docs/docs/cmd/spo/file/file-rename.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-add.mdx +76 -1
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +39 -12
- package/docs/docs/cmd/spo/folder/folder-get.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-move.mdx +40 -13
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-rename.mdx +5 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/docs/docs/cmd/teams/team/team-add.mdx +1 -1
- package/docs/docs/cmd/yammer/network/network-list.mdx +1 -1
- package/npm-shrinkwrap.json +143 -89
- package/package.json +13 -13
- /package/dist/m365/aad/commands/{o365group → m365group}/GroupExtended.js +0 -0
package/dist/m365/pa/commands.js
CHANGED
|
@@ -6,7 +6,9 @@ export default {
|
|
|
6
6
|
APP_REMOVE: `${prefix} app remove`,
|
|
7
7
|
APP_CONSENT_SET: `${prefix} app consent set`,
|
|
8
8
|
APP_OWNER_SET: `${prefix} app owner set`,
|
|
9
|
+
APP_PERMISSION_ENSURE: `${prefix} app permission ensure`,
|
|
9
10
|
APP_PERMISSION_LIST: `${prefix} app permission list`,
|
|
11
|
+
APP_PERMISSION_REMOVE: `${prefix} app permission remove`,
|
|
10
12
|
CONNECTOR_EXPORT: `${prefix} connector export`,
|
|
11
13
|
CONNECTOR_LIST: `${prefix} connector list`,
|
|
12
14
|
ENVIRONMENT_GET: `${prefix} environment get`,
|
|
@@ -59,8 +59,8 @@ class PlannerBucketAddCommand extends GraphCommand {
|
|
|
59
59
|
const plan = await planner.getPlanByTitle(args.options.planTitle, groupId);
|
|
60
60
|
return plan.id;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
return
|
|
62
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
63
|
+
return plan.id;
|
|
64
64
|
}
|
|
65
65
|
async getGroupId(args) {
|
|
66
66
|
if (args.options.ownerGroupId) {
|
|
@@ -68,8 +68,8 @@ class PlannerBucketGetCommand extends GraphCommand {
|
|
|
68
68
|
const plan = await planner.getPlanByTitle(planTitle, groupId);
|
|
69
69
|
return plan.id;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
return
|
|
71
|
+
const plan = await planner.getPlanByRosterId(rosterId);
|
|
72
|
+
return plan.id;
|
|
73
73
|
}
|
|
74
74
|
async getBucketById(id) {
|
|
75
75
|
const requestOptions = {
|
|
@@ -47,8 +47,8 @@ class PlannerBucketListCommand extends GraphCommand {
|
|
|
47
47
|
const plan = await planner.getPlanByTitle(args.options.planTitle, groupId);
|
|
48
48
|
return plan.id;
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
return
|
|
50
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
51
|
+
return plan.id;
|
|
52
52
|
}
|
|
53
53
|
async getGroupId(args) {
|
|
54
54
|
if (args.options.ownerGroupId) {
|
|
@@ -98,8 +98,8 @@ class PlannerBucketRemoveCommand extends GraphCommand {
|
|
|
98
98
|
const plan = await planner.getPlanByTitle(planTitle, groupId);
|
|
99
99
|
return plan.id;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
return
|
|
101
|
+
const plan = await planner.getPlanByRosterId(rosterId);
|
|
102
|
+
return plan.id;
|
|
103
103
|
}
|
|
104
104
|
async getGroupId(args) {
|
|
105
105
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
@@ -89,8 +89,8 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
89
89
|
const plan = await planner.getPlanByTitle(planTitle, groupId);
|
|
90
90
|
return plan.id;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
return
|
|
92
|
+
const plan = await planner.getPlanByRosterId(rosterId);
|
|
93
|
+
return plan.id;
|
|
94
94
|
}
|
|
95
95
|
async getGroupId(args) {
|
|
96
96
|
const { ownerGroupId, ownerGroupName } = args.options;
|
|
@@ -38,8 +38,7 @@ class PlannerPlanGetCommand extends GraphCommand {
|
|
|
38
38
|
else {
|
|
39
39
|
let plan = {};
|
|
40
40
|
if (args.options.rosterId) {
|
|
41
|
-
|
|
42
|
-
plan = plans[0];
|
|
41
|
+
plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
43
42
|
}
|
|
44
43
|
else {
|
|
45
44
|
let groupId = undefined;
|
|
@@ -29,17 +29,16 @@ class PlannerPlanListCommand extends GraphCommand {
|
|
|
29
29
|
}
|
|
30
30
|
async commandAction(logger, args) {
|
|
31
31
|
try {
|
|
32
|
-
let plannerPlans =
|
|
32
|
+
let plannerPlans = [];
|
|
33
33
|
if (args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
34
34
|
const groupId = await this.getGroupId(args);
|
|
35
35
|
plannerPlans = await planner.getPlansByGroupId(groupId);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (plannerPlans && plannerPlans.length > 0) {
|
|
41
|
-
await logger.log(plannerPlans);
|
|
38
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
39
|
+
plannerPlans.push(plan);
|
|
42
40
|
}
|
|
41
|
+
await logger.log(plannerPlans);
|
|
43
42
|
}
|
|
44
43
|
catch (err) {
|
|
45
44
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -47,8 +47,8 @@ class PlannerPlanSetCommand extends GraphCommand {
|
|
|
47
47
|
}
|
|
48
48
|
let groupId = '';
|
|
49
49
|
if (args.options.rosterId) {
|
|
50
|
-
const
|
|
51
|
-
return
|
|
50
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
51
|
+
return plan.id;
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
groupId = await this.getGroupId(args);
|
|
@@ -67,7 +67,7 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
67
67
|
'1.17.2',
|
|
68
68
|
'1.17.3',
|
|
69
69
|
'1.17.4',
|
|
70
|
-
'1.18.0-beta.
|
|
70
|
+
'1.18.0-beta.5'
|
|
71
71
|
];
|
|
72
72
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
73
73
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -42,7 +42,7 @@ export class PnPJsRule extends BasicDependencyRule {
|
|
|
42
42
|
}
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
|
-
visit(project) {
|
|
45
|
+
async visit(project) {
|
|
46
46
|
const findings = this.pnpModules
|
|
47
47
|
.map(x => this.getModuleAndParents(project, x.key))
|
|
48
48
|
.reduce((x, y) => [...x, ...y]);
|
|
@@ -67,7 +67,7 @@ export class PnPJsRule extends BasicDependencyRule {
|
|
|
67
67
|
targetValue: 'require(\"tslib\");'
|
|
68
68
|
})));
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return { entries: findings, suggestions: fileEdits };
|
|
71
71
|
}
|
|
72
72
|
getEntryFilesList(project) {
|
|
73
73
|
return project && project.manifests ? project.manifests.map(x => x.path.replace('.manifest.json', '.ts')) : [];
|
|
@@ -103,7 +103,7 @@ export default [
|
|
|
103
103
|
'fixWith': 'symbol'
|
|
104
104
|
},
|
|
105
105
|
'Function': {
|
|
106
|
-
'message': 'The \\'Function\\' type accepts any function-like value
|
|
106
|
+
'message': 'The \\'Function\\' type accepts any function-like value.\\nIt provides no type safety when calling the function, which can be a common source of bugs.\\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \\'new\\'.\\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -27,33 +27,33 @@ import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_D
|
|
|
27
27
|
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
28
28
|
import { FN010010_YORC_sdkVersions_teams_js } from './rules/FN010010_YORC_sdkVersions_teams_js.js';
|
|
29
29
|
export default [
|
|
30
|
-
new FN001001_DEP_microsoft_sp_core_library('1.18.0-beta.
|
|
31
|
-
new FN001002_DEP_microsoft_sp_lodash_subset('1.18.0-beta.
|
|
32
|
-
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.18.0-beta.
|
|
33
|
-
new FN001004_DEP_microsoft_sp_webpart_base('1.18.0-beta.
|
|
34
|
-
new FN001011_DEP_microsoft_sp_dialog('1.18.0-beta.
|
|
35
|
-
new FN001012_DEP_microsoft_sp_application_base('1.18.0-beta.
|
|
36
|
-
new FN001014_DEP_microsoft_sp_listview_extensibility('1.18.0-beta.
|
|
37
|
-
new FN001021_DEP_microsoft_sp_property_pane('1.18.0-beta.
|
|
30
|
+
new FN001001_DEP_microsoft_sp_core_library('1.18.0-beta.5'),
|
|
31
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.18.0-beta.5'),
|
|
32
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.18.0-beta.5'),
|
|
33
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.18.0-beta.5'),
|
|
34
|
+
new FN001011_DEP_microsoft_sp_dialog('1.18.0-beta.5'),
|
|
35
|
+
new FN001012_DEP_microsoft_sp_application_base('1.18.0-beta.5'),
|
|
36
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.18.0-beta.5'),
|
|
37
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.18.0-beta.5'),
|
|
38
38
|
new FN001022_DEP_office_ui_fabric_react('', false),
|
|
39
|
-
new FN001023_DEP_microsoft_sp_component_base('1.18.0-beta.
|
|
40
|
-
new FN001024_DEP_microsoft_sp_diagnostics('1.18.0-beta.
|
|
41
|
-
new FN001025_DEP_microsoft_sp_dynamic_data('1.18.0-beta.
|
|
42
|
-
new FN001026_DEP_microsoft_sp_extension_base('1.18.0-beta.
|
|
43
|
-
new FN001027_DEP_microsoft_sp_http('1.18.0-beta.
|
|
44
|
-
new FN001028_DEP_microsoft_sp_list_subscription('1.18.0-beta.
|
|
45
|
-
new FN001029_DEP_microsoft_sp_loader('1.18.0-beta.
|
|
46
|
-
new FN001030_DEP_microsoft_sp_module_interfaces('1.18.0-beta.
|
|
47
|
-
new FN001031_DEP_microsoft_sp_odata_types('1.18.0-beta.
|
|
48
|
-
new FN001032_DEP_microsoft_sp_page_context('1.18.0-beta.
|
|
39
|
+
new FN001023_DEP_microsoft_sp_component_base('1.18.0-beta.5'),
|
|
40
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.18.0-beta.5'),
|
|
41
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.18.0-beta.5'),
|
|
42
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.18.0-beta.5'),
|
|
43
|
+
new FN001027_DEP_microsoft_sp_http('1.18.0-beta.5'),
|
|
44
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.18.0-beta.5'),
|
|
45
|
+
new FN001029_DEP_microsoft_sp_loader('1.18.0-beta.5'),
|
|
46
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.18.0-beta.5'),
|
|
47
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.18.0-beta.5'),
|
|
48
|
+
new FN001032_DEP_microsoft_sp_page_context('1.18.0-beta.5'),
|
|
49
49
|
new FN001035_DEP_fluentui_react('8.106.4'),
|
|
50
|
-
new FN001013_DEP_microsoft_decorators('1.18.0-beta.
|
|
51
|
-
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.0-beta.
|
|
52
|
-
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.0-beta.
|
|
53
|
-
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.0-beta.
|
|
54
|
-
new FN002001_DEVDEP_microsoft_sp_build_web('1.18.0-beta.
|
|
55
|
-
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.0-beta.
|
|
56
|
-
new FN010001_YORC_version('1.18.0-beta.
|
|
50
|
+
new FN001013_DEP_microsoft_decorators('1.18.0-beta.5'),
|
|
51
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.0-beta.5'),
|
|
52
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.0-beta.5'),
|
|
53
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.0-beta.5'),
|
|
54
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.18.0-beta.5'),
|
|
55
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.0-beta.5'),
|
|
56
|
+
new FN010001_YORC_version('1.18.0-beta.5'),
|
|
57
57
|
new FN010010_YORC_sdkVersions_teams_js('2.12.0')
|
|
58
58
|
];
|
|
59
|
-
//# sourceMappingURL=upgrade-1.18.0-beta.
|
|
59
|
+
//# sourceMappingURL=upgrade-1.18.0-beta.5.js.map
|
|
@@ -71,7 +71,7 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
71
71
|
'1.17.2',
|
|
72
72
|
'1.17.3',
|
|
73
73
|
'1.17.4',
|
|
74
|
-
'1.18.0-beta.
|
|
74
|
+
'1.18.0-beta.5'
|
|
75
75
|
];
|
|
76
76
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
77
77
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -524,14 +524,14 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
524
524
|
fix: 'npm i -g yo@4'
|
|
525
525
|
}
|
|
526
526
|
},
|
|
527
|
-
'1.18.0-beta.
|
|
527
|
+
'1.18.0-beta.5': {
|
|
528
528
|
gulpCli: {
|
|
529
529
|
range: '^1 || ^2',
|
|
530
530
|
fix: 'npm i -g gulp-cli@2'
|
|
531
531
|
},
|
|
532
532
|
node: {
|
|
533
|
-
range: '>=16.
|
|
534
|
-
fix: 'Install Node.js >=16.
|
|
533
|
+
range: '>=16.14.0 <17.0.0',
|
|
534
|
+
fix: 'Install Node.js >=16.14.0 <17.0.0'
|
|
535
535
|
},
|
|
536
536
|
sp: SharePointVersion.SPO,
|
|
537
537
|
yo: {
|
|
@@ -603,31 +603,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
603
603
|
this.handleRejectedPromise(err);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
resolve();
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
await logger.log(formatting.getStatus(CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
|
|
616
|
-
fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
|
|
617
|
-
reject(`SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
else {
|
|
621
|
-
resolve();
|
|
606
|
+
async checkSharePointCompatibility(spfxVersion, prerequisites, args, fixes, logger) {
|
|
607
|
+
if (args.options.env) {
|
|
608
|
+
const sp = this.spVersionStringToEnum(args.options.env);
|
|
609
|
+
if ((prerequisites.sp & sp) === sp) {
|
|
610
|
+
await logger.log(formatting.getStatus(CheckStatus.Success, `Supported in ${SharePointVersion[sp]}`));
|
|
611
|
+
return;
|
|
622
612
|
}
|
|
623
|
-
|
|
613
|
+
await logger.log(formatting.getStatus(CheckStatus.Failure, `Not supported in ${SharePointVersion[sp]}`));
|
|
614
|
+
fixes.push(`Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`);
|
|
615
|
+
throw `SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`;
|
|
616
|
+
}
|
|
624
617
|
}
|
|
625
|
-
checkNodeVersion(prerequisites, fixes, logger) {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
.then((nodeVersion) => {
|
|
629
|
-
this.checkStatus('Node', nodeVersion, prerequisites.node, OptionalOrRequired.Required, fixes, logger);
|
|
630
|
-
});
|
|
618
|
+
async checkNodeVersion(prerequisites, fixes, logger) {
|
|
619
|
+
const nodeVersion = this.getNodeVersion();
|
|
620
|
+
this.checkStatus('Node', nodeVersion, prerequisites.node, OptionalOrRequired.Required, fixes, logger);
|
|
631
621
|
}
|
|
632
622
|
async checkSharePointFrameworkVersion(spfxVersionRequested, fixes, logger) {
|
|
633
623
|
let spfxVersionDetected = await this.getSPFxVersionFromYoRcFile(logger);
|
|
@@ -646,54 +636,42 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
646
636
|
fixes.push(versionCheck.fix);
|
|
647
637
|
}
|
|
648
638
|
}
|
|
649
|
-
checkYo(prerequisites, fixes, logger) {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
.
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
fixes.push(prerequisites.yo.fix);
|
|
659
|
-
}
|
|
660
|
-
});
|
|
639
|
+
async checkYo(prerequisites, fixes, logger) {
|
|
640
|
+
const yoVersion = await this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
641
|
+
if (yoVersion) {
|
|
642
|
+
this.checkStatus('yo', yoVersion, prerequisites.yo, OptionalOrRequired.Required, fixes, logger);
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
await logger.log(formatting.getStatus(CheckStatus.Failure, `yo not found`));
|
|
646
|
+
fixes.push(prerequisites.yo.fix);
|
|
647
|
+
}
|
|
661
648
|
}
|
|
662
|
-
checkGulpCli(prerequisites, fixes, logger) {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
.
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
fixes.push(prerequisites.gulpCli.fix);
|
|
672
|
-
}
|
|
673
|
-
});
|
|
649
|
+
async checkGulpCli(prerequisites, fixes, logger) {
|
|
650
|
+
const gulpCliVersion = await this.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
651
|
+
if (gulpCliVersion) {
|
|
652
|
+
this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli, OptionalOrRequired.Required, fixes, logger);
|
|
653
|
+
}
|
|
654
|
+
else {
|
|
655
|
+
await logger.log(formatting.getStatus(CheckStatus.Failure, `gulp-cli not found`));
|
|
656
|
+
fixes.push(prerequisites.gulpCli.fix);
|
|
657
|
+
}
|
|
674
658
|
}
|
|
675
|
-
checkGulp(fixes, logger) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
.
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
fixes.push('npm un -g gulp');
|
|
682
|
-
}
|
|
683
|
-
});
|
|
659
|
+
async checkGulp(fixes, logger) {
|
|
660
|
+
const gulpVersion = await this.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
661
|
+
if (gulpVersion) {
|
|
662
|
+
await logger.log(formatting.getStatus(CheckStatus.Failure, `gulp should be removed`));
|
|
663
|
+
fixes.push('npm un -g gulp');
|
|
664
|
+
}
|
|
684
665
|
}
|
|
685
|
-
checkTypeScript(fixes, logger) {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
.
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
await logger.log(formatting.getStatus(CheckStatus.Success, `bundled typescript used`));
|
|
695
|
-
}
|
|
696
|
-
});
|
|
666
|
+
async checkTypeScript(fixes, logger) {
|
|
667
|
+
const typeScriptVersion = await this.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue, logger);
|
|
668
|
+
if (typeScriptVersion) {
|
|
669
|
+
await logger.log(formatting.getStatus(CheckStatus.Failure, `typescript v${typeScriptVersion} installed in the project`));
|
|
670
|
+
fixes.push('npm un typescript');
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
await logger.log(formatting.getStatus(CheckStatus.Success, `bundled typescript used`));
|
|
674
|
+
}
|
|
697
675
|
}
|
|
698
676
|
spVersionStringToEnum(sp) {
|
|
699
677
|
return SharePointVersion[sp.toUpperCase()];
|
|
@@ -742,43 +720,35 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
742
720
|
}
|
|
743
721
|
}
|
|
744
722
|
}
|
|
745
|
-
getPackageVersion(packageName, searchMode, handlePromise, logger) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
723
|
+
async getPackageVersion(packageName, searchMode, handlePromise, logger) {
|
|
724
|
+
const args = ['ls', packageName, '--depth=0', '--json'];
|
|
725
|
+
if (searchMode === PackageSearchMode.GlobalOnly) {
|
|
726
|
+
args.push('-g');
|
|
727
|
+
}
|
|
728
|
+
let version;
|
|
729
|
+
try {
|
|
730
|
+
version = await this.getPackageVersionFromNpm(args, logger);
|
|
731
|
+
}
|
|
732
|
+
catch {
|
|
733
|
+
if (searchMode === PackageSearchMode.LocalAndGlobal) {
|
|
749
734
|
args.push('-g');
|
|
735
|
+
version = await this.getPackageVersionFromNpm(args, logger);
|
|
750
736
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
if (version) {
|
|
767
|
-
resolve(version);
|
|
768
|
-
}
|
|
769
|
-
else {
|
|
770
|
-
if (handlePromise === HandlePromise.Continue) {
|
|
771
|
-
resolve('');
|
|
772
|
-
}
|
|
773
|
-
else {
|
|
774
|
-
reject();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
})
|
|
778
|
-
.catch((err) => {
|
|
779
|
-
reject(err);
|
|
780
|
-
});
|
|
781
|
-
});
|
|
737
|
+
else {
|
|
738
|
+
version = '';
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (version) {
|
|
742
|
+
return version;
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
if (handlePromise === HandlePromise.Continue) {
|
|
746
|
+
return '';
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
throw new Error();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
782
752
|
}
|
|
783
753
|
getPackageVersionFromNpm(args, logger) {
|
|
784
754
|
return new Promise(async (resolve, reject) => {
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import request from '../../../../request.js';
|
|
2
2
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
3
|
export class SpoAppBaseCommand extends SpoCommand {
|
|
4
|
-
getAppCatalogSiteUrl(logger, authSiteUrl, args) {
|
|
5
|
-
|
|
6
|
-
if
|
|
7
|
-
|
|
4
|
+
async getAppCatalogSiteUrl(logger, authSiteUrl, args) {
|
|
5
|
+
if (args.options.appCatalogScope === 'sitecollection') {
|
|
6
|
+
// trim trailing slashes if there are any
|
|
7
|
+
const appCatalogUrl = args.options.appCatalogUrl.replace(/\/$/, '');
|
|
8
|
+
const appCatalogUrlChunks = appCatalogUrl.split('/');
|
|
9
|
+
// Trim the last part of the URL if it ends on '/appcatalog', but don't trim it if the site URL is called like that (/sites/appcatalog).
|
|
10
|
+
if (appCatalogUrl.toLowerCase().endsWith('/appcatalog') && appCatalogUrlChunks.length !== 5) {
|
|
11
|
+
return appCatalogUrl.substring(0, appCatalogUrl.lastIndexOf('/'));
|
|
8
12
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
reject(err);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
13
|
+
}
|
|
14
|
+
if (args.options.appCatalogUrl) {
|
|
15
|
+
return args.options.appCatalogUrl.replace(/\/$/, '');
|
|
16
|
+
}
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
await logger.logToStderr('Getting tenant app catalog url...');
|
|
19
|
+
}
|
|
20
|
+
const requestOptions = {
|
|
21
|
+
url: `${authSiteUrl}/_api/SP_TenantSettings_Current`,
|
|
22
|
+
headers: {
|
|
23
|
+
accept: 'application/json;odata=nometadata'
|
|
24
|
+
},
|
|
25
|
+
responseType: 'json'
|
|
26
|
+
};
|
|
27
|
+
const response = await request.get(requestOptions);
|
|
28
|
+
if (response.CorporateCatalogUrl) {
|
|
29
|
+
return response.CorporateCatalogUrl;
|
|
30
|
+
}
|
|
31
|
+
throw new Error('Tenant app catalog is not configured.');
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=SpoAppBaseCommand.js.map
|
|
@@ -22,6 +22,7 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
_SpoAppAddCommand_instances.add(this);
|
|
25
|
+
this.appCatalogScopeOptions = ['tenant', 'sitecollection'];
|
|
25
26
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initTelemetry).call(this);
|
|
26
27
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initOptions).call(this);
|
|
27
28
|
__classPrivateFieldGet(this, _SpoAppAddCommand_instances, "m", _SpoAppAddCommand_initValidators).call(this);
|
|
@@ -62,9 +63,9 @@ class SpoAppAddCommand extends SpoAppBaseCommand {
|
|
|
62
63
|
_SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = function _SpoAppAddCommand_initTelemetry() {
|
|
63
64
|
this.telemetry.push((args) => {
|
|
64
65
|
Object.assign(this.telemetryProperties, {
|
|
65
|
-
overwrite:
|
|
66
|
+
overwrite: !!args.options.overwrite,
|
|
66
67
|
appCatalogScope: args.options.appCatalogScope || 'tenant',
|
|
67
|
-
appCatalogUrl:
|
|
68
|
+
appCatalogUrl: typeof args.options.appCatalogUrl !== 'undefined'
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
71
|
}, _SpoAppAddCommand_initOptions = function _SpoAppAddCommand_initOptions() {
|
|
@@ -72,7 +73,7 @@ _SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = f
|
|
|
72
73
|
option: '-p, --filePath <filePath>'
|
|
73
74
|
}, {
|
|
74
75
|
option: '-s, --appCatalogScope [appCatalogScope]',
|
|
75
|
-
autocomplete:
|
|
76
|
+
autocomplete: this.appCatalogScopeOptions
|
|
76
77
|
}, {
|
|
77
78
|
option: '-u, --appCatalogUrl [appCatalogUrl]'
|
|
78
79
|
}, {
|
|
@@ -80,14 +81,13 @@ _SpoAppAddCommand_instances = new WeakSet(), _SpoAppAddCommand_initTelemetry = f
|
|
|
80
81
|
});
|
|
81
82
|
}, _SpoAppAddCommand_initValidators = function _SpoAppAddCommand_initValidators() {
|
|
82
83
|
this.validators.push(async (args) => {
|
|
83
|
-
// verify either 'tenant' or 'sitecollection' specified if scope provided
|
|
84
84
|
if (args.options.appCatalogScope) {
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
85
|
+
const appCatalogScope = args.options.appCatalogScope.toLowerCase();
|
|
86
|
+
if (this.appCatalogScopeOptions.indexOf(appCatalogScope) === -1) {
|
|
87
|
+
return `${args.options.appCatalogScope} is not a valid appCatalogScope. Allowed values are: ${this.appCatalogScopeOptions.join(', ')}`;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
90
|
-
return `You must specify appCatalogUrl when
|
|
89
|
+
if (appCatalogScope === 'sitecollection' && !args.options.appCatalogUrl) {
|
|
90
|
+
return `You must specify appCatalogUrl when appCatalogScope is sitecollection`;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
const fullPath = path.resolve(args.options.filePath);
|