@pnp/cli-microsoft365 11.1.0-beta.317d8bb → 11.1.0-beta.734344f
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -7
- package/dist/Command.js +2 -2
- package/dist/auth/msalCachePlugin.js +6 -2
- package/dist/autocomplete.js +6 -2
- package/dist/chili/chili.js +2 -1
- package/dist/cli/cli.js +4 -2
- package/dist/config.js +0 -1
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +2 -2
- package/dist/m365/app/commands/permission/permission-list.js +4 -2
- package/dist/m365/booking/commands/business/business-list.js +5 -0
- package/dist/m365/commands/setup.js +6 -3
- package/dist/m365/commands/status.js +5 -1
- package/dist/m365/connection/commands/connection-list.js +5 -1
- package/dist/m365/entra/commands/app/app-role-add.js +1 -1
- package/dist/m365/entra/commands/group/group-add.js +1 -1
- package/dist/m365/entra/commands/group/group-set.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-add.js +0 -1
- package/dist/m365/file/commands/convert/convert-pdf.js +1 -6
- package/dist/m365/flow/commands/environment/environment-list.js +5 -0
- package/dist/m365/flow/commands/flow-export.js +8 -5
- package/dist/m365/flow/commands/run/run-get.js +3 -3
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +1 -1
- package/dist/m365/onedrive/commands/onedrive-list.js +5 -0
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +5 -0
- package/dist/m365/pa/commands/app/app-export.js +1 -1
- package/dist/m365/pa/commands/app/app-get.js +1 -1
- package/dist/m365/pa/commands/environment/environment-list.js +5 -0
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/pp/commands/environment/environment-list.js +10 -23
- package/dist/m365/pp/commands/solution/solution-publisher-get.js +1 -1
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +5 -0
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +5 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
- package/dist/m365/spfx/commands/package/package-generate.js +3 -1
- package/dist/m365/spfx/commands/project/base-project-command.js +13 -5
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN021007_PKG_only_one_rush_stack_compiler_installed.js +1 -1
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +6 -4
- package/dist/m365/spfx/commands/project/project-model/ScssFile.js +3 -1
- package/dist/m365/spfx/commands/project/project-model/TsFile.js +6 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +5 -5
- package/dist/m365/spo/commands/file/file-add.js +4 -2
- package/dist/m365/spo/commands/file/file-rename.js +3 -4
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +9 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +12 -12
- package/dist/m365/spo/commands/page/page-add.js +4 -2
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -0
- package/dist/m365/spo/commands/page/page-set.js +4 -2
- package/dist/m365/spo/commands/page/page-text-add.js +1 -0
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +34 -54
- package/dist/m365/spo/commands/theme/theme-apply.js +1 -1
- package/dist/m365/spo/commands/web/web-reindex.js +17 -27
- package/dist/m365/teams/commands/tab/tab-add.js +9 -3
- package/dist/m365/viva/commands/connections/connections-app-create.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +1 -1
- package/dist/telemetry.js +3 -1
- package/dist/utils/accessToken.js +4 -0
- package/dist/utils/cache.js +3 -2
- package/dist/utils/customAppScope.js +1 -1
- package/dist/utils/directoryExtension.js +1 -1
- package/dist/utils/entraAdministrativeUnit.js +1 -1
- package/dist/utils/entraApp.js +2 -2
- package/dist/utils/entraDevice.js +1 -1
- package/dist/utils/entraServicePrincipal.js +2 -2
- package/dist/utils/formatting.js +1 -1
- package/dist/utils/md.js +2 -2
- package/dist/utils/odata.js +2 -0
- package/dist/utils/planner.js +1 -1
- package/dist/utils/powerPlatform.js +2 -2
- package/dist/utils/roleDefinition.js +2 -2
- package/dist/utils/spo.js +10 -11
- package/dist/utils/urlUtil.js +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/utils/vivaEngage.js +3 -3
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +15 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +14 -0
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +14 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +19 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +21 -0
- package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +19 -0
- package/eslint-rules/lib/rules/correct-command-class-name.js +18 -2
- package/eslint.config.mjs +270 -0
- package/npm-shrinkwrap.json +1117 -2277
- package/package.json +22 -21
- package/.eslintrc.cjs +0 -289
package/dist/Auth.js
CHANGED
|
@@ -122,6 +122,7 @@ export class Auth {
|
|
|
122
122
|
this._connection = Object.assign(this._connection, connection);
|
|
123
123
|
}
|
|
124
124
|
catch {
|
|
125
|
+
// Do nothing
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
async ensureAccessToken(resource, logger, debug = false, fetchNew = false) {
|
|
@@ -296,15 +297,17 @@ export class Auth {
|
|
|
296
297
|
return new ConfidentialClientApplication(await this.getAuthClientConfiguration(logger, debug, certificateThumbprint, certificatePrivateKey, clientSecret));
|
|
297
298
|
}
|
|
298
299
|
retrieveAuthCodeWithBrowser(resource, logger, debug) {
|
|
299
|
-
return new Promise(
|
|
300
|
+
return new Promise((resolve, reject) => {
|
|
300
301
|
// _authServer is never set before hitting this line, but this check
|
|
301
302
|
// is implemented so that we can support lazy loading
|
|
302
303
|
// but also stub it for testing
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
this._authServer
|
|
306
|
-
|
|
307
|
-
|
|
304
|
+
(async () => {
|
|
305
|
+
/* c8 ignore next 3 */
|
|
306
|
+
if (!this._authServer) {
|
|
307
|
+
this._authServer = (await import('./AuthServer.js')).default;
|
|
308
|
+
}
|
|
309
|
+
this._authServer.initializeServer(this.connection, resource, resolve, reject, logger, debug);
|
|
310
|
+
})().catch(reject);
|
|
308
311
|
});
|
|
309
312
|
}
|
|
310
313
|
async ensureAccessTokenWithBrowser(resource, logger, debug) {
|
|
@@ -404,7 +407,7 @@ export class Auth {
|
|
|
404
407
|
this.connection.thumbprint = await this.calculateThumbprint(pemCert);
|
|
405
408
|
}
|
|
406
409
|
}
|
|
407
|
-
catch
|
|
410
|
+
catch {
|
|
408
411
|
this.connection.certificateType = CertificateType.Binary;
|
|
409
412
|
}
|
|
410
413
|
}
|
package/dist/Command.js
CHANGED
|
@@ -243,7 +243,7 @@ class Command {
|
|
|
243
243
|
/* c8 ignore next 4 */
|
|
244
244
|
if (this.debug && typeof global.it === 'undefined') {
|
|
245
245
|
const error = new Error();
|
|
246
|
-
cli.error(error.stack).
|
|
246
|
+
cli.error(error.stack).catch(() => undefined);
|
|
247
247
|
}
|
|
248
248
|
if (res.error) {
|
|
249
249
|
try {
|
|
@@ -284,7 +284,7 @@ class Command {
|
|
|
284
284
|
/* c8 ignore next 4 */
|
|
285
285
|
if (this.debug && typeof global.it === 'undefined') {
|
|
286
286
|
const error = new Error();
|
|
287
|
-
cli.error(error.stack).
|
|
287
|
+
cli.error(error.stack).catch(() => undefined);
|
|
288
288
|
}
|
|
289
289
|
if (response.error &&
|
|
290
290
|
response.error['odata.error'] &&
|
|
@@ -8,7 +8,9 @@ class MsalCachePlugin {
|
|
|
8
8
|
const data = await this.fileTokenStorage.get();
|
|
9
9
|
tokenCacheContext.tokenCache.deserialize(data);
|
|
10
10
|
}
|
|
11
|
-
catch {
|
|
11
|
+
catch {
|
|
12
|
+
// Do nothing
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
15
|
async afterCacheAccess(tokenCacheContext) {
|
|
14
16
|
if (!tokenCacheContext.cacheHasChanged) {
|
|
@@ -17,7 +19,9 @@ class MsalCachePlugin {
|
|
|
17
19
|
try {
|
|
18
20
|
await this.fileTokenStorage.set(tokenCacheContext.tokenCache.serialize());
|
|
19
21
|
}
|
|
20
|
-
catch {
|
|
22
|
+
catch {
|
|
23
|
+
// Do nothing
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
const msalCachePlugin = new MsalCachePlugin();
|
package/dist/autocomplete.js
CHANGED
|
@@ -17,7 +17,9 @@ class Autocomplete {
|
|
|
17
17
|
const data = fs.readFileSync(Autocomplete.autocompleteFilePath, 'utf-8');
|
|
18
18
|
this.commands = JSON.parse(data);
|
|
19
19
|
}
|
|
20
|
-
catch {
|
|
20
|
+
catch {
|
|
21
|
+
// Do nothing
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
this.omelette = omelette('m365_comp|m365|microsoft365');
|
|
23
25
|
this.omelette.on('complete', this.handleAutocomplete.bind(this));
|
|
@@ -58,7 +60,9 @@ class Autocomplete {
|
|
|
58
60
|
replies = Object.keys(replies);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
catch {
|
|
63
|
+
catch {
|
|
64
|
+
// Do nothing
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
if (!replies) {
|
|
64
68
|
replies = [];
|
package/dist/chili/chili.js
CHANGED
|
@@ -97,10 +97,11 @@ async function runConversationTurn(conversationId, question) {
|
|
|
97
97
|
];
|
|
98
98
|
const result = await prompt.forSelection({ message: 'What would you like to do next?', choices });
|
|
99
99
|
switch (result) {
|
|
100
|
-
case 'ask':
|
|
100
|
+
case 'ask': {
|
|
101
101
|
const prompt = await promptForPrompt();
|
|
102
102
|
await runConversationTurn(conversationId, prompt);
|
|
103
103
|
break;
|
|
104
|
+
}
|
|
104
105
|
case 'end':
|
|
105
106
|
await endConversation(conversationId);
|
|
106
107
|
console.log('');
|
package/dist/cli/cli.js
CHANGED
|
@@ -360,7 +360,7 @@ async function loadOptionsFromContext(commandOptions, debug) {
|
|
|
360
360
|
m365rc = JSON.parse(fileContents);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
catch
|
|
363
|
+
catch {
|
|
364
364
|
await cli.closeWithError(`Error parsing ${filePath}`, { options: {} });
|
|
365
365
|
/* c8 ignore next */
|
|
366
366
|
}
|
|
@@ -403,7 +403,9 @@ async function loadCommandFromFile(commandFileUrl) {
|
|
|
403
403
|
cli.commandToExecute = cli.getCommandInfo(command.default, commandFileUrl, commandInfo?.help);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
catch {
|
|
406
|
+
catch {
|
|
407
|
+
// Do nothing
|
|
408
|
+
}
|
|
407
409
|
}
|
|
408
410
|
function getCommandInfo(command, filePath = '', helpFilePath = '') {
|
|
409
411
|
const options = command.schema ? zod.schemaToOptionInfo(command.schema) : getCommandOptions(command);
|
package/dist/config.js
CHANGED
|
@@ -64,7 +64,6 @@ export default {
|
|
|
64
64
|
'https://microsoft.sharepoint-df.com/User.ReadWrite.All'
|
|
65
65
|
],
|
|
66
66
|
applicationName: `CLI for Microsoft 365 v${app.packageJson().version}`,
|
|
67
|
-
delimiter: 'm365\$',
|
|
68
67
|
configstoreName: 'cli-m365-config',
|
|
69
68
|
minimalScopes: [
|
|
70
69
|
'https://graph.microsoft.com/User.Read'
|
|
@@ -38,7 +38,7 @@ class AdaptiveCardSendCommand extends AnonymousCommand {
|
|
|
38
38
|
JSON.parse(options.card);
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
|
-
catch
|
|
41
|
+
catch {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -53,7 +53,7 @@ class AdaptiveCardSendCommand extends AnonymousCommand {
|
|
|
53
53
|
JSON.parse(options.cardData);
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
|
-
catch
|
|
56
|
+
catch {
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -60,7 +60,7 @@ class AppPermissionListCommand extends AppCommand {
|
|
|
60
60
|
}
|
|
61
61
|
const permissionsPromises = [];
|
|
62
62
|
switch (mode) {
|
|
63
|
-
case GetServicePrincipal.withPermissions:
|
|
63
|
+
case GetServicePrincipal.withPermissions: {
|
|
64
64
|
const appRoleAssignmentsRequestOptions = {
|
|
65
65
|
url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/appRoleAssignments`,
|
|
66
66
|
headers: {
|
|
@@ -80,7 +80,8 @@ class AppPermissionListCommand extends AppCommand {
|
|
|
80
80
|
request.get(oauth2PermissionGrantsRequestOptions)
|
|
81
81
|
]);
|
|
82
82
|
break;
|
|
83
|
-
|
|
83
|
+
}
|
|
84
|
+
case GetServicePrincipal.withPermissionDefinitions: {
|
|
84
85
|
const oauth2PermissionScopesRequestOptions = {
|
|
85
86
|
url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipal.id}/oauth2PermissionScopes`,
|
|
86
87
|
headers: {
|
|
@@ -100,6 +101,7 @@ class AppPermissionListCommand extends AppCommand {
|
|
|
100
101
|
request.get(appRolesRequestOptions)
|
|
101
102
|
]);
|
|
102
103
|
break;
|
|
104
|
+
}
|
|
103
105
|
}
|
|
104
106
|
const permissions = await Promise.all(permissionsPromises);
|
|
105
107
|
switch (mode) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import { odata } from '../../../../utils/odata.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class BookingBusinessListCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.BUSINESS_LIST;
|
|
@@ -8,6 +10,9 @@ class BookingBusinessListCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Lists all Microsoft Bookings businesses that are created for the tenant.';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'displayName'];
|
|
13
18
|
}
|
|
@@ -90,7 +90,7 @@ class SetupCommand extends AnonymousCommand {
|
|
|
90
90
|
};
|
|
91
91
|
preferences.entraApp = await cli.promptForSelection(entraAppConfig);
|
|
92
92
|
switch (preferences.entraApp) {
|
|
93
|
-
case EntraAppConfig.Create:
|
|
93
|
+
case EntraAppConfig.Create: {
|
|
94
94
|
const newEntraAppScopesConfig = {
|
|
95
95
|
message: 'What scopes should the new app registration have?',
|
|
96
96
|
choices: [
|
|
@@ -100,10 +100,12 @@ class SetupCommand extends AnonymousCommand {
|
|
|
100
100
|
};
|
|
101
101
|
preferences.newEntraAppScopes = await cli.promptForSelection(newEntraAppScopesConfig);
|
|
102
102
|
break;
|
|
103
|
-
|
|
103
|
+
}
|
|
104
|
+
case EntraAppConfig.UseExisting: {
|
|
104
105
|
const existingApp = await this.configureExistingEntraApp(logger);
|
|
105
106
|
Object.assign(preferences, existingApp);
|
|
106
107
|
break;
|
|
108
|
+
}
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
else {
|
|
@@ -318,7 +320,7 @@ class SetupCommand extends AnonymousCommand {
|
|
|
318
320
|
}
|
|
319
321
|
async configureSettings({ preferences, settings, silent, logger }) {
|
|
320
322
|
switch (preferences.entraApp) {
|
|
321
|
-
case EntraAppConfig.Create:
|
|
323
|
+
case EntraAppConfig.Create: {
|
|
322
324
|
if (this.verbose) {
|
|
323
325
|
await logger.logToStderr('Creating a new Entra app...');
|
|
324
326
|
}
|
|
@@ -332,6 +334,7 @@ class SetupCommand extends AnonymousCommand {
|
|
|
332
334
|
cli.getConfig().delete(settingsNames.clientCertificateBase64Encoded);
|
|
333
335
|
cli.getConfig().delete(settingsNames.clientCertificatePassword);
|
|
334
336
|
break;
|
|
337
|
+
}
|
|
335
338
|
case EntraAppConfig.UseExisting:
|
|
336
339
|
Object.assign(settings, {
|
|
337
340
|
clientId: preferences.clientId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import auth from '../../Auth.js';
|
|
2
|
-
import Command, { CommandError } from '../../Command.js';
|
|
2
|
+
import Command, { CommandError, globalOptionsZod } from '../../Command.js';
|
|
3
3
|
import commands from './commands.js';
|
|
4
|
+
const options = globalOptionsZod.strict();
|
|
4
5
|
class StatusCommand extends Command {
|
|
5
6
|
get name() {
|
|
6
7
|
return commands.STATUS;
|
|
@@ -8,6 +9,9 @@ class StatusCommand extends Command {
|
|
|
8
9
|
get description() {
|
|
9
10
|
return 'Shows Microsoft 365 login status';
|
|
10
11
|
}
|
|
12
|
+
get schema() {
|
|
13
|
+
return options;
|
|
14
|
+
}
|
|
11
15
|
async commandAction(logger) {
|
|
12
16
|
if (auth.connection.active) {
|
|
13
17
|
try {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import assert from 'assert';
|
|
2
2
|
import auth from '../../../Auth.js';
|
|
3
|
-
import Command, { CommandError } from '../../../Command.js';
|
|
3
|
+
import Command, { CommandError, globalOptionsZod } from '../../../Command.js';
|
|
4
4
|
import commands from '../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
5
6
|
class ConnectionListCommand extends Command {
|
|
6
7
|
get name() {
|
|
7
8
|
return commands.LIST;
|
|
@@ -9,6 +10,9 @@ class ConnectionListCommand extends Command {
|
|
|
9
10
|
get description() {
|
|
10
11
|
return 'Show the list of available connections';
|
|
11
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
12
16
|
defaultProperties() {
|
|
13
17
|
return ['name', 'connectedAs', 'authType', 'active'];
|
|
14
18
|
}
|
|
@@ -104,7 +104,7 @@ _a = EntraAppRoleAddCommand, _EntraAppRoleAddCommand_instances = new WeakSet(),
|
|
|
104
104
|
if (claim.startsWith('.')) {
|
|
105
105
|
return 'Claim must not begin with .';
|
|
106
106
|
}
|
|
107
|
-
if (!/^[\w:!#$%&'()
|
|
107
|
+
if (!/^[\w:!#$%&'()*+,-./:;<=>?@[\]^+_`{|}~]+$/.test(claim)) {
|
|
108
108
|
return `Claim can contain only the following characters a-z, A-Z, 0-9, :!#$%&'()*+,-./:;<=>?@[]^+_\`{|}~]+`;
|
|
109
109
|
}
|
|
110
110
|
return true;
|
|
@@ -158,7 +158,7 @@ _EntraGroupAddCommand_instances = new WeakSet(), _EntraGroupAddCommand_initOptio
|
|
|
158
158
|
}
|
|
159
159
|
if (args.options.mailNickname) {
|
|
160
160
|
if (!validation.isValidMailNickname(args.options.mailNickname)) {
|
|
161
|
-
return `Value for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ ()
|
|
161
|
+
return `Value for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \\ [] " ; : <> , SPACE.`;
|
|
162
162
|
}
|
|
163
163
|
if (args.options.mailNickname.length > 64) {
|
|
164
164
|
return `The maximum amount of characters for 'mailNickname' is 64.`;
|
|
@@ -207,7 +207,7 @@ _EntraGroupSetCommand_instances = new WeakSet(), _EntraGroupSetCommand_initTelem
|
|
|
207
207
|
}
|
|
208
208
|
if (args.options.mailNickname) {
|
|
209
209
|
if (!validation.isValidMailNickname(args.options.mailNickname)) {
|
|
210
|
-
return `Value '${args.options.mailNickname}' for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ ()
|
|
210
|
+
return `Value '${args.options.mailNickname}' for option 'mailNickname' must contain only characters in the ASCII character set 0-127 except the following: @ () \\ [] " ; : <> , SPACE.`;
|
|
211
211
|
}
|
|
212
212
|
if (args.options.mailNickname.length > 64) {
|
|
213
213
|
return `The maximum amount of characters for 'mailNickname' is 64.`;
|
|
@@ -134,7 +134,6 @@ class EntraM365GroupAddCommand extends GraphCommand {
|
|
|
134
134
|
const userArr = users.split(',').map(o => o.trim());
|
|
135
135
|
let promises = [];
|
|
136
136
|
let userIds = [];
|
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
138
137
|
promises = userArr.map(user => {
|
|
139
138
|
const requestOptions = {
|
|
140
139
|
url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${formatting.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
|
|
@@ -69,12 +69,7 @@ class FileConvertPdfCommand extends GraphCommand {
|
|
|
69
69
|
if (this.verbose) {
|
|
70
70
|
await logger.logToStderr(`Deleting the temporary PDF file at ${localTargetFilePath}...`);
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
fs.unlinkSync(localTargetFilePath);
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
throw e;
|
|
77
|
-
}
|
|
72
|
+
fs.unlinkSync(localTargetFilePath);
|
|
78
73
|
}
|
|
79
74
|
else {
|
|
80
75
|
if (this.debug) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { odata } from '../../../../utils/odata.js';
|
|
2
2
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class FlowEnvironmentListCommand extends PowerAutomateCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.ENVIRONMENT_LIST;
|
|
@@ -8,6 +10,9 @@ class FlowEnvironmentListCommand extends PowerAutomateCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Lists Microsoft Flow environments in the current tenant';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['name', 'displayName'];
|
|
13
18
|
}
|
|
@@ -73,9 +73,12 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
73
73
|
// adds suggestedCreationType property to all resources
|
|
74
74
|
// see https://github.com/pnp/cli-microsoft365/issues/1845
|
|
75
75
|
Object.keys(res.resources).forEach((key) => {
|
|
76
|
-
res.resources[key].type === 'Microsoft.Flow/flows'
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
if (res.resources[key].type === 'Microsoft.Flow/flows') {
|
|
77
|
+
res.resources[key].suggestedCreationType = 'Update';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
res.resources[key].suggestedCreationType = 'Existing';
|
|
81
|
+
}
|
|
79
82
|
});
|
|
80
83
|
requestOptions.data = {
|
|
81
84
|
includedResourceIds: [
|
|
@@ -95,10 +98,10 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
95
98
|
await logger.logToStderr(`Getting file for Microsoft Flow ${args.options.name}...`);
|
|
96
99
|
}
|
|
97
100
|
const downloadFileUrl = formatArgument === 'json' ? '' : res.packageLink.value;
|
|
98
|
-
const filenameRegEx = /([
|
|
101
|
+
const filenameRegEx = /([^/]+\.zip)/i;
|
|
99
102
|
filenameFromApi = formatArgument === 'json' ? `${res.properties.displayName}.json` : (filenameRegEx.exec(downloadFileUrl) || ['output.zip'])[0];
|
|
100
103
|
// Replace all illegal characters from the file name
|
|
101
|
-
const illegalCharsRegEx = /[
|
|
104
|
+
const illegalCharsRegEx = /[\\/:*?"<>|]/g;
|
|
102
105
|
filenameFromApi = filenameFromApi.replace(illegalCharsRegEx, '_');
|
|
103
106
|
if (this.verbose) {
|
|
104
107
|
await logger.logToStderr(`Filename from PowerApps API: ${filenameFromApi}.`);
|
|
@@ -44,7 +44,7 @@ class FlowRunGetCommand extends PowerAutomateCommand {
|
|
|
44
44
|
if (args.options.withTrigger && res.properties.trigger.outputsLink) {
|
|
45
45
|
res.triggerInformation = await this.getTriggerInformation(res);
|
|
46
46
|
}
|
|
47
|
-
if (
|
|
47
|
+
if (args.options.withActions) {
|
|
48
48
|
res.actions = await this.getActionsInformation(res, args.options.withActions);
|
|
49
49
|
}
|
|
50
50
|
await logger.log(res);
|
|
@@ -64,10 +64,10 @@ class FlowRunGetCommand extends PowerAutomateCommand {
|
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
actionsResult[action] = res.properties.actions[action];
|
|
67
|
-
if (
|
|
67
|
+
if (res.properties.actions[action].inputsLink?.uri) {
|
|
68
68
|
actionsResult[action].input = await this.requestAdditionalInformation(res.properties.actions[action].inputsLink?.uri);
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
70
|
+
if (res.properties.actions[action].outputsLink?.uri) {
|
|
71
71
|
actionsResult[action].output = await this.requestAdditionalInformation(res.properties.actions[action].outputsLink?.uri);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -88,7 +88,7 @@ class GraphSchemaExtensionSetCommand extends GraphCommand {
|
|
|
88
88
|
try {
|
|
89
89
|
properties = JSON.parse(propertiesString);
|
|
90
90
|
}
|
|
91
|
-
catch
|
|
91
|
+
catch {
|
|
92
92
|
return 'The specified properties is not a valid JSON string';
|
|
93
93
|
}
|
|
94
94
|
// If the properties object is not an array
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../Command.js';
|
|
1
2
|
import config from "../../../config.js";
|
|
2
3
|
import request from "../../../request.js";
|
|
3
4
|
import { spo } from "../../../utils/spo.js";
|
|
4
5
|
import SpoCommand from "../../base/SpoCommand.js";
|
|
5
6
|
import commands from "../commands.js";
|
|
7
|
+
const options = globalOptionsZod.strict();
|
|
6
8
|
class OneDriveListCommand extends SpoCommand {
|
|
7
9
|
get name() {
|
|
8
10
|
return commands.LIST;
|
|
@@ -10,6 +12,9 @@ class OneDriveListCommand extends SpoCommand {
|
|
|
10
12
|
get description() {
|
|
11
13
|
return "Retrieves a list of OneDrive sites";
|
|
12
14
|
}
|
|
15
|
+
get schema() {
|
|
16
|
+
return options;
|
|
17
|
+
}
|
|
13
18
|
defaultProperties() {
|
|
14
19
|
return ['Title', 'Url'];
|
|
15
20
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import { odata } from '../../../../utils/odata.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class OutlookRoomListListCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.ROOMLIST_LIST;
|
|
@@ -8,6 +10,9 @@ class OutlookRoomListListCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Get a collection of available roomlists';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'displayName', 'phone', 'emailAddress'];
|
|
13
18
|
}
|
|
@@ -35,7 +35,7 @@ class PaAppExportCommand extends PowerPlatformCommand {
|
|
|
35
35
|
let filename = args.options.name;
|
|
36
36
|
if (args.options.packageDisplayName) {
|
|
37
37
|
//Replace all illegal characters from the file name
|
|
38
|
-
const illegalCharsRegEx = /[
|
|
38
|
+
const illegalCharsRegEx = /[\\/:*?"<>|]/g;
|
|
39
39
|
filename = args.options.packageDisplayName.replace(illegalCharsRegEx, '_');
|
|
40
40
|
}
|
|
41
41
|
const requestOptions = {
|
|
@@ -57,7 +57,7 @@ class PaAppGetCommand extends PowerAppsCommand {
|
|
|
57
57
|
const app = allApps.find((a) => {
|
|
58
58
|
return a.properties.displayName.toLowerCase() === `${args.options.displayName}`.toLowerCase();
|
|
59
59
|
});
|
|
60
|
-
if (
|
|
60
|
+
if (app) {
|
|
61
61
|
await logger.log(this.setProperties(app));
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import request from '../../../../request.js';
|
|
2
2
|
import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class PaEnvironmentListCommand extends PowerAppsCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.ENVIRONMENT_LIST;
|
|
@@ -8,6 +10,9 @@ class PaEnvironmentListCommand extends PowerAppsCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Lists Microsoft Power Apps environments in the current tenant';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['name', 'displayName'];
|
|
13
18
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import request from '../../../../request.js';
|
|
2
3
|
import PlannerCommand from '../../../base/PlannerCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class PlannerTenantSettingsListCommand extends PlannerCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.TENANT_SETTINGS_LIST;
|
|
@@ -8,6 +10,9 @@ class PlannerTenantSettingsListCommand extends PlannerCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Lists the Microsoft Planner configuration of the tenant';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
async commandAction(logger) {
|
|
12
17
|
const requestOptions = {
|
|
13
18
|
url: `${this.resource}/taskAPI/tenantAdminSettings/Settings`,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
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");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PpEnvironmentListCommand_instances, _PpEnvironmentListCommand_initTelemetry, _PpEnvironmentListCommand_initOptions;
|
|
7
1
|
import request from '../../../../request.js';
|
|
8
2
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
9
3
|
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
const options = globalOptionsZod
|
|
7
|
+
.extend({
|
|
8
|
+
asAdmin: z.boolean().optional()
|
|
9
|
+
})
|
|
10
|
+
.strict();
|
|
10
11
|
class PpEnvironmentListCommand extends PowerPlatformCommand {
|
|
11
12
|
get name() {
|
|
12
13
|
return commands.ENVIRONMENT_LIST;
|
|
@@ -14,15 +15,12 @@ class PpEnvironmentListCommand extends PowerPlatformCommand {
|
|
|
14
15
|
get description() {
|
|
15
16
|
return 'Lists Microsoft Power Platform environments';
|
|
16
17
|
}
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
17
21
|
defaultProperties() {
|
|
18
22
|
return ['name', 'displayName'];
|
|
19
23
|
}
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
_PpEnvironmentListCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _PpEnvironmentListCommand_instances, "m", _PpEnvironmentListCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _PpEnvironmentListCommand_instances, "m", _PpEnvironmentListCommand_initOptions).call(this);
|
|
25
|
-
}
|
|
26
24
|
async commandAction(logger, args) {
|
|
27
25
|
if (this.verbose) {
|
|
28
26
|
await logger.logToStderr(`Retrieving list of Microsoft Power Platform environments...`);
|
|
@@ -55,16 +53,5 @@ class PpEnvironmentListCommand extends PowerPlatformCommand {
|
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
_PpEnvironmentListCommand_instances = new WeakSet(), _PpEnvironmentListCommand_initTelemetry = function _PpEnvironmentListCommand_initTelemetry() {
|
|
59
|
-
this.telemetry.push((args) => {
|
|
60
|
-
Object.assign(this.telemetryProperties, {
|
|
61
|
-
asAdmin: !!args.options.asAdmin
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _PpEnvironmentListCommand_initOptions = function _PpEnvironmentListCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '--asAdmin'
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
56
|
export default new PpEnvironmentListCommand();
|
|
70
57
|
//# sourceMappingURL=environment-list.js.map
|
|
@@ -45,7 +45,7 @@ class PpSolutionPublisherGetCommand extends PowerPlatformCommand {
|
|
|
45
45
|
const result = await request.get(requestOptions);
|
|
46
46
|
return result;
|
|
47
47
|
}
|
|
48
|
-
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/publishers?$filter=friendlyname eq
|
|
48
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/publishers?$filter=friendlyname eq '${args.options.name}'&$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix&api-version=9.1`;
|
|
49
49
|
const result = await request.get(requestOptions);
|
|
50
50
|
if (result.value.length === 0) {
|
|
51
51
|
throw `The specified publisher '${args.options.name}' does not exist.`;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import { odata } from '../../../../utils/odata.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class PurviewRetentionEventListCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.RETENTIONEVENT_LIST;
|
|
@@ -8,6 +10,9 @@ class PurviewRetentionEventListCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Get a list of retention events';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'displayName', 'eventTriggerDateTime'];
|
|
13
18
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import { odata } from '../../../../utils/odata.js';
|
|
2
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
4
|
import commands from '../../commands.js';
|
|
5
|
+
const options = globalOptionsZod.strict();
|
|
4
6
|
class PurviewRetentionEventTypeListCommand extends GraphCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.RETENTIONEVENTTYPE_LIST;
|
|
@@ -8,6 +10,9 @@ class PurviewRetentionEventTypeListCommand extends GraphCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Get a list of retention event types';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'displayName', 'createdDateTime'];
|
|
13
18
|
}
|