@pnp/cli-microsoft365 6.8.0-beta.a10f6e4 → 6.8.0-beta.c74eb4b
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 +6 -1
- package/dist/m365/commands/commands.js +1 -0
- package/dist/m365/commands/docs.js +42 -0
- package/dist/m365/commands/login.js +1 -1
- package/dist/m365/pa/commands/app/app-consent-set.js +101 -0
- package/dist/m365/pa/commands.js +1 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +97 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +85 -0
- package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +89 -0
- package/dist/m365/purview/commands.js +3 -0
- package/dist/m365/spo/commands/file/file-list.js +15 -4
- package/dist/m365/spo/commands/file/file-remove.js +3 -0
- package/dist/m365/spo/commands/list/list-get.js +30 -3
- package/dist/m365/spo/commands/list/list-list.js +39 -2
- package/dist/m365/spo/commands/term/term-add.js +13 -4
- package/dist/m365/spo/commands/term/term-get.js +14 -5
- package/dist/m365/spo/commands/term/term-group-get.js +12 -3
- package/dist/m365/spo/commands/term/term-group-list.js +39 -4
- package/dist/m365/spo/commands/term/term-list.js +18 -9
- package/dist/m365/spo/commands/term/term-set-add.js +13 -4
- package/dist/m365/spo/commands/term/term-set-get.js +12 -3
- package/dist/m365/spo/commands/term/term-set-list.js +12 -3
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/aad/o365group/o365group-get.md +0 -12
- package/docs/docs/cmd/cli/cli-consent.md +6 -0
- package/docs/docs/cmd/cli/cli-doctor.md +17 -0
- package/docs/docs/cmd/cli/cli-issue.md +6 -0
- package/docs/docs/cmd/cli/cli-reconsent.md +6 -0
- package/docs/docs/cmd/cli/completion/completion-sh-setup.md +6 -0
- package/docs/docs/cmd/cli/config/config-get.md +6 -0
- package/docs/docs/cmd/docs.md +51 -0
- package/docs/docs/cmd/login.md +1 -1
- package/docs/docs/cmd/pa/app/app-consent-set.md +47 -0
- package/docs/docs/cmd/planner/task/task-get.md +0 -6
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.md +118 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.md +111 -0
- package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.md +97 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +17 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-list.md +17 -0
- package/docs/docs/cmd/spo/file/file-list.md +9 -6
- package/docs/docs/cmd/spo/file/file-remove.md +12 -0
- package/docs/docs/cmd/spo/list/list-get.md +10 -0
- package/docs/docs/cmd/spo/list/list-list.md +28 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +19 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +12 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +6 -0
- package/docs/docs/cmd/spo/page/page-column-get.md +15 -0
- package/docs/docs/cmd/spo/page/page-column-list.md +16 -0
- package/docs/docs/cmd/spo/page/page-control-get.md +18 -0
- package/docs/docs/cmd/spo/page/page-control-list.md +18 -0
- package/docs/docs/cmd/spo/page/page-copy.md +35 -0
- package/docs/docs/cmd/spo/page/page-get.md +39 -0
- package/docs/docs/cmd/spo/page/page-list.md +53 -0
- package/docs/docs/cmd/spo/page/page-section-get.md +12 -0
- package/docs/docs/cmd/spo/page/page-section-list.md +13 -0
- package/docs/docs/cmd/spo/page/page-template-list.md +31 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-get.md +6 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-list.md +13 -0
- package/docs/docs/cmd/spo/report/report-activityfilecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-activitypages.md +7 -0
- package/docs/docs/cmd/spo/report/report-activityusercounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-activityuserdetail.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagedetail.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagefilecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagepages.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagesitecounts.md +7 -0
- package/docs/docs/cmd/spo/report/report-siteusagestorage.md +7 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-get.md +20 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-list.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-add.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.md +18 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-approve.md +20 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-list.md +17 -0
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.md +13 -0
- package/docs/docs/cmd/spo/term/term-add.md +107 -6
- package/docs/docs/cmd/spo/term/term-get.md +111 -10
- package/docs/docs/cmd/spo/term/term-group-get.md +71 -5
- package/docs/docs/cmd/spo/term/term-group-list.md +70 -2
- package/docs/docs/cmd/spo/term/term-list.md +80 -8
- package/docs/docs/cmd/spo/term/term-set-add.md +95 -11
- package/docs/docs/cmd/spo/term/term-set-get.md +92 -8
- package/docs/docs/cmd/spo/term/term-set-list.md +85 -5
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -66,6 +66,7 @@ const dictionary = [
|
|
|
66
66
|
'o365',
|
|
67
67
|
'permission',
|
|
68
68
|
'place',
|
|
69
|
+
'policy',
|
|
69
70
|
'property',
|
|
70
71
|
'records',
|
|
71
72
|
'recycle',
|
|
@@ -73,6 +74,7 @@ const dictionary = [
|
|
|
73
74
|
'role',
|
|
74
75
|
'room',
|
|
75
76
|
'schema',
|
|
77
|
+
'sensitivity',
|
|
76
78
|
'service',
|
|
77
79
|
'set',
|
|
78
80
|
'setting',
|
package/README.md
CHANGED
|
@@ -74,15 +74,20 @@
|
|
|
74
74
|
- Access all your Microsoft 365 workloads
|
|
75
75
|
- Supported workloads
|
|
76
76
|
- Azure Active Directory
|
|
77
|
+
- Bookings
|
|
77
78
|
- Microsoft Teams
|
|
78
79
|
- Microsoft To Do
|
|
79
80
|
- OneDrive
|
|
81
|
+
- OneNote
|
|
80
82
|
- Outlook
|
|
81
83
|
- Planner
|
|
82
84
|
- Power Automate
|
|
83
85
|
- Power Apps
|
|
86
|
+
- Power Platform
|
|
87
|
+
- Purview
|
|
84
88
|
- Skype for Business
|
|
85
89
|
- SharePoint Online
|
|
90
|
+
- To Do
|
|
86
91
|
- Yammer
|
|
87
92
|
- Supported authentication methods
|
|
88
93
|
- Azure Managed Identity
|
|
@@ -98,7 +103,7 @@
|
|
|
98
103
|
|
|
99
104
|
## Install
|
|
100
105
|
|
|
101
|
-
To
|
|
106
|
+
To use the CLI for Microsoft 365 you need [`Node.js`](https://nodejs.org). The CLI has been tested with Node.js versions 18 and higher, but we recommend you to use the Node.js LTS version available at the moment.
|
|
102
107
|
|
|
103
108
|
```
|
|
104
109
|
npm install -g @pnp/cli-microsoft365
|
|
@@ -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
|
+
const AnonymousCommand_1 = require("../base/AnonymousCommand");
|
|
13
|
+
const Cli_1 = require("../../cli/Cli");
|
|
14
|
+
const commands_1 = require("./commands");
|
|
15
|
+
const settingsNames_1 = require("../../settingsNames");
|
|
16
|
+
const packageJSON = require('../../../package.json');
|
|
17
|
+
class DocsCommand extends AnonymousCommand_1.default {
|
|
18
|
+
get name() {
|
|
19
|
+
return commands_1.default.DOCS;
|
|
20
|
+
}
|
|
21
|
+
get description() {
|
|
22
|
+
return 'Returns the CLI for Microsoft 365 docs webpage URL';
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
logger.log(packageJSON.homepage);
|
|
27
|
+
if (Cli_1.Cli.getInstance().getSettingWithDefaultValue(settingsNames_1.settingsNames.autoOpenLinksInBrowser, false) === false) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// _open is never set before hitting this line, but this check
|
|
31
|
+
// is implemented so that we can support lazy loading
|
|
32
|
+
// but also stub it for testing
|
|
33
|
+
/* c8 ignore next 3 */
|
|
34
|
+
if (!this._open) {
|
|
35
|
+
this._open = require('open');
|
|
36
|
+
}
|
|
37
|
+
yield this._open(packageJSON.homepage);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
module.exports = new DocsCommand();
|
|
42
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -145,7 +145,7 @@ _LoginCommand_instances = new WeakSet(), _LoginCommand_initTelemetry = function
|
|
|
145
145
|
}, {
|
|
146
146
|
option: '--tenant [tenant]'
|
|
147
147
|
}, {
|
|
148
|
-
option: '--secret [secret]'
|
|
148
|
+
option: '-s, --secret [secret]'
|
|
149
149
|
}, {
|
|
150
150
|
option: '--cloud [cloud]',
|
|
151
151
|
autocomplete: misc_1.misc.getEnums(Auth_1.CloudType)
|
|
@@ -0,0 +1,101 @@
|
|
|
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 _PaAppConsentSetCommand_instances, _PaAppConsentSetCommand_initOptions, _PaAppConsentSetCommand_initValidators, _PaAppConsentSetCommand_initTypes;
|
|
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 PowerAppsCommand_1 = require("../../../base/PowerAppsCommand");
|
|
22
|
+
const commands_1 = require("../../commands");
|
|
23
|
+
class PaAppConsentSetCommand extends PowerAppsCommand_1.default {
|
|
24
|
+
get name() {
|
|
25
|
+
return commands_1.default.APP_CONSENT_SET;
|
|
26
|
+
}
|
|
27
|
+
get description() {
|
|
28
|
+
return 'Configures if users can bypass the API Consent window for the selected canvas app';
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
_PaAppConsentSetCommand_instances.add(this);
|
|
33
|
+
__classPrivateFieldGet(this, _PaAppConsentSetCommand_instances, "m", _PaAppConsentSetCommand_initOptions).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PaAppConsentSetCommand_instances, "m", _PaAppConsentSetCommand_initValidators).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PaAppConsentSetCommand_instances, "m", _PaAppConsentSetCommand_initTypes).call(this);
|
|
36
|
+
}
|
|
37
|
+
commandAction(logger, args) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
logger.logToStderr(`Setting the bypass consent for the Microsoft Power App ${args.options.name}... to ${args.options.bypass}`);
|
|
41
|
+
}
|
|
42
|
+
if (args.options.confirm) {
|
|
43
|
+
yield this.consentPaApp(args);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const result = yield Cli_1.Cli.prompt({
|
|
47
|
+
type: 'confirm',
|
|
48
|
+
name: 'continue',
|
|
49
|
+
default: false,
|
|
50
|
+
message: `Are you sure you bypass the consent for the Microsoft Power App ${args.options.name} to ${args.options.bypass}?`
|
|
51
|
+
});
|
|
52
|
+
if (result.continue) {
|
|
53
|
+
yield this.consentPaApp(args);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
consentPaApp(args) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const requestOptions = {
|
|
61
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.environment}/apps/${args.options.name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`,
|
|
62
|
+
headers: {
|
|
63
|
+
accept: 'application/json;odata.metadata=none'
|
|
64
|
+
},
|
|
65
|
+
responseType: 'json',
|
|
66
|
+
data: {
|
|
67
|
+
bypassconsent: args.options.bypass
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
try {
|
|
71
|
+
yield request_1.default.post(requestOptions);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
this.handleRejectedODataJsonPromise(err);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
_PaAppConsentSetCommand_instances = new WeakSet(), _PaAppConsentSetCommand_initOptions = function _PaAppConsentSetCommand_initOptions() {
|
|
80
|
+
this.options.unshift({
|
|
81
|
+
option: '-e, --environment <environment>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '-n, --name <name>'
|
|
84
|
+
}, {
|
|
85
|
+
option: '-b, --bypass <bypass>',
|
|
86
|
+
autocomplete: ['true', 'false']
|
|
87
|
+
}, {
|
|
88
|
+
option: '--confirm'
|
|
89
|
+
});
|
|
90
|
+
}, _PaAppConsentSetCommand_initValidators = function _PaAppConsentSetCommand_initValidators() {
|
|
91
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (!validation_1.validation.isValidGuid(args.options.name)) {
|
|
93
|
+
return `${args.options.name} is not a valid GUID`;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}));
|
|
97
|
+
}, _PaAppConsentSetCommand_initTypes = function _PaAppConsentSetCommand_initTypes() {
|
|
98
|
+
this.types.boolean.push('bypass');
|
|
99
|
+
};
|
|
100
|
+
module.exports = new PaAppConsentSetCommand();
|
|
101
|
+
//# sourceMappingURL=app-consent-set.js.map
|
package/dist/m365/pa/commands.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.default = {
|
|
|
6
6
|
APP_GET: `${prefix} app get`,
|
|
7
7
|
APP_LIST: `${prefix} app list`,
|
|
8
8
|
APP_REMOVE: `${prefix} app remove`,
|
|
9
|
+
APP_CONSENT_SET: `${prefix} app consent set`,
|
|
9
10
|
CONNECTOR_EXPORT: `${prefix} connector export`,
|
|
10
11
|
CONNECTOR_LIST: `${prefix} connector list`,
|
|
11
12
|
ENVIRONMENT_GET: `${prefix} environment get`,
|
|
@@ -0,0 +1,97 @@
|
|
|
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 _PurviewSensitivityLabelGetCommand_instances, _PurviewSensitivityLabelGetCommand_initTelemetry, _PurviewSensitivityLabelGetCommand_initOptions, _PurviewSensitivityLabelGetCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const request_1 = require("../../../../request");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
24
|
+
class PurviewSensitivityLabelGetCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.SENSITIVITYLABEL_GET;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Retrieve the specified sensitivity label';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_PurviewSensitivityLabelGetCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelGetCommand_instances, "m", _PurviewSensitivityLabelGetCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelGetCommand_instances, "m", _PurviewSensitivityLabelGetCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelGetCommand_instances, "m", _PurviewSensitivityLabelGetCommand_initValidators).call(this);
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
41
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
|
|
42
|
+
this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`);
|
|
43
|
+
}
|
|
44
|
+
if (this.verbose) {
|
|
45
|
+
logger.logToStderr(`Retrieving sensitivity label with id ${args.options.id}`);
|
|
46
|
+
}
|
|
47
|
+
const requestUrl = args.options.userId || args.options.userName
|
|
48
|
+
? `${this.resource}/beta/users/${args.options.userId || args.options.userName}/security/informationProtection/sensitivityLabels/${args.options.id}`
|
|
49
|
+
: `${this.resource}/beta/me/security/informationProtection/sensitivityLabels/${args.options.id}`;
|
|
50
|
+
const requestOptions = {
|
|
51
|
+
url: requestUrl,
|
|
52
|
+
headers: {
|
|
53
|
+
accept: 'application/json;odata.metadata=none'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json'
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
const res = yield request_1.default.get(requestOptions);
|
|
59
|
+
logger.log(res);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_PurviewSensitivityLabelGetCommand_instances = new WeakSet(), _PurviewSensitivityLabelGetCommand_initTelemetry = function _PurviewSensitivityLabelGetCommand_initTelemetry() {
|
|
68
|
+
this.telemetry.push((args) => {
|
|
69
|
+
Object.assign(this.telemetryProperties, {
|
|
70
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
71
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}, _PurviewSensitivityLabelGetCommand_initOptions = function _PurviewSensitivityLabelGetCommand_initOptions() {
|
|
75
|
+
this.options.unshift({
|
|
76
|
+
option: '-i, --id <id>'
|
|
77
|
+
}, {
|
|
78
|
+
option: '--userId [userId]'
|
|
79
|
+
}, {
|
|
80
|
+
option: '--userName [userName]'
|
|
81
|
+
});
|
|
82
|
+
}, _PurviewSensitivityLabelGetCommand_initValidators = function _PurviewSensitivityLabelGetCommand_initValidators() {
|
|
83
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
85
|
+
return `'${args.options.id}' is not a valid GUID.`;
|
|
86
|
+
}
|
|
87
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
88
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
89
|
+
}
|
|
90
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
91
|
+
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
96
|
+
module.exports = new PurviewSensitivityLabelGetCommand();
|
|
97
|
+
//# sourceMappingURL=sensitivitylabel-get.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
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 _PurviewSensitivityLabelListCommand_instances, _PurviewSensitivityLabelListCommand_initTelemetry, _PurviewSensitivityLabelListCommand_initOptions, _PurviewSensitivityLabelListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
23
|
+
const odata_1 = require("../../../../utils/odata");
|
|
24
|
+
class PurviewSensitivityLabelListCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.SENSITIVITYLABEL_LIST;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Get a list of sensitivity labels';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_PurviewSensitivityLabelListCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelListCommand_instances, "m", _PurviewSensitivityLabelListCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelListCommand_instances, "m", _PurviewSensitivityLabelListCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelListCommand_instances, "m", _PurviewSensitivityLabelListCommand_initValidators).call(this);
|
|
37
|
+
}
|
|
38
|
+
defaultProperties() {
|
|
39
|
+
return ['id', 'name', 'isActive'];
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
44
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
|
|
45
|
+
this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`);
|
|
46
|
+
}
|
|
47
|
+
const requestUrl = args.options.userId || args.options.userName
|
|
48
|
+
? `${this.resource}/beta/users/${args.options.userId || args.options.userName}/security/informationProtection/sensitivityLabels`
|
|
49
|
+
: `${this.resource}/beta/me/security/informationProtection/sensitivityLabels`;
|
|
50
|
+
try {
|
|
51
|
+
const items = yield odata_1.odata.getAllItems(requestUrl);
|
|
52
|
+
logger.log(items);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.handleRejectedODataJsonPromise(err);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
_PurviewSensitivityLabelListCommand_instances = new WeakSet(), _PurviewSensitivityLabelListCommand_initTelemetry = function _PurviewSensitivityLabelListCommand_initTelemetry() {
|
|
61
|
+
this.telemetry.push((args) => {
|
|
62
|
+
Object.assign(this.telemetryProperties, {
|
|
63
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
64
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}, _PurviewSensitivityLabelListCommand_initOptions = function _PurviewSensitivityLabelListCommand_initOptions() {
|
|
68
|
+
this.options.unshift({
|
|
69
|
+
option: '--userId [userId]'
|
|
70
|
+
}, {
|
|
71
|
+
option: '--userName [userName]'
|
|
72
|
+
});
|
|
73
|
+
}, _PurviewSensitivityLabelListCommand_initValidators = function _PurviewSensitivityLabelListCommand_initValidators() {
|
|
74
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
76
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
77
|
+
}
|
|
78
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
79
|
+
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
module.exports = new PurviewSensitivityLabelListCommand();
|
|
85
|
+
//# sourceMappingURL=sensitivitylabel-list.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 _PurviewSensitivityLabelPolicySettingsListCommand_instances, _PurviewSensitivityLabelPolicySettingsListCommand_initTelemetry, _PurviewSensitivityLabelPolicySettingsListCommand_initOptions, _PurviewSensitivityLabelPolicySettingsListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Auth_1 = require("../../../../Auth");
|
|
19
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
20
|
+
const commands_1 = require("../../commands");
|
|
21
|
+
const request_1 = require("../../../../request");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
24
|
+
class PurviewSensitivityLabelPolicySettingsListCommand extends GraphCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.SENSITIVITYLABEL_POLICYSETTINGS_LIST;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Get a list of policy settings for a sensitivity label';
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
_PurviewSensitivityLabelPolicySettingsListCommand_instances.add(this);
|
|
34
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelPolicySettingsListCommand_instances, "m", _PurviewSensitivityLabelPolicySettingsListCommand_initTelemetry).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelPolicySettingsListCommand_instances, "m", _PurviewSensitivityLabelPolicySettingsListCommand_initOptions).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PurviewSensitivityLabelPolicySettingsListCommand_instances, "m", _PurviewSensitivityLabelPolicySettingsListCommand_initValidators).call(this);
|
|
37
|
+
}
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
41
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
|
|
42
|
+
this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`);
|
|
43
|
+
}
|
|
44
|
+
const requestUrl = args.options.userId || args.options.userName
|
|
45
|
+
? `${this.resource}/beta/users/${args.options.userId || args.options.userName}/security/informationProtection/labelPolicySettings`
|
|
46
|
+
: `${this.resource}/beta/me/security/informationProtection/labelPolicySettings`;
|
|
47
|
+
const requestOptions = {
|
|
48
|
+
url: requestUrl,
|
|
49
|
+
headers: {
|
|
50
|
+
accept: 'application/json;odata.metadata=none'
|
|
51
|
+
},
|
|
52
|
+
responseType: 'json'
|
|
53
|
+
};
|
|
54
|
+
try {
|
|
55
|
+
const res = yield request_1.default.get(requestOptions);
|
|
56
|
+
logger.log(res);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedODataJsonPromise(err);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_PurviewSensitivityLabelPolicySettingsListCommand_instances = new WeakSet(), _PurviewSensitivityLabelPolicySettingsListCommand_initTelemetry = function _PurviewSensitivityLabelPolicySettingsListCommand_initTelemetry() {
|
|
65
|
+
this.telemetry.push((args) => {
|
|
66
|
+
Object.assign(this.telemetryProperties, {
|
|
67
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
68
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}, _PurviewSensitivityLabelPolicySettingsListCommand_initOptions = function _PurviewSensitivityLabelPolicySettingsListCommand_initOptions() {
|
|
72
|
+
this.options.unshift({
|
|
73
|
+
option: '--userId [userId]'
|
|
74
|
+
}, {
|
|
75
|
+
option: '--userName [userName]'
|
|
76
|
+
});
|
|
77
|
+
}, _PurviewSensitivityLabelPolicySettingsListCommand_initValidators = function _PurviewSensitivityLabelPolicySettingsListCommand_initValidators() {
|
|
78
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
80
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
81
|
+
}
|
|
82
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
83
|
+
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
module.exports = new PurviewSensitivityLabelPolicySettingsListCommand();
|
|
89
|
+
//# sourceMappingURL=sensitivitylabel-policysettings-list.js.map
|
|
@@ -17,6 +17,9 @@ exports.default = {
|
|
|
17
17
|
RETENTIONLABEL_LIST: `${prefix} retentionlabel list`,
|
|
18
18
|
RETENTIONLABEL_REMOVE: `${prefix} retentionlabel remove`,
|
|
19
19
|
RETENTIONLABEL_SET: `${prefix} retentionlabel set`,
|
|
20
|
+
SENSITIVITYLABEL_GET: `${prefix} sensitivitylabel get`,
|
|
21
|
+
SENSITIVITYLABEL_LIST: `${prefix} sensitivitylabel list`,
|
|
22
|
+
SENSITIVITYLABEL_POLICYSETTINGS_LIST: `${prefix} sensitivitylabel policysettings list`,
|
|
20
23
|
THREATASSESSMENT_GET: `${prefix} threatassessment get`
|
|
21
24
|
};
|
|
22
25
|
//# sourceMappingURL=commands.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 _SpoFileListCommand_instances, _SpoFileListCommand_initTelemetry, _SpoFileListCommand_initOptions, _SpoFileListCommand_initValidators;
|
|
16
|
+
var _SpoFileListCommand_instances, _SpoFileListCommand_initTelemetry, _SpoFileListCommand_initOptions, _SpoFileListCommand_initValidators, _SpoFileListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
@@ -34,6 +34,7 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
34
34
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initTelemetry).call(this);
|
|
35
35
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initOptions).call(this);
|
|
36
36
|
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoFileListCommand_instances, "m", _SpoFileListCommand_initOptionSets).call(this);
|
|
37
38
|
}
|
|
38
39
|
commandAction(logger, args) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41,11 +42,15 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
41
42
|
logger.logToStderr(`Retrieving all files in folder '${args.options.folder}' at site '${args.options.webUrl}'${args.options.recursive ? ' (recursive)' : ''}...`);
|
|
42
43
|
}
|
|
43
44
|
try {
|
|
45
|
+
if (args.options.folder) {
|
|
46
|
+
args.options.folderUrl = args.options.folder;
|
|
47
|
+
this.warn(logger, `Option 'folder' is deprecated. Please use 'folderUrl' instead`);
|
|
48
|
+
}
|
|
44
49
|
const fieldProperties = this.formatSelectProperties(args.options.fields, args.options.output);
|
|
45
50
|
const allFiles = [];
|
|
46
51
|
const allFolders = args.options.recursive
|
|
47
|
-
? [...yield this.getFolders(args.options.
|
|
48
|
-
: [args.options.
|
|
52
|
+
? [...yield this.getFolders(args.options.folderUrl, args, logger), args.options.folderUrl]
|
|
53
|
+
: [args.options.folderUrl];
|
|
49
54
|
for (const folder of allFolders) {
|
|
50
55
|
const files = yield this.getFiles(folder, fieldProperties, args, logger);
|
|
51
56
|
files.forEach((file) => allFiles.push(file));
|
|
@@ -152,6 +157,8 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
152
157
|
_SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry = function _SpoFileListCommand_initTelemetry() {
|
|
153
158
|
this.telemetry.push((args) => {
|
|
154
159
|
Object.assign(this.telemetryProperties, {
|
|
160
|
+
folder: typeof args.options.folder !== 'undefined',
|
|
161
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
155
162
|
recursive: args.options.recursive,
|
|
156
163
|
fields: typeof args.options.fields !== 'undefined',
|
|
157
164
|
filter: typeof args.options.filter !== 'undefined'
|
|
@@ -161,7 +168,9 @@ _SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry
|
|
|
161
168
|
this.options.unshift({
|
|
162
169
|
option: '-u, --webUrl <webUrl>'
|
|
163
170
|
}, {
|
|
164
|
-
option: '-f, --folder
|
|
171
|
+
option: '-f, --folder [folder]'
|
|
172
|
+
}, {
|
|
173
|
+
option: '-f, --folderUrl [folderUrl]'
|
|
165
174
|
}, {
|
|
166
175
|
option: '--fields [fields]'
|
|
167
176
|
}, {
|
|
@@ -171,6 +180,8 @@ _SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry
|
|
|
171
180
|
});
|
|
172
181
|
}, _SpoFileListCommand_initValidators = function _SpoFileListCommand_initValidators() {
|
|
173
182
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
183
|
+
}, _SpoFileListCommand_initOptionSets = function _SpoFileListCommand_initOptionSets() {
|
|
184
|
+
this.optionSets.push({ options: ['folder', 'folderUrl'] });
|
|
174
185
|
};
|
|
175
186
|
SpoFileListCommand.pageSize = 5000;
|
|
176
187
|
module.exports = new SpoFileListCommand();
|
|
@@ -29,6 +29,9 @@ class SpoFileRemoveCommand extends SpoCommand_1.default {
|
|
|
29
29
|
get description() {
|
|
30
30
|
return 'Removes the specified file';
|
|
31
31
|
}
|
|
32
|
+
alias() {
|
|
33
|
+
return [commands_1.default.PAGE_TEMPLATE_REMOVE];
|
|
34
|
+
}
|
|
32
35
|
constructor() {
|
|
33
36
|
super();
|
|
34
37
|
_SpoFileRemoveCommand_instances.add(this);
|
|
@@ -53,10 +53,17 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
53
53
|
const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.url);
|
|
54
54
|
requestUrl += `GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const fieldsProperties = this.formatSelectProperties(args.options.properties, args.options.withPermissions);
|
|
57
|
+
const queryParams = [];
|
|
58
|
+
if (fieldsProperties.selectProperties.length > 0) {
|
|
59
|
+
queryParams.push(`$select=${fieldsProperties.selectProperties.join(',')}`);
|
|
60
|
+
}
|
|
61
|
+
if (fieldsProperties.expandProperties.length > 0) {
|
|
62
|
+
queryParams.push(`$expand=${fieldsProperties.expandProperties.join(',')}`);
|
|
63
|
+
}
|
|
64
|
+
const querystring = queryParams.length > 0 ? `?${queryParams.join('&')}` : ``;
|
|
58
65
|
const requestOptions = {
|
|
59
|
-
url: requestUrl
|
|
66
|
+
url: `${requestUrl}${querystring}`,
|
|
60
67
|
headers: {
|
|
61
68
|
'accept': 'application/json;odata=nometadata'
|
|
62
69
|
},
|
|
@@ -76,6 +83,26 @@ class SpoListGetCommand extends SpoCommand_1.default {
|
|
|
76
83
|
}
|
|
77
84
|
});
|
|
78
85
|
}
|
|
86
|
+
formatSelectProperties(properties, withPermissions) {
|
|
87
|
+
const selectProperties = [];
|
|
88
|
+
let expandProperties = [];
|
|
89
|
+
if (withPermissions) {
|
|
90
|
+
expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings'];
|
|
91
|
+
}
|
|
92
|
+
if (properties) {
|
|
93
|
+
properties.split(',').forEach((property) => {
|
|
94
|
+
const subparts = property.trim().split('/');
|
|
95
|
+
if (subparts.length > 1) {
|
|
96
|
+
expandProperties.push(subparts[0]);
|
|
97
|
+
}
|
|
98
|
+
selectProperties.push(property.trim());
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
selectProperties: [...new Set(selectProperties)],
|
|
103
|
+
expandProperties: [...new Set(expandProperties)]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
79
106
|
}
|
|
80
107
|
_SpoListGetCommand_instances = new WeakSet(), _SpoListGetCommand_initTelemetry = function _SpoListGetCommand_initTelemetry() {
|
|
81
108
|
this.telemetry.push((args) => {
|