@pnp/cli-microsoft365 5.9.0-beta.5aade58 → 5.9.0-beta.60e454b

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 (99) hide show
  1. package/.eslintrc.js +17 -2
  2. package/README.md +5 -0
  3. package/dist/appInsights.js +2 -0
  4. package/dist/m365/outlook/commands/mail/mail-send.js +1 -1
  5. package/dist/m365/planner/commands/bucket/bucket-get.js +1 -1
  6. package/dist/m365/pp/commands/Environment.js +3 -0
  7. package/dist/m365/pp/commands/card/card-list.js +68 -0
  8. package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +69 -0
  9. package/dist/m365/pp/commands/environment/environment-get.js +75 -0
  10. package/dist/m365/pp/commands/solution/Solution.js +3 -0
  11. package/dist/m365/pp/commands/solution/solution-list.js +87 -0
  12. package/dist/m365/pp/commands/tenant/tenant-settings-list.js +45 -0
  13. package/dist/m365/pp/commands.js +6 -1
  14. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0.js +0 -2
  15. package/dist/m365/spfx/commands/spfx-doctor.js +52 -7
  16. package/dist/m365/spo/commands/eventreceiver/EventReceiver.js +3 -0
  17. package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +182 -0
  18. package/dist/m365/spo/commands/file/file-copy.js +25 -39
  19. package/dist/m365/spo/commands/file/file-move.js +24 -37
  20. package/dist/m365/spo/commands/file/file-rename.js +19 -16
  21. package/dist/m365/spo/commands/file/file-roleassignment-add.js +231 -0
  22. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +180 -0
  23. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +129 -0
  24. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
  25. package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +168 -0
  26. package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +94 -0
  27. package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +89 -0
  28. package/dist/m365/spo/commands/group/AssociatedGroupPropertiesCollection.js +3 -0
  29. package/dist/m365/spo/commands/group/group-list.js +49 -10
  30. package/dist/m365/spo/commands/list/list-contenttype-add.js +21 -18
  31. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +59 -47
  32. package/dist/m365/spo/commands/list/list-contenttype-list.js +16 -8
  33. package/dist/m365/spo/commands/list/list-contenttype-remove.js +16 -8
  34. package/dist/m365/spo/commands/list/list-roleassignment-add.js +10 -10
  35. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +8 -8
  36. package/dist/m365/spo/commands/list/list-webhook-add.js +19 -11
  37. package/dist/m365/spo/commands/list/list-webhook-get.js +17 -9
  38. package/dist/m365/spo/commands/list/list-webhook-list.js +23 -24
  39. package/dist/m365/spo/commands/list/list-webhook-remove.js +19 -11
  40. package/dist/m365/spo/commands/list/list-webhook-set.js +18 -10
  41. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +8 -8
  42. package/dist/m365/spo/commands/web/web-roleassignment-add.js +10 -10
  43. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +8 -8
  44. package/dist/m365/spo/commands.js +8 -0
  45. package/dist/m365/teams/commands/channel/channel-add.js +9 -9
  46. package/dist/m365/todo/commands/task/task-set.js +53 -1
  47. package/dist/utils/cache.js +81 -0
  48. package/dist/utils/pid.js +57 -0
  49. package/dist/utils/powerPlatform.js +42 -0
  50. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -1
  51. package/docs/docs/cmd/aad/user/user-signin-list.md +1 -1
  52. package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +1 -1
  53. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +1 -1
  54. package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
  55. package/docs/docs/cmd/pp/card/card-list.md +33 -0
  56. package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +33 -0
  57. package/docs/docs/cmd/pp/environment/environment-get.md +38 -0
  58. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  59. package/docs/docs/cmd/pp/solution/solution-list.md +33 -0
  60. package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +26 -0
  61. package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
  62. package/docs/docs/cmd/spfx/spfx-doctor.md +10 -1
  63. package/docs/docs/cmd/spo/eventreceiver/eventreceiver-get.md +2 -2
  64. package/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.md +69 -0
  65. package/docs/docs/cmd/spo/file/file-roleassignment-add.md +57 -0
  66. package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +54 -0
  67. package/docs/docs/cmd/spo/file/file-roleinheritance-break.md +54 -0
  68. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +39 -0
  69. package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.md +57 -0
  70. package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.md +39 -0
  71. package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +36 -0
  72. package/docs/docs/cmd/spo/group/group-list.md +10 -1
  73. package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +1 -1
  74. package/docs/docs/cmd/spo/hubsite/hubsite-get.md +3 -3
  75. package/docs/docs/cmd/spo/list/list-contenttype-add.md +16 -7
  76. package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +16 -7
  77. package/docs/docs/cmd/spo/list/list-contenttype-list.md +15 -6
  78. package/docs/docs/cmd/spo/list/list-contenttype-remove.md +17 -8
  79. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +1 -1
  80. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +1 -1
  81. package/docs/docs/cmd/spo/list/list-webhook-add.md +15 -16
  82. package/docs/docs/cmd/spo/list/list-webhook-get.md +15 -6
  83. package/docs/docs/cmd/spo/list/list-webhook-list.md +16 -7
  84. package/docs/docs/cmd/spo/list/list-webhook-remove.md +12 -10
  85. package/docs/docs/cmd/spo/list/list-webhook-set.md +13 -11
  86. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +1 -1
  87. package/docs/docs/cmd/spo/roledefinition/roledefinition-add.md +1 -1
  88. package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +1 -1
  89. package/docs/docs/cmd/teams/cache/cache-remove.md +1 -1
  90. package/docs/docs/cmd/teams/channel/channel-add.md +5 -5
  91. package/docs/docs/cmd/teams/channel/channel-member-set.md +1 -1
  92. package/docs/docs/cmd/teams/funsettings/funsettings-set.md +6 -6
  93. package/docs/docs/cmd/tenant/security/security-alerts-list.md +1 -1
  94. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
  95. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +1 -1
  96. package/docs/docs/cmd/todo/task/task-set.md +29 -2
  97. package/npm-shrinkwrap.json +342 -357
  98. package/package.json +25 -18
  99. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +0 -60
@@ -43,17 +43,17 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand_1.default {
43
43
  logger.logToStderr(`Adding role assignment to web ${args.options.webUrl}...`);
44
44
  }
45
45
  try {
46
- args.options.roleDefinitionId = yield this.GetRoleDefinitionId(args.options);
46
+ args.options.roleDefinitionId = yield this.getRoleDefinitionId(args.options);
47
47
  if (args.options.upn) {
48
- args.options.principalId = yield this.GetUserPrincipalId(args.options);
49
- yield this.AddRoleAssignment(logger, args.options);
48
+ args.options.principalId = yield this.getUserPrincipalId(args.options);
49
+ yield this.addRoleAssignment(logger, args.options);
50
50
  }
51
51
  else if (args.options.groupName) {
52
- args.options.principalId = yield this.GetGroupPrincipalId(args.options);
53
- yield this.AddRoleAssignment(logger, args.options);
52
+ args.options.principalId = yield this.getGroupPrincipalId(args.options);
53
+ yield this.addRoleAssignment(logger, args.options);
54
54
  }
55
55
  else {
56
- yield this.AddRoleAssignment(logger, args.options);
56
+ yield this.addRoleAssignment(logger, args.options);
57
57
  }
58
58
  }
59
59
  catch (err) {
@@ -61,7 +61,7 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand_1.default {
61
61
  }
62
62
  });
63
63
  }
64
- AddRoleAssignment(logger, options) {
64
+ addRoleAssignment(logger, options) {
65
65
  const requestOptions = {
66
66
  url: `${options.webUrl}/_api/web/roleassignments/addroleassignment(principalid='${options.principalId}',roledefid='${options.roleDefinitionId}')`,
67
67
  method: 'POST',
@@ -76,7 +76,7 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand_1.default {
76
76
  .then(_ => Promise.resolve())
77
77
  .catch((err) => Promise.reject(err));
78
78
  }
79
- GetRoleDefinitionId(options) {
79
+ getRoleDefinitionId(options) {
80
80
  if (!options.roleDefinitionName) {
81
81
  return Promise.resolve(options.roleDefinitionId);
82
82
  }
@@ -95,7 +95,7 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand_1.default {
95
95
  return Promise.reject(err);
96
96
  });
97
97
  }
98
- GetGroupPrincipalId(options) {
98
+ getGroupPrincipalId(options) {
99
99
  const groupGetCommandOptions = {
100
100
  webUrl: options.webUrl,
101
101
  name: options.groupName,
@@ -111,7 +111,7 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand_1.default {
111
111
  return Promise.reject(err);
112
112
  });
113
113
  }
114
- GetUserPrincipalId(options) {
114
+ getUserPrincipalId(options) {
115
115
  const userGetCommandOptions = {
116
116
  webUrl: options.webUrl,
117
117
  email: options.upn,
@@ -44,15 +44,15 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand_1.default {
44
44
  }
45
45
  try {
46
46
  if (args.options.upn) {
47
- args.options.principalId = yield this.GetUserPrincipalId(args.options);
48
- yield this.RemoveRoleAssignment(logger, args.options);
47
+ args.options.principalId = yield this.getUserPrincipalId(args.options);
48
+ yield this.removeRoleAssignment(logger, args.options);
49
49
  }
50
50
  else if (args.options.groupName) {
51
- args.options.principalId = yield this.GetGroupPrincipalId(args.options);
52
- yield this.RemoveRoleAssignment(logger, args.options);
51
+ args.options.principalId = yield this.getGroupPrincipalId(args.options);
52
+ yield this.removeRoleAssignment(logger, args.options);
53
53
  }
54
54
  else {
55
- yield this.RemoveRoleAssignment(logger, args.options);
55
+ yield this.removeRoleAssignment(logger, args.options);
56
56
  }
57
57
  }
58
58
  catch (err) {
@@ -75,7 +75,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand_1.default {
75
75
  }
76
76
  });
77
77
  }
78
- RemoveRoleAssignment(logger, options) {
78
+ removeRoleAssignment(logger, options) {
79
79
  const requestOptions = {
80
80
  url: `${options.webUrl}/_api/web/roleassignments/removeroleassignment(principalid='${options.principalId}')`,
81
81
  method: 'POST',
@@ -90,7 +90,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand_1.default {
90
90
  .then(_ => Promise.resolve())
91
91
  .catch((err) => Promise.reject(err));
92
92
  }
93
- GetGroupPrincipalId(options) {
93
+ getGroupPrincipalId(options) {
94
94
  const groupGetCommandOptions = {
95
95
  webUrl: options.webUrl,
96
96
  name: options.groupName,
@@ -106,7 +106,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand_1.default {
106
106
  return Promise.reject(err);
107
107
  });
108
108
  }
109
- GetUserPrincipalId(options) {
109
+ getUserPrincipalId(options) {
110
110
  const userGetCommandOptions = {
111
111
  webUrl: options.webUrl,
112
112
  email: options.upn,
@@ -38,6 +38,7 @@ exports.default = {
38
38
  CUSTOMACTION_REMOVE: `${prefix} customaction remove`,
39
39
  EVENTRECEIVER_GET: `${prefix} eventreceiver get`,
40
40
  EVENTRECEIVER_LIST: `${prefix} eventreceiver list`,
41
+ EVENTRECEIVER_REMOVE: `${prefix} eventreceiver remove`,
41
42
  EXTERNALUSER_LIST: `${prefix} externaluser list`,
42
43
  FEATURE_DISABLE: `${prefix} feature disable`,
43
44
  FEATURE_ENABLE: `${prefix} feature enable`,
@@ -56,6 +57,10 @@ exports.default = {
56
57
  FILE_MOVE: `${prefix} file move`,
57
58
  FILE_REMOVE: `${prefix} file remove`,
58
59
  FILE_RENAME: `${prefix} file rename`,
60
+ FILE_ROLEASSIGNMENT_ADD: `${prefix} file roleassignment add`,
61
+ FILE_ROLEASSIGNMENT_REMOVE: `${prefix} file roleassignment remove`,
62
+ FILE_ROLEINHERITANCE_BREAK: `${prefix} file roleinheritance break`,
63
+ FILE_ROLEINHERITANCE_RESET: `${prefix} file roleinheritance reset`,
59
64
  FILE_SHARINGINFO_GET: `${prefix} file sharinginfo get`,
60
65
  FOLDER_ADD: `${prefix} folder add`,
61
66
  FOLDER_COPY: `${prefix} folder copy`,
@@ -64,6 +69,9 @@ exports.default = {
64
69
  FOLDER_MOVE: `${prefix} folder move`,
65
70
  FOLDER_REMOVE: `${prefix} folder remove`,
66
71
  FOLDER_RENAME: `${prefix} folder rename`,
72
+ FOLDER_ROLEASSIGNMENT_REMOVE: `${prefix} folder roleassignment remove`,
73
+ FOLDER_ROLEINHERITANCE_BREAK: `${prefix} folder roleinheritance break`,
74
+ FOLDER_ROLEINHERITANCE_RESET: `${prefix} folder roleinheritance reset`,
67
75
  GET: `${prefix} get`,
68
76
  GROUP_ADD: `${prefix} group add`,
69
77
  GROUP_GET: `${prefix} group get`,
@@ -73,8 +73,8 @@ class TeamsChannelAddCommand extends GraphCommand_1.default {
73
73
  },
74
74
  responseType: 'json'
75
75
  };
76
- if (args.options.type === 'private') {
77
- // Private channels must have at least 1 owner
76
+ if (args.options.type === 'private' || args.options.type === 'shared') {
77
+ // Private and Shared channels must have at least 1 owner
78
78
  requestOptions.data.members = [
79
79
  {
80
80
  '@odata.type': '#microsoft.graph.aadUserConversationMember',
@@ -119,7 +119,7 @@ _TeamsChannelAddCommand_instances = new WeakSet(), _TeamsChannelAddCommand_initT
119
119
  option: '-d, --description [description]'
120
120
  }, {
121
121
  option: '--type [type]',
122
- autocomplete: ['standard', 'private']
122
+ autocomplete: ['standard', 'private', 'shared']
123
123
  }, {
124
124
  option: '--owner [owner]'
125
125
  });
@@ -128,14 +128,14 @@ _TeamsChannelAddCommand_instances = new WeakSet(), _TeamsChannelAddCommand_initT
128
128
  if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
129
129
  return `${args.options.teamId} is not a valid GUID`;
130
130
  }
131
- if (args.options.type && ['standard', 'private'].indexOf(args.options.type) === -1) {
132
- return `${args.options.type} is not a valid type value. Allowed values standard|private.`;
131
+ if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type) === -1) {
132
+ return `${args.options.type} is not a valid type value. Allowed values standard|private|shared.`;
133
133
  }
134
- if (args.options.type === 'private' && !args.options.owner) {
135
- return 'Specify owner when creating a private channel.';
134
+ if ((args.options.type === 'private' || args.options.type === 'shared') && !args.options.owner) {
135
+ return `Specify owner when creating a ${args.options.type} channel.`;
136
136
  }
137
- if (args.options.type !== 'private' && args.options.owner) {
138
- return 'Specify owner only when creating a private channel.';
137
+ if ((args.options.type !== 'private' && args.options.type !== 'shared') && args.options.owner) {
138
+ return `Specify owner only when creating a private or shared channel.`;
139
139
  }
140
140
  return true;
141
141
  }));
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  var _TodoTaskSetCommand_instances, _TodoTaskSetCommand_initTelemetry, _TodoTaskSetCommand_initOptions, _TodoTaskSetCommand_initValidators, _TodoTaskSetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
+ const validation_1 = require("../../../../utils/validation");
19
20
  const GraphCommand_1 = require("../../../base/GraphCommand");
20
21
  const commands_1 = require("../../commands");
21
22
  class TodoTaskSetCommand extends GraphCommand_1.default {
@@ -76,7 +77,14 @@ class TodoTaskSetCommand extends GraphCommand_1.default {
76
77
  return Promise.resolve(taskList.id);
77
78
  });
78
79
  }
80
+ getDateTimeTimeZone(dateTime) {
81
+ return {
82
+ dateTime: dateTime,
83
+ timeZone: 'Etc/GMT'
84
+ };
85
+ }
79
86
  mapRequestBody(options) {
87
+ var _a;
80
88
  const requestBody = {};
81
89
  if (options.status) {
82
90
  requestBody.status = options.status;
@@ -84,6 +92,21 @@ class TodoTaskSetCommand extends GraphCommand_1.default {
84
92
  if (options.title) {
85
93
  requestBody.title = options.title;
86
94
  }
95
+ if (options.importance) {
96
+ requestBody.importance = options.importance.toLowerCase();
97
+ }
98
+ if (options.bodyContentType || options.bodyContent) {
99
+ requestBody.body = {
100
+ content: options.bodyContent,
101
+ contentType: ((_a = options.bodyContentType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || 'text'
102
+ };
103
+ }
104
+ if (options.dueDateTime) {
105
+ requestBody.dueDateTime = this.getDateTimeTimeZone(options.dueDateTime);
106
+ }
107
+ if (options.reminderDateTime) {
108
+ requestBody.reminderDateTime = this.getDateTimeTimeZone(options.reminderDateTime);
109
+ }
87
110
  return requestBody;
88
111
  }
89
112
  }
@@ -93,7 +116,12 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
93
116
  listId: typeof args.options.listId !== 'undefined',
94
117
  listName: typeof args.options.listName !== 'undefined',
95
118
  status: typeof args.options.status !== 'undefined',
96
- title: typeof args.options.title !== 'undefined'
119
+ title: typeof args.options.title !== 'undefined',
120
+ bodyContent: typeof args.options.bodyContent !== 'undefined',
121
+ bodyContentType: args.options.bodyContentType,
122
+ dueDateTime: typeof args.options.dueDateTime !== 'undefined',
123
+ importance: args.options.importance,
124
+ reminderDateTime: typeof args.options.reminderDateTime !== 'undefined'
97
125
  });
98
126
  });
99
127
  }, _TodoTaskSetCommand_initOptions = function _TodoTaskSetCommand_initOptions() {
@@ -108,6 +136,18 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
108
136
  option: '--listName [listName]'
109
137
  }, {
110
138
  option: '--listId [listId]'
139
+ }, {
140
+ option: '--bodyContent [bodyContent]'
141
+ }, {
142
+ option: '--bodyContentType [bodyContentType]',
143
+ autocomplete: ['text', 'html']
144
+ }, {
145
+ option: '--dueDateTime [dueDateTime]'
146
+ }, {
147
+ option: '--importance [importance]',
148
+ autocomplete: ['low', 'normal', 'high']
149
+ }, {
150
+ option: '--reminderDateTime [reminderDateTime]'
111
151
  });
112
152
  }, _TodoTaskSetCommand_initValidators = function _TodoTaskSetCommand_initValidators() {
113
153
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -119,6 +159,18 @@ _TodoTaskSetCommand_instances = new WeakSet(), _TodoTaskSetCommand_initTelemetry
119
159
  args.options.status !== 'deferred') {
120
160
  return `${args.options.status} is not a valid value. Allowed values are notStarted|inProgress|completed|waitingOnOthers|deferred`;
121
161
  }
162
+ if (args.options.bodyContentType && ['text', 'html'].indexOf(args.options.bodyContentType.toLowerCase()) === -1) {
163
+ return `'${args.options.bodyContentType}' is not a valid value for the bodyContentType option. Allowed values are text|html`;
164
+ }
165
+ if (args.options.importance && ['low', 'normal', 'high'].indexOf(args.options.importance.toLowerCase()) === -1) {
166
+ return `'${args.options.importance}' is not a valid value for the importance option. Allowed values are low|normal|high`;
167
+ }
168
+ if (args.options.dueDateTime && !validation_1.validation.isValidISODateTime(args.options.dueDateTime)) {
169
+ return `'${args.options.dueDateTime}' is not a valid ISO date string`;
170
+ }
171
+ if (args.options.reminderDateTime && !validation_1.validation.isValidISODateTime(args.options.reminderDateTime)) {
172
+ return `'${args.options.reminderDateTime}' is not a valid ISO date string`;
173
+ }
122
174
  return true;
123
175
  }));
124
176
  }, _TodoTaskSetCommand_initOptionSets = function _TodoTaskSetCommand_initOptionSets() {
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cache = void 0;
4
+ const fs = require("fs");
5
+ const os = require("os");
6
+ const path = require("path");
7
+ const config_1 = require("../config");
8
+ const cacheFolderPath = path.join(os.tmpdir(), config_1.default.configstoreName.replace('config', 'cache'));
9
+ const mkdirOptions = { mode: 0o0700, recursive: true };
10
+ exports.cache = {
11
+ cacheFolderPath: cacheFolderPath,
12
+ getValue(key) {
13
+ this.clearExpired();
14
+ try {
15
+ const cacheFilePath = path.join(cacheFolderPath, key);
16
+ if (!fs.existsSync(cacheFilePath)) {
17
+ return undefined;
18
+ }
19
+ return fs.readFileSync(cacheFilePath, 'utf8');
20
+ }
21
+ catch (_a) {
22
+ return undefined;
23
+ }
24
+ },
25
+ setValue(key, value) {
26
+ this.clearExpired();
27
+ try {
28
+ fs.mkdirSync(cacheFolderPath, mkdirOptions);
29
+ const cacheFilePath = path.join(cacheFolderPath, key);
30
+ // we don't need to wait for the file to be written
31
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
32
+ fs.writeFile(cacheFilePath, value, () => { });
33
+ }
34
+ catch (_a) { }
35
+ },
36
+ clearExpired(cb) {
37
+ // we don't need to wait for this to complete
38
+ // even if it stops meanwhile, it will be picked up next time
39
+ fs.readdir(cacheFolderPath, (err, files) => {
40
+ if (err) {
41
+ if (cb) {
42
+ cb();
43
+ }
44
+ return;
45
+ }
46
+ const numFiles = files.length;
47
+ if (numFiles === 0) {
48
+ if (cb) {
49
+ cb();
50
+ }
51
+ return;
52
+ }
53
+ files.forEach((file, index) => {
54
+ fs.stat(path.join(cacheFolderPath, file), (err, stats) => {
55
+ if (err || stats.isDirectory()) {
56
+ if (cb && index === numFiles - 1) {
57
+ cb();
58
+ }
59
+ return;
60
+ }
61
+ // remove files that haven't been accessed in the last 24 hours
62
+ if (stats.atime.getTime() < Date.now() - 24 * 60 * 60 * 1000) {
63
+ // we don't need to wait for the file to be deleted
64
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
65
+ fs.unlink(path.join(cacheFolderPath, file), () => {
66
+ if (cb && index === numFiles - 1) {
67
+ cb();
68
+ }
69
+ });
70
+ }
71
+ else {
72
+ if (cb && index === numFiles - 1) {
73
+ cb();
74
+ }
75
+ }
76
+ });
77
+ });
78
+ });
79
+ }
80
+ };
81
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pid = void 0;
4
+ const os = require("os");
5
+ const fs = require("fs");
6
+ const child_process_1 = require("child_process");
7
+ const cache_1 = require("./cache");
8
+ function getProcessNameOnMacOs(pid) {
9
+ const stdout = (0, child_process_1.execSync)(`ps -o comm= ${pid}`, { encoding: 'utf8' });
10
+ return stdout.trim();
11
+ }
12
+ function getProcessNameOnLinux(pid) {
13
+ if (!fs.existsSync(`/proc/${pid}/stat`)) {
14
+ return undefined;
15
+ }
16
+ const stat = fs.readFileSync(`/proc/${pid}/stat`, 'utf8');
17
+ const start = stat.indexOf('(');
18
+ const procName = stat.substring(start + 1, stat.indexOf(')') - start);
19
+ return procName;
20
+ }
21
+ function getProcessNameOnWindows(pid) {
22
+ const stdout = (0, child_process_1.execSync)(`wmic PROCESS where ProcessId=${pid} get Caption | find /V "Caption"`, { encoding: 'utf8' });
23
+ return stdout.trim();
24
+ }
25
+ exports.pid = {
26
+ getProcessName(pid) {
27
+ let processName = cache_1.cache.getValue(pid.toString());
28
+ if (processName) {
29
+ return processName;
30
+ }
31
+ let getPidName = undefined;
32
+ const platform = os.platform();
33
+ if (platform.indexOf('win') === 0) {
34
+ getPidName = getProcessNameOnWindows;
35
+ }
36
+ if (platform === 'darwin') {
37
+ getPidName = getProcessNameOnMacOs;
38
+ }
39
+ if (platform === 'linux') {
40
+ getPidName = getProcessNameOnLinux;
41
+ }
42
+ if (getPidName) {
43
+ try {
44
+ processName = getPidName(pid);
45
+ if (processName) {
46
+ cache_1.cache.setValue(pid.toString(), processName);
47
+ }
48
+ return processName;
49
+ }
50
+ catch (_a) {
51
+ return undefined;
52
+ }
53
+ }
54
+ return undefined;
55
+ }
56
+ };
57
+ //# sourceMappingURL=pid.js.map
@@ -0,0 +1,42 @@
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
+ exports.powerPlatform = void 0;
13
+ const request_1 = require("../request");
14
+ const powerPlatformResource = 'https://api.bap.microsoft.com';
15
+ exports.powerPlatform = {
16
+ getDynamicsInstanceApiUrl(environment, asAdmin) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ let url = '';
19
+ if (asAdmin) {
20
+ url = `${powerPlatformResource}/providers/Microsoft.BusinessAppPlatform/scopes/admin/environments/${encodeURIComponent(environment)}`;
21
+ }
22
+ else {
23
+ url = `${powerPlatformResource}/providers/Microsoft.BusinessAppPlatform/environments/${encodeURIComponent(environment)}`;
24
+ }
25
+ const requestOptions = {
26
+ url: `${url}?api-version=2020-10-01&$select=properties.linkedEnvironmentMetadata.instanceApiUrl`,
27
+ headers: {
28
+ accept: 'application/json;odata.metadata=none'
29
+ },
30
+ responseType: 'json'
31
+ };
32
+ try {
33
+ const response = yield request_1.default.get(requestOptions);
34
+ return Promise.resolve(response.properties.linkedEnvironmentMetadata.instanceApiUrl);
35
+ }
36
+ catch (ex) {
37
+ throw Error(`The environment '${environment}' could not be retrieved. See the inner exception for more details: ${ex.message}`);
38
+ }
39
+ });
40
+ }
41
+ };
42
+ //# sourceMappingURL=powerPlatform.js.map
@@ -1,4 +1,4 @@
1
- # aad o365group restore
1
+ # aad o365group recyclebinitem restore
2
2
 
3
3
  Restores a deleted Microsoft 365 Group
4
4
 
@@ -78,4 +78,4 @@ Get all user's sign-ins filter by given user's Id and application identifier in
78
78
 
79
79
  ```sh
80
80
  m365 aad user signin list --userId '11111111-1111-1111-1111-111111111111' --appId '00000000-0000-0000-0000-000000000000'
81
- ```
81
+ ```
@@ -1,4 +1,4 @@
1
- # onerive report activityusercounts
1
+ # onedrive report activityusercounts
2
2
 
3
3
  Gets the trend in the number of active OneDrive users
4
4
 
@@ -21,4 +21,4 @@ Lists the checklist items of a Planner task.
21
21
 
22
22
  ```sh
23
23
  m365 planner task checklistitem list --taskId 'vzCcZoOv-U27PwydxHB8opcADJo-'
24
- ```
24
+ ```
@@ -42,4 +42,4 @@ Add a new reference with the url _https://www.microsoft.com_ and with the type E
42
42
 
43
43
  ```sh
44
44
  m365 planner task reference add --taskId "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --url "https://www.microsoft.com" --type "Excel"
45
- ```
45
+ ```
@@ -0,0 +1,33 @@
1
+ # pp card list
2
+
3
+ Lists Microsoft Power Platform cards in the specified Power Platform environment.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ pp card list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environment <environment>`
14
+ : The name of the environment.
15
+
16
+ `-a, --asAdmin`
17
+ : Run the command as admin for environments you do not have explicitly assigned permissions to.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Examples
22
+
23
+ List cards in a specific environment.
24
+
25
+ ```sh
26
+ m365 pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5"
27
+ ```
28
+
29
+ List cards in a specific environment as admin.
30
+
31
+ ```sh
32
+ m365 pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin
33
+ ```
@@ -0,0 +1,33 @@
1
+ # pp dataverse table list
2
+
3
+ Lists dataverse tables in a given environment
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ pp dataverse table list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environment <environment>`
14
+ : The name of the environment to list all tables for
15
+
16
+ `-a, --asAdmin`
17
+ : Set, to retrieve the dataverse tables as admin for environments you are not a member of.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Examples
22
+
23
+ List all tables for the given environment
24
+
25
+ ```sh
26
+ m365 pp dataverse table list -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"
27
+ ```
28
+
29
+ List all tables for the given environment as Admin
30
+
31
+ ```sh
32
+ m365 pp dataverse table list -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin
33
+ ```
@@ -0,0 +1,38 @@
1
+ # pp environment get
2
+
3
+ Gets information about the specified Power Platform environment
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pp environment get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-n, --name <name>`
14
+ : The name of the environment to get information about
15
+
16
+ `-a, --asAdmin`
17
+ : Run the command as admin and retrieve details of environments you do not have explicitly assigned permissions to
18
+
19
+ ## Remarks
20
+
21
+ !!! attention
22
+ This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
23
+ Register CLI for Microsoft 365 or Azure AD application as a management application for the Power Platform using
24
+ m365 pp managementapp add [options]
25
+
26
+ ## Examples
27
+
28
+ Get information about the Power Platform environment by name
29
+
30
+ ```sh
31
+ m365 pp environment get --name Default-d87a7535-dd31-4437-bfe1-95340acd55c5
32
+ ```
33
+
34
+ Get information as admin about the Power Platform environment by name
35
+
36
+ ```sh
37
+ m365 pp environment get --name Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin
38
+ ```
@@ -11,7 +11,7 @@ m365 pp environment list [options]
11
11
  ## Options
12
12
 
13
13
  `-a, --asAdmin`
14
- Run the command as admin and retrieve all environments. Lists only environments you have explicitly are assigned permissions to by default.
14
+ : Run the command as admin and retrieve all environments. Lists only environments you have explicitly are assigned permissions to by default.
15
15
 
16
16
  --8<-- "docs/cmd/_global.md"
17
17
 
@@ -0,0 +1,33 @@
1
+ # pp solution list
2
+
3
+ Lists solutions in a given environment.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pp solution list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environment <environment>`
14
+ : The name of the environment
15
+
16
+ `-a, --asAdmin`
17
+ : Run the command as admin for environments you do not have explicitly assigned permissions to.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Examples
22
+
23
+ List all solutions in a specific environment
24
+
25
+ ```sh
26
+ m365 pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"
27
+ ```
28
+
29
+ List all solutions in a specific environment as Admin
30
+
31
+ ```sh
32
+ m365 pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin
33
+ ```
@@ -0,0 +1,26 @@
1
+ # pp tenant settings list
2
+
3
+ Lists the global Power Platform tenant settings
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pp tenant settings list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Remarks
16
+
17
+ !!! attention
18
+ This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
19
+
20
+ ## Examples
21
+
22
+ Lists the global Power Platform settings of the tenant
23
+
24
+ ```sh
25
+ m365 pp tenant settings list
26
+ ```