@pnp/cli-microsoft365 6.9.0-beta.6a23aba → 6.9.0-beta.8393174
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/.devcontainer/Dockerfile +12 -19
- package/.devcontainer/devcontainer.json +24 -17
- package/Dockerfile +3 -1
- package/dist/Auth.js +2 -8
- package/dist/AuthServer.js +2 -4
- package/dist/cli/Cli.js +16 -0
- package/dist/m365/aad/commands/app/app-add.js +258 -249
- package/dist/m365/aad/commands/app/app-get.js +65 -62
- package/dist/m365/aad/commands/app/app-remove.js +22 -23
- package/dist/m365/aad/commands/app/app-role-add.js +35 -34
- package/dist/m365/aad/commands/app/app-role-list.js +22 -23
- package/dist/m365/aad/commands/app/app-role-remove.js +76 -73
- package/dist/m365/aad/commands/app/app-set.js +103 -103
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +16 -14
- package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +43 -52
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +20 -16
- package/dist/m365/aad/commands/o365group/o365group-add.js +40 -37
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +7 -6
- package/dist/m365/aad/commands/o365group/o365group-list.js +6 -11
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +7 -8
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +23 -24
- package/dist/m365/aad/commands/o365group/o365group-set.js +15 -20
- package/dist/m365/aad/commands/o365group/o365group-teamify.js +15 -16
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +17 -10
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +17 -10
- package/dist/m365/aad/commands/policy/policy-list.js +12 -13
- package/dist/m365/aad/commands/siteclassification/siteclassification-enable.js +1 -3
- package/dist/m365/aad/commands/siteclassification/siteclassification-set.js +19 -20
- package/dist/m365/aad/commands/sp/sp-add.js +22 -23
- package/dist/m365/aad/commands/sp/sp-get.js +22 -23
- package/dist/m365/app/commands/app-open.js +4 -14
- package/dist/m365/cli/commands/cli-issue.js +4 -10
- package/dist/m365/cli/commands/cli-reconsent.js +2 -8
- package/dist/m365/cli/commands/config/config-set.js +1 -0
- package/dist/m365/commands/docs.js +2 -8
- package/dist/m365/commands/login.js +20 -0
- package/dist/m365/commands/setupPresets.js +2 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +147 -143
- package/dist/m365/file/commands/file-add.js +87 -93
- package/dist/m365/file/commands/file-list.js +49 -55
- package/dist/m365/flow/commands/flow-list.js +4 -4
- package/dist/m365/flow/commands/flow-remove.js +2 -3
- package/dist/m365/flow/commands/run/run-resubmit.js +11 -10
- package/dist/m365/onedrive/commands/onedrive-list.js +21 -32
- package/dist/m365/outlook/commands/message/message-list.js +18 -23
- package/dist/m365/outlook/commands/message/message-move.js +15 -20
- package/dist/m365/pa/commands/app/app-export.js +3 -4
- package/dist/m365/pa/commands/app/app-get.js +11 -9
- package/dist/m365/pa/commands/app/app-remove.js +1 -1
- package/dist/m365/pa/commands/pcf/pcf-init.js +1 -2
- package/dist/m365/pa/commands/solution/solution-init.js +1 -2
- package/dist/m365/pa/commands/solution/solution-reference-add.js +1 -2
- package/dist/m365/planner/commands/bucket/bucket-add.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-get.js +27 -28
- package/dist/m365/planner/commands/bucket/bucket-list.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-remove.js +33 -34
- package/dist/m365/planner/commands/bucket/bucket-set.js +33 -34
- package/dist/m365/planner/commands/plan/plan-add.js +49 -52
- package/dist/m365/planner/commands/plan/plan-set.js +19 -20
- package/dist/m365/planner/commands/task/task-add.js +75 -78
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +11 -10
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -8
- package/dist/m365/planner/commands/task/task-get.js +53 -56
- package/dist/m365/planner/commands/task/task-list.js +23 -24
- package/dist/m365/planner/commands/task/task-reference-add.js +11 -10
- package/dist/m365/planner/commands/task/task-reference-remove.js +13 -14
- package/dist/m365/planner/commands/task/task-remove.js +44 -48
- package/dist/m365/planner/commands/task/task-set.js +83 -87
- package/dist/m365/pp/commands/card/card-get.js +6 -1
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +0 -5
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +0 -5
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +19 -22
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +0 -5
- package/dist/m365/spfx/commands/project/JsonRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +1 -0
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +17 -24
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +154 -0
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -2
- package/dist/m365/spo/commands/file/file-checkout-undo.js +119 -0
- package/dist/m365/spo/commands/homesite/homesite-remove.js +1 -1
- package/dist/m365/spo/commands/list/list-sensitivitylabel-ensure.js +127 -0
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +31 -1
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +31 -2
- package/dist/m365/{teams/Message.js → spo/commands/tenant/Solution.js} +1 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +156 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +215 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +114 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +50 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +1 -1
- package/dist/m365/spo/commands.js +7 -0
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -7
- package/dist/settingsNames.js +1 -0
- package/dist/utils/browserUtil.js +23 -0
- package/dist/utils/md.js +1 -3
- package/dist/utils/spo.js +60 -0
- package/docs/docs/cmd/aad/app/app-add.mdx +113 -0
- package/docs/docs/cmd/aad/app/app-get.mdx +217 -0
- package/docs/docs/cmd/aad/app/app-list.mdx +21 -0
- package/docs/docs/cmd/aad/app/app-role-add.mdx +4 -0
- package/docs/docs/cmd/aad/app/app-role-list.mdx +63 -0
- package/docs/docs/cmd/aad/app/app-role-remove.mdx +4 -0
- package/docs/docs/cmd/aad/app/app-set.mdx +4 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +61 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-list.mdx +59 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +4 -0
- package/docs/docs/cmd/aad/group/group-get.mdx +24 -0
- package/docs/docs/cmd/aad/group/group-list.mdx +98 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-add.mdx +114 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-get.mdx +115 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-list.mdx +115 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx +4 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-set.mdx +4 -0
- package/docs/docs/cmd/aad/groupsettingtemplate/groupsettingtemplate-get.mdx +63 -0
- package/docs/docs/cmd/aad/groupsettingtemplate/groupsettingtemplate-list.mdx +63 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.mdx +122 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-list.mdx +68 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-post-list.mdx +77 -0
- package/docs/docs/cmd/aad/o365group/o365group-get.mdx +122 -0
- package/docs/docs/cmd/aad/o365group/o365group-list.mdx +99 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-list.mdx +96 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-renew.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx +48 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx +60 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-set.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-teamify.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-add.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-list.mdx +56 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-set.mdx +8 -4
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-add.mdx +4 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-list.mdx +59 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx +4 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-set.mdx +4 -0
- package/docs/docs/cmd/aad/policy/policy-list.mdx +77 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx +4 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-enable.mdx +4 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-get.mdx +57 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-set.mdx +4 -0
- package/docs/docs/cmd/aad/sp/sp-add.mdx +136 -0
- package/docs/docs/cmd/aad/sp/sp-get.mdx +166 -0
- package/docs/docs/cmd/aad/user/user-get.mdx +75 -0
- package/docs/docs/cmd/aad/user/user-guest-add.mdx +23 -0
- package/docs/docs/cmd/aad/user/user-hibp.mdx +82 -0
- package/docs/docs/cmd/aad/user/user-license-add.mdx +2 -2
- package/docs/docs/cmd/aad/user/user-license-remove.mdx +2 -2
- package/docs/docs/cmd/aad/user/user-list.mdx +52 -0
- package/docs/docs/cmd/aad/user/user-password-validate.mdx +67 -0
- package/docs/docs/cmd/aad/user/user-signin-list.mdx +131 -0
- package/docs/docs/cmd/flow/flow-list.mdx +11 -3
- package/docs/docs/cmd/flow/run/run-list.mdx +0 -3
- package/docs/docs/cmd/login.mdx +39 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +0 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +0 -6
- package/docs/docs/cmd/setup.mdx +2 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +72 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.mdx +12 -3
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +55 -0
- package/docs/docs/cmd/spo/list/list-sensitivitylabel-ensure.mdx +64 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +7 -4
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +9 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-set.mdx +81 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +183 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +155 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +114 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/docs/docs/cmd/status.mdx +6 -3
- package/docs/docs/cmd/util/accesstoken/accesstoken-get.mdx +12 -2
- package/npm-shrinkwrap.json +299 -272
- package/package.json +17 -17
- package/dist/m365/aad/commands/approleassignment/AppRoleAssignment.js +0 -3
- package/dist/m365/aad/commands/approleassignment/ServicePrincipal.js +0 -3
- package/dist/m365/aad/commands/groupsetting/GroupSetting.js +0 -3
- package/dist/m365/aad/commands/groupsettingtemplate/GroupSettingTemplate.js +0 -3
- package/dist/m365/aad/commands/siteclassification/DirectorySetting.js +0 -10
- package/dist/m365/aad/commands/siteclassification/DirectorySettingTemplatesRsp.js +0 -3
- package/dist/m365/aad/commands/siteclassification/DirectorySettingValue.js +0 -3
- package/dist/m365/outlook/Message.js +0 -3
- package/dist/m365/spo/commands/site/SitePermission.js +0 -3
- package/dist/m365/teams/Channel.js +0 -3
- package/dist/m365/teams/ConversationMember.js +0 -3
- package/dist/m365/teams/Reply.js +0 -3
- package/dist/m365/teams/Tab.js +0 -3
- package/dist/m365/teams/Team.js +0 -3
- package/dist/m365/teams/TeamsApp.js +0 -3
- package/dist/m365/teams/TeamsAppInstallation.js +0 -3
- package/dist/m365/teams/TeamsTabConfiguration.js +0 -3
- package/dist/m365/teams/commands/Meeting.js +0 -3
|
@@ -50,83 +50,86 @@ class AadAppGetCommand extends GraphCommand_1.default {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
getAppObjectId(args) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.get(requestOptions)
|
|
69
|
-
.then((res) => {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (args.options.objectId) {
|
|
55
|
+
return args.options.objectId;
|
|
56
|
+
}
|
|
57
|
+
const { appId, name } = args.options;
|
|
58
|
+
const filter = appId ?
|
|
59
|
+
`appId eq '${formatting_1.formatting.encodeQueryParameter(appId)}'` :
|
|
60
|
+
`displayName eq '${formatting_1.formatting.encodeQueryParameter(name)}'`;
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata.metadata=none'
|
|
65
|
+
},
|
|
66
|
+
responseType: 'json'
|
|
67
|
+
};
|
|
68
|
+
const res = yield request_1.default.get(requestOptions);
|
|
70
69
|
if (res.value.length === 1) {
|
|
71
|
-
return
|
|
70
|
+
return res.value[0].id;
|
|
72
71
|
}
|
|
73
72
|
if (res.value.length === 0) {
|
|
74
73
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
75
|
-
|
|
74
|
+
throw `No Azure AD application registration with ${applicationIdentifier} found`;
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
throw `Multiple Azure AD application registration with name ${name} found. Please disambiguate (app object IDs): ${res.value.map(a => a.id).join(', ')}`;
|
|
78
77
|
});
|
|
79
78
|
}
|
|
80
79
|
getAppInfo(appObjectId) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const requestOptions = {
|
|
82
|
+
url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}`,
|
|
83
|
+
headers: {
|
|
84
|
+
accept: 'application/json;odata.metadata=none'
|
|
85
|
+
},
|
|
86
|
+
responseType: 'json'
|
|
87
|
+
};
|
|
88
|
+
return request_1.default.get(requestOptions);
|
|
89
|
+
});
|
|
89
90
|
}
|
|
90
91
|
saveAppInfo(args, appInfo, logger) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const filePath = '.m365rc.json';
|
|
95
|
-
if (this.verbose) {
|
|
96
|
-
logger.logToStderr(`Saving Azure AD app registration information to the ${filePath} file...`);
|
|
97
|
-
}
|
|
98
|
-
let m365rc = {};
|
|
99
|
-
if (fs.existsSync(filePath)) {
|
|
100
|
-
if (this.debug) {
|
|
101
|
-
logger.logToStderr(`Reading existing ${filePath}...`);
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
if (!args.options.save) {
|
|
94
|
+
return appInfo;
|
|
102
95
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
m365rc = JSON.parse(fileContents);
|
|
107
|
-
}
|
|
96
|
+
const filePath = '.m365rc.json';
|
|
97
|
+
if (this.verbose) {
|
|
98
|
+
logger.logToStderr(`Saving Azure AD app registration information to the ${filePath} file...`);
|
|
108
99
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
let m365rc = {};
|
|
101
|
+
if (fs.existsSync(filePath)) {
|
|
102
|
+
if (this.debug) {
|
|
103
|
+
logger.logToStderr(`Reading existing ${filePath}...`);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const fileContents = fs.readFileSync(filePath, 'utf8');
|
|
107
|
+
if (fileContents) {
|
|
108
|
+
m365rc = JSON.parse(fileContents);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
logger.logToStderr(`Error reading ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
|
|
113
|
+
return appInfo;
|
|
114
|
+
}
|
|
112
115
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
m365rc.apps = [];
|
|
116
|
-
}
|
|
117
|
-
if (!m365rc.apps.some(a => a.appId === appInfo.appId)) {
|
|
118
|
-
m365rc.apps.push({
|
|
119
|
-
appId: appInfo.appId,
|
|
120
|
-
name: appInfo.displayName
|
|
121
|
-
});
|
|
122
|
-
try {
|
|
123
|
-
fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
|
|
116
|
+
if (!m365rc.apps) {
|
|
117
|
+
m365rc.apps = [];
|
|
124
118
|
}
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
if (!m365rc.apps.some(a => a.appId === appInfo.appId)) {
|
|
120
|
+
m365rc.apps.push({
|
|
121
|
+
appId: appInfo.appId,
|
|
122
|
+
name: appInfo.displayName
|
|
123
|
+
});
|
|
124
|
+
try {
|
|
125
|
+
fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
logger.logToStderr(`Error writing ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
|
|
129
|
+
}
|
|
127
130
|
}
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
return appInfo;
|
|
132
|
+
});
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
_AadAppGetCommand_instances = new WeakSet(), _AadAppGetCommand_initTelemetry = function _AadAppGetCommand_initTelemetry() {
|
|
@@ -74,34 +74,33 @@ class AadAppRemoveCommand extends GraphCommand_1.default {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
getObjectId(args, logger) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.get(requestOptions)
|
|
96
|
-
.then((res) => {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
if (args.options.objectId) {
|
|
79
|
+
return args.options.objectId;
|
|
80
|
+
}
|
|
81
|
+
const { appId, name } = args.options;
|
|
82
|
+
if (this.verbose) {
|
|
83
|
+
logger.logToStderr(`Retrieving information about Azure AD app ${appId ? appId : name}...`);
|
|
84
|
+
}
|
|
85
|
+
const filter = appId ?
|
|
86
|
+
`appId eq '${formatting_1.formatting.encodeQueryParameter(appId)}'` :
|
|
87
|
+
`displayName eq '${formatting_1.formatting.encodeQueryParameter(name)}'`;
|
|
88
|
+
const requestOptions = {
|
|
89
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
90
|
+
headers: {
|
|
91
|
+
accept: 'application/json;odata.metadata=none'
|
|
92
|
+
},
|
|
93
|
+
responseType: 'json'
|
|
94
|
+
};
|
|
95
|
+
const res = yield request_1.default.get(requestOptions);
|
|
97
96
|
if (res.value.length === 1) {
|
|
98
|
-
return
|
|
97
|
+
return res.value[0].id;
|
|
99
98
|
}
|
|
100
99
|
if (res.value.length === 0) {
|
|
101
100
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
102
|
-
|
|
101
|
+
throw `No Azure AD application registration with ${applicationIdentifier} found`;
|
|
103
102
|
}
|
|
104
|
-
|
|
103
|
+
throw `Multiple Azure AD application registration with name ${name} found. Please choose one of the object IDs: ${res.value.map(a => a.id).join(', ')}`;
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
106
|
}
|
|
@@ -67,17 +67,19 @@ class AadAppRoleAddCommand extends GraphCommand_1.default {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
getAppInfo(appId, logger) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (this.verbose) {
|
|
72
|
+
logger.logToStderr(`Retrieving information about roles for Azure AD app ${appId}...`);
|
|
73
|
+
}
|
|
74
|
+
const requestOptions = {
|
|
75
|
+
url: `${this.resource}/v1.0/myorganization/applications/${appId}?$select=id,appRoles`,
|
|
76
|
+
headers: {
|
|
77
|
+
accept: 'application/json;odata.metadata=none'
|
|
78
|
+
},
|
|
79
|
+
responseType: 'json'
|
|
80
|
+
};
|
|
81
|
+
return request_1.default.get(requestOptions);
|
|
82
|
+
});
|
|
81
83
|
}
|
|
82
84
|
getAllowedMemberTypes(args) {
|
|
83
85
|
switch (args.options.allowedMembers) {
|
|
@@ -92,34 +94,33 @@ class AadAppRoleAddCommand extends GraphCommand_1.default {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
getAppObjectId(args, logger) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.get(requestOptions)
|
|
114
|
-
.then((res) => {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (args.options.appObjectId) {
|
|
99
|
+
return args.options.appObjectId;
|
|
100
|
+
}
|
|
101
|
+
const { appId, appName } = args.options;
|
|
102
|
+
if (this.verbose) {
|
|
103
|
+
logger.logToStderr(`Retrieving information about Azure AD app ${appId ? appId : appName}...`);
|
|
104
|
+
}
|
|
105
|
+
const filter = appId ?
|
|
106
|
+
`appId eq '${formatting_1.formatting.encodeQueryParameter(appId)}'` :
|
|
107
|
+
`displayName eq '${formatting_1.formatting.encodeQueryParameter(appName)}'`;
|
|
108
|
+
const requestOptions = {
|
|
109
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
110
|
+
headers: {
|
|
111
|
+
accept: 'application/json;odata.metadata=none'
|
|
112
|
+
},
|
|
113
|
+
responseType: 'json'
|
|
114
|
+
};
|
|
115
|
+
const res = yield request_1.default.get(requestOptions);
|
|
115
116
|
if (res.value.length === 1) {
|
|
116
|
-
return
|
|
117
|
+
return res.value[0].id;
|
|
117
118
|
}
|
|
118
119
|
if (res.value.length === 0) {
|
|
119
120
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
120
|
-
|
|
121
|
+
throw `No Azure AD application registration with ${applicationIdentifier} found`;
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
+
throw `Multiple Azure AD application registration with name ${appName} found. Please disambiguate (app object IDs): ${res.value.map(a => a.id).join(', ')}`;
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
126
|
}
|
|
@@ -50,34 +50,33 @@ class AadAppRoleListCommand extends GraphCommand_1.default {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
getAppObjectId(args, logger) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.get(requestOptions)
|
|
72
|
-
.then((res) => {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (args.options.appObjectId) {
|
|
55
|
+
return args.options.appObjectId;
|
|
56
|
+
}
|
|
57
|
+
const { appId, appName } = args.options;
|
|
58
|
+
if (this.verbose) {
|
|
59
|
+
logger.logToStderr(`Retrieving information about Azure AD app ${appId ? appId : appName}...`);
|
|
60
|
+
}
|
|
61
|
+
const filter = appId ?
|
|
62
|
+
`appId eq '${formatting_1.formatting.encodeQueryParameter(appId)}'` :
|
|
63
|
+
`displayName eq '${formatting_1.formatting.encodeQueryParameter(appName)}'`;
|
|
64
|
+
const requestOptions = {
|
|
65
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
66
|
+
headers: {
|
|
67
|
+
accept: 'application/json;odata.metadata=none'
|
|
68
|
+
},
|
|
69
|
+
responseType: 'json'
|
|
70
|
+
};
|
|
71
|
+
const res = yield request_1.default.get(requestOptions);
|
|
73
72
|
if (res.value.length === 1) {
|
|
74
|
-
return
|
|
73
|
+
return res.value[0].id;
|
|
75
74
|
}
|
|
76
75
|
if (res.value.length === 0) {
|
|
77
76
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
78
|
-
|
|
77
|
+
throw `No Azure AD application registration with ${applicationIdentifier} found`;
|
|
79
78
|
}
|
|
80
|
-
|
|
79
|
+
throw `Multiple Azure AD application registration with name ${appName} found. Please disambiguate (app object IDs): ${res.value.map(a => a.id).join(', ')}`;
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
82
|
}
|
|
@@ -63,10 +63,9 @@ class AadAppRoleRemoveCommand extends GraphCommand_1.default {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
processAppRoleDelete(logger, args) {
|
|
66
|
-
return this
|
|
67
|
-
.getAppObjectId(args, logger)
|
|
68
|
-
|
|
69
|
-
.then((aadApp) => {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const appObjectId = yield this.getAppObjectId(args, logger);
|
|
68
|
+
const aadApp = yield this.getAadApp(appObjectId, logger);
|
|
70
69
|
const appRoleDeleteIdentifierNameValue = args.options.name ? `name '${args.options.name}'` : (args.options.claim ? `claim '${args.options.claim}'` : `id '${args.options.id}'`);
|
|
71
70
|
if (this.verbose) {
|
|
72
71
|
logger.logToStderr(`Deleting role with ${appRoleDeleteIdentifierNameValue} from Azure AD app ${aadApp.id}...`);
|
|
@@ -78,99 +77,103 @@ class AadAppRoleRemoveCommand extends GraphCommand_1.default {
|
|
|
78
77
|
if (args.options.name &&
|
|
79
78
|
appRoleToDelete !== undefined &&
|
|
80
79
|
appRoleToDelete.length > 1) {
|
|
81
|
-
|
|
80
|
+
throw `Multiple roles with the provided 'name' were found. Please disambiguate using the claims : ${appRoleToDelete.map(role => `${role.value}`).join(', ')}`;
|
|
82
81
|
}
|
|
83
82
|
if (appRoleToDelete.length === 0) {
|
|
84
|
-
|
|
83
|
+
throw `No app role with ${appRoleDeleteIdentifierNameValue} found.`;
|
|
85
84
|
}
|
|
86
85
|
const roleToDelete = appRoleToDelete[0];
|
|
87
86
|
if (roleToDelete.isEnabled) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.then(_ => this.deleteAppRole(logger, aadApp, roleToDelete.id));
|
|
87
|
+
yield this.disableAppRole(logger, aadApp, roleToDelete.id);
|
|
88
|
+
yield this.deleteAppRole(logger, aadApp, roleToDelete.id);
|
|
91
89
|
}
|
|
92
90
|
else {
|
|
93
|
-
|
|
91
|
+
yield this.deleteAppRole(logger, aadApp, roleToDelete.id);
|
|
94
92
|
}
|
|
95
93
|
});
|
|
96
94
|
}
|
|
97
95
|
disableAppRole(logger, aadApp, roleId) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
aadApp.appRoles[roleIndex].isEnabled = false;
|
|
103
|
-
const requestOptions = {
|
|
104
|
-
url: `${this.resource}/v1.0/myorganization/applications/${aadApp.id}`,
|
|
105
|
-
headers: {
|
|
106
|
-
accept: 'application/json;odata.metadata=none'
|
|
107
|
-
},
|
|
108
|
-
responseType: 'json',
|
|
109
|
-
data: {
|
|
110
|
-
appRoles: aadApp.appRoles
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const roleIndex = aadApp.appRoles.findIndex((role) => role.id === roleId);
|
|
98
|
+
if (this.verbose) {
|
|
99
|
+
logger.logToStderr(`Disabling the app role`);
|
|
111
100
|
}
|
|
112
|
-
|
|
113
|
-
|
|
101
|
+
aadApp.appRoles[roleIndex].isEnabled = false;
|
|
102
|
+
const requestOptions = {
|
|
103
|
+
url: `${this.resource}/v1.0/myorganization/applications/${aadApp.id}`,
|
|
104
|
+
headers: {
|
|
105
|
+
accept: 'application/json;odata.metadata=none'
|
|
106
|
+
},
|
|
107
|
+
responseType: 'json',
|
|
108
|
+
data: {
|
|
109
|
+
appRoles: aadApp.appRoles
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
return request_1.default.patch(requestOptions);
|
|
113
|
+
});
|
|
114
114
|
}
|
|
115
115
|
deleteAppRole(logger, aadApp, roleId) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const updatedAppRoles = aadApp.appRoles.filter((role) => role.id !== roleId);
|
|
120
|
-
const requestOptions = {
|
|
121
|
-
url: `${this.resource}/v1.0/myorganization/applications/${aadApp.id}`,
|
|
122
|
-
headers: {
|
|
123
|
-
accept: 'application/json;odata.metadata=none'
|
|
124
|
-
},
|
|
125
|
-
responseType: 'json',
|
|
126
|
-
data: {
|
|
127
|
-
appRoles: updatedAppRoles
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
if (this.verbose) {
|
|
118
|
+
logger.logToStderr(`Deleting the app role.`);
|
|
128
119
|
}
|
|
129
|
-
|
|
130
|
-
|
|
120
|
+
const updatedAppRoles = aadApp.appRoles.filter((role) => role.id !== roleId);
|
|
121
|
+
const requestOptions = {
|
|
122
|
+
url: `${this.resource}/v1.0/myorganization/applications/${aadApp.id}`,
|
|
123
|
+
headers: {
|
|
124
|
+
accept: 'application/json;odata.metadata=none'
|
|
125
|
+
},
|
|
126
|
+
responseType: 'json',
|
|
127
|
+
data: {
|
|
128
|
+
appRoles: updatedAppRoles
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
return request_1.default.patch(requestOptions);
|
|
132
|
+
});
|
|
131
133
|
}
|
|
132
134
|
getAadApp(appId, logger) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
if (this.verbose) {
|
|
137
|
+
logger.logToStderr(`Retrieving app roles information for the Azure AD app ${appId}...`);
|
|
138
|
+
}
|
|
139
|
+
const requestOptions = {
|
|
140
|
+
url: `${this.resource}/v1.0/myorganization/applications/${appId}?$select=id,appRoles`,
|
|
141
|
+
headers: {
|
|
142
|
+
accept: 'application/json;odata.metadata=none'
|
|
143
|
+
},
|
|
144
|
+
responseType: 'json'
|
|
145
|
+
};
|
|
146
|
+
return request_1.default.get(requestOptions);
|
|
147
|
+
});
|
|
144
148
|
}
|
|
145
149
|
getAppObjectId(args, logger) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.get(requestOptions)
|
|
165
|
-
.then((res) => {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
if (args.options.appObjectId) {
|
|
152
|
+
return args.options.appObjectId;
|
|
153
|
+
}
|
|
154
|
+
const { appId, appName } = args.options;
|
|
155
|
+
if (this.verbose) {
|
|
156
|
+
logger.logToStderr(`Retrieving information about Azure AD app ${appId ? appId : appName}...`);
|
|
157
|
+
}
|
|
158
|
+
const filter = appId ?
|
|
159
|
+
`appId eq '${formatting_1.formatting.encodeQueryParameter(appId)}'` :
|
|
160
|
+
`displayName eq '${formatting_1.formatting.encodeQueryParameter(appName)}'`;
|
|
161
|
+
const requestOptions = {
|
|
162
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
163
|
+
headers: {
|
|
164
|
+
accept: 'application/json;odata.metadata=none'
|
|
165
|
+
},
|
|
166
|
+
responseType: 'json'
|
|
167
|
+
};
|
|
168
|
+
const res = yield request_1.default.get(requestOptions);
|
|
166
169
|
if (res.value.length === 1) {
|
|
167
|
-
return
|
|
170
|
+
return res.value[0].id;
|
|
168
171
|
}
|
|
169
172
|
if (res.value.length === 0) {
|
|
170
173
|
const applicationIdentifier = appId ? `ID ${appId}` : `name ${appName}`;
|
|
171
|
-
|
|
174
|
+
throw `No Azure AD application registration with ${applicationIdentifier} found`;
|
|
172
175
|
}
|
|
173
|
-
|
|
176
|
+
throw `Multiple Azure AD application registration with name ${appName} found. Please disambiguate using app object IDs: ${res.value.map(a => a.id).join(', ')}`;
|
|
174
177
|
});
|
|
175
178
|
}
|
|
176
179
|
}
|