@pnp/cli-microsoft365 5.9.0-beta.21a8d94 → 5.9.0-beta.47e46ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -0
- package/README.md +5 -0
- package/dist/appInsights.js +2 -0
- package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +75 -0
- package/dist/m365/pp/commands/solution/Solution.js +3 -0
- package/dist/m365/pp/commands/solution/solution-list.js +87 -0
- package/dist/m365/pp/commands/tenant/tenant-settings-list.js +45 -0
- package/dist/m365/pp/commands.js +4 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0.js +0 -2
- package/dist/m365/spfx/commands/spfx-doctor.js +52 -7
- package/dist/m365/spo/commands/file/file-copy.js +25 -39
- package/dist/m365/spo/commands/file/file-move.js +24 -37
- package/dist/m365/spo/commands/file/file-rename.js +19 -16
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +231 -0
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +180 -0
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
- package/dist/m365/spo/commands/folder/folder-get.js +36 -6
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +94 -0
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +89 -0
- package/dist/m365/spo/commands.js +5 -0
- package/dist/m365/teams/commands/channel/channel-list.js +3 -3
- package/dist/utils/cache.js +81 -0
- package/dist/utils/pid.js +57 -0
- package/dist/utils/powerPlatform.js +42 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -1
- package/docs/docs/cmd/aad/user/user-signin-list.md +1 -1
- package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +1 -1
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +1 -1
- package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +33 -0
- package/docs/docs/cmd/pp/solution/solution-list.md +33 -0
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +26 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
- package/docs/docs/cmd/spfx/spfx-doctor.md +10 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.md +57 -0
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +54 -0
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +39 -0
- package/docs/docs/cmd/spo/folder/folder-get.md +13 -4
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.md +39 -0
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +36 -0
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +1 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +3 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +1 -1
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/roledefinition/roledefinition-add.md +1 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-add.md +5 -5
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +5 -5
- package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +1 -1
- package/docs/docs/cmd/teams/cache/cache-remove.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-add.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-list.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-set.md +1 -1
- package/docs/docs/cmd/teams/funsettings/funsettings-set.md +6 -6
- package/docs/docs/cmd/tenant/security/security-alerts-list.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +1 -1
- package/npm-shrinkwrap.json +342 -357
- package/package.json +21 -18
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +0 -60
|
@@ -0,0 +1,94 @@
|
|
|
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 _SpoFolderRoleInheritanceBreakCommand_instances, _SpoFolderRoleInheritanceBreakCommand_initTelemetry, _SpoFolderRoleInheritanceBreakCommand_initOptions, _SpoFolderRoleInheritanceBreakCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
class SpoFolderRoleInheritanceBreakCommand extends SpoCommand_1.default {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
_SpoFolderRoleInheritanceBreakCommand_instances.add(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceBreakCommand_instances, "m", _SpoFolderRoleInheritanceBreakCommand_initTelemetry).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceBreakCommand_instances, "m", _SpoFolderRoleInheritanceBreakCommand_initOptions).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceBreakCommand_instances, "m", _SpoFolderRoleInheritanceBreakCommand_initValidators).call(this);
|
|
31
|
+
}
|
|
32
|
+
get name() {
|
|
33
|
+
return commands_1.default.FOLDER_ROLEINHERITANCE_BREAK;
|
|
34
|
+
}
|
|
35
|
+
get description() {
|
|
36
|
+
return 'Breaks the role inheritance of a folder. Keeping existing permissions is the default behavior.';
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const keepExistingPermissions = !args.options.clearExistingPermissions;
|
|
41
|
+
const breakFolderRoleInheritance = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${args.options.webUrl}/_api/web/GetFolderByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(args.options.folderUrl)}')/ListItemAllFields/breakroleinheritance(${keepExistingPermissions})`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json'
|
|
49
|
+
};
|
|
50
|
+
yield request_1.default.post(requestOptions);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (args.options.confirm) {
|
|
57
|
+
yield breakFolderRoleInheritance();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const result = yield Cli_1.Cli.prompt({
|
|
61
|
+
type: 'confirm',
|
|
62
|
+
name: 'continue',
|
|
63
|
+
default: false,
|
|
64
|
+
message: `Are you sure you want to break the role inheritance of folder ${args.options.folderUrl} located in site ${args.options.webUrl}?`
|
|
65
|
+
});
|
|
66
|
+
if (result.continue) {
|
|
67
|
+
yield breakFolderRoleInheritance();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_SpoFolderRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoFolderRoleInheritanceBreakCommand_initTelemetry = function _SpoFolderRoleInheritanceBreakCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
clearExistingPermissions: !!args.options.clearExistingPermissions,
|
|
77
|
+
confirm: !!args.options.confirm
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}, _SpoFolderRoleInheritanceBreakCommand_initOptions = function _SpoFolderRoleInheritanceBreakCommand_initOptions() {
|
|
81
|
+
this.options.unshift({
|
|
82
|
+
option: '-u, --webUrl <webUrl>'
|
|
83
|
+
}, {
|
|
84
|
+
option: '-f, --folderUrl <folderUrl>'
|
|
85
|
+
}, {
|
|
86
|
+
option: '-c, --clearExistingPermissions'
|
|
87
|
+
}, {
|
|
88
|
+
option: '--confirm'
|
|
89
|
+
});
|
|
90
|
+
}, _SpoFolderRoleInheritanceBreakCommand_initValidators = function _SpoFolderRoleInheritanceBreakCommand_initValidators() {
|
|
91
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
92
|
+
};
|
|
93
|
+
module.exports = new SpoFolderRoleInheritanceBreakCommand();
|
|
94
|
+
//# sourceMappingURL=folder-roleinheritance-break.js.map
|
|
@@ -0,0 +1,89 @@
|
|
|
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 _SpoFolderRoleInheritanceResetCommand_instances, _SpoFolderRoleInheritanceResetCommand_initTelemetry, _SpoFolderRoleInheritanceResetCommand_initOptions, _SpoFolderRoleInheritanceResetCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class SpoFolderRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
_SpoFolderRoleInheritanceResetCommand_instances.add(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceResetCommand_instances, "m", _SpoFolderRoleInheritanceResetCommand_initTelemetry).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceResetCommand_instances, "m", _SpoFolderRoleInheritanceResetCommand_initOptions).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderRoleInheritanceResetCommand_instances, "m", _SpoFolderRoleInheritanceResetCommand_initValidators).call(this);
|
|
30
|
+
}
|
|
31
|
+
get name() {
|
|
32
|
+
return commands_1.default.FOLDER_ROLEINHERITANCE_RESET;
|
|
33
|
+
}
|
|
34
|
+
get description() {
|
|
35
|
+
return 'Restores the role inheritance of a folder';
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resetFolderRoleInheritance = () => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
try {
|
|
41
|
+
const requestOptions = {
|
|
42
|
+
url: `${args.options.webUrl}/_api/web/GetFolderByServerRelativeUrl('${args.options.folderUrl}')/ListItemAllFields/resetroleinheritance`,
|
|
43
|
+
headers: {
|
|
44
|
+
accept: 'application/json;odata=nometadata'
|
|
45
|
+
},
|
|
46
|
+
responseType: 'json'
|
|
47
|
+
};
|
|
48
|
+
yield request_1.default.post(requestOptions);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleRejectedODataJsonPromise(err);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
if (args.options.confirm) {
|
|
55
|
+
yield resetFolderRoleInheritance();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const result = yield Cli_1.Cli.prompt({
|
|
59
|
+
type: 'confirm',
|
|
60
|
+
name: 'continue',
|
|
61
|
+
default: false,
|
|
62
|
+
message: `Are you sure you want to reset the role inheritance of folder ${args.options.folderUrl} located in site ${args.options.webUrl}?`
|
|
63
|
+
});
|
|
64
|
+
if (result.continue) {
|
|
65
|
+
yield resetFolderRoleInheritance();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_SpoFolderRoleInheritanceResetCommand_instances = new WeakSet(), _SpoFolderRoleInheritanceResetCommand_initTelemetry = function _SpoFolderRoleInheritanceResetCommand_initTelemetry() {
|
|
72
|
+
this.telemetry.push((args) => {
|
|
73
|
+
Object.assign(this.telemetryProperties, {
|
|
74
|
+
confirm: !!args.options.confirm
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}, _SpoFolderRoleInheritanceResetCommand_initOptions = function _SpoFolderRoleInheritanceResetCommand_initOptions() {
|
|
78
|
+
this.options.unshift({
|
|
79
|
+
option: '-u, --webUrl <webUrl>'
|
|
80
|
+
}, {
|
|
81
|
+
option: '-f, --folderUrl <folderUrl>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '--confirm'
|
|
84
|
+
});
|
|
85
|
+
}, _SpoFolderRoleInheritanceResetCommand_initValidators = function _SpoFolderRoleInheritanceResetCommand_initValidators() {
|
|
86
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
87
|
+
};
|
|
88
|
+
module.exports = new SpoFolderRoleInheritanceResetCommand();
|
|
89
|
+
//# sourceMappingURL=folder-roleinheritance-reset.js.map
|
|
@@ -56,6 +56,9 @@ exports.default = {
|
|
|
56
56
|
FILE_MOVE: `${prefix} file move`,
|
|
57
57
|
FILE_REMOVE: `${prefix} file remove`,
|
|
58
58
|
FILE_RENAME: `${prefix} file rename`,
|
|
59
|
+
FILE_ROLEASSIGNMENT_ADD: `${prefix} file roleassignment add`,
|
|
60
|
+
FILE_ROLEASSIGNMENT_REMOVE: `${prefix} file roleassignment remove`,
|
|
61
|
+
FILE_ROLEINHERITANCE_RESET: `${prefix} file roleinheritance reset`,
|
|
59
62
|
FILE_SHARINGINFO_GET: `${prefix} file sharinginfo get`,
|
|
60
63
|
FOLDER_ADD: `${prefix} folder add`,
|
|
61
64
|
FOLDER_COPY: `${prefix} folder copy`,
|
|
@@ -64,6 +67,8 @@ exports.default = {
|
|
|
64
67
|
FOLDER_MOVE: `${prefix} folder move`,
|
|
65
68
|
FOLDER_REMOVE: `${prefix} folder remove`,
|
|
66
69
|
FOLDER_RENAME: `${prefix} folder rename`,
|
|
70
|
+
FOLDER_ROLEINHERITANCE_BREAK: `${prefix} folder roleinheritance break`,
|
|
71
|
+
FOLDER_ROLEINHERITANCE_RESET: `${prefix} folder roleinheritance reset`,
|
|
67
72
|
GET: `${prefix} get`,
|
|
68
73
|
GROUP_ADD: `${prefix} group add`,
|
|
69
74
|
GROUP_GET: `${prefix} group get`,
|
|
@@ -82,15 +82,15 @@ _TeamsChannelListCommand_instances = new WeakSet(), _TeamsChannelListCommand_ini
|
|
|
82
82
|
option: '--teamName [teamName]'
|
|
83
83
|
}, {
|
|
84
84
|
option: '--type [type]',
|
|
85
|
-
autocomplete: ['standard', 'private']
|
|
85
|
+
autocomplete: ['standard', 'private', 'shared']
|
|
86
86
|
});
|
|
87
87
|
}, _TeamsChannelListCommand_initValidators = function _TeamsChannelListCommand_initValidators() {
|
|
88
88
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
90
90
|
return `${args.options.teamId} is not a valid GUID`;
|
|
91
91
|
}
|
|
92
|
-
if (args.options.type && ['standard', 'private'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
93
|
-
return `${args.options.type} is not a valid type value. Allowed values standard|private`;
|
|
92
|
+
if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
93
|
+
return `${args.options.type} is not a valid type value. Allowed values standard|private|shared`;
|
|
94
94
|
}
|
|
95
95
|
return true;
|
|
96
96
|
}));
|
|
@@ -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
|
|
@@ -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,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
|
+
```
|
|
@@ -13,6 +13,9 @@ m365 spfx doctor [options]
|
|
|
13
13
|
`-e, --env [env]`
|
|
14
14
|
: Version of SharePoint for which to check compatibility: `sp2016|sp2019|spo`
|
|
15
15
|
|
|
16
|
+
`-v, --spfxVersion [spfxVersion]`
|
|
17
|
+
: Version of the SharePoint Framework Yeoman generator to check compatibility for without `v`, eg. `1.11.0`
|
|
18
|
+
|
|
16
19
|
`-h, --help`
|
|
17
20
|
: output usage information
|
|
18
21
|
|
|
@@ -48,7 +51,7 @@ Next to verifying the readiness of your environment to use a particular version
|
|
|
48
51
|
|
|
49
52
|
## Examples
|
|
50
53
|
|
|
51
|
-
Verify if your environment meets the requirements to work with the SharePoint Framework
|
|
54
|
+
Verify if your environment meets the requirements to work with SharePoint Framework based on the globally installed version of the SharePoint Framework Yeoman generator or the current project
|
|
52
55
|
|
|
53
56
|
```sh
|
|
54
57
|
m365 spfx doctor --output text
|
|
@@ -59,3 +62,9 @@ Verify if your environment meets the requirements to work with the SharePoint Fr
|
|
|
59
62
|
```sh
|
|
60
63
|
m365 spfx doctor --env sp2019 --output text
|
|
61
64
|
```
|
|
65
|
+
|
|
66
|
+
Verify if your environment meets the requirements to work with SharePoint Framework v1.11.0
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
m365 spfx doctor --spfxVersion 1.11.0 --output text
|
|
70
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# spo file roleassignment add
|
|
2
|
+
|
|
3
|
+
Adds a role assignment to the specified file.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 spo file roleassignment add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-u, --webUrl <webUrl>`
|
|
14
|
+
: URL of the site where the file is located
|
|
15
|
+
|
|
16
|
+
`--fileUrl [fileUrl]`
|
|
17
|
+
: The server-relative URL of the file to retrieve. Specify either `fileUrl` or `fileId` but not both
|
|
18
|
+
|
|
19
|
+
`i, --fileId [fileId]`
|
|
20
|
+
: The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both
|
|
21
|
+
|
|
22
|
+
`--principalId [principalId]`
|
|
23
|
+
: The SharePoint Id of the principal. It may be either a user id or group id to add a role assignment for. Specify either upn, groupName or principalId.
|
|
24
|
+
|
|
25
|
+
`--upn [upn]`
|
|
26
|
+
: upn/email of user to assign role to. Specify either upn, groupName or principalId.
|
|
27
|
+
|
|
28
|
+
`--groupName [groupName]`
|
|
29
|
+
: The group name of Azure AD or SharePoint group. Specify either upn, groupName or principalId.
|
|
30
|
+
|
|
31
|
+
`--roleDefinitionId [roleDefinitionId]`
|
|
32
|
+
: ID of role definition. Specify either roleDefinitionId or roleDefinitionName but not both
|
|
33
|
+
|
|
34
|
+
`--roleDefinitionName [roleDefinitionName]`
|
|
35
|
+
: Enter the name of a role definition, like 'Contribute', 'Read', etc. Specify either roleDefinitionId or roleDefinitionName but not both
|
|
36
|
+
|
|
37
|
+
--8<-- "docs/cmd/_global.md"
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
Adds a role assignment to a file with a specified id. It will use a principal id and a specific role definition id.
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
m365 spo file roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileId "b2307a39-e878-458b-bc90-03bc578531d6" --principalId 11 --roleDefinitionId 1073741829
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Adds a role assignment to a file with a specified site-relative URL for a specific upn and a role definition name.
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
m365 spo file roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "Shared Documents/Test1.docx" --upn "testuser@tenant.onmicrosoft.com" --roleDefinitionName "Full Control"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Adds a role assignment to a file with a specified server-relative URL the for a specific group and a role definition name.
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
m365 spo file roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx" --upn "testuser@tenant.onmicrosoft.com" --roleDefinitionName "Read"
|
|
57
|
+
```
|