@pnp/cli-microsoft365 6.3.0-beta.ad6d08e → 6.3.0-beta.cefe20e

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 (86) hide show
  1. package/dist/appInsights.js +2 -1
  2. package/dist/cli/Cli.js +32 -2
  3. package/dist/m365/aad/commands/license/license-list.js +41 -0
  4. package/dist/m365/aad/commands/user/user-add.js +223 -0
  5. package/dist/m365/aad/commands/user/user-license-add.js +88 -0
  6. package/dist/m365/aad/commands/user/user-license-list.js +99 -0
  7. package/dist/m365/aad/commands/user/user-license-remove.js +114 -0
  8. package/dist/m365/aad/commands/user/user-recyclebinitem-list.js +41 -0
  9. package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +77 -0
  10. package/dist/m365/aad/commands/user/user-remove.js +107 -0
  11. package/dist/m365/aad/commands.js +8 -0
  12. package/dist/m365/flow/commands/environment/FlowEnvironmentDetails.js +3 -0
  13. package/dist/m365/flow/commands/environment/environment-get.js +26 -11
  14. package/dist/m365/spo/commands/file/file-move.js +0 -2
  15. package/dist/m365/spo/commands/folder/folder-copy.js +0 -2
  16. package/dist/m365/spo/commands/folder/folder-move.js +0 -2
  17. package/dist/m365/spo/commands/site/site-add.js +0 -3
  18. package/dist/m365/spo/commands/site/site-remove.js +0 -3
  19. package/dist/m365/spo/commands/site/site-set.js +0 -2
  20. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +0 -1
  21. package/dist/m365/teams/commands/team/team-add.js +3 -8
  22. package/dist/utils/session.js +18 -0
  23. package/dist/utils/spo.js +3 -12
  24. package/docs/docs/cmd/aad/license/license-list.md +87 -0
  25. package/docs/docs/cmd/aad/user/user-add.md +168 -0
  26. package/docs/docs/cmd/aad/user/user-license-add.md +108 -0
  27. package/docs/docs/cmd/aad/user/user-license-list.md +98 -0
  28. package/docs/docs/cmd/aad/user/user-license-remove.md +43 -0
  29. package/docs/docs/cmd/aad/user/user-recyclebinitem-clear.md +1 -1
  30. package/docs/docs/cmd/aad/user/user-recyclebinitem-list.md +82 -0
  31. package/docs/docs/cmd/aad/user/user-recyclebinitem-remove.md +1 -1
  32. package/docs/docs/cmd/aad/user/user-recyclebinitem-restore.md +99 -0
  33. package/docs/docs/cmd/aad/user/user-remove.md +51 -0
  34. package/docs/docs/cmd/aad/user/user-set.md +1 -1
  35. package/docs/docs/cmd/flow/environment/environment-get.md +31 -3
  36. package/docs/docs/cmd/spo/homesite/homesite-get.md +20 -1
  37. package/docs/docs/cmd/spo/homesite/homesite-remove.md +8 -2
  38. package/docs/docs/cmd/spo/homesite/homesite-set.md +8 -2
  39. package/docs/docs/cmd/spo/hubsite/hubsite-connect.md +9 -9
  40. package/docs/docs/cmd/spo/hubsite/hubsite-data-get.md +34 -5
  41. package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +6 -6
  42. package/docs/docs/cmd/spo/hubsite/hubsite-get.md +36 -19
  43. package/docs/docs/cmd/spo/hubsite/hubsite-list.md +59 -1
  44. package/docs/docs/cmd/spo/hubsite/hubsite-register.md +30 -1
  45. package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.md +6 -6
  46. package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.md +4 -4
  47. package/docs/docs/cmd/spo/hubsite/hubsite-set.md +40 -15
  48. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +4 -4
  49. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +7 -1
  50. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +9 -3
  51. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +8 -2
  52. package/docs/docs/cmd/spo/list/list-add.md +123 -57
  53. package/docs/docs/cmd/spo/list/list-contenttype-add.md +49 -4
  54. package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +3 -3
  55. package/docs/docs/cmd/spo/list/list-contenttype-list.md +48 -3
  56. package/docs/docs/cmd/spo/list/list-contenttype-remove.md +5 -5
  57. package/docs/docs/cmd/spo/list/list-get.md +70 -4
  58. package/docs/docs/cmd/spo/list/list-list.md +70 -2
  59. package/docs/docs/cmd/spo/list/list-remove.md +6 -6
  60. package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +2 -2
  61. package/docs/docs/cmd/spo/list/list-retentionlabel-get.md +36 -3
  62. package/docs/docs/cmd/spo/list/list-retentionlabel-remove.md +3 -3
  63. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +6 -6
  64. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +3 -3
  65. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -9
  66. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +7 -7
  67. package/docs/docs/cmd/spo/list/list-set.md +61 -61
  68. package/docs/docs/cmd/spo/list/list-sitescript-get.md +35 -3
  69. package/docs/docs/cmd/spo/list/list-view-add.md +66 -5
  70. package/docs/docs/cmd/spo/list/list-view-field-add.md +10 -10
  71. package/docs/docs/cmd/spo/list/list-view-get.md +61 -0
  72. package/docs/docs/cmd/spo/list/list-view-list.md +61 -0
  73. package/docs/docs/cmd/spo/list/list-view-set.md +1 -1
  74. package/docs/docs/cmd/spo/list/list-webhook-add.md +19 -0
  75. package/docs/docs/cmd/spo/list/list-webhook-get.md +19 -0
  76. package/docs/docs/cmd/spo/list/list-webhook-list.md +19 -0
  77. package/docs/docs/cmd/spo/listitem/listitem-add.md +29 -0
  78. package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +17 -2
  79. package/docs/docs/cmd/spo/listitem/listitem-get.md +57 -0
  80. package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +6 -0
  81. package/docs/docs/cmd/spo/listitem/listitem-list.md +28 -0
  82. package/docs/docs/cmd/spo/listitem/listitem-record-declare.md +15 -0
  83. package/docs/docs/cmd/spo/listitem/listitem-set.md +30 -0
  84. package/docs/docs/cmd/spo/navigation/navigation-node-add.md +22 -0
  85. package/npm-shrinkwrap.json +1 -0
  86. package/package.json +2 -1
@@ -0,0 +1,114 @@
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 _AadUserLicenseRemoveCommand_instances, _AadUserLicenseRemoveCommand_initTelemetry, _AadUserLicenseRemoveCommand_initOptions, _AadUserLicenseRemoveCommand_initOptionSets, _AadUserLicenseRemoveCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const commands_1 = require("../../commands");
19
+ const request_1 = require("../../../../request");
20
+ const validation_1 = require("../../../../utils/validation");
21
+ const Cli_1 = require("../../../../cli/Cli");
22
+ const GraphCommand_1 = require("../../../base/GraphCommand");
23
+ class AadUserLicenseRemoveCommand extends GraphCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.USER_LICENSE_REMOVE;
26
+ }
27
+ get description() {
28
+ return 'Removes a license from a user';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _AadUserLicenseRemoveCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _AadUserLicenseRemoveCommand_instances, "m", _AadUserLicenseRemoveCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _AadUserLicenseRemoveCommand_instances, "m", _AadUserLicenseRemoveCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _AadUserLicenseRemoveCommand_instances, "m", _AadUserLicenseRemoveCommand_initValidators).call(this);
36
+ __classPrivateFieldGet(this, _AadUserLicenseRemoveCommand_instances, "m", _AadUserLicenseRemoveCommand_initOptionSets).call(this);
37
+ }
38
+ commandAction(logger, args) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (this.verbose) {
41
+ logger.logToStderr(`Removing the licenses for the user '${args.options.userId || args.options.userName}'...`);
42
+ }
43
+ if (args.options.confirm) {
44
+ yield this.deleteUserLicenses(args);
45
+ }
46
+ else {
47
+ const result = yield Cli_1.Cli.prompt({
48
+ type: 'confirm',
49
+ name: 'continue',
50
+ default: false,
51
+ message: `Are you sure you want to remove the licenses for the user '${args.options.userId || args.options.userName}'?`
52
+ });
53
+ if (result.continue) {
54
+ yield this.deleteUserLicenses(args);
55
+ }
56
+ }
57
+ });
58
+ }
59
+ deleteUserLicenses(args) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const removeLicenses = args.options.ids.split(',');
62
+ const requestBody = { "addLicenses": [], "removeLicenses": removeLicenses };
63
+ const requestOptions = {
64
+ url: `${this.resource}/v1.0/users/${args.options.userId || args.options.userName}/assignLicense`,
65
+ headers: {
66
+ accept: 'application/json;odata.metadata=none'
67
+ },
68
+ data: requestBody,
69
+ responseType: 'json'
70
+ };
71
+ try {
72
+ yield request_1.default.post(requestOptions);
73
+ }
74
+ catch (err) {
75
+ this.handleRejectedODataJsonPromise(err);
76
+ }
77
+ });
78
+ }
79
+ }
80
+ _AadUserLicenseRemoveCommand_instances = new WeakSet(), _AadUserLicenseRemoveCommand_initTelemetry = function _AadUserLicenseRemoveCommand_initTelemetry() {
81
+ this.telemetry.push((args) => {
82
+ Object.assign(this.telemetryProperties, {
83
+ userId: typeof args.options.userId !== 'undefined',
84
+ userName: typeof args.options.userName !== 'undefined'
85
+ });
86
+ });
87
+ }, _AadUserLicenseRemoveCommand_initOptions = function _AadUserLicenseRemoveCommand_initOptions() {
88
+ this.options.unshift({
89
+ option: '--userId [userId]'
90
+ }, {
91
+ option: '--userName [userName]'
92
+ }, {
93
+ option: '--ids <ids>'
94
+ }, {
95
+ option: '--confirm'
96
+ });
97
+ }, _AadUserLicenseRemoveCommand_initOptionSets = function _AadUserLicenseRemoveCommand_initOptionSets() {
98
+ this.optionSets.push({ options: ['userId', 'userName'] });
99
+ }, _AadUserLicenseRemoveCommand_initValidators = function _AadUserLicenseRemoveCommand_initValidators() {
100
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
101
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
102
+ return `${args.options.userId} is not a valid GUID`;
103
+ }
104
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
105
+ return `${args.options.userName} is not a valid user principal name (UPN)`;
106
+ }
107
+ if (args.options.ids && args.options.ids.split(',').some(e => !validation_1.validation.isValidGuid(e))) {
108
+ return `${args.options.ids} contains one or more invalid GUIDs`;
109
+ }
110
+ return true;
111
+ }));
112
+ };
113
+ module.exports = new AadUserLicenseRemoveCommand();
114
+ //# sourceMappingURL=user-license-remove.js.map
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const odata_1 = require("../../../../utils/odata");
13
+ const GraphCommand_1 = require("../../../base/GraphCommand");
14
+ const commands_1 = require("../../commands");
15
+ class AadUserRecycleBinItemListCommand extends GraphCommand_1.default {
16
+ get name() {
17
+ return commands_1.default.USER_RECYCLEBINITEM_LIST;
18
+ }
19
+ get description() {
20
+ return 'Lists users from the recycle bin in the current tenant';
21
+ }
22
+ defaultProperties() {
23
+ return ['id', 'displayName', 'userPrincipalName'];
24
+ }
25
+ commandAction(logger) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ if (this.verbose) {
28
+ logger.logToStderr('Retrieving users from the recycle bin...');
29
+ }
30
+ try {
31
+ const users = yield odata_1.odata.getAllItems(`${this.resource}/v1.0/directory/deletedItems/microsoft.graph.user`);
32
+ logger.log(users);
33
+ }
34
+ catch (err) {
35
+ this.handleRejectedODataJsonPromise(err);
36
+ }
37
+ });
38
+ }
39
+ }
40
+ module.exports = new AadUserRecycleBinItemListCommand();
41
+ //# sourceMappingURL=user-recyclebinitem-list.js.map
@@ -0,0 +1,77 @@
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 _AadUserRecycleBinItemRestoreCommand_instances, _AadUserRecycleBinItemRestoreCommand_initTelemetry, _AadUserRecycleBinItemRestoreCommand_initOptions, _AadUserRecycleBinItemRestoreCommand_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 AadUserRecycleBinItemRestoreCommand extends GraphCommand_1.default {
23
+ get name() {
24
+ return commands_1.default.USER_RECYCLEBINITEM_RESTORE;
25
+ }
26
+ get description() {
27
+ return 'Restores a user from the tenant recycle bin';
28
+ }
29
+ constructor() {
30
+ super();
31
+ _AadUserRecycleBinItemRestoreCommand_instances.add(this);
32
+ __classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initTelemetry).call(this);
33
+ __classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initOptions).call(this);
34
+ __classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initValidators).call(this);
35
+ }
36
+ commandAction(logger, args) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (this.verbose) {
39
+ logger.logToStderr(`Restoring user with id ${args.options.id} from the recycle bin.`);
40
+ }
41
+ try {
42
+ const requestOptions = {
43
+ url: `${this.resource}/v1.0/directory/deletedItems/${args.options.id}/restore`,
44
+ headers: {
45
+ 'content-type': 'application/json;odata.metadata=none'
46
+ },
47
+ responseType: 'json'
48
+ };
49
+ const user = yield request_1.default.post(requestOptions);
50
+ logger.log(user);
51
+ }
52
+ catch (err) {
53
+ this.handleRejectedODataJsonPromise(err);
54
+ }
55
+ });
56
+ }
57
+ }
58
+ _AadUserRecycleBinItemRestoreCommand_instances = new WeakSet(), _AadUserRecycleBinItemRestoreCommand_initTelemetry = function _AadUserRecycleBinItemRestoreCommand_initTelemetry() {
59
+ this.telemetry.push((args) => {
60
+ Object.assign(this.telemetryProperties, {
61
+ confirm: !!args.options.confirm
62
+ });
63
+ });
64
+ }, _AadUserRecycleBinItemRestoreCommand_initOptions = function _AadUserRecycleBinItemRestoreCommand_initOptions() {
65
+ this.options.unshift({
66
+ option: '--id <id>'
67
+ });
68
+ }, _AadUserRecycleBinItemRestoreCommand_initValidators = function _AadUserRecycleBinItemRestoreCommand_initValidators() {
69
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
70
+ if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
71
+ return `${args.options.id} is not a valid GUID`;
72
+ }
73
+ return true;
74
+ }));
75
+ };
76
+ module.exports = new AadUserRecycleBinItemRestoreCommand();
77
+ //# sourceMappingURL=user-recyclebinitem-restore.js.map
@@ -0,0 +1,107 @@
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 _AadUserRemoveCommand_instances, _AadUserRemoveCommand_initTelemetry, _AadUserRemoveCommand_initOptions, _AadUserRemoveCommand_initOptionSets, _AadUserRemoveCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const commands_1 = require("../../commands");
19
+ const request_1 = require("../../../../request");
20
+ const validation_1 = require("../../../../utils/validation");
21
+ const Cli_1 = require("../../../../cli/Cli");
22
+ const GraphCommand_1 = require("../../../base/GraphCommand");
23
+ class AadUserRemoveCommand extends GraphCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.USER_REMOVE;
26
+ }
27
+ get description() {
28
+ return 'Removes a specific user';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _AadUserRemoveCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _AadUserRemoveCommand_instances, "m", _AadUserRemoveCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _AadUserRemoveCommand_instances, "m", _AadUserRemoveCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _AadUserRemoveCommand_instances, "m", _AadUserRemoveCommand_initValidators).call(this);
36
+ __classPrivateFieldGet(this, _AadUserRemoveCommand_instances, "m", _AadUserRemoveCommand_initOptionSets).call(this);
37
+ }
38
+ commandAction(logger, args) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (this.verbose) {
41
+ logger.logToStderr(`Removing user '${args.options.id || args.options.userName}'...`);
42
+ }
43
+ if (args.options.confirm) {
44
+ yield this.deleteUser(args);
45
+ }
46
+ else {
47
+ const result = yield Cli_1.Cli.prompt({
48
+ type: 'confirm',
49
+ name: 'continue',
50
+ default: false,
51
+ message: `Are you sure you want to remove user '${args.options.id || args.options.userName}'?`
52
+ });
53
+ if (result.continue) {
54
+ yield this.deleteUser(args);
55
+ }
56
+ }
57
+ });
58
+ }
59
+ deleteUser(args) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ try {
62
+ const requestOptions = {
63
+ url: `${this.resource}/v1.0/users/${args.options.id || args.options.userName}`,
64
+ headers: {
65
+ accept: 'application/json;odata.metadata=none'
66
+ },
67
+ responseType: 'json'
68
+ };
69
+ yield request_1.default.delete(requestOptions);
70
+ }
71
+ catch (err) {
72
+ this.handleRejectedODataJsonPromise(err);
73
+ }
74
+ });
75
+ }
76
+ }
77
+ _AadUserRemoveCommand_instances = new WeakSet(), _AadUserRemoveCommand_initTelemetry = function _AadUserRemoveCommand_initTelemetry() {
78
+ this.telemetry.push((args) => {
79
+ Object.assign(this.telemetryProperties, {
80
+ id: typeof args.options.id !== 'undefined',
81
+ userName: typeof args.options.userName !== 'undefined',
82
+ confirm: !!args.options.confirm
83
+ });
84
+ });
85
+ }, _AadUserRemoveCommand_initOptions = function _AadUserRemoveCommand_initOptions() {
86
+ this.options.unshift({
87
+ option: '--id [id]'
88
+ }, {
89
+ option: '--userName [userName]'
90
+ }, {
91
+ option: '--confirm'
92
+ });
93
+ }, _AadUserRemoveCommand_initOptionSets = function _AadUserRemoveCommand_initOptionSets() {
94
+ this.optionSets.push({ options: ['id', 'userName'] });
95
+ }, _AadUserRemoveCommand_initValidators = function _AadUserRemoveCommand_initValidators() {
96
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
97
+ if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
98
+ return `${args.options.id} is not a valid GUID`;
99
+ }
100
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
101
+ return `${args.options.userName} is not a valid user principal name (UPN)`;
102
+ }
103
+ return true;
104
+ }));
105
+ };
106
+ module.exports = new AadUserRemoveCommand();
107
+ //# sourceMappingURL=user-remove.js.map
@@ -22,6 +22,7 @@ exports.default = {
22
22
  GROUPSETTING_SET: `${prefix} groupsetting set`,
23
23
  GROUPSETTINGTEMPLATE_GET: `${prefix} groupsettingtemplate get`,
24
24
  GROUPSETTINGTEMPLATE_LIST: `${prefix} groupsettingtemplate list`,
25
+ LICENSE_LIST: `${prefix} license list`,
25
26
  O365GROUP_ADD: `${prefix} o365group add`,
26
27
  O365GROUP_GET: `${prefix} o365group get`,
27
28
  O365GROUP_LIST: `${prefix} o365group list`,
@@ -55,13 +56,20 @@ exports.default = {
55
56
  SITECLASSIFICATION_SET: `${prefix} siteclassification set`,
56
57
  SP_ADD: `${prefix} sp add`,
57
58
  SP_GET: `${prefix} sp get`,
59
+ USER_ADD: `${prefix} user add`,
58
60
  USER_GET: `${prefix} user get`,
59
61
  USER_GUEST_ADD: `${prefix} user guest add`,
60
62
  USER_HIBP: `${prefix} user hibp`,
63
+ USER_LICENSE_ADD: `${prefix} user license add`,
64
+ USER_LICENSE_LIST: `${prefix} user license list`,
65
+ USER_LICENSE_REMOVE: `${prefix} user license remove`,
61
66
  USER_LIST: `${prefix} user list`,
62
67
  USER_PASSWORD_VALIDATE: `${prefix} user password validate`,
63
68
  USER_RECYCLEBINITEM_CLEAR: `${prefix} user recyclebinitem clear`,
69
+ USER_RECYCLEBINITEM_LIST: `${prefix} user recyclebinitem list`,
64
70
  USER_RECYCLEBINITEM_REMOVE: `${prefix} user recyclebinitem remove`,
71
+ USER_REMOVE: `${prefix} user remove`,
72
+ USER_RECYCLEBINITEM_RESTORE: `${prefix} user recyclebinitem restore`,
65
73
  USER_SET: `${prefix} user set`,
66
74
  USER_SIGNIN_LIST: `${prefix} user signin list`
67
75
  };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FlowEnvironmentDetails.js.map
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
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
14
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
15
  };
16
- var _FlowEnvironmentGetCommand_instances, _FlowEnvironmentGetCommand_initOptions;
16
+ var _FlowEnvironmentGetCommand_instances, _FlowEnvironmentGetCommand_initOptions, _FlowEnvironmentGetCommand_initTelemetry;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
19
  const formatting_1 = require("../../../../utils/formatting");
@@ -33,27 +33,36 @@ class FlowEnvironmentGetCommand extends AzmgmtCommand_1.default {
33
33
  super();
34
34
  _FlowEnvironmentGetCommand_instances.add(this);
35
35
  __classPrivateFieldGet(this, _FlowEnvironmentGetCommand_instances, "m", _FlowEnvironmentGetCommand_initOptions).call(this);
36
+ __classPrivateFieldGet(this, _FlowEnvironmentGetCommand_instances, "m", _FlowEnvironmentGetCommand_initTelemetry).call(this);
36
37
  }
37
38
  commandAction(logger, args) {
39
+ var _a;
38
40
  return __awaiter(this, void 0, void 0, function* () {
39
41
  if (this.verbose) {
40
- logger.logToStderr(`Retrieving information about Microsoft Flow environment ${args.options.name}...`);
42
+ logger.logToStderr(`Retrieving information about Microsoft Flow environment ${(_a = args.options.name) !== null && _a !== void 0 ? _a : ''}...`);
43
+ }
44
+ let requestUrl = `${this.resource}providers/Microsoft.ProcessSimple/environments/`;
45
+ if (args.options.name) {
46
+ requestUrl += `${formatting_1.formatting.encodeQueryParameter(args.options.name)}`;
47
+ }
48
+ else {
49
+ requestUrl += `~default`;
41
50
  }
42
51
  const requestOptions = {
43
- url: `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting_1.formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`,
52
+ url: `${requestUrl}?api-version=2016-11-01`,
44
53
  headers: {
45
54
  accept: 'application/json'
46
55
  },
47
56
  responseType: 'json'
48
57
  };
49
58
  try {
50
- const res = yield request_1.default.get(requestOptions);
51
- res.displayName = res.properties.displayName;
52
- res.provisioningState = res.properties.provisioningState;
53
- res.environmentSku = res.properties.environmentSku;
54
- res.azureRegionHint = res.properties.azureRegionHint;
55
- res.isDefault = res.properties.isDefault;
56
- logger.log(res);
59
+ const flowItem = yield request_1.default.get(requestOptions);
60
+ flowItem.displayName = flowItem.properties.displayName;
61
+ flowItem.provisioningState = flowItem.properties.provisioningState;
62
+ flowItem.environmentSku = flowItem.properties.environmentSku;
63
+ flowItem.azureRegionHint = flowItem.properties.azureRegionHint;
64
+ flowItem.isDefault = flowItem.properties.isDefault;
65
+ logger.log(flowItem);
57
66
  }
58
67
  catch (err) {
59
68
  this.handleRejectedODataJsonPromise(err);
@@ -63,7 +72,13 @@ class FlowEnvironmentGetCommand extends AzmgmtCommand_1.default {
63
72
  }
64
73
  _FlowEnvironmentGetCommand_instances = new WeakSet(), _FlowEnvironmentGetCommand_initOptions = function _FlowEnvironmentGetCommand_initOptions() {
65
74
  this.options.unshift({
66
- option: '-n, --name <name>'
75
+ option: '-n, --name [name]'
76
+ });
77
+ }, _FlowEnvironmentGetCommand_initTelemetry = function _FlowEnvironmentGetCommand_initTelemetry() {
78
+ this.telemetry.push((args) => {
79
+ Object.assign(this.telemetryProperties, {
80
+ name: typeof args.options.name !== 'undefined'
81
+ });
67
82
  });
68
83
  };
69
84
  module.exports = new FlowEnvironmentGetCommand();
@@ -82,7 +82,6 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
82
82
  responseType: 'json'
83
83
  };
84
84
  const jobInfo = yield request_1.default.post(requestOptions);
85
- this.dots = '';
86
85
  const copyJobInfo = jobInfo.value[0];
87
86
  const progressPollInterval = 1800; // 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
88
87
  yield new Promise((resolve, reject) => {
@@ -94,7 +93,6 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
94
93
  resolve,
95
94
  reject,
96
95
  logger,
97
- dots: this.dots,
98
96
  debug: this.debug,
99
97
  verbose: this.verbose
100
98
  });
@@ -64,7 +64,6 @@ class SpoFolderCopyCommand extends SpoCommand_1.default {
64
64
  };
65
65
  try {
66
66
  const jobInfo = yield request_1.default.post(requestOptions);
67
- this.dots = '';
68
67
  const copyJobInfo = jobInfo.value[0];
69
68
  const progressPollInterval = 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
70
69
  yield new Promise((resolve, reject) => {
@@ -76,7 +75,6 @@ class SpoFolderCopyCommand extends SpoCommand_1.default {
76
75
  resolve,
77
76
  reject,
78
77
  logger,
79
- dots: this.dots,
80
78
  debug: this.debug,
81
79
  verbose: this.verbose
82
80
  });
@@ -65,7 +65,6 @@ class SpoFolderMoveCommand extends SpoCommand_1.default {
65
65
  };
66
66
  try {
67
67
  const jobInfo = yield request_1.default.post(requestOptions);
68
- this.dots = '';
69
68
  const copyJobInfo = jobInfo.value[0];
70
69
  const progressPollInterval = 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
71
70
  yield new Promise((resolve, reject) => {
@@ -77,7 +76,6 @@ class SpoFolderMoveCommand extends SpoCommand_1.default {
77
76
  resolve,
78
77
  reject,
79
78
  logger,
80
- dots: this.dots,
81
79
  debug: this.debug,
82
80
  verbose: this.verbose
83
81
  });
@@ -166,7 +166,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
166
166
  }
167
167
  createClassicSite(logger, args) {
168
168
  return __awaiter(this, void 0, void 0, function* () {
169
- this.dots = '';
170
169
  try {
171
170
  this.spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
172
171
  this.context = yield spo_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
@@ -228,7 +227,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
228
227
  reject,
229
228
  logger,
230
229
  currentContext: this.context,
231
- dots: this.dots,
232
230
  verbose: this.verbose,
233
231
  debug: this.debug
234
232
  });
@@ -362,7 +360,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
362
360
  reject,
363
361
  logger,
364
362
  currentContext: this.context,
365
- dots: this.dots,
366
363
  verbose: this.verbose,
367
364
  debug: this.debug
368
365
  });
@@ -43,7 +43,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
44
  const removeSite = () => __awaiter(this, void 0, void 0, function* () {
45
45
  try {
46
- this.dots = '';
47
46
  if (args.options.fromRecycleBin) {
48
47
  yield this.deleteSiteWithoutGroup(logger, args);
49
48
  }
@@ -203,7 +202,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
203
202
  reject,
204
203
  logger,
205
204
  currentContext: this.context,
206
- dots: this.dots,
207
205
  debug: this.debug,
208
206
  verbose: this.verbose
209
207
  });
@@ -248,7 +246,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
248
246
  reject,
249
247
  logger,
250
248
  currentContext: this.context,
251
- dots: this.dots,
252
249
  debug: this.debug,
253
250
  verbose: this.verbose
254
251
  });
@@ -46,7 +46,6 @@ class SpoSiteSetCommand extends SpoCommand_1.default {
46
46
  commandAction(logger, args) {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
48
  try {
49
- this.dots = '';
50
49
  this.tenantId = yield spo_1.spo.getTenantId(logger, this.debug);
51
50
  this.spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
52
51
  this.context = yield spo_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
@@ -128,7 +127,6 @@ class SpoSiteSetCommand extends SpoCommand_1.default {
128
127
  reject,
129
128
  logger,
130
129
  currentContext: this.context,
131
- dots: this.dots,
132
130
  debug: this.debug,
133
131
  verbose: this.verbose
134
132
  });
@@ -74,7 +74,6 @@ class SpoTenantRecycleBinItemRemoveCommand extends SpoCommand_1.default {
74
74
  reject,
75
75
  logger,
76
76
  currentContext: this.context,
77
- dots: this.dots,
78
77
  debug: this.debug,
79
78
  verbose: this.verbose
80
79
  });
@@ -44,7 +44,6 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
44
44
  }
45
45
  commandAction(logger, args) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
- this.dots = '';
48
47
  let requestBody;
49
48
  if (args.options.template) {
50
49
  if (this.verbose) {
@@ -95,7 +94,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
95
94
  }
96
95
  else {
97
96
  setTimeout(() => {
98
- this.waitUntilFinished(requestOptions, resolve, reject, logger, this.dots);
97
+ this.waitUntilFinished(requestOptions, resolve, reject, logger);
99
98
  }, this.pollingInterval);
100
99
  }
101
100
  }));
@@ -113,11 +112,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
113
112
  }
114
113
  });
115
114
  }
116
- waitUntilFinished(requestOptions, resolve, reject, logger, dots) {
117
- if (!this.debug && this.verbose) {
118
- dots += '.';
119
- process.stdout.write(`\r${dots}`);
120
- }
115
+ waitUntilFinished(requestOptions, resolve, reject, logger) {
121
116
  request_1.default
122
117
  .get(requestOptions)
123
118
  .then((teamsAsyncOperation) => {
@@ -133,7 +128,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
133
128
  return;
134
129
  }
135
130
  setTimeout(() => {
136
- this.waitUntilFinished(requestOptions, resolve, reject, logger, dots);
131
+ this.waitUntilFinished(requestOptions, resolve, reject, logger);
137
132
  }, this.pollingInterval);
138
133
  }).catch(err => reject(err));
139
134
  }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.session = void 0;
4
+ const crypto = require("crypto");
5
+ const cache_1 = require("./cache");
6
+ exports.session = {
7
+ getId(pid) {
8
+ const key = `${pid.toString()}_session`;
9
+ let sessionId = cache_1.cache.getValue(key);
10
+ if (sessionId) {
11
+ return sessionId;
12
+ }
13
+ sessionId = crypto.randomBytes(24).toString('base64');
14
+ cache_1.cache.setValue(key, sessionId);
15
+ return sessionId;
16
+ }
17
+ };
18
+ //# sourceMappingURL=session.js.map