@pnp/cli-microsoft365 5.0.0-beta.aff293c → 5.0.0-beta.c4100fe
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 +2 -2
- package/.devcontainer/devcontainer.json +13 -2
- package/.eslintrc.js +3 -0
- package/.mocharc.json +9 -0
- package/README.md +3 -3
- package/dist/Command.js +1 -1
- package/dist/Utils.js +7 -0
- package/dist/api.d.ts +11 -0
- package/dist/api.js +17 -0
- package/dist/appInsights.js +5 -2
- package/dist/cli/Cli.js +42 -7
- package/dist/m365/aad/commands/app/app-add.js +101 -12
- package/dist/m365/aad/commands/app/app-delete.js +123 -0
- package/dist/m365/aad/commands/app/app-get.js +142 -0
- package/dist/m365/aad/commands/app/app-set.js +98 -3
- package/dist/m365/aad/commands/group/group-list.js +54 -0
- package/dist/m365/aad/commands/o365group/{GroupUser.js → GroupExtended.js} +1 -1
- package/dist/m365/aad/commands/o365group/o365group-add.js +56 -50
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +41 -0
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +3 -3
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-add.js +5 -8
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +7 -7
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +36 -12
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-set.js +3 -3
- package/dist/m365/aad/commands/sp/sp-add.js +107 -0
- package/dist/m365/aad/commands/sp/sp-get.js +44 -21
- package/dist/m365/aad/commands/user/user-get.js +33 -6
- package/dist/m365/aad/commands/user/user-hibp.js +67 -0
- package/dist/m365/aad/commands/user/user-list.js +7 -4
- package/dist/m365/aad/commands/user/user-password-validate.js +42 -0
- package/dist/m365/aad/commands.js +7 -0
- package/dist/m365/app/commands/permission/permission-list.js +266 -0
- package/dist/m365/app/commands.js +7 -0
- package/dist/m365/base/AppCommand.js +76 -0
- package/dist/m365/{aad/commands/o365group/Group.js → base/M365RcJson.js} +1 -1
- package/dist/m365/cli/commands/cli-doctor.js +2 -0
- package/dist/m365/cli/commands/config/config-set.js +4 -1
- package/dist/m365/file/commands/file-add.js +32 -13
- package/dist/m365/file/commands/file-list.js +181 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/flow/commands/flow-get.js +2 -2
- package/dist/m365/outlook/commands/room/room-list.js +43 -0
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +25 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/pa/cds-project-mutator.js +1 -1
- package/dist/m365/pa/commands/app/app-list.js +28 -1
- package/dist/m365/planner/AppliedCategories.js +3 -0
- package/dist/m365/planner/commands/task/task-add.js +288 -0
- package/dist/m365/planner/commands/task/task-details-get.js +39 -0
- package/dist/m365/planner/commands/task/task-get.js +37 -0
- package/dist/m365/planner/commands/task/task-list.js +37 -7
- package/dist/m365/planner/commands/task/task-set.js +357 -0
- package/dist/m365/planner/commands.js +5 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-add.js +99 -0
- package/dist/m365/search/commands.js +7 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006005_CFG_PS_metadata.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +60 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +62 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.13.1.js +53 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0.js +59 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +3 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +197 -64
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +52 -0
- package/dist/m365/spo/commands/group/group-user-add.js +74 -16
- package/dist/m365/spo/commands/group/group-user-remove.js +100 -0
- package/dist/m365/spo/commands/list/list-get.js +6 -2
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +90 -0
- package/dist/m365/spo/commands/page/Page.js +3 -1
- package/dist/m365/spo/commands/page/page-add.js +7 -10
- package/dist/m365/spo/commands/page/page-set.js +7 -10
- package/dist/m365/spo/commands/site/site-ensure.js +1 -1
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +76 -0
- package/dist/m365/spo/commands/site/site-remove.js +98 -30
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +48 -0
- package/dist/m365/spo/commands.js +6 -1
- package/dist/m365/teams/commands/app/app-install.js +75 -21
- package/dist/m365/teams/commands/app/app-list.js +9 -6
- package/dist/m365/teams/commands/app/app-update.js +55 -12
- package/dist/m365/teams/commands/channel/channel-get.js +29 -7
- package/dist/m365/teams/commands/chat/chat-list.js +43 -0
- package/dist/m365/teams/commands/chat/chat-member-list.js +42 -0
- package/dist/m365/teams/commands/chat/chat-message-list.js +60 -0
- package/dist/m365/teams/commands/chat/chat-message-send.js +225 -0
- package/dist/m365/teams/commands/message/message-get.js +1 -1
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +1 -1
- package/dist/m365/teams/commands/report/report-pstncalls.js +1 -1
- package/dist/m365/teams/commands/tab/tab-get.js +9 -6
- package/dist/m365/teams/commands.js +4 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +57 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +56 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +39 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +38 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +51 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +38 -0
- package/dist/m365/tenant/commands.js +6 -0
- package/dist/request.js +9 -4
- package/dist/settingsNames.js +6 -1
- package/docs/docs/cmd/_global.md +2 -2
- package/docs/docs/cmd/aad/app/app-add.md +11 -0
- package/docs/docs/cmd/aad/app/app-delete.md +51 -0
- package/docs/docs/cmd/aad/app/app-get.md +59 -0
- package/docs/docs/cmd/aad/app/app-set.md +21 -0
- package/docs/docs/cmd/aad/group/group-list.md +30 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.md +1 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-list.md +24 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-list.md +4 -3
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.md +9 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-set.md +3 -2
- package/docs/docs/cmd/aad/sp/sp-add.md +53 -0
- package/docs/docs/cmd/aad/sp/sp-get.md +2 -1
- package/docs/docs/cmd/aad/user/user-get.md +13 -4
- package/docs/docs/cmd/aad/user/user-hibp.md +46 -0
- package/docs/docs/cmd/aad/user/user-list.md +9 -0
- package/docs/docs/cmd/aad/user/user-password-validate.md +29 -0
- package/docs/docs/cmd/app/permission/permission-list.md +36 -0
- package/docs/docs/cmd/file/file-add.md +11 -0
- package/docs/docs/cmd/file/file-list.md +46 -0
- package/docs/docs/cmd/outlook/room/room-list.md +30 -0
- package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +21 -0
- package/docs/docs/cmd/pa/app/app-list.md +17 -1
- package/docs/docs/cmd/planner/task/task-add.md +78 -0
- package/docs/docs/cmd/planner/task/task-details-get.md +24 -0
- package/docs/docs/cmd/planner/task/task-get.md +29 -0
- package/docs/docs/cmd/planner/task/task-list.md +5 -0
- package/docs/docs/cmd/planner/task/task-set.md +99 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +43 -0
- package/docs/docs/cmd/spfx/project/project-externalize.md +1 -1
- package/docs/docs/cmd/spfx/project/project-rename.md +1 -1
- package/docs/docs/cmd/spfx/project/project-upgrade.md +8 -8
- package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-list.md +33 -0
- package/docs/docs/cmd/spo/group/group-user-add.md +28 -6
- package/docs/docs/cmd/spo/group/group-user-remove.md +39 -0
- package/docs/docs/cmd/spo/list/list-get.md +9 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +39 -0
- package/docs/docs/cmd/spo/page/page-add.md +2 -2
- package/docs/docs/cmd/spo/page/page-set.md +3 -3
- package/docs/docs/cmd/spo/site/site-recyclebinitem-list.md +40 -0
- package/docs/docs/cmd/spo/site/site-remove.md +3 -1
- package/docs/docs/cmd/spo/web/web-installedlanguage-list.md +24 -0
- package/docs/docs/cmd/teams/app/app-install.md +22 -4
- package/docs/docs/cmd/teams/app/app-update.md +12 -3
- package/docs/docs/cmd/teams/channel/channel-get.md +11 -2
- package/docs/docs/cmd/teams/chat/chat-list.md +30 -0
- package/docs/docs/cmd/teams/chat/chat-member-list.md +24 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.md +24 -0
- package/docs/docs/cmd/teams/chat/chat-message-send.md +55 -0
- package/docs/docs/cmd/teams/message/message-get.md +0 -3
- package/docs/docs/cmd/teams/report/report-directroutingcalls.md +0 -3
- package/docs/docs/cmd/teams/report/report-pstncalls.md +4 -3
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +33 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +30 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.md +24 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.md +34 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.md +28 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +34 -0
- package/npm-shrinkwrap.json +1740 -2288
- package/package.json +46 -33
- package/dist/m365/base/AadCommand.js +0 -10
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const request_1 = require("../../../../request");
|
|
5
|
+
const Utils_1 = require("../../../../Utils");
|
|
6
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
|
+
const commands_1 = require("../../commands");
|
|
8
|
+
class AadAppGetCommand extends GraphCommand_1.default {
|
|
9
|
+
get name() {
|
|
10
|
+
return commands_1.default.APP_GET;
|
|
11
|
+
}
|
|
12
|
+
get description() {
|
|
13
|
+
return 'Gets an Azure AD app registration';
|
|
14
|
+
}
|
|
15
|
+
getTelemetryProperties(args) {
|
|
16
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
17
|
+
telemetryProps.appId = typeof args.options.appId !== 'undefined';
|
|
18
|
+
telemetryProps.objectId = typeof args.options.objectId !== 'undefined';
|
|
19
|
+
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
20
|
+
return telemetryProps;
|
|
21
|
+
}
|
|
22
|
+
commandAction(logger, args, cb) {
|
|
23
|
+
this
|
|
24
|
+
.getAppObjectId(args)
|
|
25
|
+
.then(appObjectId => this.getAppInfo(appObjectId))
|
|
26
|
+
.then(appInfo => this.saveAppInfo(args, appInfo, logger))
|
|
27
|
+
.then((res) => {
|
|
28
|
+
logger.log(res);
|
|
29
|
+
cb();
|
|
30
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
31
|
+
}
|
|
32
|
+
getAppObjectId(args) {
|
|
33
|
+
if (args.options.objectId) {
|
|
34
|
+
return Promise.resolve(args.options.objectId);
|
|
35
|
+
}
|
|
36
|
+
const { appId, name } = args.options;
|
|
37
|
+
const filter = appId ?
|
|
38
|
+
`appId eq '${encodeURIComponent(appId)}'` :
|
|
39
|
+
`displayName eq '${encodeURIComponent(name)}'`;
|
|
40
|
+
const requestOptions = {
|
|
41
|
+
url: `${this.resource}/v1.0/myorganization/applications?$filter=${filter}&$select=id`,
|
|
42
|
+
headers: {
|
|
43
|
+
accept: 'application/json;odata.metadata=none'
|
|
44
|
+
},
|
|
45
|
+
responseType: 'json'
|
|
46
|
+
};
|
|
47
|
+
return request_1.default
|
|
48
|
+
.get(requestOptions)
|
|
49
|
+
.then((res) => {
|
|
50
|
+
if (res.value.length === 1) {
|
|
51
|
+
return Promise.resolve(res.value[0].id);
|
|
52
|
+
}
|
|
53
|
+
if (res.value.length === 0) {
|
|
54
|
+
const applicationIdentifier = appId ? `ID ${appId}` : `name ${name}`;
|
|
55
|
+
return Promise.reject(`No Azure AD application registration with ${applicationIdentifier} found`);
|
|
56
|
+
}
|
|
57
|
+
return Promise.reject(`Multiple Azure AD application registration with name ${name} found. Please disambiguate (app object IDs): ${res.value.map(a => a.id).join(', ')}`);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
getAppInfo(appObjectId) {
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}`,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata.metadata=none'
|
|
65
|
+
},
|
|
66
|
+
responseType: 'json'
|
|
67
|
+
};
|
|
68
|
+
return request_1.default.get(requestOptions);
|
|
69
|
+
}
|
|
70
|
+
saveAppInfo(args, appInfo, logger) {
|
|
71
|
+
if (!args.options.save) {
|
|
72
|
+
return Promise.resolve(appInfo);
|
|
73
|
+
}
|
|
74
|
+
const filePath = '.m365rc.json';
|
|
75
|
+
if (this.verbose) {
|
|
76
|
+
logger.logToStderr(`Saving Azure AD app registration information to the ${filePath} file...`);
|
|
77
|
+
}
|
|
78
|
+
let m365rc = {};
|
|
79
|
+
if (fs.existsSync(filePath)) {
|
|
80
|
+
if (this.debug) {
|
|
81
|
+
logger.logToStderr(`Reading existing ${filePath}...`);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const fileContents = fs.readFileSync(filePath, 'utf8');
|
|
85
|
+
if (fileContents) {
|
|
86
|
+
m365rc = JSON.parse(fileContents);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
logger.logToStderr(`Error reading ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
|
|
91
|
+
return Promise.resolve(appInfo);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!m365rc.apps) {
|
|
95
|
+
m365rc.apps = [];
|
|
96
|
+
}
|
|
97
|
+
if (!m365rc.apps.some(a => a.appId === appInfo.appId)) {
|
|
98
|
+
m365rc.apps.push({
|
|
99
|
+
appId: appInfo.appId,
|
|
100
|
+
name: appInfo.displayName
|
|
101
|
+
});
|
|
102
|
+
try {
|
|
103
|
+
fs.writeFileSync(filePath, JSON.stringify(m365rc, null, 2));
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
logger.logToStderr(`Error writing ${filePath}: ${e}. Please add app info to ${filePath} manually.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return Promise.resolve(appInfo);
|
|
110
|
+
}
|
|
111
|
+
options() {
|
|
112
|
+
const options = [
|
|
113
|
+
{ option: '--appId [appId]' },
|
|
114
|
+
{ option: '--objectId [objectId]' },
|
|
115
|
+
{ option: '--name [name]' },
|
|
116
|
+
{ option: '--save' }
|
|
117
|
+
];
|
|
118
|
+
const parentOptions = super.options();
|
|
119
|
+
return options.concat(parentOptions);
|
|
120
|
+
}
|
|
121
|
+
validate(args) {
|
|
122
|
+
if (!args.options.appId &&
|
|
123
|
+
!args.options.objectId &&
|
|
124
|
+
!args.options.name) {
|
|
125
|
+
return 'Specify either appId, objectId, or name';
|
|
126
|
+
}
|
|
127
|
+
if ((args.options.appId && args.options.objectId) ||
|
|
128
|
+
(args.options.appId && args.options.name) ||
|
|
129
|
+
(args.options.objectId && args.options.name)) {
|
|
130
|
+
return 'Specify either appId, objectId, or name but not both';
|
|
131
|
+
}
|
|
132
|
+
if (args.options.appId && !Utils_1.default.isValidGuid(args.options.appId)) {
|
|
133
|
+
return `${args.options.appId} is not a valid GUID`;
|
|
134
|
+
}
|
|
135
|
+
if (args.options.objectId && !Utils_1.default.isValidGuid(args.options.objectId)) {
|
|
136
|
+
return `${args.options.objectId} is not a valid GUID`;
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
module.exports = new AadAppGetCommand();
|
|
142
|
+
//# sourceMappingURL=app-get.js.map
|
|
@@ -15,6 +15,9 @@ class AadAppSetCommand extends GraphCommand_1.default {
|
|
|
15
15
|
telemetryProps.appId = typeof args.options.appId !== 'undefined';
|
|
16
16
|
telemetryProps.objectId = typeof args.options.objectId !== 'undefined';
|
|
17
17
|
telemetryProps.name = typeof args.options.name !== 'undefined';
|
|
18
|
+
telemetryProps.platform = typeof args.options.platform !== 'undefined';
|
|
19
|
+
telemetryProps.redirectUris = typeof args.options.redirectUris !== 'undefined';
|
|
20
|
+
telemetryProps.redirectUrisToRemove = typeof args.options.redirectUrisToRemove !== 'undefined';
|
|
18
21
|
telemetryProps.uri = typeof args.options.uri !== 'undefined';
|
|
19
22
|
return telemetryProps;
|
|
20
23
|
}
|
|
@@ -22,6 +25,7 @@ class AadAppSetCommand extends GraphCommand_1.default {
|
|
|
22
25
|
this
|
|
23
26
|
.getAppObjectId(args, logger)
|
|
24
27
|
.then(objectId => this.configureUri(args, objectId, logger))
|
|
28
|
+
.then(objectId => this.configureRedirectUris(args, objectId, logger))
|
|
25
29
|
.then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
26
30
|
}
|
|
27
31
|
getAppObjectId(args, logger) {
|
|
@@ -57,7 +61,7 @@ class AadAppSetCommand extends GraphCommand_1.default {
|
|
|
57
61
|
}
|
|
58
62
|
configureUri(args, objectId, logger) {
|
|
59
63
|
if (!args.options.uri) {
|
|
60
|
-
return Promise.resolve();
|
|
64
|
+
return Promise.resolve(objectId);
|
|
61
65
|
}
|
|
62
66
|
if (this.verbose) {
|
|
63
67
|
logger.logToStderr(`Configuring Azure AD application ID URI...`);
|
|
@@ -73,14 +77,97 @@ class AadAppSetCommand extends GraphCommand_1.default {
|
|
|
73
77
|
responseType: 'json',
|
|
74
78
|
data: applicationInfo
|
|
75
79
|
};
|
|
76
|
-
return request_1.default
|
|
80
|
+
return request_1.default
|
|
81
|
+
.patch(requestOptions)
|
|
82
|
+
.then(_ => Promise.resolve(objectId));
|
|
83
|
+
}
|
|
84
|
+
configureRedirectUris(args, objectId, logger) {
|
|
85
|
+
if (!args.options.redirectUris && !args.options.redirectUrisToRemove) {
|
|
86
|
+
return Promise.resolve(objectId);
|
|
87
|
+
}
|
|
88
|
+
if (this.verbose) {
|
|
89
|
+
logger.logToStderr(`Configuring Azure AD application redirect URIs...`);
|
|
90
|
+
}
|
|
91
|
+
const getAppRequestOptions = {
|
|
92
|
+
url: `${this.resource}/v1.0/myorganization/applications/${objectId}`,
|
|
93
|
+
headers: {
|
|
94
|
+
'content-type': 'application/json;odata.metadata=none'
|
|
95
|
+
},
|
|
96
|
+
responseType: 'json'
|
|
97
|
+
};
|
|
98
|
+
return request_1.default
|
|
99
|
+
.get(getAppRequestOptions)
|
|
100
|
+
.then((application) => {
|
|
101
|
+
const publicClientRedirectUris = application.publicClient.redirectUris;
|
|
102
|
+
const spaRedirectUris = application.spa.redirectUris;
|
|
103
|
+
const webRedirectUris = application.web.redirectUris;
|
|
104
|
+
// start with existing redirect URIs
|
|
105
|
+
const applicationPatch = {
|
|
106
|
+
publicClient: {
|
|
107
|
+
redirectUris: publicClientRedirectUris
|
|
108
|
+
},
|
|
109
|
+
spa: {
|
|
110
|
+
redirectUris: spaRedirectUris
|
|
111
|
+
},
|
|
112
|
+
web: {
|
|
113
|
+
redirectUris: webRedirectUris
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
if (args.options.redirectUrisToRemove) {
|
|
117
|
+
// remove redirect URIs from all platforms
|
|
118
|
+
const redirectUrisToRemove = args.options.redirectUrisToRemove
|
|
119
|
+
.split(',')
|
|
120
|
+
.map(u => u.trim());
|
|
121
|
+
applicationPatch.publicClient.redirectUris =
|
|
122
|
+
publicClientRedirectUris.filter(u => !redirectUrisToRemove.includes(u));
|
|
123
|
+
applicationPatch.spa.redirectUris =
|
|
124
|
+
spaRedirectUris.filter(u => !redirectUrisToRemove.includes(u));
|
|
125
|
+
applicationPatch.web.redirectUris =
|
|
126
|
+
webRedirectUris.filter(u => !redirectUrisToRemove.includes(u));
|
|
127
|
+
}
|
|
128
|
+
if (args.options.redirectUris) {
|
|
129
|
+
const urlsToAdd = args.options.redirectUris
|
|
130
|
+
.split(',')
|
|
131
|
+
.map(u => u.trim());
|
|
132
|
+
// add new redirect URIs. If the URI is already present, it will be ignored
|
|
133
|
+
switch (args.options.platform) {
|
|
134
|
+
case 'spa':
|
|
135
|
+
applicationPatch.spa.redirectUris
|
|
136
|
+
.push(...urlsToAdd.filter(u => !spaRedirectUris.includes(u)));
|
|
137
|
+
break;
|
|
138
|
+
case 'publicClient':
|
|
139
|
+
applicationPatch.publicClient.redirectUris
|
|
140
|
+
.push(...urlsToAdd.filter(u => !publicClientRedirectUris.includes(u)));
|
|
141
|
+
break;
|
|
142
|
+
case 'web':
|
|
143
|
+
applicationPatch.web.redirectUris
|
|
144
|
+
.push(...urlsToAdd.filter(u => !webRedirectUris.includes(u)));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const requestOptions = {
|
|
148
|
+
url: `${this.resource}/v1.0/myorganization/applications/${objectId}`,
|
|
149
|
+
headers: {
|
|
150
|
+
'content-type': 'application/json;odata.metadata=none'
|
|
151
|
+
},
|
|
152
|
+
responseType: 'json',
|
|
153
|
+
data: applicationPatch
|
|
154
|
+
};
|
|
155
|
+
return request_1.default.patch(requestOptions);
|
|
156
|
+
})
|
|
157
|
+
.then(_ => Promise.resolve(objectId));
|
|
77
158
|
}
|
|
78
159
|
options() {
|
|
79
160
|
const options = [
|
|
80
161
|
{ option: '--appId [appId]' },
|
|
81
162
|
{ option: '--objectId [objectId]' },
|
|
82
163
|
{ option: '-n, --name [name]' },
|
|
83
|
-
{ option: '-u, --uri [uri]' }
|
|
164
|
+
{ option: '-u, --uri [uri]' },
|
|
165
|
+
{ option: '-r, --redirectUris [redirectUris]' },
|
|
166
|
+
{
|
|
167
|
+
option: '--platform [platform]',
|
|
168
|
+
autocomplete: AadAppSetCommand.aadApplicationPlatform
|
|
169
|
+
},
|
|
170
|
+
{ option: '--redirectUrisToRemove [redirectUrisToRemove]' }
|
|
84
171
|
];
|
|
85
172
|
const parentOptions = super.options();
|
|
86
173
|
return options.concat(parentOptions);
|
|
@@ -96,8 +183,16 @@ class AadAppSetCommand extends GraphCommand_1.default {
|
|
|
96
183
|
(args.options.objectId && args.options.name)) {
|
|
97
184
|
return 'Specify either appId, objectId or name but not both';
|
|
98
185
|
}
|
|
186
|
+
if (args.options.redirectUris && !args.options.platform) {
|
|
187
|
+
return `When you specify redirectUris you also need to specify platform`;
|
|
188
|
+
}
|
|
189
|
+
if (args.options.platform &&
|
|
190
|
+
AadAppSetCommand.aadApplicationPlatform.indexOf(args.options.platform) < 0) {
|
|
191
|
+
return `${args.options.platform} is not a valid value for platform. Allowed values are ${AadAppSetCommand.aadApplicationPlatform.join(', ')}`;
|
|
192
|
+
}
|
|
99
193
|
return true;
|
|
100
194
|
}
|
|
101
195
|
}
|
|
196
|
+
AadAppSetCommand.aadApplicationPlatform = ['spa', 'web', 'publicClient'];
|
|
102
197
|
module.exports = new AadAppSetCommand();
|
|
103
198
|
//# sourceMappingURL=app-set.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
4
|
+
const commands_1 = require("../../commands");
|
|
5
|
+
class AadGroupListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.GROUP_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Lists all groups defined in Azure Active Directory.';
|
|
11
|
+
}
|
|
12
|
+
getTelemetryProperties(args) {
|
|
13
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
14
|
+
telemetryProps.deleted = args.options.deleted;
|
|
15
|
+
return telemetryProps;
|
|
16
|
+
}
|
|
17
|
+
defaultProperties() {
|
|
18
|
+
return ['id', 'displayName', 'groupType'];
|
|
19
|
+
}
|
|
20
|
+
commandAction(logger, args, cb) {
|
|
21
|
+
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.group' : 'groups';
|
|
22
|
+
this
|
|
23
|
+
.getAllItems(`${this.resource}/v1.0/${endpoint}`, logger, true)
|
|
24
|
+
.then(() => {
|
|
25
|
+
if (args.options.output === 'text') {
|
|
26
|
+
this.items.forEach((group) => {
|
|
27
|
+
if (group.groupTypes && group.groupTypes.length > 0 && group.groupTypes[0] === 'Unified') {
|
|
28
|
+
group.groupType = 'Microsoft 365';
|
|
29
|
+
}
|
|
30
|
+
else if (group.mailEnabled && group.securityEnabled) {
|
|
31
|
+
group.groupType = 'Mail enabled security';
|
|
32
|
+
}
|
|
33
|
+
else if (group.securityEnabled) {
|
|
34
|
+
group.groupType = 'Security';
|
|
35
|
+
}
|
|
36
|
+
else if (group.mailEnabled) {
|
|
37
|
+
group.groupType = 'Distribution';
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
logger.log(this.items);
|
|
42
|
+
cb();
|
|
43
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
44
|
+
}
|
|
45
|
+
options() {
|
|
46
|
+
const options = [
|
|
47
|
+
{ option: '-d, --deleted' }
|
|
48
|
+
];
|
|
49
|
+
const parentOptions = super.options();
|
|
50
|
+
return options.concat(parentOptions);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
module.exports = new AadGroupListCommand();
|
|
54
|
+
//# sourceMappingURL=group-list.js.map
|
|
@@ -5,6 +5,7 @@ const path = require("path");
|
|
|
5
5
|
const request_1 = require("../../../../request");
|
|
6
6
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
7
7
|
const commands_1 = require("../../commands");
|
|
8
|
+
const Utils_1 = require("../../../../Utils");
|
|
8
9
|
class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
9
10
|
get name() {
|
|
10
11
|
return commands_1.default.O365GROUP_ADD;
|
|
@@ -14,6 +15,8 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
14
15
|
}
|
|
15
16
|
commandAction(logger, args, cb) {
|
|
16
17
|
let group;
|
|
18
|
+
let ownerIds = [];
|
|
19
|
+
let memberIds = [];
|
|
17
20
|
if (this.verbose) {
|
|
18
21
|
logger.logToStderr(`Creating Microsoft 365 Group...`);
|
|
19
22
|
}
|
|
@@ -35,8 +38,16 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
35
38
|
visibility: args.options.isPrivate === 'true' ? 'Private' : 'Public'
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
.
|
|
41
|
+
this
|
|
42
|
+
.getUserIds(logger, args.options.owners)
|
|
43
|
+
.then((ownerIdsRes) => {
|
|
44
|
+
ownerIds = ownerIdsRes;
|
|
45
|
+
return this.getUserIds(logger, args.options.members);
|
|
46
|
+
})
|
|
47
|
+
.then((memberIdsRes) => {
|
|
48
|
+
memberIds = memberIdsRes;
|
|
49
|
+
return request_1.default.post(requestOptions);
|
|
50
|
+
})
|
|
40
51
|
.then((res) => {
|
|
41
52
|
group = res;
|
|
42
53
|
if (!args.options.logoPath) {
|
|
@@ -61,72 +72,32 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
61
72
|
});
|
|
62
73
|
})
|
|
63
74
|
.then(() => {
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
logger.logToStderr('Owners not set. Skipping');
|
|
67
|
-
}
|
|
68
|
-
return Promise.resolve(undefined);
|
|
69
|
-
}
|
|
70
|
-
const owners = args.options.owners.split(',').map(o => o.trim());
|
|
71
|
-
if (this.verbose) {
|
|
72
|
-
logger.logToStderr('Retrieving user information to set group owners...');
|
|
73
|
-
}
|
|
74
|
-
const requestOptions = {
|
|
75
|
-
url: `${this.resource}/v1.0/users?$filter=${owners.map(o => `userPrincipalName eq '${o}'`).join(' or ')}&$select=id`,
|
|
76
|
-
headers: {
|
|
77
|
-
'content-type': 'application/json'
|
|
78
|
-
},
|
|
79
|
-
responseType: 'json'
|
|
80
|
-
};
|
|
81
|
-
return request_1.default.get(requestOptions);
|
|
82
|
-
})
|
|
83
|
-
.then((res) => {
|
|
84
|
-
if (!res) {
|
|
85
|
-
return Promise.resolve();
|
|
75
|
+
if (ownerIds.length === 0) {
|
|
76
|
+
return Promise.resolve([]);
|
|
86
77
|
}
|
|
87
|
-
return Promise.all(
|
|
78
|
+
return Promise.all(ownerIds.map(ownerId => request_1.default.post({
|
|
88
79
|
url: `${this.resource}/v1.0/groups/${group.id}/owners/$ref`,
|
|
89
80
|
headers: {
|
|
90
81
|
'content-type': 'application/json'
|
|
91
82
|
},
|
|
92
83
|
responseType: 'json',
|
|
93
84
|
data: {
|
|
94
|
-
"@odata.id": `https://graph.microsoft.com/v1.0/users/${
|
|
85
|
+
"@odata.id": `https://graph.microsoft.com/v1.0/users/${ownerId}`
|
|
95
86
|
}
|
|
96
87
|
})));
|
|
97
88
|
})
|
|
98
89
|
.then(() => {
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
logger.logToStderr('Members not set. Skipping');
|
|
102
|
-
}
|
|
103
|
-
return Promise.resolve(undefined);
|
|
104
|
-
}
|
|
105
|
-
const members = args.options.members.split(',').map(o => o.trim());
|
|
106
|
-
if (this.verbose) {
|
|
107
|
-
logger.logToStderr('Retrieving user information to set group members...');
|
|
108
|
-
}
|
|
109
|
-
const requestOptions = {
|
|
110
|
-
url: `${this.resource}/v1.0/users?$filter=${members.map(o => `userPrincipalName eq '${o}'`).join(' or ')}&$select=id`,
|
|
111
|
-
headers: {
|
|
112
|
-
'content-type': 'application/json'
|
|
113
|
-
},
|
|
114
|
-
responseType: 'json'
|
|
115
|
-
};
|
|
116
|
-
return request_1.default.get(requestOptions);
|
|
117
|
-
})
|
|
118
|
-
.then((res) => {
|
|
119
|
-
if (!res) {
|
|
120
|
-
return Promise.resolve();
|
|
90
|
+
if (memberIds.length === 0) {
|
|
91
|
+
return Promise.resolve([]);
|
|
121
92
|
}
|
|
122
|
-
return Promise.all(
|
|
93
|
+
return Promise.all(memberIds.map(memberId => request_1.default.post({
|
|
123
94
|
url: `${this.resource}/v1.0/groups/${group.id}/members/$ref`,
|
|
124
95
|
headers: {
|
|
125
96
|
'content-type': 'application/json'
|
|
126
97
|
},
|
|
127
98
|
responseType: 'json',
|
|
128
99
|
data: {
|
|
129
|
-
"@odata.id": `https://graph.microsoft.com/v1.0/users/${
|
|
100
|
+
"@odata.id": `https://graph.microsoft.com/v1.0/users/${memberId}`
|
|
130
101
|
}
|
|
131
102
|
})));
|
|
132
103
|
})
|
|
@@ -135,6 +106,41 @@ class AadO365GroupAddCommand extends GraphCommand_1.default {
|
|
|
135
106
|
cb();
|
|
136
107
|
}, (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
137
108
|
}
|
|
109
|
+
getUserIds(logger, users) {
|
|
110
|
+
if (!users) {
|
|
111
|
+
if (this.debug) {
|
|
112
|
+
logger.logToStderr('No users to validate, skipping.');
|
|
113
|
+
}
|
|
114
|
+
return Promise.resolve([]);
|
|
115
|
+
}
|
|
116
|
+
if (this.verbose) {
|
|
117
|
+
logger.logToStderr('Retrieving user information.');
|
|
118
|
+
}
|
|
119
|
+
const userArr = users.split(',').map(o => o.trim());
|
|
120
|
+
let promises = [];
|
|
121
|
+
let userIds = [];
|
|
122
|
+
promises = userArr.map(user => {
|
|
123
|
+
const requestOptions = {
|
|
124
|
+
url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${Utils_1.default.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
|
|
125
|
+
headers: {
|
|
126
|
+
'content-type': 'application/json'
|
|
127
|
+
},
|
|
128
|
+
responseType: 'json'
|
|
129
|
+
};
|
|
130
|
+
return request_1.default.get(requestOptions);
|
|
131
|
+
});
|
|
132
|
+
return Promise.all(promises).then((usersRes) => {
|
|
133
|
+
let userUpns = [];
|
|
134
|
+
userUpns = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.userPrincipalName; });
|
|
135
|
+
userIds = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.id; });
|
|
136
|
+
// Find the members where no graph response was found
|
|
137
|
+
const invalidUsers = userArr.filter(user => !userUpns.some((upn) => (upn === null || upn === void 0 ? void 0 : upn.toLowerCase()) === user.toLowerCase()));
|
|
138
|
+
if (invalidUsers && invalidUsers.length > 0) {
|
|
139
|
+
return Promise.reject(`Cannot proceed with group creation. The following users provided are invalid : ${invalidUsers.join(',')}`);
|
|
140
|
+
}
|
|
141
|
+
return Promise.resolve(userIds);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
138
144
|
setGroupLogo(requestOptions, retryLeft, resolve, reject, logger) {
|
|
139
145
|
request_1.default
|
|
140
146
|
.put(requestOptions)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class AadO365GroupConversationListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.O365GROUP_CONVERSATION_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists conversations for the specified Microsoft 365 group';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['topic', 'lastDeliveredDateTime', 'id'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
this
|
|
18
|
+
.getAllItems(`${this.resource}/v1.0/groups/${args.options.groupId}/conversations`, logger, true)
|
|
19
|
+
.then(() => {
|
|
20
|
+
logger.log(this.items);
|
|
21
|
+
cb();
|
|
22
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
23
|
+
}
|
|
24
|
+
options() {
|
|
25
|
+
const options = [
|
|
26
|
+
{
|
|
27
|
+
option: '-i, --groupId <groupId>'
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
const parentOptions = super.options();
|
|
31
|
+
return options.concat(parentOptions);
|
|
32
|
+
}
|
|
33
|
+
validate(args) {
|
|
34
|
+
if (!Utils_1.default.isValidGuid(args.options.groupId)) {
|
|
35
|
+
return `${args.options.groupId} is not a valid GUID`;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
module.exports = new AadO365GroupConversationListCommand();
|
|
41
|
+
//# sourceMappingURL=o365group-conversation-list.js.map
|
|
@@ -37,14 +37,14 @@ class AadO365GroupUserSetCommand extends GraphItemsListCommand_1.GraphItemsListC
|
|
|
37
37
|
logger.logToStderr(this.items);
|
|
38
38
|
logger.logToStderr('');
|
|
39
39
|
}
|
|
40
|
-
if (this.items.filter(i =>
|
|
40
|
+
if (this.items.filter(i => args.options.userName.toUpperCase() === i.userPrincipalName.toUpperCase()).length <= 0) {
|
|
41
41
|
const userNotInGroup = (typeof args.options.groupId !== 'undefined') ?
|
|
42
42
|
'The specified user does not belong to the given Microsoft 365 Group. Please use the \'o365group user add\' command to add new users.' :
|
|
43
43
|
'The specified user does not belong to the given Microsoft Teams team. Please use the \'graph teams user add\' command to add new users.';
|
|
44
44
|
throw new Error(userNotInGroup);
|
|
45
45
|
}
|
|
46
46
|
if (args.options.role === "Owner") {
|
|
47
|
-
const foundMember = this.items.find(e =>
|
|
47
|
+
const foundMember = this.items.find(e => args.options.userName.toUpperCase() === e.userPrincipalName.toUpperCase() && e.userType === 'Member');
|
|
48
48
|
if (foundMember !== undefined) {
|
|
49
49
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners/$ref`;
|
|
50
50
|
const requestOptions = {
|
|
@@ -65,7 +65,7 @@ class AadO365GroupUserSetCommand extends GraphItemsListCommand_1.GraphItemsListC
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
const foundOwner = this.items.find(e =>
|
|
68
|
+
const foundOwner = this.items.find(e => args.options.userName.toUpperCase() === e.userPrincipalName.toUpperCase() && e.userType === 'Owner');
|
|
69
69
|
if (foundOwner !== undefined) {
|
|
70
70
|
const endpoint = `${this.resource}/v1.0/groups/${groupId}/owners/${foundOwner.id}/$ref`;
|
|
71
71
|
const requestOptions = {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
|
-
const
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
class AadOAuth2GrantAddCommand extends
|
|
7
|
+
class AadOAuth2GrantAddCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
9
|
return commands_1.default.OAUTH2GRANT_ADD;
|
|
10
10
|
}
|
|
@@ -16,20 +16,17 @@ class AadOAuth2GrantAddCommand extends AadCommand_1.default {
|
|
|
16
16
|
logger.logToStderr(`Granting the service principal specified permissions...`);
|
|
17
17
|
}
|
|
18
18
|
const requestOptions = {
|
|
19
|
-
url: `${this.resource}/
|
|
19
|
+
url: `${this.resource}/v1.0/oauth2PermissionGrants`,
|
|
20
20
|
headers: {
|
|
21
|
-
'content-type': 'application/json'
|
|
21
|
+
'content-type': 'application/json;odata.metadata=none'
|
|
22
22
|
},
|
|
23
23
|
responseType: 'json',
|
|
24
24
|
data: {
|
|
25
|
-
"odata.type": "Microsoft.DirectoryServices.OAuth2PermissionGrant",
|
|
26
25
|
"clientId": args.options.clientId,
|
|
27
26
|
"consentType": "AllPrincipals",
|
|
28
27
|
"principalId": null,
|
|
29
28
|
"resourceId": args.options.resourceId,
|
|
30
|
-
"scope": args.options.scope
|
|
31
|
-
"startTime": "0001-01-01T00:00:00",
|
|
32
|
-
"expiryTime": "9000-01-01T00:00:00"
|
|
29
|
+
"scope": args.options.scope
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
32
|
request_1.default
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
|
-
const
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
class AadOAuth2GrantListCommand extends
|
|
7
|
+
class AadOAuth2GrantListCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
9
|
return commands_1.default.OAUTH2GRANT_LIST;
|
|
10
10
|
}
|
|
@@ -19,9 +19,9 @@ class AadOAuth2GrantListCommand extends AadCommand_1.default {
|
|
|
19
19
|
logger.logToStderr(`Retrieving list of OAuth grants for the service principal...`);
|
|
20
20
|
}
|
|
21
21
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}/
|
|
22
|
+
url: `${this.resource}/v1.0/oauth2PermissionGrants?$filter=clientId eq '${encodeURIComponent(args.options.spObjectId)}'`,
|
|
23
23
|
headers: {
|
|
24
|
-
accept: 'application/json;odata=
|
|
24
|
+
accept: 'application/json;odata.metadata=none'
|
|
25
25
|
},
|
|
26
26
|
responseType: 'json'
|
|
27
27
|
};
|
|
@@ -37,15 +37,15 @@ class AadOAuth2GrantListCommand extends AadCommand_1.default {
|
|
|
37
37
|
options() {
|
|
38
38
|
const options = [
|
|
39
39
|
{
|
|
40
|
-
option: '-i, --
|
|
40
|
+
option: '-i, --spObjectId <spObjectId>'
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
43
|
const parentOptions = super.options();
|
|
44
44
|
return options.concat(parentOptions);
|
|
45
45
|
}
|
|
46
46
|
validate(args) {
|
|
47
|
-
if (!Utils_1.default.isValidGuid(args.options.
|
|
48
|
-
return `${args.options.
|
|
47
|
+
if (!Utils_1.default.isValidGuid(args.options.spObjectId)) {
|
|
48
|
+
return `${args.options.spObjectId} is not a valid GUID`;
|
|
49
49
|
}
|
|
50
50
|
return true;
|
|
51
51
|
}
|