@pnp/cli-microsoft365 6.5.0-beta.b69bf55 → 6.5.0-beta.ccd8e85

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.
Files changed (41) hide show
  1. package/.eslintrc.js +2 -0
  2. package/README.md +3 -3
  3. package/dist/Command.js +17 -7
  4. package/dist/cli/Cli.js +15 -11
  5. package/dist/m365/cli/commands/config/config-set.js +1 -0
  6. package/dist/m365/flow/commands/flow-export.js +6 -6
  7. package/dist/m365/pa/commands/app/app-export.js +197 -0
  8. package/dist/m365/pa/commands.js +1 -0
  9. package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +79 -0
  10. package/dist/m365/purview/commands.js +2 -1
  11. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.17.0-beta.3.js → upgrade-1.17.0.js} +26 -26
  12. package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
  13. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +27 -13
  14. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +72 -0
  15. package/dist/m365/spo/commands/commandset/commandset-add.js +2 -1
  16. package/dist/m365/spo/commands/commandset/commandset-remove.js +12 -9
  17. package/dist/m365/spo/commands/commandset/commandset-set.js +12 -9
  18. package/dist/m365/spo/commands/file/file-move.js +1 -1
  19. package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +22 -1
  20. package/dist/m365/spo/commands/listitem/listitem-get.js +21 -6
  21. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +35 -1
  22. package/dist/m365/spo/commands/web/web-set.js +33 -13
  23. package/dist/m365/spo/commands.js +1 -0
  24. package/dist/m365/teams/commands/team/team-list.js +4 -6
  25. package/dist/m365/todo/commands/task/task-set.js +25 -1
  26. package/dist/settingsNames.js +2 -1
  27. package/dist/utils/md.js +4 -3
  28. package/docs/docs/_clisettings.md +1 -0
  29. package/docs/docs/cmd/pa/app/app-export.md +52 -0
  30. package/docs/docs/cmd/purview/threatassessment/threatassessment-get.md +191 -0
  31. package/docs/docs/cmd/spfx/project/project-upgrade.md +2 -2
  32. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +4 -1
  33. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.md +109 -0
  34. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +12 -1
  35. package/docs/docs/cmd/spo/list/list-view-remove.md +1 -1
  36. package/docs/docs/cmd/spo/list/list-view-set.md +2 -2
  37. package/docs/docs/cmd/spo/listitem/listitem-get.md +14 -5
  38. package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.md +15 -2
  39. package/docs/docs/cmd/teams/team/team-list.md +44 -4
  40. package/docs/docs/cmd/todo/task/task-set.md +50 -0
  41. package/package.json +2 -1
package/.eslintrc.js CHANGED
@@ -10,6 +10,7 @@ const dictionary = [
10
10
  'application',
11
11
  'apply',
12
12
  'approve',
13
+ 'assessment',
13
14
  'assets',
14
15
  'audit',
15
16
  'bin',
@@ -84,6 +85,7 @@ const dictionary = [
84
85
  'storage',
85
86
  'table',
86
87
  'teams',
88
+ 'threat',
87
89
  'token',
88
90
  'type',
89
91
  'user',
package/README.md CHANGED
@@ -15,8 +15,8 @@
15
15
  alt="GitHub" />
16
16
  </a>
17
17
 
18
- <a href="https://discord.gg/35HTFJ544b">
19
- <img src="https://img.shields.io/badge/Discord-Join-7289da?style=flat-square"
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://discord.gg/35HTFJ544b">
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).map(k => {
498
- const value = l[k];
499
- let stringValue = value;
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 `${md_1.md.escapeMd(k)} | ${md_1.md.escapeMd(stringValue)}`;
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 (Cli.getInstance().spinner.isSpinning) {
761
- Cli.getInstance().spinner.stop();
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 (Cli.getInstance().spinner.isSpinning) {
773
- Cli.getInstance().spinner.stop();
775
+ if (cli.spinner.isSpinning) {
776
+ cli.spinner.stop();
774
777
  }
775
- const errorOutput = Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.errorOutput, 'stderr');
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 spinnerSpinning = Cli.getInstance().spinner.isSpinning;
789
+ const cli = Cli.getInstance();
790
+ const spinnerSpinning = cli.spinner.isSpinning;
787
791
  /* c8 ignore next 3 */
788
792
  if (spinnerSpinning) {
789
- Cli.getInstance().spinner.stop();
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
- Cli.getInstance().spinner.start();
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' || output === 'csv';
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,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 AzmgmtCommand_1 = require("../../base/AzmgmtCommand");
23
+ const PowerPlatformCommand_1 = require("../../base/PowerPlatformCommand");
24
24
  const commands_1 = require("../commands");
25
- class FlowExportCommand extends AzmgmtCommand_1.default {
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: `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/listPackageResources?api-version=2016-11-01`,
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
- `${this.resource}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
- : `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/exportPackage?api-version=2016-11-01`,
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
- `${this.resource}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`
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
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prefix = 'pa';
4
4
  exports.default = {
5
+ APP_EXPORT: `${prefix} app export`,
5
6
  APP_GET: `${prefix} app get`,
6
7
  APP_LIST: `${prefix} app list`,
7
8
  APP_REMOVE: `${prefix} app remove`,
@@ -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
@@ -32,36 +32,36 @@ const FN010010_YORC_sdkVersions_teams_js_1 = require("./rules/FN010010_YORC_sdkV
32
32
  const FN014008_CODE_launch_hostedWorkbench_type_1 = require("./rules/FN014008_CODE_launch_hostedWorkbench_type");
33
33
  const FN014009_CODE_launch_hostedWorkbench_url_1 = require("./rules/FN014009_CODE_launch_hostedWorkbench_url");
34
34
  module.exports = [
35
- new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.17.0-beta.3'),
36
- new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.17.0-beta.3'),
37
- new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.17.0-beta.3'),
38
- new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.17.0-beta.3'),
39
- new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.17.0-beta.3'),
40
- new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.17.0-beta.3'),
41
- new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.17.0-beta.3'),
42
- new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.17.0-beta.3'),
43
- new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.17.0-beta.3'),
44
- new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.17.0-beta.3'),
45
- new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.17.0-beta.3'),
46
- new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.17.0-beta.3'),
47
- new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.17.0-beta.3'),
48
- new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.17.0-beta.3'),
49
- new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.17.0-beta.3'),
50
- new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.17.0-beta.3'),
51
- new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.17.0-beta.3'),
52
- new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.17.0-beta.3'),
53
- new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.17.0-beta.3'),
54
- new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.17.0-beta.3'),
55
- new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.17.0-beta.3'),
56
- new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.17.0-beta.3'),
57
- new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.17.0-beta.3'),
58
- new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.17.0-beta.3'),
35
+ new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.17.0'),
36
+ new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.17.0'),
37
+ new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.17.0'),
38
+ new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.17.0'),
39
+ new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.17.0'),
40
+ new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.17.0'),
41
+ new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.17.0'),
42
+ new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.17.0'),
43
+ new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.17.0'),
44
+ new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.17.0'),
45
+ new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.17.0'),
46
+ new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.17.0'),
47
+ new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.17.0'),
48
+ new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.17.0'),
49
+ new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.17.0'),
50
+ new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.17.0'),
51
+ new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.17.0'),
52
+ new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.17.0'),
53
+ new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.17.0'),
54
+ new FN001034_DEP_microsoft_sp_adaptive_card_extension_base_1.FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.17.0'),
55
+ new FN002022_DEVDEP_microsoft_eslint_plugin_spfx_1.FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.17.0'),
56
+ new FN002023_DEVDEP_microsoft_eslint_config_spfx_1.FN002023_DEVDEP_microsoft_eslint_config_spfx('1.17.0'),
57
+ new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.17.0'),
58
+ new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.17.0'),
59
59
  new FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5_1.FN002020_DEVDEP_microsoft_rush_stack_compiler_4_5('0.4.0'),
60
60
  new FN002024_DEVDEP_eslint_1.FN002024_DEVDEP_eslint('8.7.0'),
61
61
  new FN007002_CFG_S_initialPage_1.FN007002_CFG_S_initialPage('https://{tenantDomain}/_layouts/workbench.aspx'),
62
- new FN010001_YORC_version_1.FN010001_YORC_version('1.17.0-beta.3'),
62
+ new FN010001_YORC_version_1.FN010001_YORC_version('1.17.0'),
63
63
  new FN010010_YORC_sdkVersions_teams_js_1.FN010010_YORC_sdkVersions_teams_js('2.9.1'),
64
64
  new FN014008_CODE_launch_hostedWorkbench_type_1.FN014008_CODE_launch_hostedWorkbench_type('edge'),
65
65
  new FN014009_CODE_launch_hostedWorkbench_url_1.FN014009_CODE_launch_hostedWorkbench_url('https://{tenantDomain}/_layouts/workbench.aspx')
66
66
  ];
67
- //# sourceMappingURL=upgrade-1.17.0-beta.3.js.map
67
+ //# sourceMappingURL=upgrade-1.17.0.js.map
@@ -18,8 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const fs = require("fs");
19
19
  const os = require("os");
20
20
  const path = require("path");
21
- // uncomment to support upgrading to preview releases
22
- const semver_1 = require("semver");
23
21
  const Command_1 = require("../../../../Command");
24
22
  const fsUtil_1 = require("../../../../utils/fsUtil");
25
23
  const packageManager_1 = require("../../../../utils/packageManager");
@@ -77,7 +75,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
77
75
  '1.15.2',
78
76
  '1.16.0',
79
77
  '1.16.1',
80
- '1.17.0-beta.3'
78
+ '1.17.0'
81
79
  ];
82
80
  __classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
83
81
  __classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
@@ -91,15 +89,15 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
91
89
  }
92
90
  this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
93
91
  // uncomment to support upgrading to preview releases
94
- if (!args.options.toVersion &&
95
- !args.options.preview &&
96
- (0, semver_1.prerelease)(this.toVersion)) {
97
- // no version and no preview specified while the current version to
98
- // upgrade to is a prerelease so let's grab the first non-preview version
99
- // since we're supporting only one preview version, it's sufficient for
100
- // us to take second to last version
101
- this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
102
- }
92
+ // if (!args.options.toVersion &&
93
+ // !args.options.preview &&
94
+ // prerelease(this.toVersion)) {
95
+ // // no version and no preview specified while the current version to
96
+ // // upgrade to is a prerelease so let's grab the first non-preview version
97
+ // // since we're supporting only one preview version, it's sufficient for
98
+ // // us to take second to last version
99
+ // this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
100
+ // }
103
101
  this.packageManager = args.options.packageManager || 'npm';
104
102
  this.shell = args.options.shell || 'bash';
105
103
  if (this.supportedVersions.indexOf(this.toVersion) < 0) {
@@ -486,9 +484,9 @@ _SpfxProjectUpgradeCommand_instances = new WeakSet(), _SpfxProjectUpgradeCommand
486
484
  preview: args.options.preview
487
485
  });
488
486
  // uncomment to support upgrading to preview releases
489
- if ((0, semver_1.prerelease)(this.telemetryProperties.toVersion) && !args.options.preview) {
490
- this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
491
- }
487
+ // if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
488
+ // this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
489
+ // }
492
490
  });
493
491
  }, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
494
492
  this.options.unshift({