@pnp/cli-microsoft365 7.3.0-beta.d293309 → 7.3.0
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 +3 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-add.js +137 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-get.js +112 -0
- package/dist/m365/aad/commands/app/app-permission-add.js +237 -0
- package/dist/m365/aad/commands.js +4 -1
- package/dist/m365/base/PowerAutomateCommand.js +18 -0
- package/dist/m365/external/commands/connection/connection-schema-add.js +36 -3
- package/dist/m365/flow/commands/environment/environment-get.js +3 -3
- package/dist/m365/flow/commands/environment/environment-list.js +3 -3
- package/dist/m365/flow/commands/flow-disable.js +3 -3
- package/dist/m365/flow/commands/flow-enable.js +3 -3
- package/dist/m365/flow/commands/flow-get.js +3 -3
- package/dist/m365/flow/commands/flow-list.js +14 -12
- package/dist/m365/flow/commands/flow-remove.js +3 -3
- package/dist/m365/flow/commands/owner/owner-ensure.js +3 -3
- package/dist/m365/flow/commands/owner/owner-list.js +3 -3
- package/dist/m365/flow/commands/owner/owner-remove.js +3 -3
- package/dist/m365/flow/commands/run/run-cancel.js +3 -3
- package/dist/m365/flow/commands/run/run-get.js +3 -3
- package/dist/m365/flow/commands/run/run-list.js +8 -7
- package/dist/m365/flow/commands/run/run-resubmit.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-batch-add.js +18 -7
- package/dist/m365/spo/commands/page/page-add.js +7 -28
- package/dist/m365/teams/commands/user/user-app-add.js +23 -5
- package/dist/utils/aadAdministrativeUnit.js +4 -4
- package/dist/utils/aadDevice.js +25 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-add.mdx +93 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-get.mdx +130 -0
- package/docs/docs/cmd/aad/app/app-permission-add.mdx +62 -0
- package/docs/docs/cmd/external/connection/connection-schema-add.mdx +14 -1
- package/docs/docs/cmd/spo/listitem/listitem-batch-add.mdx +25 -3
- package/docs/docs/cmd/teams/user/user-app-add.mdx +12 -3
- package/docs/docs/cmd/teams/user/user-app-remove.mdx +2 -2
- package/package.json +2 -2
|
@@ -6,9 +6,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _FlowDisableCommand_instances, _FlowDisableCommand_initTelemetry, _FlowDisableCommand_initOptions;
|
|
7
7
|
import request from '../../../request.js';
|
|
8
8
|
import { formatting } from '../../../utils/formatting.js';
|
|
9
|
-
import
|
|
9
|
+
import PowerAutomateCommand from '../../base/PowerAutomateCommand.js';
|
|
10
10
|
import commands from '../commands.js';
|
|
11
|
-
class FlowDisableCommand extends
|
|
11
|
+
class FlowDisableCommand extends PowerAutomateCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.DISABLE;
|
|
14
14
|
}
|
|
@@ -26,7 +26,7 @@ class FlowDisableCommand extends AzmgmtCommand {
|
|
|
26
26
|
await logger.logToStderr(`Disables Microsoft Flow ${args.options.name}...`);
|
|
27
27
|
}
|
|
28
28
|
const requestOptions = {
|
|
29
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}/stop?api-version=2016-11-01`,
|
|
29
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}/stop?api-version=2016-11-01`,
|
|
30
30
|
headers: {
|
|
31
31
|
accept: 'application/json'
|
|
32
32
|
},
|
|
@@ -6,9 +6,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _FlowEnableCommand_instances, _FlowEnableCommand_initTelemetry, _FlowEnableCommand_initOptions;
|
|
7
7
|
import request from '../../../request.js';
|
|
8
8
|
import { formatting } from '../../../utils/formatting.js';
|
|
9
|
-
import
|
|
9
|
+
import PowerAutomateCommand from '../../base/PowerAutomateCommand.js';
|
|
10
10
|
import commands from '../commands.js';
|
|
11
|
-
class FlowEnableCommand extends
|
|
11
|
+
class FlowEnableCommand extends PowerAutomateCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.ENABLE;
|
|
14
14
|
}
|
|
@@ -26,7 +26,7 @@ class FlowEnableCommand extends AzmgmtCommand {
|
|
|
26
26
|
await logger.logToStderr(`Enables Microsoft Flow ${args.options.name}...`);
|
|
27
27
|
}
|
|
28
28
|
const requestOptions = {
|
|
29
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}/start?api-version=2016-11-01`,
|
|
29
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}/start?api-version=2016-11-01`,
|
|
30
30
|
headers: {
|
|
31
31
|
accept: 'application/json'
|
|
32
32
|
},
|
|
@@ -6,9 +6,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _FlowGetCommand_instances, _FlowGetCommand_initTelemetry, _FlowGetCommand_initOptions;
|
|
7
7
|
import request from '../../../request.js';
|
|
8
8
|
import { formatting } from '../../../utils/formatting.js';
|
|
9
|
-
import
|
|
9
|
+
import PowerAutomateCommand from '../../base/PowerAutomateCommand.js';
|
|
10
10
|
import commands from '../commands.js';
|
|
11
|
-
class FlowGetCommand extends
|
|
11
|
+
class FlowGetCommand extends PowerAutomateCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.GET;
|
|
14
14
|
}
|
|
@@ -29,7 +29,7 @@ class FlowGetCommand extends AzmgmtCommand {
|
|
|
29
29
|
await logger.logToStderr(`Retrieving information about Microsoft Flow ${args.options.name}...`);
|
|
30
30
|
}
|
|
31
31
|
const requestOptions = {
|
|
32
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
32
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
33
33
|
headers: {
|
|
34
34
|
accept: 'application/json'
|
|
35
35
|
},
|
|
@@ -5,9 +5,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _FlowListCommand_instances, _FlowListCommand_initTelemetry, _FlowListCommand_initOptions, _FlowListCommand_initValidators;
|
|
7
7
|
import { formatting } from '../../../utils/formatting.js';
|
|
8
|
-
import {
|
|
8
|
+
import { odata } from '../../../utils/odata.js';
|
|
9
|
+
import PowerAutomateCommand from '../../base/PowerAutomateCommand.js';
|
|
9
10
|
import commands from '../commands.js';
|
|
10
|
-
class FlowListCommand extends
|
|
11
|
+
class FlowListCommand extends PowerAutomateCommand {
|
|
11
12
|
get name() {
|
|
12
13
|
return commands.LIST;
|
|
13
14
|
}
|
|
@@ -28,31 +29,32 @@ class FlowListCommand extends AzmgmtItemsListCommand {
|
|
|
28
29
|
async commandAction(logger, args) {
|
|
29
30
|
try {
|
|
30
31
|
const { environmentName, asAdmin, sharingStatus, includeSolutions } = args.options;
|
|
32
|
+
let items = [];
|
|
31
33
|
if (sharingStatus === 'personal') {
|
|
32
34
|
const url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'personal');
|
|
33
|
-
await
|
|
35
|
+
items = await odata.getAllItems(url);
|
|
34
36
|
}
|
|
35
37
|
else if (sharingStatus === 'sharedWithMe') {
|
|
36
38
|
const url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'team');
|
|
37
|
-
await
|
|
39
|
+
items = await odata.getAllItems(url);
|
|
38
40
|
}
|
|
39
41
|
else if (sharingStatus === 'all') {
|
|
40
42
|
let url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'personal');
|
|
41
|
-
await
|
|
43
|
+
items = await odata.getAllItems(url);
|
|
42
44
|
url = this.getApiUrl(environmentName, asAdmin, includeSolutions, 'team');
|
|
43
|
-
await
|
|
45
|
+
items = await odata.getAllItems(url);
|
|
44
46
|
}
|
|
45
47
|
else {
|
|
46
48
|
const url = this.getApiUrl(environmentName, asAdmin, includeSolutions);
|
|
47
|
-
await
|
|
49
|
+
items = await odata.getAllItems(url);
|
|
48
50
|
}
|
|
49
51
|
// Remove duplicates
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
|
|
52
|
+
items = items.filter((flow, index, self) => index === self.findIndex(f => f.id === flow.id));
|
|
53
|
+
if (items.length > 0) {
|
|
54
|
+
items.forEach(i => {
|
|
53
55
|
i.displayName = i.properties.displayName;
|
|
54
56
|
});
|
|
55
|
-
await logger.log(
|
|
57
|
+
await logger.log(items);
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
60
|
if (this.verbose) {
|
|
@@ -65,7 +67,7 @@ class FlowListCommand extends AzmgmtItemsListCommand {
|
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
getApiUrl(environmentName, asAdmin, includeSolutionFlows, filter) {
|
|
68
|
-
let url = `${this.resource}providers/Microsoft.ProcessSimple${asAdmin ? '/scopes/admin' : ''}/environments/${formatting.encodeQueryParameter(environmentName)}/flows?api-version=2016-11-01`;
|
|
70
|
+
let url = `${this.resource}/providers/Microsoft.ProcessSimple${asAdmin ? '/scopes/admin' : ''}/environments/${formatting.encodeQueryParameter(environmentName)}/flows?api-version=2016-11-01`;
|
|
69
71
|
if (filter === 'personal') {
|
|
70
72
|
url += `&$filter=search('personal')`;
|
|
71
73
|
}
|
|
@@ -8,9 +8,9 @@ import { cli } from '../../../cli/cli.js';
|
|
|
8
8
|
import request from '../../../request.js';
|
|
9
9
|
import { formatting } from '../../../utils/formatting.js';
|
|
10
10
|
import { validation } from '../../../utils/validation.js';
|
|
11
|
-
import AzmgmtCommand from '../../base/AzmgmtCommand.js';
|
|
12
11
|
import commands from '../commands.js';
|
|
13
|
-
|
|
12
|
+
import PowerAutomateCommand from '../../base/PowerAutomateCommand.js';
|
|
13
|
+
class FlowRemoveCommand extends PowerAutomateCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.REMOVE;
|
|
16
16
|
}
|
|
@@ -30,7 +30,7 @@ class FlowRemoveCommand extends AzmgmtCommand {
|
|
|
30
30
|
}
|
|
31
31
|
const removeFlow = async () => {
|
|
32
32
|
const requestOptions = {
|
|
33
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
33
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
34
34
|
fullResponse: true,
|
|
35
35
|
headers: {
|
|
36
36
|
accept: 'application/json'
|
|
@@ -9,9 +9,9 @@ import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
|
9
9
|
import { aadUser } from '../../../../utils/aadUser.js';
|
|
10
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
|
-
import
|
|
12
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
-
class FlowOwnerEnsureCommand extends
|
|
14
|
+
class FlowOwnerEnsureCommand extends PowerAutomateCommand {
|
|
15
15
|
get name() {
|
|
16
16
|
return commands.OWNER_ENSURE;
|
|
17
17
|
}
|
|
@@ -52,7 +52,7 @@ class FlowOwnerEnsureCommand extends AzmgmtCommand {
|
|
|
52
52
|
type = 'Group';
|
|
53
53
|
}
|
|
54
54
|
const requestOptions = {
|
|
55
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
|
|
55
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
|
|
56
56
|
headers: {
|
|
57
57
|
accept: 'application/json'
|
|
58
58
|
},
|
|
@@ -8,9 +8,9 @@ import { cli } from '../../../../cli/cli.js';
|
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { odata } from '../../../../utils/odata.js';
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
|
-
import
|
|
11
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
class FlowOwnerListCommand extends
|
|
13
|
+
class FlowOwnerListCommand extends PowerAutomateCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.OWNER_LIST;
|
|
16
16
|
}
|
|
@@ -32,7 +32,7 @@ class FlowOwnerListCommand extends AzmgmtCommand {
|
|
|
32
32
|
if (this.verbose) {
|
|
33
33
|
await logger.logToStderr(`Listing owners for flow ${args.options.flowName} in environment ${args.options.environmentName}`);
|
|
34
34
|
}
|
|
35
|
-
const response = await odata.getAllItems(`${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/permissions?api-version=2016-11-01`);
|
|
35
|
+
const response = await odata.getAllItems(`${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/permissions?api-version=2016-11-01`);
|
|
36
36
|
if (!cli.shouldTrimOutput(args.options.output)) {
|
|
37
37
|
await logger.log(response);
|
|
38
38
|
}
|
|
@@ -10,9 +10,9 @@ import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
|
10
10
|
import { aadUser } from '../../../../utils/aadUser.js';
|
|
11
11
|
import { formatting } from '../../../../utils/formatting.js';
|
|
12
12
|
import { validation } from '../../../../utils/validation.js';
|
|
13
|
-
import
|
|
13
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
14
14
|
import commands from '../../commands.js';
|
|
15
|
-
class FlowOwnerRemoveCommand extends
|
|
15
|
+
class FlowOwnerRemoveCommand extends PowerAutomateCommand {
|
|
16
16
|
get name() {
|
|
17
17
|
return commands.OWNER_REMOVE;
|
|
18
18
|
}
|
|
@@ -47,7 +47,7 @@ class FlowOwnerRemoveCommand extends AzmgmtCommand {
|
|
|
47
47
|
idToRemove = await aadGroup.getGroupIdByDisplayName(args.options.groupName);
|
|
48
48
|
}
|
|
49
49
|
const requestOptions = {
|
|
50
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
|
|
50
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
|
|
51
51
|
headers: {
|
|
52
52
|
accept: 'application/json'
|
|
53
53
|
},
|
|
@@ -8,9 +8,9 @@ import { cli } from '../../../../cli/cli.js';
|
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
|
-
import
|
|
11
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
class FlowRunCancelCommand extends
|
|
13
|
+
class FlowRunCancelCommand extends PowerAutomateCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.RUN_CANCEL;
|
|
16
16
|
}
|
|
@@ -30,7 +30,7 @@ class FlowRunCancelCommand extends AzmgmtCommand {
|
|
|
30
30
|
}
|
|
31
31
|
const cancelFlow = async () => {
|
|
32
32
|
const requestOptions = {
|
|
33
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs/${formatting.encodeQueryParameter(args.options.name)}/cancel?api-version=2016-11-01`,
|
|
33
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs/${formatting.encodeQueryParameter(args.options.name)}/cancel?api-version=2016-11-01`,
|
|
34
34
|
headers: {
|
|
35
35
|
accept: 'application/json'
|
|
36
36
|
},
|
|
@@ -7,9 +7,9 @@ var _FlowRunGetCommand_instances, _FlowRunGetCommand_initOptions, _FlowRunGetCom
|
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
|
-
import
|
|
10
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
-
class FlowRunGetCommand extends
|
|
12
|
+
class FlowRunGetCommand extends PowerAutomateCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.RUN_GET;
|
|
15
15
|
}
|
|
@@ -31,7 +31,7 @@ class FlowRunGetCommand extends AzmgmtCommand {
|
|
|
31
31
|
await logger.logToStderr(`Retrieving information about run ${args.options.name} of Microsoft Flow ${args.options.flowName}...`);
|
|
32
32
|
}
|
|
33
33
|
const requestOptions = {
|
|
34
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
34
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
|
|
35
35
|
headers: {
|
|
36
36
|
accept: 'application/json'
|
|
37
37
|
},
|
|
@@ -5,10 +5,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _FlowRunListCommand_instances, _FlowRunListCommand_initTelemetry, _FlowRunListCommand_initOptions, _FlowRunListCommand_initValidators;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
import { odata } from '../../../../utils/odata.js';
|
|
8
9
|
import { validation } from '../../../../utils/validation.js';
|
|
9
|
-
import
|
|
10
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
10
11
|
import commands from '../../commands.js';
|
|
11
|
-
class FlowRunListCommand extends
|
|
12
|
+
class FlowRunListCommand extends PowerAutomateCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.RUN_LIST;
|
|
14
15
|
}
|
|
@@ -30,20 +31,20 @@ class FlowRunListCommand extends AzmgmtItemsListCommand {
|
|
|
30
31
|
if (this.verbose) {
|
|
31
32
|
await logger.logToStderr(`Retrieving list of runs for Microsoft Flow ${args.options.flowName}...`);
|
|
32
33
|
}
|
|
33
|
-
let url = `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
|
|
34
|
+
let url = `${this.resource}/providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
|
|
34
35
|
const filters = this.getFilters(args.options);
|
|
35
36
|
if (filters.length > 0) {
|
|
36
37
|
url += `&$filter=${filters.join(' and ')}`;
|
|
37
38
|
}
|
|
38
39
|
try {
|
|
39
|
-
await
|
|
40
|
-
if (args.options.output !== 'json' &&
|
|
41
|
-
|
|
40
|
+
const items = await odata.getAllItems(url);
|
|
41
|
+
if (args.options.output !== 'json' && items.length > 0) {
|
|
42
|
+
items.forEach(i => {
|
|
42
43
|
i.startTime = i.properties.startTime;
|
|
43
44
|
i.status = i.properties.status;
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
await logger.log(
|
|
47
|
+
await logger.log(items);
|
|
47
48
|
}
|
|
48
49
|
catch (err) {
|
|
49
50
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -9,9 +9,9 @@ import { cli } from '../../../../cli/cli.js';
|
|
|
9
9
|
import request from '../../../../request.js';
|
|
10
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
|
-
import AzmgmtCommand from '../../../base/AzmgmtCommand.js';
|
|
13
12
|
import commands from '../../commands.js';
|
|
14
|
-
|
|
13
|
+
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
14
|
+
class FlowRunResubmitCommand extends PowerAutomateCommand {
|
|
15
15
|
get name() {
|
|
16
16
|
return commands.RUN_RESUBMIT;
|
|
17
17
|
}
|
|
@@ -36,7 +36,7 @@ class FlowRunResubmitCommand extends AzmgmtCommand {
|
|
|
36
36
|
await logger.logToStderr(chalk.yellow(`Retrieved trigger: ${triggerName}`));
|
|
37
37
|
}
|
|
38
38
|
const requestOptions = {
|
|
39
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/triggers/${formatting.encodeQueryParameter(triggerName)}/histories/${formatting.encodeQueryParameter(args.options.name)}/resubmit?api-version=2016-11-01`,
|
|
39
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/triggers/${formatting.encodeQueryParameter(triggerName)}/histories/${formatting.encodeQueryParameter(args.options.name)}/resubmit?api-version=2016-11-01`,
|
|
40
40
|
headers: {
|
|
41
41
|
accept: 'application/json'
|
|
42
42
|
},
|
|
@@ -60,7 +60,7 @@ class FlowRunResubmitCommand extends AzmgmtCommand {
|
|
|
60
60
|
}
|
|
61
61
|
async getTriggerName(environment, flow) {
|
|
62
62
|
const requestOptions = {
|
|
63
|
-
url: `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(environment)}/flows/${formatting.encodeQueryParameter(flow)}/triggers?api-version=2016-11-01`,
|
|
63
|
+
url: `${this.resource}/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(environment)}/flows/${formatting.encodeQueryParameter(flow)}/triggers?api-version=2016-11-01`,
|
|
64
64
|
headers: {
|
|
65
65
|
accept: 'application/json'
|
|
66
66
|
},
|
|
@@ -35,9 +35,9 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
35
35
|
async commandAction(logger, args) {
|
|
36
36
|
try {
|
|
37
37
|
if (this.verbose) {
|
|
38
|
-
await logger.logToStderr(`Starting to create batch items from csv at path ${args.options.filePath}`);
|
|
38
|
+
await logger.logToStderr(`Starting to create batch items from csv ${args.options.filePath ? `at path ${args.options.filePath}` : 'from content'}`);
|
|
39
39
|
}
|
|
40
|
-
const csvContent = fs.readFileSync(args.options.filePath, 'utf8');
|
|
40
|
+
const csvContent = args.options.filePath ? fs.readFileSync(args.options.filePath, 'utf8') : args.options.csvContent;
|
|
41
41
|
const jsonContent = formatting.parseCsvToJson(csvContent);
|
|
42
42
|
await this.addItemsAsBatch(jsonContent, args.options, logger);
|
|
43
43
|
}
|
|
@@ -97,7 +97,7 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
97
97
|
batchBody.push(`Accept: application/json;odata=nometadata\n`);
|
|
98
98
|
batchBody.push(`Content-Type: application/json;odata=verbose\n`);
|
|
99
99
|
batchBody.push(`If-Match: *\n\n`);
|
|
100
|
-
batchBody.push(`{\n"formValues": ${JSON.stringify(item)}\n}`);
|
|
100
|
+
batchBody.push(`{\n"formValues": ${JSON.stringify(this.formatFormValues(item))}\n}`);
|
|
101
101
|
});
|
|
102
102
|
// close batch body
|
|
103
103
|
batchBody.push(`\n\n`);
|
|
@@ -105,6 +105,13 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
105
105
|
batchBody.push(`--batch_${batchId}--\n`);
|
|
106
106
|
return batchBody;
|
|
107
107
|
}
|
|
108
|
+
formatFormValues(input) {
|
|
109
|
+
// Fix for PS 7
|
|
110
|
+
return input.map(obj => ({
|
|
111
|
+
FieldName: obj.FieldName.replace(/\\"/g, ''),
|
|
112
|
+
FieldValue: obj.FieldValue.replace(/\\"/g, '')
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
108
115
|
parseBatchResponseBody(response) {
|
|
109
116
|
const batchResults = [];
|
|
110
117
|
response.split('\r\n')
|
|
@@ -151,6 +158,8 @@ class SpoListItemBatchAddCommand extends SpoCommand {
|
|
|
151
158
|
_SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddCommand_initTelemetry = function _SpoListItemBatchAddCommand_initTelemetry() {
|
|
152
159
|
this.telemetry.push((args) => {
|
|
153
160
|
Object.assign(this.telemetryProperties, {
|
|
161
|
+
filePath: typeof args.options.filePath !== 'undefined',
|
|
162
|
+
csvContent: typeof args.options.csvContent !== 'undefined',
|
|
154
163
|
listId: typeof args.options.listId !== 'undefined',
|
|
155
164
|
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
156
165
|
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
@@ -158,9 +167,11 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
158
167
|
});
|
|
159
168
|
}, _SpoListItemBatchAddCommand_initOptions = function _SpoListItemBatchAddCommand_initOptions() {
|
|
160
169
|
this.options.unshift({
|
|
161
|
-
option: '-p, --filePath <filePath>'
|
|
162
|
-
}, {
|
|
163
170
|
option: '-u, --webUrl <webUrl>'
|
|
171
|
+
}, {
|
|
172
|
+
option: '-p, --filePath [filePath]'
|
|
173
|
+
}, {
|
|
174
|
+
option: '-c, --csvContent [csvContent]'
|
|
164
175
|
}, {
|
|
165
176
|
option: '-l, --listId [listId]'
|
|
166
177
|
}, {
|
|
@@ -178,7 +189,7 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
178
189
|
!validation.isValidGuid(args.options.listId)) {
|
|
179
190
|
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
180
191
|
}
|
|
181
|
-
if (!fs.existsSync(args.options.filePath)) {
|
|
192
|
+
if (args.options.filePath && !fs.existsSync(args.options.filePath)) {
|
|
182
193
|
return `File with path ${args.options.filePath} does not exist`;
|
|
183
194
|
}
|
|
184
195
|
return true;
|
|
@@ -186,7 +197,7 @@ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddComma
|
|
|
186
197
|
}, _SpoListItemBatchAddCommand_initTypes = function _SpoListItemBatchAddCommand_initTypes() {
|
|
187
198
|
this.types.string.push('webUrl', 'filePath', 'listId', 'listTitle', 'listUrl');
|
|
188
199
|
}, _SpoListItemBatchAddCommand_initOptionSets = function _SpoListItemBatchAddCommand_initOptionSets() {
|
|
189
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
200
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['filePath', 'csvContent'] });
|
|
190
201
|
};
|
|
191
202
|
export default new SpoListItemBatchAddCommand();
|
|
192
203
|
//# sourceMappingURL=listitem-batch-add.js.map
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoPageAddCommand_instances, _SpoPageAddCommand_initTelemetry, _SpoPageAddCommand_initOptions, _SpoPageAddCommand_initValidators;
|
|
7
|
-
import { Auth } from '../../../../Auth.js';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -31,11 +30,9 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
31
30
|
__classPrivateFieldGet(this, _SpoPageAddCommand_instances, "m", _SpoPageAddCommand_initValidators).call(this);
|
|
32
31
|
}
|
|
33
32
|
async commandAction(logger, args) {
|
|
34
|
-
const resource = Auth.getResourceFromUrl(args.options.webUrl);
|
|
35
33
|
let requestDigest = '';
|
|
36
34
|
let itemId = '';
|
|
37
35
|
let pageName = args.options.name;
|
|
38
|
-
const serverRelativeSiteUrl = urlUtil.getServerRelativeSiteUrl(args.options.webUrl);
|
|
39
36
|
const fileNameWithoutExtension = pageName.replace('.aspx', '');
|
|
40
37
|
let bannerImageUrl = '';
|
|
41
38
|
let canvasContent1 = '';
|
|
@@ -52,39 +49,22 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
52
49
|
const reqDigest = await spo.getRequestDigest(args.options.webUrl);
|
|
53
50
|
requestDigest = reqDigest.FormDigestValue;
|
|
54
51
|
let requestOptions = {
|
|
55
|
-
url: `${args.options.webUrl}/_api/
|
|
52
|
+
url: `${args.options.webUrl}/_api/sitepages/pages`,
|
|
53
|
+
responseType: 'json',
|
|
56
54
|
headers: {
|
|
57
|
-
'X-RequestDigest': requestDigest,
|
|
58
55
|
'content-type': 'application/json;odata=nometadata',
|
|
59
56
|
accept: 'application/json;odata=nometadata'
|
|
60
57
|
},
|
|
61
58
|
data: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
PageLayoutType: args.options.layoutType || 'Article',
|
|
60
|
+
Name: pageName,
|
|
61
|
+
PromotedState: args.options.promoteAs === 'NewsPage' ? 2 : 0,
|
|
62
|
+
Title: pageTitle
|
|
63
|
+
}
|
|
66
64
|
};
|
|
67
65
|
const template = await request.post(requestOptions);
|
|
68
66
|
itemId = template.UniqueId;
|
|
69
67
|
const listItemId = await this.getFileListItemId(args.options.webUrl, serverRelativeFileUrl);
|
|
70
|
-
const layoutType = args.options.layoutType || 'Article';
|
|
71
|
-
const listItemSetOptions = {
|
|
72
|
-
webUrl: args.options.webUrl,
|
|
73
|
-
listUrl: listServerRelativeUrl,
|
|
74
|
-
id: listItemId,
|
|
75
|
-
systemUpdate: true,
|
|
76
|
-
ContentTypeId: '0x0101009D1CB255DA76424F860D91F20E6C4118',
|
|
77
|
-
Title: pageTitle,
|
|
78
|
-
ClientSideApplicationId: 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec',
|
|
79
|
-
PageLayoutType: layoutType,
|
|
80
|
-
verbose: this.verbose,
|
|
81
|
-
debug: this.debug
|
|
82
|
-
};
|
|
83
|
-
if (args.options.layoutType === 'Article') {
|
|
84
|
-
listItemSetOptions.PromotedState = 0;
|
|
85
|
-
listItemSetOptions.BannerImageUrl = `${resource}/_layouts/15/images/sitepagethumbnail.png, /_layouts/15/images/sitepagethumbnail.png`;
|
|
86
|
-
}
|
|
87
|
-
await cli.executeCommand(spoListItemSetCommand, { options: { ...listItemSetOptions, _: [] } });
|
|
88
68
|
const pageProps = await Page.checkout(pageName, args.options.webUrl, logger, this.debug, this.verbose);
|
|
89
69
|
if (pageProps) {
|
|
90
70
|
pageId = pageProps.Id;
|
|
@@ -117,7 +97,6 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
117
97
|
listUrl: listServerRelativeUrl,
|
|
118
98
|
id: listItemId,
|
|
119
99
|
systemUpdate: true,
|
|
120
|
-
PromotedState: 2,
|
|
121
100
|
FirstPublishedDate: new Date().toISOString(),
|
|
122
101
|
verbose: this.verbose,
|
|
123
102
|
debug: this.debug
|
|
@@ -3,8 +3,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsUserAppAddCommand_instances, _TeamsUserAppAddCommand_initOptions, _TeamsUserAppAddCommand_initValidators;
|
|
6
|
+
var _TeamsUserAppAddCommand_instances, _TeamsUserAppAddCommand_initTelemetry, _TeamsUserAppAddCommand_initOptions, _TeamsUserAppAddCommand_initValidators, _TeamsUserAppAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
9
|
import { validation } from '../../../../utils/validation.js';
|
|
9
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
11
|
import commands from '../../commands.js';
|
|
@@ -18,13 +19,16 @@ class TeamsUserAppAddCommand extends GraphCommand {
|
|
|
18
19
|
constructor() {
|
|
19
20
|
super();
|
|
20
21
|
_TeamsUserAppAddCommand_instances.add(this);
|
|
22
|
+
__classPrivateFieldGet(this, _TeamsUserAppAddCommand_instances, "m", _TeamsUserAppAddCommand_initTelemetry).call(this);
|
|
21
23
|
__classPrivateFieldGet(this, _TeamsUserAppAddCommand_instances, "m", _TeamsUserAppAddCommand_initOptions).call(this);
|
|
22
24
|
__classPrivateFieldGet(this, _TeamsUserAppAddCommand_instances, "m", _TeamsUserAppAddCommand_initValidators).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _TeamsUserAppAddCommand_instances, "m", _TeamsUserAppAddCommand_initOptionSets).call(this);
|
|
23
26
|
}
|
|
24
27
|
async commandAction(logger, args) {
|
|
28
|
+
const userId = (args.options.userId ?? args.options.userName);
|
|
25
29
|
const endpoint = `${this.resource}/v1.0`;
|
|
26
30
|
const requestOptions = {
|
|
27
|
-
url: `${endpoint}/users/${
|
|
31
|
+
url: `${endpoint}/users/${formatting.encodeQueryParameter(userId)}/teamwork/installedApps`,
|
|
28
32
|
headers: {
|
|
29
33
|
'content-type': 'application/json;odata=nometadata',
|
|
30
34
|
'accept': 'application/json;odata.metadata=none'
|
|
@@ -42,22 +46,36 @@ class TeamsUserAppAddCommand extends GraphCommand {
|
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
|
-
_TeamsUserAppAddCommand_instances = new WeakSet(),
|
|
49
|
+
_TeamsUserAppAddCommand_instances = new WeakSet(), _TeamsUserAppAddCommand_initTelemetry = function _TeamsUserAppAddCommand_initTelemetry() {
|
|
50
|
+
this.telemetry.push((args) => {
|
|
51
|
+
Object.assign(this.telemetryProperties, {
|
|
52
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
53
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}, _TeamsUserAppAddCommand_initOptions = function _TeamsUserAppAddCommand_initOptions() {
|
|
46
57
|
this.options.unshift({
|
|
47
58
|
option: '--id <id>'
|
|
48
59
|
}, {
|
|
49
|
-
option: '--userId
|
|
60
|
+
option: '--userId [userId]'
|
|
61
|
+
}, {
|
|
62
|
+
option: '--userName [userName]'
|
|
50
63
|
});
|
|
51
64
|
}, _TeamsUserAppAddCommand_initValidators = function _TeamsUserAppAddCommand_initValidators() {
|
|
52
65
|
this.validators.push(async (args) => {
|
|
53
66
|
if (!validation.isValidGuid(args.options.id)) {
|
|
54
67
|
return `${args.options.id} is not a valid GUID`;
|
|
55
68
|
}
|
|
56
|
-
if (!validation.isValidGuid(args.options.userId)) {
|
|
69
|
+
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
57
70
|
return `${args.options.userId} is not a valid GUID`;
|
|
58
71
|
}
|
|
72
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
73
|
+
return `${args.options.userName} is not a valid userName`;
|
|
74
|
+
}
|
|
59
75
|
return true;
|
|
60
76
|
});
|
|
77
|
+
}, _TeamsUserAppAddCommand_initOptionSets = function _TeamsUserAppAddCommand_initOptionSets() {
|
|
78
|
+
this.optionSets.push({ options: ['userId', 'userName'] });
|
|
61
79
|
};
|
|
62
80
|
export default new TeamsUserAppAddCommand();
|
|
63
81
|
//# sourceMappingURL=user-app-add.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { odata } from
|
|
2
|
-
import { formatting } from
|
|
3
|
-
import { cli } from
|
|
4
|
-
const graphResource = 'https://graph.microsoft.com';
|
|
1
|
+
import { odata } from './odata.js';
|
|
2
|
+
import { formatting } from './formatting.js';
|
|
3
|
+
import { cli } from '../cli/cli.js';
|
|
5
4
|
export const aadAdministrativeUnit = {
|
|
6
5
|
/**
|
|
7
6
|
* Get an administrative unit by its display name.
|
|
@@ -10,6 +9,7 @@ export const aadAdministrativeUnit = {
|
|
|
10
9
|
* @throws Error when administrative unit was not found.
|
|
11
10
|
*/
|
|
12
11
|
async getAdministrativeUnitByDisplayName(displayName) {
|
|
12
|
+
const graphResource = 'https://graph.microsoft.com';
|
|
13
13
|
const administrativeUnits = await odata.getAllItems(`${graphResource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
14
14
|
if (administrativeUnits.length === 0) {
|
|
15
15
|
throw `The specified administrative unit '${displayName}' does not exist.`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { odata } from "./odata.js";
|
|
2
|
+
import { formatting } from "./formatting.js";
|
|
3
|
+
import { cli } from "../cli/cli.js";
|
|
4
|
+
const graphResource = 'https://graph.microsoft.com';
|
|
5
|
+
export const aadDevice = {
|
|
6
|
+
/**
|
|
7
|
+
* Get a device by its display name.
|
|
8
|
+
* @param displayName Device display name.
|
|
9
|
+
* @returns The device.
|
|
10
|
+
* @throws Error when device was not found.
|
|
11
|
+
*/
|
|
12
|
+
async getDeviceByDisplayName(displayName) {
|
|
13
|
+
const devices = await odata.getAllItems(`${graphResource}/v1.0/devices?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
14
|
+
if (devices.length === 0) {
|
|
15
|
+
throw `The specified device '${displayName}' does not exist.`;
|
|
16
|
+
}
|
|
17
|
+
if (devices.length > 1) {
|
|
18
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', devices);
|
|
19
|
+
const selectedDevice = await cli.handleMultipleResultsFound(`Multiple devices with name '${displayName}' found.`, resultAsKeyValuePair);
|
|
20
|
+
return selectedDevice;
|
|
21
|
+
}
|
|
22
|
+
return devices[0];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=aadDevice.js.map
|