@pnp/cli-microsoft365 6.4.0 → 6.5.0-beta.699c15b
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/.eslintrc.js +2 -0
- package/README.md +3 -3
- package/dist/Command.js +17 -7
- package/dist/cli/Cli.js +15 -11
- package/dist/m365/cli/commands/config/config-set.js +1 -0
- package/dist/m365/commands/request.js +18 -1
- package/dist/m365/flow/commands/flow-export.js +6 -6
- package/dist/m365/pa/commands/app/app-export.js +197 -0
- package/dist/m365/pa/commands.js +1 -0
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +79 -0
- package/dist/m365/purview/commands.js +2 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.0.js +23 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.17.0-beta.3.js → upgrade-1.17.0.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +27 -13
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +72 -0
- package/dist/m365/spo/commands/commandset/commandset-add.js +2 -1
- package/dist/m365/spo/commands/commandset/commandset-remove.js +12 -9
- package/dist/m365/spo/commands/commandset/commandset-set.js +12 -9
- package/dist/m365/spo/commands/file/file-move.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +22 -1
- package/dist/m365/spo/commands/listitem/listitem-get.js +21 -6
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +35 -1
- package/dist/m365/spo/commands/web/web-set.js +33 -13
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/team/team-list.js +4 -6
- package/dist/m365/todo/commands/task/task-set.js +25 -1
- package/dist/settingsNames.js +2 -1
- package/dist/utils/md.js +4 -3
- package/docs/docs/_clisettings.md +1 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.md +3 -3
- package/docs/docs/cmd/pa/app/app-export.md +52 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.md +191 -0
- package/docs/docs/cmd/request.md +10 -4
- package/docs/docs/cmd/spfx/project/project-upgrade.md +2 -2
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +4 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.md +109 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +12 -1
- package/docs/docs/cmd/spo/list/list-view-remove.md +1 -1
- package/docs/docs/cmd/spo/list/list-view-set.md +2 -2
- package/docs/docs/cmd/spo/listitem/listitem-get.md +14 -5
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.md +15 -2
- package/docs/docs/cmd/teams/team/team-list.md +44 -4
- package/docs/docs/cmd/todo/task/task-set.md +50 -0
- package/npm-shrinkwrap.json +460 -273
- package/package.json +13 -12
package/.eslintrc.js
CHANGED
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
alt="GitHub" />
|
|
16
16
|
</a>
|
|
17
17
|
|
|
18
|
-
<a href="https://
|
|
19
|
-
<img src="https://img.shields.io/badge/Discord-
|
|
18
|
+
<a href="https://aka.ms/cli-m365/discord">
|
|
19
|
+
<img src="https://img.shields.io/badge/Discord-aka.ms/cli--m365/discord-7289da?style=flat-square"
|
|
20
20
|
alt="Discord" />
|
|
21
21
|
</a>
|
|
22
22
|
|
|
@@ -219,7 +219,7 @@ Checkout our [Wiki](https://github.com/pnp/cli-microsoft365/wiki) for guides on
|
|
|
219
219
|
Join our community
|
|
220
220
|
</h4>
|
|
221
221
|
<p align="center">
|
|
222
|
-
<a href="https://
|
|
222
|
+
<a href="https://aka.ms/cli-m365/discord">
|
|
223
223
|
<img alt="Discord" src="./docs/docs/images/discord-logo.png" width="100"/>
|
|
224
224
|
</a>
|
|
225
225
|
</p>
|
package/dist/Command.js
CHANGED
|
@@ -458,9 +458,18 @@ class Command {
|
|
|
458
458
|
// replace unescaped newlines with escaped newlines #2807
|
|
459
459
|
.replace(/([^\\])\\n/g, '$1\\\\\\n');
|
|
460
460
|
}
|
|
461
|
-
getCsvOutput(logStatement) {
|
|
461
|
+
getCsvOutput(logStatement, options) {
|
|
462
462
|
const { stringify } = require('csv-stringify/sync');
|
|
463
463
|
const cli = Cli_1.Cli.getInstance();
|
|
464
|
+
if (logStatement && logStatement.length > 0 && !options.query) {
|
|
465
|
+
logStatement.map(l => {
|
|
466
|
+
for (const x of Object.keys(l)) {
|
|
467
|
+
if (typeof l[x] === 'object') {
|
|
468
|
+
delete l[x];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
464
473
|
// https://csv.js.org/stringify/options/
|
|
465
474
|
return stringify(logStatement, {
|
|
466
475
|
header: cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.csvHeader, true),
|
|
@@ -494,13 +503,14 @@ class Command {
|
|
|
494
503
|
output.push(`## ${id}`, os.EOL, os.EOL);
|
|
495
504
|
}
|
|
496
505
|
output.push(`Property | Value`, os.EOL, `---------|-------`, os.EOL);
|
|
497
|
-
output.push(Object.keys(l).
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
if (typeof value === 'object') {
|
|
501
|
-
stringValue = JSON.stringify(value);
|
|
506
|
+
output.push(Object.keys(l).filter(x => {
|
|
507
|
+
if (!options.query && typeof l[x] === 'object') {
|
|
508
|
+
return;
|
|
502
509
|
}
|
|
503
|
-
return
|
|
510
|
+
return x;
|
|
511
|
+
}).map(k => {
|
|
512
|
+
const value = l[k];
|
|
513
|
+
return `${md_1.md.escapeMd(k)} | ${md_1.md.escapeMd(value)}`;
|
|
504
514
|
}).join(os.EOL), os.EOL);
|
|
505
515
|
output.push(os.EOL);
|
|
506
516
|
});
|
package/dist/cli/Cli.js
CHANGED
|
@@ -158,9 +158,10 @@ class Cli {
|
|
|
158
158
|
const cli = Cli.getInstance();
|
|
159
159
|
const parentCommandName = cli.currentCommandName;
|
|
160
160
|
cli.currentCommandName = command.getCommandName(cli.currentCommandName);
|
|
161
|
+
const showSpinner = cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.showSpinner, true);
|
|
161
162
|
// don't show spinner if running tests
|
|
162
163
|
/* c8 ignore next 3 */
|
|
163
|
-
if (typeof global.it === 'undefined') {
|
|
164
|
+
if (showSpinner && typeof global.it === 'undefined') {
|
|
164
165
|
cli.spinner.start();
|
|
165
166
|
}
|
|
166
167
|
try {
|
|
@@ -529,7 +530,7 @@ class Cli {
|
|
|
529
530
|
}
|
|
530
531
|
switch (options.output) {
|
|
531
532
|
case 'csv':
|
|
532
|
-
return command.getCsvOutput(logStatement);
|
|
533
|
+
return command.getCsvOutput(logStatement, options);
|
|
533
534
|
case 'md':
|
|
534
535
|
return command.getMdOutput(logStatement, command, options);
|
|
535
536
|
default:
|
|
@@ -756,9 +757,10 @@ class Cli {
|
|
|
756
757
|
/* c8 ignore next */
|
|
757
758
|
}
|
|
758
759
|
static log(message, ...optionalParams) {
|
|
760
|
+
const cli = Cli.getInstance();
|
|
759
761
|
/* c8 ignore next 3 */
|
|
760
|
-
if (
|
|
761
|
-
|
|
762
|
+
if (cli.spinner.isSpinning) {
|
|
763
|
+
cli.spinner.stop();
|
|
762
764
|
}
|
|
763
765
|
if (message) {
|
|
764
766
|
console.log(message, ...optionalParams);
|
|
@@ -768,11 +770,12 @@ class Cli {
|
|
|
768
770
|
}
|
|
769
771
|
}
|
|
770
772
|
static error(message, ...optionalParams) {
|
|
773
|
+
const cli = Cli.getInstance();
|
|
771
774
|
/* c8 ignore next 3 */
|
|
772
|
-
if (
|
|
773
|
-
|
|
775
|
+
if (cli.spinner.isSpinning) {
|
|
776
|
+
cli.spinner.stop();
|
|
774
777
|
}
|
|
775
|
-
const errorOutput =
|
|
778
|
+
const errorOutput = cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.errorOutput, 'stderr');
|
|
776
779
|
if (errorOutput === 'stdout') {
|
|
777
780
|
console.log(message, ...optionalParams);
|
|
778
781
|
}
|
|
@@ -783,16 +786,17 @@ class Cli {
|
|
|
783
786
|
static prompt(options) {
|
|
784
787
|
return __awaiter(this, void 0, void 0, function* () {
|
|
785
788
|
const inquirer = require('inquirer');
|
|
786
|
-
const
|
|
789
|
+
const cli = Cli.getInstance();
|
|
790
|
+
const spinnerSpinning = cli.spinner.isSpinning;
|
|
787
791
|
/* c8 ignore next 3 */
|
|
788
792
|
if (spinnerSpinning) {
|
|
789
|
-
|
|
793
|
+
cli.spinner.stop();
|
|
790
794
|
}
|
|
791
795
|
const response = yield inquirer.prompt(options);
|
|
792
796
|
// Restart the spinner if it was running before the prompt
|
|
793
797
|
/* c8 ignore next 3 */
|
|
794
798
|
if (spinnerSpinning) {
|
|
795
|
-
|
|
799
|
+
cli.spinner.start();
|
|
796
800
|
}
|
|
797
801
|
return response;
|
|
798
802
|
});
|
|
@@ -822,7 +826,7 @@ class Cli {
|
|
|
822
826
|
});
|
|
823
827
|
}
|
|
824
828
|
static shouldTrimOutput(output) {
|
|
825
|
-
return output === 'text'
|
|
829
|
+
return output === 'text';
|
|
826
830
|
}
|
|
827
831
|
}
|
|
828
832
|
exports.Cli = Cli;
|
|
@@ -46,6 +46,7 @@ class CliConfigSetCommand extends AnonymousCommand_1.default {
|
|
|
46
46
|
case settingsNames_1.settingsNames.printErrorsAsPlainText:
|
|
47
47
|
case settingsNames_1.settingsNames.prompt:
|
|
48
48
|
case settingsNames_1.settingsNames.showHelpOnFailure:
|
|
49
|
+
case settingsNames_1.settingsNames.showSpinner:
|
|
49
50
|
value = args.options.value === 'true';
|
|
50
51
|
break;
|
|
51
52
|
default:
|
|
@@ -20,6 +20,7 @@ const Command_1 = require("../../Command");
|
|
|
20
20
|
const request_1 = require("../../request");
|
|
21
21
|
const commands_1 = require("./commands");
|
|
22
22
|
const path = require("path");
|
|
23
|
+
const Auth_1 = require("../../Auth");
|
|
23
24
|
class RequestCommand extends Command_1.default {
|
|
24
25
|
get name() {
|
|
25
26
|
return commands_1.default.REQUEST;
|
|
@@ -44,6 +45,7 @@ class RequestCommand extends Command_1.default {
|
|
|
44
45
|
logger.logToStderr(`Preparing request...`);
|
|
45
46
|
}
|
|
46
47
|
try {
|
|
48
|
+
const url = this.resolveUrlTokens(args.options.url);
|
|
47
49
|
const method = (args.options.method || 'get').toUpperCase();
|
|
48
50
|
const headers = {};
|
|
49
51
|
const unknownOptions = this.getUnknownOptions(args.options);
|
|
@@ -58,7 +60,7 @@ class RequestCommand extends Command_1.default {
|
|
|
58
60
|
headers['x-resource'] = args.options.resource;
|
|
59
61
|
}
|
|
60
62
|
const config = {
|
|
61
|
-
url:
|
|
63
|
+
url: url,
|
|
62
64
|
headers,
|
|
63
65
|
method,
|
|
64
66
|
data: args.options.body
|
|
@@ -98,6 +100,21 @@ class RequestCommand extends Command_1.default {
|
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
102
|
}
|
|
103
|
+
resolveUrlTokens(url) {
|
|
104
|
+
if (url.startsWith('@graphbeta')) {
|
|
105
|
+
return url.replace('@graphbeta', 'https://graph.microsoft.com/beta');
|
|
106
|
+
}
|
|
107
|
+
if (url.startsWith('@graph')) {
|
|
108
|
+
return url.replace('@graph', 'https://graph.microsoft.com/v1.0');
|
|
109
|
+
}
|
|
110
|
+
if (url.startsWith('@spo')) {
|
|
111
|
+
if (Auth_1.default.service.spoUrl) {
|
|
112
|
+
return url.replace('@spo', Auth_1.default.service.spoUrl);
|
|
113
|
+
}
|
|
114
|
+
throw `SharePoint root site URL is unknown. Please set your SharePoint URL using command 'spo set'.`;
|
|
115
|
+
}
|
|
116
|
+
return url;
|
|
117
|
+
}
|
|
101
118
|
}
|
|
102
119
|
_RequestCommand_instances = new WeakSet(), _RequestCommand_initTelemetry = function _RequestCommand_initTelemetry() {
|
|
103
120
|
this.telemetry.push((args) => {
|
|
@@ -20,9 +20,9 @@ const path = require("path");
|
|
|
20
20
|
const request_1 = require("../../../request");
|
|
21
21
|
const formatting_1 = require("../../../utils/formatting");
|
|
22
22
|
const validation_1 = require("../../../utils/validation");
|
|
23
|
-
const
|
|
23
|
+
const PowerPlatformCommand_1 = require("../../base/PowerPlatformCommand");
|
|
24
24
|
const commands_1 = require("../commands");
|
|
25
|
-
class FlowExportCommand extends
|
|
25
|
+
class FlowExportCommand extends PowerPlatformCommand_1.default {
|
|
26
26
|
get name() {
|
|
27
27
|
return commands_1.default.EXPORT;
|
|
28
28
|
}
|
|
@@ -52,7 +52,7 @@ class FlowExportCommand extends AzmgmtCommand_1.default {
|
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
const requestOptions = {
|
|
55
|
-
url:
|
|
55
|
+
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/listPackageResources?api-version=2016-11-01`,
|
|
56
56
|
headers: {
|
|
57
57
|
accept: 'application/json'
|
|
58
58
|
},
|
|
@@ -73,8 +73,8 @@ class FlowExportCommand extends AzmgmtCommand_1.default {
|
|
|
73
73
|
}
|
|
74
74
|
let requestOptions = {
|
|
75
75
|
url: formatArgument === 'json' ?
|
|
76
|
-
|
|
77
|
-
:
|
|
76
|
+
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.id)}?api-version=2016-11-01`
|
|
77
|
+
: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/exportPackage?api-version=2016-11-01`,
|
|
78
78
|
headers: {
|
|
79
79
|
accept: 'application/json'
|
|
80
80
|
},
|
|
@@ -117,7 +117,7 @@ class FlowExportCommand extends AzmgmtCommand_1.default {
|
|
|
117
117
|
}
|
|
118
118
|
requestOptions = {
|
|
119
119
|
url: formatArgument === 'json' ?
|
|
120
|
-
|
|
120
|
+
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.id)}/exportToARMTemplate?api-version=2016-11-01`
|
|
121
121
|
: downloadFileUrl,
|
|
122
122
|
// Set responseType to arraybuffer, otherwise binary data will be encoded
|
|
123
123
|
// to utf8 and binary data is corrupt
|
|
@@ -0,0 +1,197 @@
|
|
|
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 _PaAppExportCommand_instances, _PaAppExportCommand_initTelemetry, _PaAppExportCommand_initOptions, _PaAppExportCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const validation_1 = require("../../../../utils/validation");
|
|
19
|
+
const commands_1 = require("../../commands");
|
|
20
|
+
const fs = require("fs");
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
23
|
+
const request_1 = require("../../../../request");
|
|
24
|
+
const PowerPlatformCommand_1 = require("../../../base/PowerPlatformCommand");
|
|
25
|
+
class PaAppExportCommand extends PowerPlatformCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.APP_EXPORT;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Exports the specified Power App';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_PaAppExportCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PaAppExportCommand_instances, "m", _PaAppExportCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PaAppExportCommand_instances, "m", _PaAppExportCommand_initOptions).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PaAppExportCommand_instances, "m", _PaAppExportCommand_initValidators).call(this);
|
|
38
|
+
}
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
const location = yield this.exportPackage(args, logger);
|
|
43
|
+
const packageLink = yield this.getPackageLink(args, logger, location);
|
|
44
|
+
//Replace all illegal characters from the file name
|
|
45
|
+
const illegalCharsRegEx = /[\\\/:*?"<>|]/g;
|
|
46
|
+
const filename = args.options.packageDisplayName.replace(illegalCharsRegEx, '_');
|
|
47
|
+
const requestOptions = {
|
|
48
|
+
url: packageLink,
|
|
49
|
+
// Set responseType to arraybuffer, otherwise binary data will be encoded
|
|
50
|
+
// to utf8 and binary data is corrupt
|
|
51
|
+
responseType: 'arraybuffer',
|
|
52
|
+
headers: {
|
|
53
|
+
'x-anonymous': true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const file = yield request_1.default.get(requestOptions);
|
|
57
|
+
let path = args.options.path || './';
|
|
58
|
+
if (!path.endsWith('/')) {
|
|
59
|
+
path += '/';
|
|
60
|
+
}
|
|
61
|
+
path += `${filename}.zip`;
|
|
62
|
+
fs.writeFileSync(path, file, 'binary');
|
|
63
|
+
if (this.verbose) {
|
|
64
|
+
logger.logToStderr(`File saved to path '${path}'`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
this.handleRejectedODataJsonPromise(err);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
getPackageResources(args, logger) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
if (this.verbose) {
|
|
75
|
+
logger.logToStderr('Getting the Microsoft Power App resources...');
|
|
76
|
+
}
|
|
77
|
+
const requestOptions = {
|
|
78
|
+
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environment)}/listPackageResources?api-version=2016-11-01`,
|
|
79
|
+
headers: {
|
|
80
|
+
accept: 'application/json'
|
|
81
|
+
},
|
|
82
|
+
data: {
|
|
83
|
+
baseResourceIds: [
|
|
84
|
+
`/providers/Microsoft.PowerApps/apps/${args.options.id}`
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
responseType: 'json'
|
|
88
|
+
};
|
|
89
|
+
const response = yield request_1.default.post(requestOptions);
|
|
90
|
+
Object.keys(response.resources).forEach((key) => {
|
|
91
|
+
response.resources[key].suggestedCreationType = 'Update';
|
|
92
|
+
});
|
|
93
|
+
return response.resources;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
exportPackage(args, logger) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (this.verbose) {
|
|
99
|
+
logger.logToStderr(`Initiating package export for Microsoft Power App ${args.options.id}...`);
|
|
100
|
+
}
|
|
101
|
+
const resources = yield this.getPackageResources(args, logger);
|
|
102
|
+
const requestOptions = {
|
|
103
|
+
url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environment)}/exportPackage?api-version=2016-11-01`,
|
|
104
|
+
headers: {
|
|
105
|
+
accept: 'application/json'
|
|
106
|
+
},
|
|
107
|
+
responseType: 'json',
|
|
108
|
+
data: {
|
|
109
|
+
includedResourceIds: [
|
|
110
|
+
`/providers/Microsoft.PowerApps/apps/${args.options.id}`
|
|
111
|
+
],
|
|
112
|
+
details: {
|
|
113
|
+
creator: args.options.packageCreatedBy,
|
|
114
|
+
description: args.options.packageDescription,
|
|
115
|
+
displayName: args.options.packageDisplayName,
|
|
116
|
+
sourceEnvironment: args.options.packageSourceEnvironment
|
|
117
|
+
},
|
|
118
|
+
resources: resources
|
|
119
|
+
},
|
|
120
|
+
fullResponse: true
|
|
121
|
+
};
|
|
122
|
+
const response = yield request_1.default.post(requestOptions);
|
|
123
|
+
return response.headers.location;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
getPackageLink(args, logger, location) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
if (this.verbose) {
|
|
129
|
+
logger.logToStderr('Retrieving the package link and waiting on the exported package.');
|
|
130
|
+
}
|
|
131
|
+
let status;
|
|
132
|
+
let link;
|
|
133
|
+
const requestOptions = {
|
|
134
|
+
url: location,
|
|
135
|
+
headers: {
|
|
136
|
+
accept: 'application/json'
|
|
137
|
+
},
|
|
138
|
+
responseType: 'json'
|
|
139
|
+
};
|
|
140
|
+
do {
|
|
141
|
+
const response = yield request_1.default.get(requestOptions);
|
|
142
|
+
status = response.properties.status;
|
|
143
|
+
if (status === "Succeeded") {
|
|
144
|
+
link = response.properties.packageLink.value;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
yield this.sleep(5000);
|
|
148
|
+
}
|
|
149
|
+
if (this.verbose) {
|
|
150
|
+
logger.logToStderr(`Current status of the get package link: ${status}`);
|
|
151
|
+
}
|
|
152
|
+
} while (status === 'Running');
|
|
153
|
+
return link;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
sleep(ms) {
|
|
157
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
_PaAppExportCommand_instances = new WeakSet(), _PaAppExportCommand_initTelemetry = function _PaAppExportCommand_initTelemetry() {
|
|
161
|
+
this.telemetry.push((args) => {
|
|
162
|
+
Object.assign(this.telemetryProperties, {
|
|
163
|
+
packageDescription: typeof args.options.packageDescription !== 'undefined',
|
|
164
|
+
packageCreatedBy: typeof args.options.packageCreatedBy !== 'undefined',
|
|
165
|
+
packageSourceEnvironment: typeof args.options.packageSourceEnvironment !== 'undefined',
|
|
166
|
+
path: typeof args.options.path !== 'undefined'
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}, _PaAppExportCommand_initOptions = function _PaAppExportCommand_initOptions() {
|
|
170
|
+
this.options.unshift({
|
|
171
|
+
option: '-i, --id <id>'
|
|
172
|
+
}, {
|
|
173
|
+
option: '-e, --environment <environment>'
|
|
174
|
+
}, {
|
|
175
|
+
option: '-n, --packageDisplayName [packageDisplayName]'
|
|
176
|
+
}, {
|
|
177
|
+
option: '-d, --packageDescription [packageDescription]'
|
|
178
|
+
}, {
|
|
179
|
+
option: '-c, --packageCreatedBy [packageCreatedBy]'
|
|
180
|
+
}, {
|
|
181
|
+
option: '-s, --packageSourceEnvironment [packageSourceEnvironment]'
|
|
182
|
+
}, {
|
|
183
|
+
option: '-p, --path [path]'
|
|
184
|
+
});
|
|
185
|
+
}, _PaAppExportCommand_initValidators = function _PaAppExportCommand_initValidators() {
|
|
186
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
188
|
+
return `${args.options.id} is not a valid GUID`;
|
|
189
|
+
}
|
|
190
|
+
if (args.options.path && !fs.existsSync(path.dirname(args.options.path))) {
|
|
191
|
+
return 'Specified path where to save the file does not exist';
|
|
192
|
+
}
|
|
193
|
+
return true;
|
|
194
|
+
}));
|
|
195
|
+
};
|
|
196
|
+
module.exports = new PaAppExportCommand();
|
|
197
|
+
//# sourceMappingURL=app-export.js.map
|
package/dist/m365/pa/commands.js
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
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 _PurviewThreatAssessmentGetCommand_instances, _PurviewThreatAssessmentGetCommand_initTelemetry, _PurviewThreatAssessmentGetCommand_initOptions, _PurviewThreatAssessmentGetCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
class PurviewThreatAssessmentGetCommand extends GraphCommand_1.default {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands_1.default.THREATASSESSMENT_GET;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return 'Get a threat assessment';
|
|
28
|
+
}
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
_PurviewThreatAssessmentGetCommand_instances.add(this);
|
|
32
|
+
__classPrivateFieldGet(this, _PurviewThreatAssessmentGetCommand_instances, "m", _PurviewThreatAssessmentGetCommand_initTelemetry).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PurviewThreatAssessmentGetCommand_instances, "m", _PurviewThreatAssessmentGetCommand_initOptions).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewThreatAssessmentGetCommand_instances, "m", _PurviewThreatAssessmentGetCommand_initValidators).call(this);
|
|
35
|
+
}
|
|
36
|
+
commandAction(logger, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
logger.logToStderr(`Retrieving threat assessment with id ${args.options.id}`);
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${this.resource}/v1.0/informationProtection/threatAssessmentRequests/${args.options.id}${args.options.includeResults ? '?$expand=results' : ''}`,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none'
|
|
46
|
+
},
|
|
47
|
+
responseType: 'json'
|
|
48
|
+
};
|
|
49
|
+
const res = yield request_1.default.get(requestOptions);
|
|
50
|
+
logger.log(res);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
_PurviewThreatAssessmentGetCommand_instances = new WeakSet(), _PurviewThreatAssessmentGetCommand_initTelemetry = function _PurviewThreatAssessmentGetCommand_initTelemetry() {
|
|
59
|
+
this.telemetry.push((args) => {
|
|
60
|
+
Object.assign(this.telemetryProperties, {
|
|
61
|
+
includeResults: !!args.options.includeResults
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}, _PurviewThreatAssessmentGetCommand_initOptions = function _PurviewThreatAssessmentGetCommand_initOptions() {
|
|
65
|
+
this.options.unshift({
|
|
66
|
+
option: '-i, --id <id>'
|
|
67
|
+
}, {
|
|
68
|
+
option: '--includeResults'
|
|
69
|
+
});
|
|
70
|
+
}, _PurviewThreatAssessmentGetCommand_initValidators = function _PurviewThreatAssessmentGetCommand_initValidators() {
|
|
71
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
73
|
+
return `${args.options.id} is not a valid GUID.`;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
module.exports = new PurviewThreatAssessmentGetCommand();
|
|
79
|
+
//# sourceMappingURL=threatassessment-get.js.map
|
|
@@ -16,6 +16,7 @@ exports.default = {
|
|
|
16
16
|
RETENTIONLABEL_GET: `${prefix} retentionlabel get`,
|
|
17
17
|
RETENTIONLABEL_LIST: `${prefix} retentionlabel list`,
|
|
18
18
|
RETENTIONLABEL_REMOVE: `${prefix} retentionlabel remove`,
|
|
19
|
-
RETENTIONLABEL_SET: `${prefix} retentionlabel set
|
|
19
|
+
RETENTIONLABEL_SET: `${prefix} retentionlabel set`,
|
|
20
|
+
THREATASSESSMENT_GET: `${prefix} threatassessment get`
|
|
20
21
|
};
|
|
21
22
|
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FN001008_DEP_react_1 = require("./rules/FN001008_DEP_react");
|
|
4
|
+
const FN001009_DEP_react_dom_1 = require("./rules/FN001009_DEP_react_dom");
|
|
5
|
+
const FN001022_DEP_office_ui_fabric_react_1 = require("./rules/FN001022_DEP_office_ui_fabric_react");
|
|
6
|
+
const FN002004_DEVDEP_gulp_1 = require("./rules/FN002004_DEVDEP_gulp");
|
|
7
|
+
const FN002007_DEVDEP_ajv_1 = require("./rules/FN002007_DEVDEP_ajv");
|
|
8
|
+
const FN002013_DEVDEP_types_webpack_env_1 = require("./rules/FN002013_DEVDEP_types_webpack_env");
|
|
9
|
+
const FN002015_DEVDEP_types_react_1 = require("./rules/FN002015_DEVDEP_types_react");
|
|
10
|
+
const FN002016_DEVDEP_types_react_dom_1 = require("./rules/FN002016_DEVDEP_types_react_dom");
|
|
11
|
+
const FN002019_DEVDEP_microsoft_rush_stack_compiler_1 = require("./rules/FN002019_DEVDEP_microsoft_rush_stack_compiler");
|
|
12
|
+
module.exports = [
|
|
13
|
+
new FN001008_DEP_react_1.FN001008_DEP_react('17'),
|
|
14
|
+
new FN001009_DEP_react_dom_1.FN001009_DEP_react_dom('17'),
|
|
15
|
+
new FN001022_DEP_office_ui_fabric_react_1.FN001022_DEP_office_ui_fabric_react('^7.199.1'),
|
|
16
|
+
new FN002004_DEVDEP_gulp_1.FN002004_DEVDEP_gulp('4.0.2'),
|
|
17
|
+
new FN002007_DEVDEP_ajv_1.FN002007_DEVDEP_ajv('^6.12.5'),
|
|
18
|
+
new FN002013_DEVDEP_types_webpack_env_1.FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
19
|
+
new FN002015_DEVDEP_types_react_1.FN002015_DEVDEP_types_react('17'),
|
|
20
|
+
new FN002016_DEVDEP_types_react_dom_1.FN002016_DEVDEP_types_react_dom('17'),
|
|
21
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler_1.FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.5'])
|
|
22
|
+
];
|
|
23
|
+
//# sourceMappingURL=doctor-1.17.0.js.map
|
|
@@ -72,7 +72,8 @@ class SpfxProjectDoctorCommand extends base_project_command_1.BaseProjectCommand
|
|
|
72
72
|
'1.15.0',
|
|
73
73
|
'1.15.2',
|
|
74
74
|
'1.16.0',
|
|
75
|
-
'1.16.1'
|
|
75
|
+
'1.16.1',
|
|
76
|
+
'1.17.0'
|
|
76
77
|
];
|
|
77
78
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
78
79
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|