@pnp/cli-microsoft365 7.0.0-beta.4bb805e → 7.0.0-beta.602a03f
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/dist/m365/aad/commands/user/user-get.js +7 -1
- package/dist/m365/aad/commands/user/user-list.js +3 -6
- package/dist/m365/aad/commands/user/user-set.js +20 -20
- package/dist/m365/pa/commands/app/app-consent-set.js +2 -2
- package/dist/m365/pa/commands/app/app-export.js +3 -3
- package/dist/m365/pa/commands/app/app-list.js +5 -5
- package/dist/m365/pa/commands/app/app-owner-set.js +115 -0
- package/dist/m365/pa/commands/app/app-permission-list.js +104 -0
- package/dist/m365/pa/commands.js +2 -0
- package/dist/m365/planner/commands/bucket/bucket-add.js +14 -10
- package/dist/m365/planner/commands/bucket/bucket-get.js +25 -19
- package/dist/m365/planner/commands/bucket/bucket-list.js +14 -10
- package/dist/m365/planner/commands/bucket/bucket-remove.js +26 -20
- package/dist/m365/planner/commands/bucket/bucket-set.js +26 -28
- package/dist/m365/planner/commands/roster/roster-member-add.js +3 -14
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +2 -2
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-list.js +2 -2
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-remove.js +3 -3
- package/dist/m365/pp/commands/card/card-clone.js +3 -3
- package/dist/m365/pp/commands/card/card-get.js +2 -2
- package/dist/m365/pp/commands/card/card-list.js +2 -2
- package/dist/m365/pp/commands/card/card-remove.js +3 -3
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +2 -2
- package/dist/m365/pp/commands/chatbot/chatbot-list.js +3 -3
- package/dist/m365/pp/commands/chatbot/chatbot-remove.js +3 -3
- package/dist/m365/pp/commands/dataverse/dataverse-table-get.js +2 -2
- package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +2 -2
- package/dist/m365/pp/commands/dataverse/dataverse-table-remove.js +2 -2
- package/dist/m365/pp/commands/dataverse/dataverse-table-row-list.js +2 -2
- package/dist/m365/pp/commands/dataverse/dataverse-table-row-remove.js +2 -2
- package/dist/m365/pp/commands/solution/solution-get.js +2 -2
- package/dist/m365/pp/commands/solution/solution-list.js +2 -2
- package/dist/m365/pp/commands/solution/solution-publish.js +3 -3
- package/dist/m365/pp/commands/solution/solution-publisher-add.js +2 -2
- package/dist/m365/pp/commands/solution/solution-publisher-get.js +2 -2
- package/dist/m365/pp/commands/solution/solution-publisher-list.js +2 -2
- package/dist/m365/pp/commands/solution/solution-publisher-remove.js +3 -3
- package/dist/m365/pp/commands/solution/solution-remove.js +3 -3
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +19 -17
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +19 -17
- package/dist/m365/spo/commands/file/file-list.js +3 -14
- package/dist/m365/spo/commands/list/list-add.js +0 -9
- package/dist/m365/spo/commands/list/list-retentionlabel-ensure.js +0 -4
- package/dist/m365/spo/commands/list/list-retentionlabel-get.js +0 -4
- package/dist/m365/spo/commands/list/list-set.js +0 -9
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +4 -4
- package/dist/m365/spo/commands/site/site-commsite-enable.js +9 -18
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +107 -24
- package/dist/m365/spo/commands/theme/theme-get.js +1 -2
- package/dist/m365/spo/commands/user/user-get.js +5 -5
- package/dist/m365/spo/commands.js +0 -2
- package/dist/m365/teams/commands/chat/chat-member-add.js +117 -0
- package/dist/m365/teams/commands/meeting/meeting-get.js +16 -24
- package/dist/m365/teams/commands/meeting/meeting-list.js +2 -15
- package/dist/m365/teams/commands/team/team-app-list.js +1 -1
- package/dist/m365/teams/commands.js +1 -0
- package/docs/docs/cmd/aad/user/user-get.mdx +118 -25
- package/docs/docs/cmd/aad/user/user-list.mdx +0 -9
- package/docs/docs/cmd/aad/user/user-set.mdx +11 -11
- package/docs/docs/cmd/pa/app/app-consent-set.mdx +3 -3
- package/docs/docs/cmd/pa/app/app-export.mdx +3 -3
- package/docs/docs/cmd/pa/app/app-list.mdx +2 -2
- package/docs/docs/cmd/pa/app/app-owner-set.mdx +60 -0
- package/docs/docs/cmd/pa/app/app-permission-list.mdx +132 -0
- package/docs/docs/cmd/planner/bucket/bucket-add.mdx +21 -4
- package/docs/docs/cmd/planner/bucket/bucket-get.mdx +22 -5
- package/docs/docs/cmd/planner/bucket/bucket-list.mdx +21 -4
- package/docs/docs/cmd/planner/bucket/bucket-remove.mdx +21 -4
- package/docs/docs/cmd/planner/bucket/bucket-set.mdx +22 -5
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.mdx +4 -4
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.mdx +4 -4
- package/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx +4 -4
- package/docs/docs/cmd/pp/card/card-clone.mdx +6 -6
- package/docs/docs/cmd/pp/card/card-get.mdx +6 -6
- package/docs/docs/cmd/pp/card/card-list.mdx +4 -4
- package/docs/docs/cmd/pp/card/card-remove.mdx +9 -9
- package/docs/docs/cmd/pp/chatbot/chatbot-get.mdx +6 -6
- package/docs/docs/cmd/pp/chatbot/chatbot-list.mdx +4 -4
- package/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx +4 -4
- 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 +1 -1
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.mdx +5 -5
- package/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx +5 -5
- package/docs/docs/cmd/pp/solution/solution-get.mdx +6 -6
- package/docs/docs/cmd/pp/solution/solution-list.mdx +4 -4
- package/docs/docs/cmd/pp/solution/solution-publish.mdx +4 -4
- package/docs/docs/cmd/pp/solution/solution-publisher-add.mdx +3 -3
- package/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +6 -6
- package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +4 -4
- package/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +5 -5
- package/docs/docs/cmd/pp/solution/solution-remove.mdx +9 -9
- package/docs/docs/cmd/spo/file/file-list.mdx +6 -10
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-add.mdx +0 -3
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.mdx +0 -6
- package/docs/docs/cmd/spo/list/list-retentionlabel-get.mdx +0 -6
- package/docs/docs/cmd/spo/list/list-set.mdx +0 -3
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +7 -7
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +11 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +23 -11
- package/docs/docs/cmd/spo/user/user-get.mdx +6 -6
- package/docs/docs/cmd/teams/chat/chat-member-add.mdx +66 -0
- package/package.json +1 -1
|
@@ -50,6 +50,9 @@ class AadUserGetCommand extends GraphCommand_1.default {
|
|
|
50
50
|
else if (args.options.email) {
|
|
51
51
|
requestUrl += `?$filter=mail eq '${formatting_1.formatting.encodeQueryParameter(args.options.email)}'${properties}`;
|
|
52
52
|
}
|
|
53
|
+
if (args.options.withManager) {
|
|
54
|
+
requestUrl += '&$expand=manager($select=displayName,userPrincipalName,id,mail)';
|
|
55
|
+
}
|
|
53
56
|
const requestOptions = {
|
|
54
57
|
url: requestUrl,
|
|
55
58
|
headers: {
|
|
@@ -82,7 +85,8 @@ _AadUserGetCommand_instances = new WeakSet(), _AadUserGetCommand_initTelemetry =
|
|
|
82
85
|
id: typeof args.options.id !== 'undefined',
|
|
83
86
|
userName: typeof args.options.userName !== 'undefined',
|
|
84
87
|
email: typeof args.options.email !== 'undefined',
|
|
85
|
-
properties: args.options.properties
|
|
88
|
+
properties: args.options.properties,
|
|
89
|
+
withManager: typeof args.options.withManager !== 'undefined'
|
|
86
90
|
});
|
|
87
91
|
});
|
|
88
92
|
}, _AadUserGetCommand_initOptions = function _AadUserGetCommand_initOptions() {
|
|
@@ -94,6 +98,8 @@ _AadUserGetCommand_instances = new WeakSet(), _AadUserGetCommand_initTelemetry =
|
|
|
94
98
|
option: '--email [email]'
|
|
95
99
|
}, {
|
|
96
100
|
option: '-p, --properties [properties]'
|
|
101
|
+
}, {
|
|
102
|
+
option: '--withManager'
|
|
97
103
|
});
|
|
98
104
|
}, _AadUserGetCommand_initValidators = function _AadUserGetCommand_initValidators() {
|
|
99
105
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -48,8 +48,7 @@ class AadUserListCommand extends GraphCommand_1.default {
|
|
|
48
48
|
catch (ex) {
|
|
49
49
|
throw ex;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const url = `${this.resource}/v1.0/${endpoint}?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
|
|
51
|
+
const url = `${this.resource}/v1.0/users?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
|
|
53
52
|
const users = yield odata_1.odata.getAllItems(url);
|
|
54
53
|
logger.log(users);
|
|
55
54
|
}
|
|
@@ -63,7 +62,6 @@ class AadUserListCommand extends GraphCommand_1.default {
|
|
|
63
62
|
const excludeOptions = [
|
|
64
63
|
'properties',
|
|
65
64
|
'p',
|
|
66
|
-
'deleted',
|
|
67
65
|
'd',
|
|
68
66
|
'debug',
|
|
69
67
|
'verbose',
|
|
@@ -90,12 +88,11 @@ class AadUserListCommand extends GraphCommand_1.default {
|
|
|
90
88
|
_AadUserListCommand_instances = new WeakSet(), _AadUserListCommand_initTelemetry = function _AadUserListCommand_initTelemetry() {
|
|
91
89
|
this.telemetry.push((args) => {
|
|
92
90
|
Object.assign(this.telemetryProperties, {
|
|
93
|
-
properties: args.options.properties
|
|
94
|
-
deleted: typeof args.options.deleted !== 'undefined'
|
|
91
|
+
properties: args.options.properties
|
|
95
92
|
});
|
|
96
93
|
});
|
|
97
94
|
}, _AadUserListCommand_initOptions = function _AadUserListCommand_initOptions() {
|
|
98
|
-
this.options.unshift({ option: '-p, --properties [properties]' }
|
|
95
|
+
this.options.unshift({ option: '-p, --properties [properties]' });
|
|
99
96
|
};
|
|
100
97
|
module.exports = new AadUserListCommand();
|
|
101
98
|
//# sourceMappingURL=user-list.js.map
|
|
@@ -45,21 +45,21 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
try {
|
|
47
47
|
if (args.options.currentPassword) {
|
|
48
|
-
if (args.options.
|
|
49
|
-
throw `You can only change your own password. Please use --
|
|
48
|
+
if (args.options.id && args.options.id !== accessToken_1.accessToken.getUserIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken)) {
|
|
49
|
+
throw `You can only change your own password. Please use --id @meId to reference to your own userId`;
|
|
50
50
|
}
|
|
51
|
-
else if (args.options.
|
|
52
|
-
throw 'You can only change your own password. Please use --
|
|
51
|
+
else if (args.options.userName && args.options.userName.toLowerCase() !== accessToken_1.accessToken.getUserNameFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken).toLowerCase()) {
|
|
52
|
+
throw 'You can only change your own password. Please use --userName @meUserName to reference to your own user principal name';
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (this.verbose) {
|
|
56
|
-
logger.logToStderr(`Updating user ${args.options.
|
|
56
|
+
logger.logToStderr(`Updating user ${args.options.userName || args.options.id}`);
|
|
57
57
|
}
|
|
58
|
-
const requestUrl = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(args.options.
|
|
58
|
+
const requestUrl = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(args.options.id ? args.options.id : args.options.userName)}`;
|
|
59
59
|
const manifest = this.mapRequestBody(args.options);
|
|
60
60
|
if (Object.keys(manifest).some(k => manifest[k] !== undefined)) {
|
|
61
61
|
if (this.verbose) {
|
|
62
|
-
logger.logToStderr(`Setting the updated properties for user ${args.options.
|
|
62
|
+
logger.logToStderr(`Setting the updated properties for user ${args.options.userName || args.options.id}`);
|
|
63
63
|
}
|
|
64
64
|
const requestOptions = {
|
|
65
65
|
url: requestUrl,
|
|
@@ -84,7 +84,7 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
84
84
|
if (this.verbose) {
|
|
85
85
|
logger.logToStderr('Removing the manager');
|
|
86
86
|
}
|
|
87
|
-
const user = args.options.
|
|
87
|
+
const user = args.options.id || args.options.userName;
|
|
88
88
|
yield this.removeManager(user);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -125,7 +125,7 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
125
125
|
changePassword(requestUrl, options, logger) {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
127
|
if (this.verbose) {
|
|
128
|
-
logger.logToStderr(`Changing password for user ${options.
|
|
128
|
+
logger.logToStderr(`Changing password for user ${options.userName || options.id}`);
|
|
129
129
|
}
|
|
130
130
|
const requestBody = {
|
|
131
131
|
currentPassword: options.currentPassword,
|
|
@@ -145,7 +145,7 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
145
145
|
updateManager(options) {
|
|
146
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
147
|
const managerRequestOptions = {
|
|
148
|
-
url: `${this.resource}/v1.0/users/${options.
|
|
148
|
+
url: `${this.resource}/v1.0/users/${options.id || options.userName}/manager/$ref`,
|
|
149
149
|
headers: {
|
|
150
150
|
accept: 'application/json;odata.metadata=none'
|
|
151
151
|
},
|
|
@@ -171,8 +171,8 @@ class AadUserSetCommand extends GraphCommand_1.default {
|
|
|
171
171
|
_AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry = function _AadUserSetCommand_initTelemetry() {
|
|
172
172
|
this.telemetry.push((args) => {
|
|
173
173
|
Object.assign(this.telemetryProperties, {
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
id: typeof args.options.id !== 'undefined',
|
|
175
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
176
176
|
accountEnabled: !!args.options.accountEnabled,
|
|
177
177
|
resetPassword: !!args.options.resetPassword,
|
|
178
178
|
forceChangePasswordNextSignIn: !!args.options.forceChangePasswordNextSignIn,
|
|
@@ -195,9 +195,9 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
195
195
|
});
|
|
196
196
|
}, _AadUserSetCommand_initOptions = function _AadUserSetCommand_initOptions() {
|
|
197
197
|
this.options.unshift({
|
|
198
|
-
option: '-i, --
|
|
198
|
+
option: '-i, --id [id]'
|
|
199
199
|
}, {
|
|
200
|
-
option: '-n, --
|
|
200
|
+
option: '-n, --userName [userName]'
|
|
201
201
|
}, {
|
|
202
202
|
option: '--accountEnabled [accountEnabled]',
|
|
203
203
|
autocomplete: ['true', 'false']
|
|
@@ -240,12 +240,12 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
240
240
|
this.types.boolean.push('accountEnabled');
|
|
241
241
|
}, _AadUserSetCommand_initValidators = function _AadUserSetCommand_initValidators() {
|
|
242
242
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
243
|
-
if (args.options.
|
|
244
|
-
!validation_1.validation.isValidGuid(args.options.
|
|
245
|
-
return `${args.options.
|
|
243
|
+
if (args.options.id &&
|
|
244
|
+
!validation_1.validation.isValidGuid(args.options.id)) {
|
|
245
|
+
return `${args.options.id} is not a valid GUID`;
|
|
246
246
|
}
|
|
247
|
-
if (args.options.
|
|
248
|
-
return `${args.options.
|
|
247
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
248
|
+
return `${args.options.userName} is not a valid userName`;
|
|
249
249
|
}
|
|
250
250
|
if (!args.options.resetPassword && ((args.options.currentPassword && !args.options.newPassword) || (args.options.newPassword && !args.options.currentPassword))) {
|
|
251
251
|
return `Specify both currentPassword and newPassword when you want to change your password`;
|
|
@@ -296,7 +296,7 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
296
296
|
}));
|
|
297
297
|
}, _AadUserSetCommand_initOptionSets = function _AadUserSetCommand_initOptionSets() {
|
|
298
298
|
this.optionSets.push({
|
|
299
|
-
options: ['
|
|
299
|
+
options: ['id', 'userName']
|
|
300
300
|
}, {
|
|
301
301
|
options: ['managerUserId', 'managerUserName', 'removeManager'],
|
|
302
302
|
runsWhen: (args) => args.options.managerUserId || args.options.managerUserName || args.options.removeManager
|
|
@@ -58,7 +58,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand_1.default {
|
|
|
58
58
|
consentPaApp(args) {
|
|
59
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
60
|
const requestOptions = {
|
|
61
|
-
url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.
|
|
61
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.environmentName}/apps/${args.options.name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`,
|
|
62
62
|
headers: {
|
|
63
63
|
accept: 'application/json;odata.metadata=none'
|
|
64
64
|
},
|
|
@@ -78,7 +78,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand_1.default {
|
|
|
78
78
|
}
|
|
79
79
|
_PaAppConsentSetCommand_instances = new WeakSet(), _PaAppConsentSetCommand_initOptions = function _PaAppConsentSetCommand_initOptions() {
|
|
80
80
|
this.options.unshift({
|
|
81
|
-
option: '-e, --
|
|
81
|
+
option: '-e, --environmentName <environmentName>'
|
|
82
82
|
}, {
|
|
83
83
|
option: '-n, --name <name>'
|
|
84
84
|
}, {
|
|
@@ -77,7 +77,7 @@ class PaAppExportCommand extends PowerPlatformCommand_1.default {
|
|
|
77
77
|
logger.logToStderr('Getting the Microsoft Power App resources...');
|
|
78
78
|
}
|
|
79
79
|
const requestOptions = {
|
|
80
|
-
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.
|
|
80
|
+
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/listPackageResources?api-version=2016-11-01`,
|
|
81
81
|
headers: {
|
|
82
82
|
accept: 'application/json'
|
|
83
83
|
},
|
|
@@ -102,7 +102,7 @@ class PaAppExportCommand extends PowerPlatformCommand_1.default {
|
|
|
102
102
|
}
|
|
103
103
|
const resources = yield this.getPackageResources(args, logger);
|
|
104
104
|
const requestOptions = {
|
|
105
|
-
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.
|
|
105
|
+
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/exportPackage?api-version=2016-11-01`,
|
|
106
106
|
headers: {
|
|
107
107
|
accept: 'application/json'
|
|
108
108
|
},
|
|
@@ -169,7 +169,7 @@ _PaAppExportCommand_instances = new WeakSet(), _PaAppExportCommand_initTelemetry
|
|
|
169
169
|
this.options.unshift({
|
|
170
170
|
option: '-i, --id <id>'
|
|
171
171
|
}, {
|
|
172
|
-
option: '-e, --
|
|
172
|
+
option: '-e, --environmentName <environmentName>'
|
|
173
173
|
}, {
|
|
174
174
|
option: '-n, --packageDisplayName [packageDisplayName]'
|
|
175
175
|
}, {
|
|
@@ -38,7 +38,7 @@ class PaAppListCommand extends PowerAppsCommand_1.default {
|
|
|
38
38
|
}
|
|
39
39
|
commandAction(logger, args) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.
|
|
41
|
+
const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting_1.formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps?api-version=2017-08-01`;
|
|
42
42
|
try {
|
|
43
43
|
const apps = yield odata_1.odata.getAllItems(url);
|
|
44
44
|
if (apps.length > 0) {
|
|
@@ -63,21 +63,21 @@ _PaAppListCommand_instances = new WeakSet(), _PaAppListCommand_initTelemetry = f
|
|
|
63
63
|
this.telemetry.push((args) => {
|
|
64
64
|
Object.assign(this.telemetryProperties, {
|
|
65
65
|
asAdmin: args.options.asAdmin === true,
|
|
66
|
-
|
|
66
|
+
environmentName: typeof args.options.environmentName !== 'undefined'
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
}, _PaAppListCommand_initOptions = function _PaAppListCommand_initOptions() {
|
|
70
70
|
this.options.unshift({
|
|
71
|
-
option: '-e, --
|
|
71
|
+
option: '-e, --environmentName [environmentName]'
|
|
72
72
|
}, {
|
|
73
73
|
option: '--asAdmin'
|
|
74
74
|
});
|
|
75
75
|
}, _PaAppListCommand_initValidators = function _PaAppListCommand_initValidators() {
|
|
76
76
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
if (args.options.asAdmin && !args.options.
|
|
77
|
+
if (args.options.asAdmin && !args.options.environmentName) {
|
|
78
78
|
return 'When specifying the asAdmin option the environment option is required as well';
|
|
79
79
|
}
|
|
80
|
-
if (args.options.
|
|
80
|
+
if (args.options.environmentName && !args.options.asAdmin) {
|
|
81
81
|
return 'When specifying the environment option the asAdmin option is required as well';
|
|
82
82
|
}
|
|
83
83
|
return true;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _PaAppOwnerSetCommand_instances, _PaAppOwnerSetCommand_initTelemetry, _PaAppOwnerSetCommand_initOptions, _PaAppOwnerSetCommand_initValidators, _PaAppOwnerSetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const aadUser_1 = require("../../../../utils/aadUser");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class PaAppOwnerSetCommand extends PowerAppsCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.APP_OWNER_SET;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Sets a new owner for a Power Apps app';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_PaAppOwnerSetCommand_instances.add(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PaAppOwnerSetCommand_instances, "m", _PaAppOwnerSetCommand_initTelemetry).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PaAppOwnerSetCommand_instances, "m", _PaAppOwnerSetCommand_initOptions).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PaAppOwnerSetCommand_instances, "m", _PaAppOwnerSetCommand_initValidators).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PaAppOwnerSetCommand_instances, "m", _PaAppOwnerSetCommand_initOptionSets).call(this);
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (this.verbose) {
|
|
41
|
+
logger.logToStderr(`Setting new owner ${args.options.userId || args.options.userName} for Power Apps app ${args.options.appName}...`);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const userId = yield this.getUserId(args.options);
|
|
45
|
+
const requestOptions = {
|
|
46
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.environmentName}/apps/${args.options.appName}/modifyAppOwner?api-version=2022-11-01`,
|
|
47
|
+
headers: {
|
|
48
|
+
accept: 'application/json',
|
|
49
|
+
'Content-Type': 'application/json'
|
|
50
|
+
},
|
|
51
|
+
responseType: 'json',
|
|
52
|
+
data: {
|
|
53
|
+
roleForOldAppOwner: args.options.roleForOldAppOwner,
|
|
54
|
+
newAppOwner: userId
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
yield request_1.default.post(requestOptions);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
this.handleRejectedODataJsonPromise(err);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
getUserId(options) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
if (options.userId) {
|
|
67
|
+
return options.userId;
|
|
68
|
+
}
|
|
69
|
+
return aadUser_1.aadUser.getUserIdByUpn(options.userName);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_PaAppOwnerSetCommand_instances = new WeakSet(), _PaAppOwnerSetCommand_initTelemetry = function _PaAppOwnerSetCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
77
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
78
|
+
roleForOldAppOwner: typeof args.options.roleForOldAppOwner !== 'undefined'
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}, _PaAppOwnerSetCommand_initOptions = function _PaAppOwnerSetCommand_initOptions() {
|
|
82
|
+
this.options.unshift({
|
|
83
|
+
option: '-e, --environmentName <environmentName>'
|
|
84
|
+
}, {
|
|
85
|
+
option: '--appName <appName>'
|
|
86
|
+
}, {
|
|
87
|
+
option: '--userId [userId]'
|
|
88
|
+
}, {
|
|
89
|
+
option: '--userName [userName]'
|
|
90
|
+
}, {
|
|
91
|
+
option: '--roleForOldAppOwner [roleForOldAppOwner]',
|
|
92
|
+
autocomplete: PaAppOwnerSetCommand.roleForOldAppOwner
|
|
93
|
+
});
|
|
94
|
+
}, _PaAppOwnerSetCommand_initValidators = function _PaAppOwnerSetCommand_initValidators() {
|
|
95
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
if (!validation_1.validation.isValidGuid(args.options.appName)) {
|
|
97
|
+
return `${args.options.appName} is not a valid GUID for appName`;
|
|
98
|
+
}
|
|
99
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
100
|
+
return `${args.options.userId} is not a valid GUID for userId`;
|
|
101
|
+
}
|
|
102
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
103
|
+
return `${args.options.userName} is not a valid UPN for userName`;
|
|
104
|
+
}
|
|
105
|
+
if (args.options.roleForOldAppOwner && PaAppOwnerSetCommand.roleForOldAppOwner.indexOf(args.options.roleForOldAppOwner) < 0) {
|
|
106
|
+
return `${args.options.roleForOldAppOwner} is not a valid roleForOldAppOwner. Allowed values are: ${PaAppOwnerSetCommand.roleForOldAppOwner.join(', ')}`;
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
}));
|
|
110
|
+
}, _PaAppOwnerSetCommand_initOptionSets = function _PaAppOwnerSetCommand_initOptionSets() {
|
|
111
|
+
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
112
|
+
};
|
|
113
|
+
PaAppOwnerSetCommand.roleForOldAppOwner = ['CanView', 'CanEdit'];
|
|
114
|
+
module.exports = new PaAppOwnerSetCommand();
|
|
115
|
+
//# sourceMappingURL=app-owner-set.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _PaAppPermissionListCommand_instances, _PaAppPermissionListCommand_initTelemetry, _PaAppPermissionListCommand_initOptions, _PaAppPermissionListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
19
|
+
const odata_1 = require("../../../../utils/odata");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class PaAppPermissionListCommand extends PowerAppsCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.APP_PERMISSION_LIST;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Lists all permissions of a Power Apps app';
|
|
29
|
+
}
|
|
30
|
+
defaultProperties() {
|
|
31
|
+
return ['roleName', 'principalId', 'principalType'];
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
_PaAppPermissionListCommand_instances.add(this);
|
|
36
|
+
this.allowedRoleNames = ['Owner', 'CanEdit', 'CanView'];
|
|
37
|
+
__classPrivateFieldGet(this, _PaAppPermissionListCommand_instances, "m", _PaAppPermissionListCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _PaAppPermissionListCommand_instances, "m", _PaAppPermissionListCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _PaAppPermissionListCommand_instances, "m", _PaAppPermissionListCommand_initValidators).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Retrieving permissions for app ${args.options.appName}${args.options.roleName !== undefined ? ` with role name ${args.options.roleName}` : ''}`);
|
|
45
|
+
}
|
|
46
|
+
const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting_1.formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps/${args.options.appName}/permissions?api-version=2022-11-01`;
|
|
47
|
+
try {
|
|
48
|
+
let permissions = yield odata_1.odata.getAllItems(url);
|
|
49
|
+
if (args.options.roleName) {
|
|
50
|
+
permissions = permissions.filter(permission => permission.properties.roleName === args.options.roleName);
|
|
51
|
+
}
|
|
52
|
+
if (args.options.output !== 'json') {
|
|
53
|
+
permissions.forEach(permission => {
|
|
54
|
+
permission.roleName = permission.properties.roleName;
|
|
55
|
+
permission.principalId = permission.properties.principal.id;
|
|
56
|
+
permission.principalType = permission.properties.principal.type;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
logger.log(permissions);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_PaAppPermissionListCommand_instances = new WeakSet(), _PaAppPermissionListCommand_initTelemetry = function _PaAppPermissionListCommand_initTelemetry() {
|
|
68
|
+
this.telemetry.push((args) => {
|
|
69
|
+
Object.assign(this.telemetryProperties, {
|
|
70
|
+
asAdmin: !!args.options.asAdmin,
|
|
71
|
+
environmentName: typeof args.options.environmentName !== 'undefined',
|
|
72
|
+
roleName: typeof args.options.roleName !== 'undefined'
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}, _PaAppPermissionListCommand_initOptions = function _PaAppPermissionListCommand_initOptions() {
|
|
76
|
+
this.options.unshift({
|
|
77
|
+
option: '--appName <appName>'
|
|
78
|
+
}, {
|
|
79
|
+
option: '--asAdmin'
|
|
80
|
+
}, {
|
|
81
|
+
option: '-e, --environmentName [environmentName]'
|
|
82
|
+
}, {
|
|
83
|
+
option: '--roleName [roleName]',
|
|
84
|
+
autocomplete: this.allowedRoleNames
|
|
85
|
+
});
|
|
86
|
+
}, _PaAppPermissionListCommand_initValidators = function _PaAppPermissionListCommand_initValidators() {
|
|
87
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
if (!validation_1.validation.isValidGuid(args.options.appName)) {
|
|
89
|
+
return `${args.options.appName} is not a valid GUID for appName.`;
|
|
90
|
+
}
|
|
91
|
+
if (args.options.roleName && !this.allowedRoleNames.includes(args.options.roleName)) {
|
|
92
|
+
return `${args.options.roleName} is not a valid roleName. Allowed values are ${this.allowedRoleNames.join(',')}`;
|
|
93
|
+
}
|
|
94
|
+
if (args.options.asAdmin && !args.options.environmentName) {
|
|
95
|
+
return 'Specifying the environmentName is required when using asAdmin';
|
|
96
|
+
}
|
|
97
|
+
if (!args.options.asAdmin && args.options.environmentName) {
|
|
98
|
+
return 'Specifying environmentName is only allowed when using asAdmin';
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}));
|
|
102
|
+
};
|
|
103
|
+
module.exports = new PaAppPermissionListCommand();
|
|
104
|
+
//# sourceMappingURL=app-permission-list.js.map
|
package/dist/m365/pa/commands.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.default = {
|
|
|
7
7
|
APP_LIST: `${prefix} app list`,
|
|
8
8
|
APP_REMOVE: `${prefix} app remove`,
|
|
9
9
|
APP_CONSENT_SET: `${prefix} app consent set`,
|
|
10
|
+
APP_OWNER_SET: `${prefix} app owner set`,
|
|
11
|
+
APP_PERMISSION_LIST: `${prefix} app permission list`,
|
|
10
12
|
CONNECTOR_EXPORT: `${prefix} connector export`,
|
|
11
13
|
CONNECTOR_LIST: `${prefix} connector list`,
|
|
12
14
|
ENVIRONMENT_GET: `${prefix} environment get`,
|
|
@@ -68,9 +68,13 @@ class PlannerBucketAddCommand extends GraphCommand_1.default {
|
|
|
68
68
|
if (args.options.planId) {
|
|
69
69
|
return args.options.planId;
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
if (args.options.planTitle) {
|
|
72
|
+
const groupId = yield this.getGroupId(args);
|
|
73
|
+
const plan = yield planner_1.planner.getPlanByTitle(args.options.planTitle, groupId);
|
|
74
|
+
return plan.id;
|
|
75
|
+
}
|
|
76
|
+
const plans = yield planner_1.planner.getPlansByRosterId(args.options.rosterId);
|
|
77
|
+
return plans[0].id;
|
|
74
78
|
});
|
|
75
79
|
}
|
|
76
80
|
getGroupId(args) {
|
|
@@ -88,6 +92,7 @@ _PlannerBucketAddCommand_instances = new WeakSet(), _PlannerBucketAddCommand_ini
|
|
|
88
92
|
Object.assign(this.telemetryProperties, {
|
|
89
93
|
planId: typeof args.options.planId !== 'undefined',
|
|
90
94
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
95
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
91
96
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
92
97
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
93
98
|
orderHint: typeof args.options.orderHint !== 'undefined'
|
|
@@ -100,6 +105,8 @@ _PlannerBucketAddCommand_instances = new WeakSet(), _PlannerBucketAddCommand_ini
|
|
|
100
105
|
option: "--planId [planId]"
|
|
101
106
|
}, {
|
|
102
107
|
option: "--planTitle [planTitle]"
|
|
108
|
+
}, {
|
|
109
|
+
option: '--rosterId [rosterId]'
|
|
103
110
|
}, {
|
|
104
111
|
option: "--ownerGroupId [ownerGroupId]"
|
|
105
112
|
}, {
|
|
@@ -109,19 +116,16 @@ _PlannerBucketAddCommand_instances = new WeakSet(), _PlannerBucketAddCommand_ini
|
|
|
109
116
|
});
|
|
110
117
|
}, _PlannerBucketAddCommand_initValidators = function _PlannerBucketAddCommand_initValidators() {
|
|
111
118
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
113
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
114
|
-
}
|
|
115
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
116
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
117
|
-
}
|
|
118
119
|
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
119
120
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
120
121
|
}
|
|
121
122
|
return true;
|
|
122
123
|
}));
|
|
123
124
|
}, _PlannerBucketAddCommand_initOptionSets = function _PlannerBucketAddCommand_initOptionSets() {
|
|
124
|
-
this.optionSets.push({ options: ['planId', 'planTitle'] }
|
|
125
|
+
this.optionSets.push({ options: ['planId', 'planTitle', 'rosterId'] }, {
|
|
126
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
127
|
+
runsWhen: (args) => args.options.planTitle !== undefined
|
|
128
|
+
});
|
|
125
129
|
};
|
|
126
130
|
module.exports = new PlannerBucketAddCommand();
|
|
127
131
|
//# sourceMappingURL=bucket-add.js.map
|
|
@@ -75,13 +75,17 @@ class PlannerBucketGetCommand extends GraphCommand_1.default {
|
|
|
75
75
|
}
|
|
76
76
|
getPlanId(args) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
const { planId, planTitle } = args.options;
|
|
78
|
+
const { planId, planTitle, rosterId } = args.options;
|
|
79
79
|
if (planId) {
|
|
80
80
|
return planId;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
if (planTitle) {
|
|
83
|
+
const groupId = yield this.getGroupId(args);
|
|
84
|
+
const plan = yield planner_1.planner.getPlanByTitle(planTitle, groupId);
|
|
85
|
+
return plan.id;
|
|
86
|
+
}
|
|
87
|
+
const plans = yield planner_1.planner.getPlansByRosterId(rosterId);
|
|
88
|
+
return plans[0].id;
|
|
85
89
|
});
|
|
86
90
|
}
|
|
87
91
|
getBucketById(id) {
|
|
@@ -114,6 +118,7 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
114
118
|
name: typeof args.options.name !== 'undefined',
|
|
115
119
|
planId: typeof args.options.planId !== 'undefined',
|
|
116
120
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
121
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
117
122
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
118
123
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined'
|
|
119
124
|
});
|
|
@@ -127,6 +132,8 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
127
132
|
option: '--planId [planId]'
|
|
128
133
|
}, {
|
|
129
134
|
option: "--planTitle [planTitle]"
|
|
135
|
+
}, {
|
|
136
|
+
option: '--rosterId [rosterId]'
|
|
130
137
|
}, {
|
|
131
138
|
option: '--ownerGroupId [ownerGroupId]'
|
|
132
139
|
}, {
|
|
@@ -135,24 +142,12 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
135
142
|
}, _PlannerBucketGetCommand_initValidators = function _PlannerBucketGetCommand_initValidators() {
|
|
136
143
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
137
144
|
if (args.options.id) {
|
|
138
|
-
if (args.options.planId || args.options.planTitle || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
139
|
-
return 'Don\'t specify planId, planTitle, ownerGroupId or ownerGroupName when using id';
|
|
145
|
+
if (args.options.planId || args.options.planTitle || args.options.rosterId || args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
146
|
+
return 'Don\'t specify planId, planTitle, rosterId, ownerGroupId or ownerGroupName when using id';
|
|
140
147
|
}
|
|
141
148
|
}
|
|
142
149
|
if (args.options.name) {
|
|
143
|
-
if (!args.options.planId && !args.options.planTitle) {
|
|
144
|
-
return 'Specify either planId or planTitle when using name';
|
|
145
|
-
}
|
|
146
|
-
if (args.options.planId && args.options.planTitle) {
|
|
147
|
-
return 'Specify either planId or planTitle when using name but not both';
|
|
148
|
-
}
|
|
149
150
|
if (args.options.planTitle) {
|
|
150
|
-
if (!args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
151
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
152
|
-
}
|
|
153
|
-
if (args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
154
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
155
|
-
}
|
|
156
151
|
if (args.options.ownerGroupId && !validation_1.validation.isValidGuid(args.options.ownerGroupId)) {
|
|
157
152
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
158
153
|
}
|
|
@@ -162,11 +157,22 @@ _PlannerBucketGetCommand_instances = new WeakSet(), _PlannerBucketGetCommand_ini
|
|
|
162
157
|
return 'Don\'t specify ownerGroupId or ownerGroupName when using planId';
|
|
163
158
|
}
|
|
164
159
|
}
|
|
160
|
+
if (args.options.rosterId) {
|
|
161
|
+
if (args.options.ownerGroupId || args.options.ownerGroupName) {
|
|
162
|
+
return 'Don\'t specify ownerGroupId or ownerGroupName when using rosterId';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
165
|
}
|
|
166
166
|
return true;
|
|
167
167
|
}));
|
|
168
168
|
}, _PlannerBucketGetCommand_initOptionSets = function _PlannerBucketGetCommand_initOptionSets() {
|
|
169
|
-
this.optionSets.push({ options: ['id', 'name'] }
|
|
169
|
+
this.optionSets.push({ options: ['id', 'name'] }, {
|
|
170
|
+
options: ['planId', 'planTitle', 'rosterId'],
|
|
171
|
+
runsWhen: (args) => args.options.name !== undefined
|
|
172
|
+
}, {
|
|
173
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
174
|
+
runsWhen: (args) => args.options.planTitle !== undefined
|
|
175
|
+
});
|
|
170
176
|
};
|
|
171
177
|
module.exports = new PlannerBucketGetCommand();
|
|
172
178
|
//# sourceMappingURL=bucket-get.js.map
|