@pnp/cli-microsoft365 10.1.0-beta.f17d225 → 10.2.0-beta.382f561
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.cjs +2 -0
- package/README.md +2 -2
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/AuthServer.js +1 -1
- package/dist/Command.js +2 -2
- package/dist/cli/cli.js +2 -2
- package/dist/m365/base/AppCommand.js +5 -2
- package/dist/m365/commands/login.js +3 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +18 -4
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +34 -2
- package/dist/m365/entra/commands/app/app-get.js +17 -5
- package/dist/m365/entra/commands/app/app-list.js +34 -2
- package/dist/m365/entra/commands/app/app-permission-remove.js +8 -1
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +3 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +3 -0
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +3 -0
- package/dist/m365/entra/commands/group/group-get.js +6 -3
- package/dist/m365/entra/commands/group/group-list.js +16 -1
- package/dist/m365/entra/commands/m365group/m365group-add.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +21 -6
- package/dist/m365/entra/commands/m365group/m365group-get.js +29 -7
- package/dist/m365/entra/commands/m365group/m365group-list.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-remove.js +21 -9
- package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -7
- package/dist/m365/entra/commands/m365group/m365group-set.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +12 -21
- package/dist/m365/entra/commands/roledefinition/roledefinition-get.js +58 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-list.js +50 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-remove.js +74 -0
- package/dist/m365/entra/commands.js +3 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +3 -4
- package/dist/m365/file/commands/file-add.js +5 -6
- package/dist/m365/graph/commands/subscription/subscription-add.js +46 -5
- package/dist/m365/pp/commands/{chatbot/chatbot-get.js → copilot/copilot-get.js} +24 -20
- package/dist/m365/pp/commands/{chatbot/chatbot-list.js → copilot/copilot-list.js} +16 -12
- package/dist/m365/pp/commands/{chatbot/chatbot-remove.js → copilot/copilot-remove.js} +28 -24
- package/dist/m365/pp/commands.js +3 -0
- package/dist/m365/spe/ContainerProperties.js +2 -0
- package/dist/m365/spe/commands/container/container-list.js +87 -0
- package/dist/m365/spe/commands/containertype/containertype-get.js +103 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +2 -22
- package/dist/m365/spe/commands.js +2 -0
- package/dist/m365/spfx/commands/package/package-generate.js +1 -1
- package/dist/m365/spfx/commands/project/JsonRule.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.js +2 -2
- package/dist/m365/spfx/commands/spfx-doctor.js +1 -1
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +2 -2
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +6 -3
- package/dist/m365/spo/commands/file/file-add.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/list/list-contenttype-list.js +5 -2
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +10 -8
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +1 -1
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +1 -2
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +1 -2
- package/dist/m365/spo/commands/page/page-add.js +1 -1
- package/dist/m365/spo/commands/site/site-admin-add.js +4 -12
- package/dist/m365/spo/commands/site/site-admin-list.js +3 -11
- package/dist/m365/spo/commands/site/site-admin-remove.js +4 -12
- package/dist/m365/spo/commands/site/site-set.js +1 -1
- package/dist/m365/spp/commands/model/model-remove.js +105 -0
- package/dist/m365/spp/commands.js +2 -1
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/tenant/commands/people/people-pronouns-get.js +32 -0
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +2 -8
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +2 -8
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +2 -8
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/list/list-remove.js +2 -1
- package/dist/m365/todo/commands/list/list-set.js +2 -1
- package/dist/m365/todo/commands/task/task-add.js +2 -1
- package/dist/m365/todo/commands/task/task-get.js +2 -1
- package/dist/m365/todo/commands/task/task-list.js +2 -1
- package/dist/m365/todo/commands/task/task-remove.js +2 -1
- package/dist/m365/todo/commands/task/task-set.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-set.js +111 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/entraAdministrativeUnit.js +14 -2
- package/dist/utils/entraGroup.js +49 -6
- package/dist/utils/formatting.js +8 -20
- package/dist/utils/roleDefinition.js +30 -3
- package/dist/utils/spo.js +23 -4
- package/dist/utils/spp.js +3 -3
- package/dist/utils/urlUtil.js +11 -14
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +10 -3
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +16 -1
- package/docs/docs/cmd/entra/app/app-get.mdx +13 -8
- package/docs/docs/cmd/entra/app/app-list.mdx +16 -1
- package/docs/docs/cmd/entra/group/group-get.mdx +10 -3
- package/docs/docs/cmd/entra/group/group-list.mdx +9 -2
- package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +12 -3
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +29 -5
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +7 -4
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +11 -2
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +12 -3
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +2 -2
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +6 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +3 -3
- package/docs/docs/cmd/entra/roledefinition/roledefinition-get.mdx +150 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-list.mdx +148 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-remove.mdx +52 -0
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +30 -5
- package/docs/docs/cmd/login.mdx +45 -44
- package/docs/docs/cmd/pp/{chatbot/chatbot-get.mdx → copilot/copilot-get.mdx} +24 -18
- package/docs/docs/cmd/pp/{chatbot/chatbot-list.mdx → copilot/copilot-list.mdx} +20 -14
- package/docs/docs/cmd/pp/{chatbot/chatbot-remove.mdx → copilot/copilot-remove.mdx} +16 -10
- package/docs/docs/cmd/pp/managementapp/managementapp-add.mdx +1 -1
- package/docs/docs/cmd/spe/container/container-list.mdx +97 -0
- package/docs/docs/cmd/spe/containertype/containertype-get.mdx +114 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-get.mdx +7 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +7 -1
- package/docs/docs/cmd/spo/list/list-contenttype-list.mdx +7 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +57 -0
- package/docs/docs/cmd/tenant/people/people-pronouns-get.mdx +71 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +61 -0
- package/npm-shrinkwrap.json +8 -2
- package/package.json +4 -2
- package/dist/m365/spe/ContainerTypeProperties.js +0 -2
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoContentTypeListCommand_instances, _SpoContentTypeListCommand_initTelemetry, _SpoContentTypeListCommand_initOptions, _SpoContentTypeListCommand_initValidators;
|
|
6
|
+
var _SpoContentTypeListCommand_instances, _SpoContentTypeListCommand_initTelemetry, _SpoContentTypeListCommand_initOptions, _SpoContentTypeListCommand_initValidators, _SpoContentTypeListCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -25,12 +25,13 @@ class SpoContentTypeListCommand extends SpoCommand {
|
|
|
25
25
|
__classPrivateFieldGet(this, _SpoContentTypeListCommand_instances, "m", _SpoContentTypeListCommand_initTelemetry).call(this);
|
|
26
26
|
__classPrivateFieldGet(this, _SpoContentTypeListCommand_instances, "m", _SpoContentTypeListCommand_initOptions).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _SpoContentTypeListCommand_instances, "m", _SpoContentTypeListCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoContentTypeListCommand_instances, "m", _SpoContentTypeListCommand_initTypes).call(this);
|
|
28
29
|
}
|
|
29
30
|
async commandAction(logger, args) {
|
|
30
31
|
try {
|
|
31
|
-
let requestUrl = `${args.options.webUrl}/_api/web/ContentTypes`;
|
|
32
|
+
let requestUrl = `${args.options.webUrl}/_api/web/ContentTypes?$expand=Parent`;
|
|
32
33
|
if (args.options.category) {
|
|
33
|
-
requestUrl +=
|
|
34
|
+
requestUrl += `&$filter=Group eq '${formatting.encodeQueryParameter(args.options.category)}'`;
|
|
34
35
|
}
|
|
35
36
|
const res = await odata.getAllItems(requestUrl);
|
|
36
37
|
await logger.log(res);
|
|
@@ -54,6 +55,8 @@ _SpoContentTypeListCommand_instances = new WeakSet(), _SpoContentTypeListCommand
|
|
|
54
55
|
});
|
|
55
56
|
}, _SpoContentTypeListCommand_initValidators = function _SpoContentTypeListCommand_initValidators() {
|
|
56
57
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
58
|
+
}, _SpoContentTypeListCommand_initTypes = function _SpoContentTypeListCommand_initTypes() {
|
|
59
|
+
this.types.string.push('webUrl', 'category');
|
|
57
60
|
};
|
|
58
61
|
export default new SpoContentTypeListCommand();
|
|
59
62
|
//# sourceMappingURL=contenttype-list.js.map
|
|
@@ -283,7 +283,7 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
283
283
|
const isLastChunk = info.Position >= info.Size;
|
|
284
284
|
if (isLastChunk) {
|
|
285
285
|
// trim buffer for last chunk
|
|
286
|
-
fileBuffer = fileBuffer.
|
|
286
|
+
fileBuffer = fileBuffer.subarray(0, readCount);
|
|
287
287
|
}
|
|
288
288
|
const requestOptions = {
|
|
289
289
|
url: `${info.WebUrl}/_api/web/GetFolderByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(info.FolderPath)}')/Files('${formatting.encodeQueryParameter(info.Name)}')/${isLastChunk ? 'Finish' : 'Continue'}Upload(uploadId=guid'${info.Id}',fileOffset=${offset})`,
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileRetentionLabelEnsureCommand_instances, _SpoFileRetentionLabelEnsureCommand_initTelemetry, _SpoFileRetentionLabelEnsureCommand_initOptions, _SpoFileRetentionLabelEnsureCommand_initValidators, _SpoFileRetentionLabelEnsureCommand_initOptionSets, _SpoFileRetentionLabelEnsureCommand_initTypes;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { validation } from '../../../../utils/validation.js';
|
|
10
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -31,7 +30,7 @@ class SpoFileRetentionLabelEnsureCommand extends SpoCommand {
|
|
|
31
30
|
async commandAction(logger, args) {
|
|
32
31
|
try {
|
|
33
32
|
const fileProperties = await this.getFileProperties(logger, args);
|
|
34
|
-
const parsedUrl =
|
|
33
|
+
const parsedUrl = new URL(args.options.webUrl);
|
|
35
34
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
36
35
|
const listAbsoluteUrl = urlUtil.urlCombine(tenantUrl, fileProperties.listServerRelativeUrl);
|
|
37
36
|
if (args.options.assetId) {
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoFileRetentionLabelRemoveCommand_instances, _SpoFileRetentionLabelRemoveCommand_initTelemetry, _SpoFileRetentionLabelRemoveCommand_initOptions, _SpoFileRetentionLabelRemoveCommand_initValidators, _SpoFileRetentionLabelRemoveCommand_initOptionSets, _SpoFileRetentionLabelRemoveCommand_initTypes;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -43,7 +42,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand {
|
|
|
43
42
|
async removeFileRetentionLabel(logger, args) {
|
|
44
43
|
try {
|
|
45
44
|
const fileProperties = await this.getFileProperties(logger, args);
|
|
46
|
-
const parsedUrl =
|
|
45
|
+
const parsedUrl = new URL(args.options.webUrl);
|
|
47
46
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
48
47
|
const listAbsoluteUrl = urlUtil.urlCombine(tenantUrl, fileProperties.listServerRelativeUrl);
|
|
49
48
|
await spo.removeRetentionLabelFromListItems(args.options.webUrl, listAbsoluteUrl, [parseInt(fileProperties.listItemId)], logger, args.options.verbose);
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoFolderRetentionLabelEnsureCommand_instances, _SpoFolderRetentionLabelEnsureCommand_initTelemetry, _SpoFolderRetentionLabelEnsureCommand_initOptions, _SpoFolderRetentionLabelEnsureCommand_initValidators, _SpoFolderRetentionLabelEnsureCommand_initOptionSets, _SpoFolderRetentionLabelEnsureCommand_initTypes;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -32,7 +31,7 @@ class SpoFolderRetentionLabelEnsureCommand extends SpoCommand {
|
|
|
32
31
|
try {
|
|
33
32
|
const folderProperties = await this.getFolderProperties(logger, args);
|
|
34
33
|
if (folderProperties.ListItemAllFields) {
|
|
35
|
-
const parsedUrl =
|
|
34
|
+
const parsedUrl = new URL(args.options.webUrl);
|
|
36
35
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
37
36
|
const listAbsoluteUrl = urlUtil.urlCombine(tenantUrl, folderProperties.ListItemAllFields.ParentList.RootFolder.ServerRelativeUrl);
|
|
38
37
|
await spo.applyRetentionLabelToListItems(args.options.webUrl, args.options.name, listAbsoluteUrl, [parseInt(folderProperties.ListItemAllFields.Id)], logger, args.options.verbose);
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoFolderRetentionLabelRemoveCommand_instances, _SpoFolderRetentionLabelRemoveCommand_initTelemetry, _SpoFolderRetentionLabelRemoveCommand_initOptions, _SpoFolderRetentionLabelRemoveCommand_initValidators, _SpoFolderRetentionLabelRemoveCommand_initOptionSets, _SpoFolderRetentionLabelRemoveCommand_initTypes;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -44,7 +43,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand {
|
|
|
44
43
|
try {
|
|
45
44
|
const folderProperties = await this.getFolderProperties(logger, args);
|
|
46
45
|
if (folderProperties.ListItemAllFields) {
|
|
47
|
-
const parsedUrl =
|
|
46
|
+
const parsedUrl = new URL(args.options.webUrl);
|
|
48
47
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
49
48
|
const listAbsoluteUrl = urlUtil.urlCombine(tenantUrl, folderProperties.ListItemAllFields.ParentList.RootFolder.ServerRelativeUrl);
|
|
50
49
|
await spo.removeRetentionLabelFromListItems(args.options.webUrl, listAbsoluteUrl, [parseInt(folderProperties.ListItemAllFields.Id)], logger, args.options.verbose);
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoListContentTypeListCommand_instances, _SpoListContentTypeListCommand_initTelemetry, _SpoListContentTypeListCommand_initOptions, _SpoListContentTypeListCommand_initValidators, _SpoListContentTypeListCommand_initOptionSets;
|
|
6
|
+
var _SpoListContentTypeListCommand_instances, _SpoListContentTypeListCommand_initTelemetry, _SpoListContentTypeListCommand_initOptions, _SpoListContentTypeListCommand_initValidators, _SpoListContentTypeListCommand_initOptionSets, _SpoListContentTypeListCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -27,6 +27,7 @@ class SpoListContentTypeListCommand extends SpoCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoListContentTypeListCommand_instances, "m", _SpoListContentTypeListCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
if (this.verbose) {
|
|
@@ -45,7 +46,7 @@ class SpoListContentTypeListCommand extends SpoCommand {
|
|
|
45
46
|
requestUrl += `GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
|
|
46
47
|
}
|
|
47
48
|
try {
|
|
48
|
-
const res = await odata.getAllItems(`${requestUrl}/ContentTypes`);
|
|
49
|
+
const res = await odata.getAllItems(`${requestUrl}/ContentTypes?$expand=Parent`);
|
|
49
50
|
await logger.log(res);
|
|
50
51
|
}
|
|
51
52
|
catch (err) {
|
|
@@ -86,6 +87,8 @@ _SpoListContentTypeListCommand_instances = new WeakSet(), _SpoListContentTypeLis
|
|
|
86
87
|
});
|
|
87
88
|
}, _SpoListContentTypeListCommand_initOptionSets = function _SpoListContentTypeListCommand_initOptionSets() {
|
|
88
89
|
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
90
|
+
}, _SpoListContentTypeListCommand_initTypes = function _SpoListContentTypeListCommand_initTypes() {
|
|
91
|
+
this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl');
|
|
89
92
|
};
|
|
90
93
|
export default new SpoListContentTypeListCommand();
|
|
91
94
|
//# sourceMappingURL=list-contenttype-list.js.map
|
|
@@ -40,7 +40,8 @@ class SpoListItemBatchRemoveCommand extends SpoCommand {
|
|
|
40
40
|
if (args.options.filePath) {
|
|
41
41
|
const csvContent = fs.readFileSync(args.options.filePath, 'utf-8');
|
|
42
42
|
const jsonContent = formatting.parseCsvToJson(csvContent);
|
|
43
|
-
|
|
43
|
+
const idKey = Object.keys(jsonContent[0]).find(key => key.toLowerCase() === 'id');
|
|
44
|
+
idsToRemove = jsonContent.map((item) => item[idKey]);
|
|
44
45
|
}
|
|
45
46
|
else {
|
|
46
47
|
idsToRemove = formatting.splitAndTrim(args.options.ids);
|
|
@@ -193,18 +194,19 @@ _SpoListItemBatchRemoveCommand_instances = new WeakSet(), _SpoListItemBatchRemov
|
|
|
193
194
|
}
|
|
194
195
|
const fileContent = fs.readFileSync(args.options.filePath, 'utf-8');
|
|
195
196
|
const jsonContent = formatting.parseCsvToJson(fileContent);
|
|
196
|
-
|
|
197
|
+
const idKey = Object.keys(jsonContent[0]).find(key => key.toLowerCase() === 'id');
|
|
198
|
+
if (!idKey) {
|
|
197
199
|
return `The file does not contain the required header row with the column name 'ID'.`;
|
|
198
200
|
}
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
return `The
|
|
201
|
+
const invalidIDs = validation.isValidPositiveIntegerArray(jsonContent.map(element => element[idKey].toString().trim()).join(','));
|
|
202
|
+
if (invalidIDs !== true) {
|
|
203
|
+
return `The file contains one or more invalid IDs: '${invalidIDs}'.`;
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
if (args.options.ids) {
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
return `
|
|
207
|
+
const isValidIntegerArray = validation.isValidPositiveIntegerArray(args.options.ids);
|
|
208
|
+
if (isValidIntegerArray !== true) {
|
|
209
|
+
return `Option 'ids' contains one or more invalid IDs: '${isValidIntegerArray}'.`;
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
return true;
|
|
@@ -117,7 +117,7 @@ class SpoListItemBatchSetCommand extends SpoCommand {
|
|
|
117
117
|
actionString += `<Method Name="SetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="Array">${lookupMultiString.join('')}</Parameter></Parameters></Method>`;
|
|
118
118
|
break;
|
|
119
119
|
default:
|
|
120
|
-
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${row[field.InternalName].toString()}</Parameter></Parameters></Method>`;
|
|
120
|
+
actionString += `<Method Name="ParseAndSetFieldValue" Id="${index += 1}" ObjectPathId="${objectPathId}"><Parameters><Parameter Type="String">${field.InternalName}</Parameter><Parameter Type="String">${formatting.escapeXml(row[field.InternalName].toString())}</Parameter></Parameters></Method>`;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoListItemRetentionLabelEnsureCommand_instances, _SpoListItemRetentionLabelEnsureCommand_initTelemetry, _SpoListItemRetentionLabelEnsureCommand_initOptions, _SpoListItemRetentionLabelEnsureCommand_initValidators, _SpoListItemRetentionLabelEnsureCommand_initOptionSets;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -60,7 +59,7 @@ class SpoListItemRetentionLabelEnsureCommand extends SpoCommand {
|
|
|
60
59
|
return label.TagName;
|
|
61
60
|
}
|
|
62
61
|
async getListAbsoluteUrl(options, logger) {
|
|
63
|
-
const parsedUrl =
|
|
62
|
+
const parsedUrl = new URL(options.webUrl);
|
|
64
63
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
65
64
|
if (options.listUrl) {
|
|
66
65
|
const serverRelativePath = urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoListItemRetentionLabelRemoveCommand_instances, _SpoListItemRetentionLabelRemoveCommand_initTelemetry, _SpoListItemRetentionLabelRemoveCommand_initOptions, _SpoListItemRetentionLabelRemoveCommand_initValidators, _SpoListItemRetentionLabelRemoveCommand_initOptionSets;
|
|
7
|
-
import * as url from 'url';
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -49,7 +48,7 @@ class SpoListItemRetentionLabelRemoveCommand extends SpoCommand {
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
async getListAbsoluteUrl(options, logger) {
|
|
52
|
-
const parsedUrl =
|
|
51
|
+
const parsedUrl = new URL(options.webUrl);
|
|
53
52
|
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
54
53
|
if (options.listUrl) {
|
|
55
54
|
const serverRelativePath = urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
@@ -34,7 +34,7 @@ class SpoPageAddCommand extends SpoCommand {
|
|
|
34
34
|
let bannerImageUrl = '';
|
|
35
35
|
let canvasContent1 = '';
|
|
36
36
|
let layoutWebpartsContent = '';
|
|
37
|
-
const pageTitle = args.options.title ? args.options.title : (args.options.name.indexOf('.aspx') > -1 ? args.options.name.
|
|
37
|
+
const pageTitle = args.options.title ? args.options.title : (args.options.name.indexOf('.aspx') > -1 ? args.options.name.substring(0, args.options.name.indexOf('.aspx')) : args.options.name);
|
|
38
38
|
let pageId = null;
|
|
39
39
|
const pageDescription = args.options.description || "";
|
|
40
40
|
if (!pageName.endsWith('.aspx')) {
|
|
@@ -47,22 +47,14 @@ class SpoSiteAdminAddCommand extends SpoCommand {
|
|
|
47
47
|
await logger.logToStderr('Adding site administrator as an administrator...');
|
|
48
48
|
}
|
|
49
49
|
const adminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
50
|
-
const
|
|
51
|
-
const siteAdmins = (await this.getSiteAdmins(adminUrl,
|
|
50
|
+
const tenantSiteProperties = await spo.getSiteAdminPropertiesByUrl(args.options.siteUrl, false, logger, this.verbose);
|
|
51
|
+
const siteAdmins = (await this.getSiteAdmins(adminUrl, tenantSiteProperties.SiteId)).map(u => u.loginName);
|
|
52
52
|
siteAdmins.push(loginNameToAdd);
|
|
53
|
-
await this.setSiteAdminsAsAdmin(adminUrl,
|
|
53
|
+
await this.setSiteAdminsAsAdmin(adminUrl, tenantSiteProperties.SiteId, siteAdmins);
|
|
54
54
|
if (args.options.primary) {
|
|
55
|
-
await this.setPrimaryAdminAsAdmin(adminUrl,
|
|
55
|
+
await this.setPrimaryAdminAsAdmin(adminUrl, tenantSiteProperties.SiteId, loginNameToAdd);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
async getSiteIdBasedOnUrl(siteUrl, logger) {
|
|
59
|
-
const siteGraphId = await spo.getSiteId(siteUrl, logger, this.verbose);
|
|
60
|
-
const match = siteGraphId.match(/,([a-f0-9\-]{36}),/i);
|
|
61
|
-
if (!match) {
|
|
62
|
-
throw `Site with URL ${siteUrl} not found`;
|
|
63
|
-
}
|
|
64
|
-
return match[1];
|
|
65
|
-
}
|
|
66
58
|
async getSiteAdmins(adminUrl, siteId) {
|
|
67
59
|
const requestOptions = {
|
|
68
60
|
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${siteId}'`,
|
|
@@ -45,16 +45,16 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
45
45
|
await logger.logToStderr('Retrieving site administrators as an administrator...');
|
|
46
46
|
}
|
|
47
47
|
const adminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
48
|
-
const
|
|
48
|
+
const tenantSiteProperties = await spo.getSiteAdminPropertiesByUrl(args.options.siteUrl, false, logger, this.verbose);
|
|
49
49
|
const requestOptions = {
|
|
50
|
-
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${
|
|
50
|
+
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${tenantSiteProperties.SiteId}'`,
|
|
51
51
|
headers: {
|
|
52
52
|
accept: 'application/json;odata=nometadata'
|
|
53
53
|
},
|
|
54
54
|
responseType: 'json'
|
|
55
55
|
};
|
|
56
56
|
const response = await request.post(requestOptions);
|
|
57
|
-
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl,
|
|
57
|
+
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, tenantSiteProperties.SiteId, logger, this.verbose);
|
|
58
58
|
const mappedResult = response.value.map((u) => ({
|
|
59
59
|
Email: u.email,
|
|
60
60
|
LoginName: u.loginName,
|
|
@@ -63,14 +63,6 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
63
63
|
}));
|
|
64
64
|
await logger.log(mappedResult);
|
|
65
65
|
}
|
|
66
|
-
async getSiteId(siteUrl, logger) {
|
|
67
|
-
const siteGraphId = await spo.getSiteId(siteUrl, logger, this.verbose);
|
|
68
|
-
const match = siteGraphId.match(/,([a-f0-9\-]{36}),/i);
|
|
69
|
-
if (!match) {
|
|
70
|
-
throw `Site with URL ${siteUrl} not found`;
|
|
71
|
-
}
|
|
72
|
-
return match[1];
|
|
73
|
-
}
|
|
74
66
|
async callAction(logger, args) {
|
|
75
67
|
if (this.verbose) {
|
|
76
68
|
await logger.logToStderr('Retrieving site administrators...');
|
|
@@ -54,22 +54,14 @@ class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
|
54
54
|
await logger.logToStderr('Removing site administrator as an administrator...');
|
|
55
55
|
}
|
|
56
56
|
const adminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
57
|
-
const
|
|
58
|
-
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl,
|
|
57
|
+
const tenantSiteProperties = await spo.getSiteAdminPropertiesByUrl(args.options.siteUrl, false, logger, this.verbose);
|
|
58
|
+
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, tenantSiteProperties.SiteId, logger, this.verbose);
|
|
59
59
|
if (loginNameToRemove === primaryAdminLoginName) {
|
|
60
60
|
throw 'You cannot remove the primary site collection administrator.';
|
|
61
61
|
}
|
|
62
|
-
const existingAdmins = await this.getSiteAdmins(adminUrl,
|
|
62
|
+
const existingAdmins = await this.getSiteAdmins(adminUrl, tenantSiteProperties.SiteId);
|
|
63
63
|
const adminsToSet = existingAdmins.filter(u => u.loginName.toLowerCase() !== loginNameToRemove.toLowerCase());
|
|
64
|
-
await this.setSiteAdminsAsAdmin(adminUrl,
|
|
65
|
-
}
|
|
66
|
-
async getSiteId(siteUrl, logger) {
|
|
67
|
-
const siteGraphId = await spo.getSiteId(siteUrl, logger, this.verbose);
|
|
68
|
-
const match = siteGraphId.match(/,([a-f0-9\-]{36}),/i);
|
|
69
|
-
if (!match) {
|
|
70
|
-
throw `Site with URL ${siteUrl} not found`;
|
|
71
|
-
}
|
|
72
|
-
return match[1];
|
|
64
|
+
await this.setSiteAdminsAsAdmin(adminUrl, tenantSiteProperties.SiteId, adminsToSet);
|
|
73
65
|
}
|
|
74
66
|
async getSiteAdmins(adminUrl, siteId) {
|
|
75
67
|
const requestOptions = {
|
|
@@ -373,7 +373,7 @@ class SpoSiteSetCommand extends SpoCommand {
|
|
|
373
373
|
headers: {
|
|
374
374
|
'X-RequestDigest': this.context.FormDigestValue
|
|
375
375
|
},
|
|
376
|
-
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions>${payload.join('')}<ObjectPath Id="14" ObjectPathId="13" /><ObjectIdentityQuery Id="15" ObjectPathId="5" /><Query Id="16" ObjectPathId="13"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Identity Id="5" Name="53d8499e-d0d2-5000-cb83-9ade5be42ca4|${this.tenantId.
|
|
376
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions>${payload.join('')}<ObjectPath Id="14" ObjectPathId="13" /><ObjectIdentityQuery Id="15" ObjectPathId="5" /><Query Id="16" ObjectPathId="13"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Identity Id="5" Name="53d8499e-d0d2-5000-cb83-9ade5be42ca4|${this.tenantId.substring(pos, this.tenantId.indexOf('&'))}
SiteProperties
${formatting.encodeQueryParameter(args.options.url)}" /><Method Id="13" ParentId="5" Name="Update" /></ObjectPaths></Request>`
|
|
377
377
|
};
|
|
378
378
|
response = await request.post(requestOptions);
|
|
379
379
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
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");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _SppModelRemoveCommand_instances, _SppModelRemoveCommand_initTelemetry, _SppModelRemoveCommand_initOptions, _SppModelRemoveCommand_initValidators, _SppModelRemoveCommand_initOptionSets, _SppModelRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { spp } from '../../../../utils/spp.js';
|
|
11
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
|
+
import commands from '../../commands.js';
|
|
15
|
+
class SppModelRemoveCommand extends SpoCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.MODEL_REMOVE;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Deletes a document understanding model';
|
|
21
|
+
}
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SppModelRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SppModelRemoveCommand_instances, "m", _SppModelRemoveCommand_initTypes).call(this);
|
|
30
|
+
}
|
|
31
|
+
async commandAction(logger, args) {
|
|
32
|
+
try {
|
|
33
|
+
if (!args.options.force) {
|
|
34
|
+
const confirmationResult = await cli.promptForConfirmation({ message: `Are you sure you want to remove model '${args.options.title ?? args.options.id}'?` });
|
|
35
|
+
if (!confirmationResult) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
await logger.log(`Removing model from ${args.options.siteUrl}...`);
|
|
41
|
+
}
|
|
42
|
+
const siteUrl = urlUtil.removeTrailingSlashes(args.options.siteUrl);
|
|
43
|
+
await spp.assertSiteIsContentCenter(siteUrl);
|
|
44
|
+
let requestUrl = `${siteUrl}/_api/machinelearning/models/`;
|
|
45
|
+
if (args.options.title) {
|
|
46
|
+
let requestTitle = args.options.title.toLowerCase();
|
|
47
|
+
if (!requestTitle.endsWith('.classifier')) {
|
|
48
|
+
requestTitle += '.classifier';
|
|
49
|
+
}
|
|
50
|
+
requestUrl += `getbytitle('${formatting.encodeQueryParameter(requestTitle)}')`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
requestUrl += `getbyuniqueid('${args.options.id}')`;
|
|
54
|
+
}
|
|
55
|
+
const requestOptions = {
|
|
56
|
+
url: requestUrl,
|
|
57
|
+
headers: {
|
|
58
|
+
accept: 'application/json;odata=nometadata',
|
|
59
|
+
'if-match': '*'
|
|
60
|
+
},
|
|
61
|
+
responseType: 'json'
|
|
62
|
+
};
|
|
63
|
+
const result = await request.delete(requestOptions);
|
|
64
|
+
if (result?.['odata.null'] === true) {
|
|
65
|
+
throw "Model not found.";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.handleRejectedODataJsonPromise(err);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
_SppModelRemoveCommand_instances = new WeakSet(), _SppModelRemoveCommand_initTelemetry = function _SppModelRemoveCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
id: typeof args.options.id !== 'undefined',
|
|
77
|
+
title: typeof args.options.title !== 'undefined',
|
|
78
|
+
force: !!args.options.force
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}, _SppModelRemoveCommand_initOptions = function _SppModelRemoveCommand_initOptions() {
|
|
82
|
+
this.options.unshift({
|
|
83
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
84
|
+
}, {
|
|
85
|
+
option: '-i, --id [id]'
|
|
86
|
+
}, {
|
|
87
|
+
option: '-t, --title [title]'
|
|
88
|
+
}, {
|
|
89
|
+
option: '-f, --force'
|
|
90
|
+
});
|
|
91
|
+
}, _SppModelRemoveCommand_initValidators = function _SppModelRemoveCommand_initValidators() {
|
|
92
|
+
this.validators.push(async (args) => {
|
|
93
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
94
|
+
return `${args.options.id} is not a valid GUID for option 'id'.`;
|
|
95
|
+
}
|
|
96
|
+
return validation.isValidSharePointUrl(args.options.siteUrl);
|
|
97
|
+
});
|
|
98
|
+
}, _SppModelRemoveCommand_initOptionSets = function _SppModelRemoveCommand_initOptionSets() {
|
|
99
|
+
this.optionSets.push({ options: ['id', 'title'] });
|
|
100
|
+
}, _SppModelRemoveCommand_initTypes = function _SppModelRemoveCommand_initTypes() {
|
|
101
|
+
this.types.string.push('siteUrl', 'id', 'title');
|
|
102
|
+
this.types.boolean.push('force');
|
|
103
|
+
};
|
|
104
|
+
export default new SppModelRemoveCommand();
|
|
105
|
+
//# sourceMappingURL=model-remove.js.map
|
|
@@ -33,7 +33,7 @@ class TeamsUserAppListCommand extends GraphCommand {
|
|
|
33
33
|
const items = await odata.getAllItems(endpoint);
|
|
34
34
|
items.forEach(i => {
|
|
35
35
|
const userAppId = Buffer.from(i.id, 'base64').toString('ascii');
|
|
36
|
-
const appId = userAppId.
|
|
36
|
+
const appId = userAppId.substring(userAppId.indexOf("##") + 2, userAppId.length);
|
|
37
37
|
i.appId = appId;
|
|
38
38
|
});
|
|
39
39
|
if (!cli.shouldTrimOutput(args.options.output)) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import request from '../../../../request.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
class TenantPeoplePronounsGetCommand extends GraphCommand {
|
|
5
|
+
get name() {
|
|
6
|
+
return commands.PEOPLE_PRONOUNS_GET;
|
|
7
|
+
}
|
|
8
|
+
get description() {
|
|
9
|
+
return 'Retrieves information about pronouns settings for an organization';
|
|
10
|
+
}
|
|
11
|
+
async commandAction(logger) {
|
|
12
|
+
try {
|
|
13
|
+
if (this.verbose) {
|
|
14
|
+
await logger.logToStderr('Retrieving information about pronouns settings...');
|
|
15
|
+
}
|
|
16
|
+
const requestOptions = {
|
|
17
|
+
url: `${this.resource}/v1.0/admin/people/pronouns`,
|
|
18
|
+
headers: {
|
|
19
|
+
accept: 'application/json;odata.metadata=none'
|
|
20
|
+
},
|
|
21
|
+
responseType: 'json'
|
|
22
|
+
};
|
|
23
|
+
const pronouns = await request.get(requestOptions);
|
|
24
|
+
await logger.log(pronouns);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleRejectedODataJsonPromise(err);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export default new TenantPeoplePronounsGetCommand();
|
|
32
|
+
//# sourceMappingURL=people-pronouns-get.js.map
|
|
@@ -27,12 +27,11 @@ class TenantReportOffice365ActivationCountsCommand extends GraphCommand {
|
|
|
27
27
|
try {
|
|
28
28
|
const res = await request.get(requestOptions);
|
|
29
29
|
let content = '';
|
|
30
|
-
const cleanResponse = this.removeEmptyLines(res);
|
|
31
30
|
if (output && output.toLowerCase() === 'json') {
|
|
32
|
-
content = formatting.parseCsvToJson(
|
|
31
|
+
content = formatting.parseCsvToJson(res);
|
|
33
32
|
}
|
|
34
33
|
else {
|
|
35
|
-
content =
|
|
34
|
+
content = res;
|
|
36
35
|
}
|
|
37
36
|
await logger.log(content);
|
|
38
37
|
}
|
|
@@ -40,11 +39,6 @@ class TenantReportOffice365ActivationCountsCommand extends GraphCommand {
|
|
|
40
39
|
this.handleRejectedODataJsonPromise(err);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
removeEmptyLines(input) {
|
|
44
|
-
const rows = input.split('\n');
|
|
45
|
-
const cleanRows = rows.filter(Boolean);
|
|
46
|
-
return cleanRows.join('\n');
|
|
47
|
-
}
|
|
48
42
|
}
|
|
49
43
|
export default new TenantReportOffice365ActivationCountsCommand();
|
|
50
44
|
//# sourceMappingURL=report-office365activationcounts.js.map
|
|
@@ -27,12 +27,11 @@ class TenantReportOffice365ActivationsUserCountsCommand extends GraphCommand {
|
|
|
27
27
|
try {
|
|
28
28
|
const res = await request.get(requestOptions);
|
|
29
29
|
let content = '';
|
|
30
|
-
const cleanResponse = this.removeEmptyLines(res);
|
|
31
30
|
if (output && output.toLowerCase() === 'json') {
|
|
32
|
-
content = formatting.parseCsvToJson(
|
|
31
|
+
content = formatting.parseCsvToJson(res);
|
|
33
32
|
}
|
|
34
33
|
else {
|
|
35
|
-
content =
|
|
34
|
+
content = res;
|
|
36
35
|
}
|
|
37
36
|
await logger.log(content);
|
|
38
37
|
}
|
|
@@ -40,11 +39,6 @@ class TenantReportOffice365ActivationsUserCountsCommand extends GraphCommand {
|
|
|
40
39
|
this.handleRejectedODataJsonPromise(err);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
removeEmptyLines(input) {
|
|
44
|
-
const rows = input.split('\n');
|
|
45
|
-
const cleanRows = rows.filter(Boolean);
|
|
46
|
-
return cleanRows.join('\n');
|
|
47
|
-
}
|
|
48
42
|
}
|
|
49
43
|
export default new TenantReportOffice365ActivationsUserCountsCommand();
|
|
50
44
|
//# sourceMappingURL=report-office365activationsusercounts.js.map
|
|
@@ -27,12 +27,11 @@ class TenantReportOffice365ActivationsUserDetailCommand extends GraphCommand {
|
|
|
27
27
|
try {
|
|
28
28
|
const res = await request.get(requestOptions);
|
|
29
29
|
let content = '';
|
|
30
|
-
const cleanResponse = this.removeEmptyLines(res);
|
|
31
30
|
if (output && output.toLowerCase() === 'json') {
|
|
32
|
-
content = formatting.parseCsvToJson(
|
|
31
|
+
content = formatting.parseCsvToJson(res);
|
|
33
32
|
}
|
|
34
33
|
else {
|
|
35
|
-
content =
|
|
34
|
+
content = res;
|
|
36
35
|
}
|
|
37
36
|
await logger.log(content);
|
|
38
37
|
}
|
|
@@ -40,11 +39,6 @@ class TenantReportOffice365ActivationsUserDetailCommand extends GraphCommand {
|
|
|
40
39
|
this.handleRejectedODataJsonPromise(err);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
removeEmptyLines(input) {
|
|
44
|
-
const rows = input.split('\n');
|
|
45
|
-
const cleanRows = rows.filter(Boolean);
|
|
46
|
-
return cleanRows.join('\n');
|
|
47
|
-
}
|
|
48
42
|
}
|
|
49
43
|
export default new TenantReportOffice365ActivationsUserDetailCommand();
|
|
50
44
|
//# sourceMappingURL=report-office365activationsuserdetail.js.map
|
|
@@ -7,6 +7,7 @@ export default {
|
|
|
7
7
|
PEOPLE_PROFILECARDPROPERTY_LIST: `${prefix} people profilecardproperty list`,
|
|
8
8
|
PEOPLE_PROFILECARDPROPERTY_REMOVE: `${prefix} people profilecardproperty remove`,
|
|
9
9
|
PEOPLE_PROFILECARDPROPERTY_SET: `${prefix} people profilecardproperty set`,
|
|
10
|
+
PEOPLE_PRONOUNS_GET: `${prefix} people pronouns get`,
|
|
10
11
|
REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
|
|
11
12
|
REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
|
|
12
13
|
REPORT_OFFICE365ACTIVATIONCOUNTS: `${prefix} report office365activationcounts`,
|
|
@@ -6,6 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _TodoListRemoveCommand_instances, _TodoListRemoveCommand_initTelemetry, _TodoListRemoveCommand_initOptions, _TodoListRemoveCommand_initOptionSets;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import DelegatedGraphCommand from '../../../base/DelegatedGraphCommand.js';
|
|
10
11
|
import commands from '../../commands.js';
|
|
11
12
|
class TodoListRemoveCommand extends DelegatedGraphCommand {
|
|
@@ -38,7 +39,7 @@ class TodoListRemoveCommand extends DelegatedGraphCommand {
|
|
|
38
39
|
return args.options.id;
|
|
39
40
|
}
|
|
40
41
|
const requestOptions = {
|
|
41
|
-
url: `${this.resource}/v1.0/me/todo/lists?$filter=displayName eq '${
|
|
42
|
+
url: `${this.resource}/v1.0/me/todo/lists?$filter=displayName eq '${formatting.encodeQueryParameter(args.options.name)}'`,
|
|
42
43
|
headers: {
|
|
43
44
|
accept: "application/json;odata.metadata=none"
|
|
44
45
|
},
|