@pnp/cli-microsoft365 9.0.0-beta.2f8dd1e → 9.0.0-beta.33615bd
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 +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -18
- package/dist/Command.js +49 -2
- package/dist/chili/chili.js +0 -23
- package/dist/cli/cli.js +61 -101
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/commands/login.js +44 -96
- package/dist/m365/commands/setup.js +0 -4
- package/dist/m365/connection/commands/connection-remove.js +6 -2
- package/dist/m365/connection/commands/connection-set.js +4 -1
- package/dist/m365/connection/commands/connection-use.js +25 -4
- package/dist/m365/entra/commands/group/group-user-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-set.js +66 -29
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +6 -9
- package/dist/m365/entra/commands/multitenant/MultitenantOrganization.js +2 -0
- package/dist/m365/entra/commands/multitenant/multitenant-add.js +65 -0
- package/dist/m365/entra/commands/multitenant/multitenant-get.js +32 -0
- package/dist/m365/entra/commands/multitenant/multitenant-remove.js +118 -0
- package/dist/m365/entra/commands/multitenant/multitenant-set.js +72 -0
- package/dist/m365/entra/commands.js +4 -0
- package/dist/m365/external/commands/connection/connection-doctor.js +10 -24
- package/dist/m365/flow/commands/flow-list.js +23 -24
- package/dist/m365/graph/commands/subscription/subscription-add.js +4 -2
- package/dist/m365/outlook/commands/message/message-get.js +11 -11
- package/dist/m365/spe/ContainerTypeProperties.js +2 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +49 -0
- package/dist/m365/spe/commands.js +2 -1
- package/dist/m365/spfx/commands/project/base-project-command.js +36 -126
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +16 -21
- package/dist/m365/spo/commands/cdn/cdn-get.js +12 -15
- package/dist/m365/spo/commands/cdn/cdn-set.js +6 -4
- package/dist/m365/spo/commands/commandset/commandset-get.js +31 -17
- package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +124 -0
- package/dist/m365/spo/commands/field/field-list.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/group/group-member-add.js +103 -99
- package/dist/m365/spo/commands/list/list-list.js +1 -4
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +46 -21
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +48 -46
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +2 -3
- package/dist/m365/spo/commands/page/page-text-add.js +2 -3
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
- package/dist/m365/spo/commands/spo-search.js +3 -4
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +19 -5
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +20 -6
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +119 -0
- package/dist/m365/teams/commands/message/message-remove.js +112 -0
- package/dist/m365/teams/commands.js +2 -0
- package/dist/m365/viva/commands/engage/engage-community-add.js +166 -0
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/formatting.js +30 -1
- package/dist/utils/spo.js +37 -6
- package/dist/utils/teams.js +49 -0
- package/dist/utils/validation.js +19 -0
- package/dist/utils/zod.js +124 -0
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/connection/connection-use.mdx +8 -2
- package/docs/docs/cmd/entra/group/group-user-list.mdx +7 -7
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +5 -5
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +3 -3
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +37 -7
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
- package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +107 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-get.mdx +94 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +58 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +53 -0
- package/docs/docs/cmd/external/connection/connection-doctor.mdx +9 -9
- package/docs/docs/cmd/flow/flow-list.mdx +114 -56
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +18 -0
- package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
- package/docs/docs/cmd/planner/plan/plan-remove.mdx +1 -1
- package/docs/docs/cmd/spe/containertype/containertype-list.mdx +102 -0
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +87 -38
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +22 -28
- package/docs/docs/cmd/spo/cdn/cdn-set.mdx +3 -3
- package/docs/docs/cmd/spo/commandset/commandset-get.mdx +75 -24
- package/docs/docs/cmd/spo/commandset/commandset-list.mdx +26 -32
- package/docs/docs/cmd/spo/contenttype/contenttype-field-list.mdx +172 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +3 -3
- package/docs/docs/cmd/spo/field/field-list.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +2 -2
- package/docs/docs/cmd/spo/group/group-member-add.mdx +34 -27
- package/docs/docs/cmd/spo/list/list-list.mdx +5 -7
- package/docs/docs/cmd/spo/list/list-roleassignment-add.mdx +15 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +15 -3
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.mdx +4 -4
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.mdx +9 -9
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx +7 -7
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +11 -2
- package/docs/docs/cmd/spo/site/site-recyclebinitem-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.mdx +79 -30
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +20 -19
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +84 -38
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +20 -19
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +2 -49
- package/docs/docs/cmd/spo/web/web-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/teams/meeting/meeting-attendancereport-get.mdx +138 -0
- package/docs/docs/cmd/teams/meeting/meeting-list.mdx +7 -3
- package/docs/docs/cmd/teams/message/message-remove.mdx +63 -0
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +168 -0
- package/npm-shrinkwrap.json +588 -1022
- package/package.json +7 -3
|
@@ -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 _SpoPageTextAddCommand_instances, _SpoPageTextAddCommand_initTelemetry, _SpoPageTextAddCommand_initOptions, _SpoPageTextAddCommand_initValidators;
|
|
7
|
-
import { isNumber } from 'util';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { spo } from '../../../../utils/spo.js';
|
|
10
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -119,10 +118,10 @@ _SpoPageTextAddCommand_instances = new WeakSet(), _SpoPageTextAddCommand_initTel
|
|
|
119
118
|
});
|
|
120
119
|
}, _SpoPageTextAddCommand_initValidators = function _SpoPageTextAddCommand_initValidators() {
|
|
121
120
|
this.validators.push(async (args) => {
|
|
122
|
-
if (args.options.section && (!
|
|
121
|
+
if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
|
|
123
122
|
return 'The value of parameter section must be 1 or higher';
|
|
124
123
|
}
|
|
125
|
-
if (args.options.column && (!
|
|
124
|
+
if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
|
|
126
125
|
return 'The value of parameter column must be 1 or higher';
|
|
127
126
|
}
|
|
128
127
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -3,7 +3,8 @@ 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 _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators;
|
|
6
|
+
var _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initTelemetry, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators, _SpoSiteAppCatalogRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
7
8
|
import config from '../../../../config.js';
|
|
8
9
|
import request from '../../../../request.js';
|
|
9
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -21,47 +22,70 @@ class SpoSiteAppCatalogRemoveCommand extends SpoCommand {
|
|
|
21
22
|
constructor() {
|
|
22
23
|
super();
|
|
23
24
|
_SpoSiteAppCatalogRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTelemetry).call(this);
|
|
24
26
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initOptions).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTypes).call(this);
|
|
26
29
|
}
|
|
27
30
|
async commandAction(logger, args) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
31
|
-
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
31
|
+
const removeSiteAppcatalog = async () => {
|
|
32
|
+
const url = args.options.siteUrl;
|
|
32
33
|
if (this.verbose) {
|
|
33
34
|
await logger.logToStderr(`Disabling site collection app catalog...`);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
try {
|
|
37
|
+
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
38
|
+
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
39
|
+
const requestOptions = {
|
|
40
|
+
url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
41
|
+
headers: {
|
|
42
|
+
'X-RequestDigest': requestDigest.FormDigestValue
|
|
43
|
+
},
|
|
44
|
+
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><ObjectPath Id="50" ObjectPathId="49" /><ObjectPath Id="52" ObjectPathId="51" /><ObjectPath Id="54" ObjectPathId="53" /><ObjectPath Id="56" ObjectPathId="55" /><ObjectPath Id="58" ObjectPathId="57" /><Method Name="Remove" Id="59" ObjectPathId="57"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method></Actions><ObjectPaths><Constructor Id="49" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="51" ParentId="49" Name="GetSiteByUrl"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method><Property Id="53" ParentId="51" Name="RootWeb" /><Property Id="55" ParentId="53" Name="TenantAppCatalog" /><Property Id="57" ParentId="55" Name="SiteCollectionAppCatalogsSites" /></ObjectPaths></Request>`
|
|
45
|
+
};
|
|
46
|
+
const res = await request.post(requestOptions);
|
|
47
|
+
const json = JSON.parse(res);
|
|
48
|
+
const response = json[0];
|
|
49
|
+
if (response.ErrorInfo) {
|
|
50
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
await logger.logToStderr('Site collection app catalog disabled');
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedPromise(err);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (args.options.force) {
|
|
63
|
+
await removeSiteAppcatalog();
|
|
53
64
|
}
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
else {
|
|
66
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the app catalog from ${args.options.siteUrl}?` });
|
|
67
|
+
if (result) {
|
|
68
|
+
await removeSiteAppcatalog();
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
|
-
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(),
|
|
73
|
+
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(), _SpoSiteAppCatalogRemoveCommand_initTelemetry = function _SpoSiteAppCatalogRemoveCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
force: !!args.options.force
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}, _SpoSiteAppCatalogRemoveCommand_initOptions = function _SpoSiteAppCatalogRemoveCommand_initOptions() {
|
|
60
80
|
this.options.unshift({
|
|
61
81
|
option: '-u, --siteUrl <siteUrl>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '-f, --force'
|
|
62
84
|
});
|
|
63
85
|
}, _SpoSiteAppCatalogRemoveCommand_initValidators = function _SpoSiteAppCatalogRemoveCommand_initValidators() {
|
|
64
86
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
87
|
+
}, _SpoSiteAppCatalogRemoveCommand_initTypes = function _SpoSiteAppCatalogRemoveCommand_initTypes() {
|
|
88
|
+
this.types.string.push('siteUrl');
|
|
65
89
|
};
|
|
66
90
|
export default new SpoSiteAppCatalogRemoveCommand();
|
|
67
91
|
//# sourceMappingURL=site-appcatalog-remove.js.map
|
|
@@ -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 _SpoSearchCommand_instances, _SpoSearchCommand_initTelemetry, _SpoSearchCommand_initOptions, _SpoSearchCommand_initValidators;
|
|
7
|
-
import { isNumber } from 'util';
|
|
8
7
|
import { cli } from '../../../cli/cli.js';
|
|
9
8
|
import request from '../../../request.js';
|
|
10
9
|
import { formatting } from '../../../utils/formatting.js';
|
|
@@ -266,16 +265,16 @@ _SpoSearchCommand_instances = new WeakSet(), _SpoSearchCommand_initTelemetry = f
|
|
|
266
265
|
if (args.options.sortList && !/^([a-z0-9_]+:(ascending|descending))(,([a-z0-9_]+:(ascending|descending)))*$/gi.test(args.options.sortList)) {
|
|
267
266
|
return `sortlist parameter value '${args.options.sortList}' does not match the required pattern (=comma-separated list of '<property>:(ascending|descending)'-pattern)`;
|
|
268
267
|
}
|
|
269
|
-
if (args.options.rowLimit && !
|
|
268
|
+
if (args.options.rowLimit && !Number.isInteger(args.options.rowLimit)) {
|
|
270
269
|
return `${args.options.rowLimit} is not a valid number`;
|
|
271
270
|
}
|
|
272
|
-
if (args.options.startRow && !
|
|
271
|
+
if (args.options.startRow && !Number.isInteger(args.options.startRow)) {
|
|
273
272
|
return `${args.options.startRow} is not a valid number`;
|
|
274
273
|
}
|
|
275
274
|
if (args.options.startRow && args.options.allResults) {
|
|
276
275
|
return 'You cannot specify startRow when allResults is set';
|
|
277
276
|
}
|
|
278
|
-
if (args.options.culture && !
|
|
277
|
+
if (args.options.culture && !Number.isInteger(args.options.culture)) {
|
|
279
278
|
return `${args.options.culture} is not a valid number`;
|
|
280
279
|
}
|
|
281
280
|
return true;
|
|
@@ -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 _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets, _SpoTenantApplicationCustomizerGetCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -26,6 +26,7 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
26
26
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTypes).call(this);
|
|
29
30
|
}
|
|
30
31
|
async commandAction(logger, args) {
|
|
31
32
|
try {
|
|
@@ -50,13 +51,20 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
50
51
|
throw 'The specified application customizer was not found';
|
|
51
52
|
}
|
|
52
53
|
listItemInstances.forEach(v => delete v['ID']);
|
|
54
|
+
let listItemInstance;
|
|
53
55
|
if (listItemInstances.length > 1) {
|
|
54
56
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
55
|
-
|
|
56
|
-
await logger.log(result);
|
|
57
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
|
|
60
|
+
listItemInstance = listItemInstances[0];
|
|
61
|
+
}
|
|
62
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
63
|
+
await logger.log(listItemInstance);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
67
|
+
await logger.log(properties);
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
else {
|
|
@@ -73,7 +81,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
73
81
|
Object.assign(this.telemetryProperties, {
|
|
74
82
|
title: typeof args.options.title !== 'undefined',
|
|
75
83
|
id: typeof args.options.id !== 'undefined',
|
|
76
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
84
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
85
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
77
86
|
});
|
|
78
87
|
});
|
|
79
88
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
|
|
@@ -83,6 +92,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
83
92
|
option: '-i, --id [id]'
|
|
84
93
|
}, {
|
|
85
94
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
95
|
+
}, {
|
|
96
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
86
97
|
});
|
|
87
98
|
}, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
|
|
88
99
|
this.validators.push(async (args) => {
|
|
@@ -96,6 +107,9 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
96
107
|
});
|
|
97
108
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
|
|
98
109
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
110
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initTypes = function _SpoTenantApplicationCustomizerGetCommand_initTypes() {
|
|
111
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
112
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
99
113
|
};
|
|
100
114
|
export default new SpoTenantApplicationCustomizerGetCommand();
|
|
101
115
|
//# sourceMappingURL=tenant-applicationcustomizer-get.js.map
|
|
@@ -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 _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets, _SpoTenantCommandSetGetCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import { CommandError } from '../../../../Command.js';
|
|
9
9
|
import request from '../../../../request.js';
|
|
@@ -27,6 +27,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
const appCatalogUrl = await spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
@@ -47,7 +48,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
47
48
|
const reqOptions = {
|
|
48
49
|
url: `${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
|
|
49
50
|
headers: {
|
|
50
|
-
|
|
51
|
+
accept: 'application/json;odata=nometadata'
|
|
51
52
|
},
|
|
52
53
|
responseType: 'json'
|
|
53
54
|
};
|
|
@@ -55,13 +56,20 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
55
56
|
const listItemInstances = await request.get(reqOptions);
|
|
56
57
|
if (listItemInstances?.value.length > 0) {
|
|
57
58
|
listItemInstances.value.forEach(v => delete v['ID']);
|
|
59
|
+
let listItemInstance;
|
|
58
60
|
if (listItemInstances.value.length > 1) {
|
|
59
61
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances.value);
|
|
60
|
-
|
|
61
|
-
await logger.log(result);
|
|
62
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
|
-
|
|
65
|
+
listItemInstance = listItemInstances.value[0];
|
|
66
|
+
}
|
|
67
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
68
|
+
await logger.log(listItemInstance);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
72
|
+
await logger.log(properties);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
else {
|
|
@@ -78,7 +86,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
78
86
|
Object.assign(this.telemetryProperties, {
|
|
79
87
|
title: typeof args.options.title !== 'undefined',
|
|
80
88
|
id: typeof args.options.id !== 'undefined',
|
|
81
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
89
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
90
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
82
91
|
});
|
|
83
92
|
});
|
|
84
93
|
}, _SpoTenantCommandSetGetCommand_initOptions = function _SpoTenantCommandSetGetCommand_initOptions() {
|
|
@@ -88,6 +97,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
88
97
|
option: '-i, --id [id]'
|
|
89
98
|
}, {
|
|
90
99
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
100
|
+
}, {
|
|
101
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
91
102
|
});
|
|
92
103
|
}, _SpoTenantCommandSetGetCommand_initValidators = function _SpoTenantCommandSetGetCommand_initValidators() {
|
|
93
104
|
this.validators.push(async (args) => {
|
|
@@ -101,6 +112,9 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
101
112
|
});
|
|
102
113
|
}, _SpoTenantCommandSetGetCommand_initOptionSets = function _SpoTenantCommandSetGetCommand_initOptionSets() {
|
|
103
114
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
115
|
+
}, _SpoTenantCommandSetGetCommand_initTypes = function _SpoTenantCommandSetGetCommand_initTypes() {
|
|
116
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
117
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
104
118
|
};
|
|
105
119
|
export default new SpoTenantCommandSetGetCommand();
|
|
106
120
|
//# sourceMappingURL=tenant-commandset-get.js.map
|
|
@@ -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 _SpoTenantRecycleBinItemRestoreCommand_instances,
|
|
6
|
+
var _SpoTenantRecycleBinItemRestoreCommand_instances, _SpoTenantRecycleBinItemRestoreCommand_initOptions, _SpoTenantRecycleBinItemRestoreCommand_initValidators, _SpoTenantRecycleBinItemRestoreCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { odata } from '../../../../utils/odata.js';
|
|
@@ -22,15 +22,11 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
_SpoTenantRecycleBinItemRestoreCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initTelemetry).call(this);
|
|
26
25
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initOptions).call(this);
|
|
27
26
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initValidators).call(this);
|
|
28
27
|
__classPrivateFieldGet(this, _SpoTenantRecycleBinItemRestoreCommand_instances, "m", _SpoTenantRecycleBinItemRestoreCommand_initTypes).call(this);
|
|
29
28
|
}
|
|
30
29
|
async commandAction(logger, args) {
|
|
31
|
-
if (args.options.wait) {
|
|
32
|
-
await this.warn(logger, `Option 'wait' is deprecated and will be removed in the next major release.`);
|
|
33
|
-
}
|
|
34
30
|
try {
|
|
35
31
|
if (this.verbose) {
|
|
36
32
|
await logger.logToStderr(`Restoring site collection '${args.options.siteUrl}' from recycle bin.`);
|
|
@@ -62,13 +58,6 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
62
58
|
};
|
|
63
59
|
await request.post(restoreOptions);
|
|
64
60
|
}
|
|
65
|
-
// Here, we return a fixed response because this new API endpoint doesn't return a response while the previous API did.
|
|
66
|
-
// This has to be removed in the next major release.
|
|
67
|
-
await logger.log({
|
|
68
|
-
HasTimedout: false,
|
|
69
|
-
IsComplete: !!args.options.wait,
|
|
70
|
-
PollingInterval: 15000
|
|
71
|
-
});
|
|
72
61
|
}
|
|
73
62
|
catch (err) {
|
|
74
63
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -79,23 +68,14 @@ class SpoTenantRecycleBinItemRestoreCommand extends SpoCommand {
|
|
|
79
68
|
return sites[0].GroupId;
|
|
80
69
|
}
|
|
81
70
|
}
|
|
82
|
-
_SpoTenantRecycleBinItemRestoreCommand_instances = new WeakSet(),
|
|
83
|
-
this.telemetry.push((args) => {
|
|
84
|
-
Object.assign(this.telemetryProperties, {
|
|
85
|
-
wait: !!args.options.wait
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
}, _SpoTenantRecycleBinItemRestoreCommand_initOptions = function _SpoTenantRecycleBinItemRestoreCommand_initOptions() {
|
|
71
|
+
_SpoTenantRecycleBinItemRestoreCommand_instances = new WeakSet(), _SpoTenantRecycleBinItemRestoreCommand_initOptions = function _SpoTenantRecycleBinItemRestoreCommand_initOptions() {
|
|
89
72
|
this.options.unshift({
|
|
90
73
|
option: '-u, --siteUrl <siteUrl>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--wait'
|
|
93
74
|
});
|
|
94
75
|
}, _SpoTenantRecycleBinItemRestoreCommand_initValidators = function _SpoTenantRecycleBinItemRestoreCommand_initValidators() {
|
|
95
76
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
96
77
|
}, _SpoTenantRecycleBinItemRestoreCommand_initTypes = function _SpoTenantRecycleBinItemRestoreCommand_initTypes() {
|
|
97
78
|
this.types.string.push('siteUrl');
|
|
98
|
-
this.types.boolean.push('wait');
|
|
99
79
|
};
|
|
100
80
|
export default new SpoTenantRecycleBinItemRestoreCommand();
|
|
101
81
|
//# sourceMappingURL=tenant-recyclebinitem-restore.js.map
|
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
COMMANDSET_REMOVE: `${prefix} commandset remove`,
|
|
32
32
|
COMMANDSET_SET: `${prefix} commandset set`,
|
|
33
33
|
CONTENTTYPE_ADD: `${prefix} contenttype add`,
|
|
34
|
+
CONTENTTYPE_FIELD_LIST: `${prefix} contenttype field list`,
|
|
34
35
|
CONTENTTYPE_FIELD_REMOVE: `${prefix} contenttype field remove`,
|
|
35
36
|
CONTENTTYPE_FIELD_SET: `${prefix} contenttype field set`,
|
|
36
37
|
CONTENTTYPE_GET: `${prefix} contenttype get`,
|
|
@@ -0,0 +1,119 @@
|
|
|
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 _TeamsMeetingAttendancereportGetCommand_instances, _TeamsMeetingAttendancereportGetCommand_initTelemetry, _TeamsMeetingAttendancereportGetCommand_initOptions, _TeamsMeetingAttendancereportGetCommand_initTypes, _TeamsMeetingAttendancereportGetCommand_initValidators, _TeamsMeetingAttendancereportGetCommand_initOptionSets;
|
|
7
|
+
import auth from '../../../../Auth.js';
|
|
8
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import GraphCommand from "../../../base/GraphCommand.js";
|
|
11
|
+
import commands from '../../commands.js';
|
|
12
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
13
|
+
import request from '../../../../request.js';
|
|
14
|
+
class TeamsMeetingAttendancereportGetCommand extends GraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.MEETING_ATTENDANCEREPORT_GET;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Gets attendance report for a given meeting';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_TeamsMeetingAttendancereportGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportGetCommand_instances, "m", _TeamsMeetingAttendancereportGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportGetCommand_instances, "m", _TeamsMeetingAttendancereportGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportGetCommand_instances, "m", _TeamsMeetingAttendancereportGetCommand_initTypes).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportGetCommand_instances, "m", _TeamsMeetingAttendancereportGetCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _TeamsMeetingAttendancereportGetCommand_instances, "m", _TeamsMeetingAttendancereportGetCommand_initOptionSets).call(this);
|
|
29
|
+
}
|
|
30
|
+
async commandAction(logger, args) {
|
|
31
|
+
try {
|
|
32
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
33
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName && !args.options.email) {
|
|
34
|
+
throw `The option 'userId', 'userName' or 'email' is required when retrieving meeting attendance report using app only permissions.`;
|
|
35
|
+
}
|
|
36
|
+
else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName || args.options.email)) {
|
|
37
|
+
throw `The options 'userId', 'userName' and 'email' cannot be used when retrieving meeting attendance report using delegated permissions.`;
|
|
38
|
+
}
|
|
39
|
+
if (this.verbose) {
|
|
40
|
+
await logger.logToStderr(`Retrieving attendance report for ${isAppOnlyAccessToken ? `specific user ${args.options.userId || args.options.userName || args.options.email}.` : 'currently logged in user'}.`);
|
|
41
|
+
}
|
|
42
|
+
let userUrl = '';
|
|
43
|
+
if (isAppOnlyAccessToken) {
|
|
44
|
+
const userId = await this.getUserId(args.options);
|
|
45
|
+
userUrl += `users/${userId}`;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
userUrl += 'me';
|
|
49
|
+
}
|
|
50
|
+
const requestOptions = {
|
|
51
|
+
url: `${this.resource}/v1.0/${userUrl}/onlineMeetings/${args.options.meetingId}/attendanceReports/${args.options.id}?$expand=attendanceRecords`,
|
|
52
|
+
headers: {
|
|
53
|
+
accept: 'application/json;odata.metadata=none'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json'
|
|
56
|
+
};
|
|
57
|
+
const attendanceReport = await request.get(requestOptions);
|
|
58
|
+
await logger.log(attendanceReport);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.handleRejectedODataJsonPromise(err);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async getUserId(options) {
|
|
65
|
+
if (options.userId) {
|
|
66
|
+
return options.userId;
|
|
67
|
+
}
|
|
68
|
+
if (options.userName) {
|
|
69
|
+
return entraUser.getUserIdByUpn(options.userName);
|
|
70
|
+
}
|
|
71
|
+
return entraUser.getUserIdByEmail(options.email);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
_TeamsMeetingAttendancereportGetCommand_instances = new WeakSet(), _TeamsMeetingAttendancereportGetCommand_initTelemetry = function _TeamsMeetingAttendancereportGetCommand_initTelemetry() {
|
|
75
|
+
this.telemetry.push((args) => {
|
|
76
|
+
Object.assign(this.telemetryProperties, {
|
|
77
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
78
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
79
|
+
email: typeof args.options.email !== 'undefined'
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}, _TeamsMeetingAttendancereportGetCommand_initOptions = function _TeamsMeetingAttendancereportGetCommand_initOptions() {
|
|
83
|
+
this.options.unshift({
|
|
84
|
+
option: '-u, --userId [userId]'
|
|
85
|
+
}, {
|
|
86
|
+
option: '-n, --userName [userName]'
|
|
87
|
+
}, {
|
|
88
|
+
option: '--email [email]'
|
|
89
|
+
}, {
|
|
90
|
+
option: '-m, --meetingId <meetingId>'
|
|
91
|
+
}, {
|
|
92
|
+
option: '-i, --id <id>'
|
|
93
|
+
});
|
|
94
|
+
}, _TeamsMeetingAttendancereportGetCommand_initTypes = function _TeamsMeetingAttendancereportGetCommand_initTypes() {
|
|
95
|
+
this.types.string.push('userId', 'userName', 'email', 'meetingId', 'id');
|
|
96
|
+
}, _TeamsMeetingAttendancereportGetCommand_initValidators = function _TeamsMeetingAttendancereportGetCommand_initValidators() {
|
|
97
|
+
this.validators.push(async (args) => {
|
|
98
|
+
if (!validation.isValidGuid(args.options.id)) {
|
|
99
|
+
return `${args.options.id} is not a valid GUID for option 'id'.`;
|
|
100
|
+
}
|
|
101
|
+
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
102
|
+
return `${args.options.userId} is not a valid GUID for option 'userId'.`;
|
|
103
|
+
}
|
|
104
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
105
|
+
return `${args.options.userName} is not a valid UPN.`;
|
|
106
|
+
}
|
|
107
|
+
if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
|
|
108
|
+
return `${args.options.email} is not a valid email.`;
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
});
|
|
112
|
+
}, _TeamsMeetingAttendancereportGetCommand_initOptionSets = function _TeamsMeetingAttendancereportGetCommand_initOptionSets() {
|
|
113
|
+
this.optionSets.push({
|
|
114
|
+
options: ['userId', 'userName', 'email'],
|
|
115
|
+
runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
export default new TeamsMeetingAttendancereportGetCommand();
|
|
119
|
+
//# sourceMappingURL=meeting-attendancereport-get.js.map
|
|
@@ -0,0 +1,112 @@
|
|
|
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 _TeamsMessageRemoveCommand_instances, _TeamsMessageRemoveCommand_initTelemetry, _TeamsMessageRemoveCommand_initOptions, _TeamsMessageRemoveCommand_initValidators, _TeamsMessageRemoveCommand_initOptionSets, _TeamsMessageRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { teams } from '../../../../utils/teams.js';
|
|
11
|
+
import { validation } from '../../../../utils/validation.js';
|
|
12
|
+
import DelegatedGraphCommand from '../../../base/DelegatedGraphCommand.js';
|
|
13
|
+
import commands from '../../commands.js';
|
|
14
|
+
class TeamsMessageRemoveCommand extends DelegatedGraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.MESSAGE_REMOVE;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Removes a message from a channel in a Microsoft Teams team';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_TeamsMessageRemoveCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initOptionSets).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _TeamsMessageRemoveCommand_instances, "m", _TeamsMessageRemoveCommand_initTypes).call(this);
|
|
29
|
+
}
|
|
30
|
+
async commandAction(logger, args) {
|
|
31
|
+
const removeTeamMessage = async () => {
|
|
32
|
+
try {
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
await logger.logToStderr(`Removing message '${args.options.id}' from channel '${args.options.channelId || args.options.channelName}' in team '${args.options.teamId || args.options.teamName}'.`);
|
|
35
|
+
}
|
|
36
|
+
const teamId = args.options.teamId || await teams.getTeamIdByDisplayName(args.options.teamName);
|
|
37
|
+
const channelId = args.options.channelId || await teams.getChannelIdByDisplayName(teamId, args.options.channelName);
|
|
38
|
+
const requestOptions = {
|
|
39
|
+
url: `${this.resource}/v1.0/teams/${teamId}/channels/${formatting.encodeQueryParameter(channelId)}/messages/${args.options.id}/softDelete`,
|
|
40
|
+
headers: {
|
|
41
|
+
accept: 'application/json;odata.metadata=none'
|
|
42
|
+
},
|
|
43
|
+
responseType: 'json'
|
|
44
|
+
};
|
|
45
|
+
await request.post(requestOptions);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
if (err.error?.error?.code === 'NotFound') {
|
|
49
|
+
this.handleError('The message was not found in the Teams channel.');
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.handleRejectedODataJsonPromise(err);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
if (args.options.force) {
|
|
57
|
+
await removeTeamMessage();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove this message?` });
|
|
61
|
+
if (result) {
|
|
62
|
+
await removeTeamMessage();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_TeamsMessageRemoveCommand_instances = new WeakSet(), _TeamsMessageRemoveCommand_initTelemetry = function _TeamsMessageRemoveCommand_initTelemetry() {
|
|
68
|
+
this.telemetry.push((args) => {
|
|
69
|
+
Object.assign(this.telemetryProperties, {
|
|
70
|
+
teamId: typeof args.options.teamId !== 'undefined',
|
|
71
|
+
teamName: typeof args.options.teamName !== 'undefined',
|
|
72
|
+
channelId: typeof args.options.channelId !== 'undefined',
|
|
73
|
+
channelName: typeof args.options.channelName !== 'undefined',
|
|
74
|
+
force: !!args.options.force
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}, _TeamsMessageRemoveCommand_initOptions = function _TeamsMessageRemoveCommand_initOptions() {
|
|
78
|
+
this.options.unshift({
|
|
79
|
+
option: '--teamId [teamId]'
|
|
80
|
+
}, {
|
|
81
|
+
option: '--teamName [teamName]'
|
|
82
|
+
}, {
|
|
83
|
+
option: '--channelId [channelId]'
|
|
84
|
+
}, {
|
|
85
|
+
option: '--channelName [channelName]'
|
|
86
|
+
}, {
|
|
87
|
+
option: '-i, --id <id>'
|
|
88
|
+
}, {
|
|
89
|
+
option: '-f, --force'
|
|
90
|
+
});
|
|
91
|
+
}, _TeamsMessageRemoveCommand_initValidators = function _TeamsMessageRemoveCommand_initValidators() {
|
|
92
|
+
this.validators.push(async (args) => {
|
|
93
|
+
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
94
|
+
return `'${args.options.teamId}' is not a valid GUID for 'teamId'.`;
|
|
95
|
+
}
|
|
96
|
+
if (args.options.channelId && !validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
97
|
+
return `'${args.options.channelId}' is not a valid ID for 'channelId'.`;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
});
|
|
101
|
+
}, _TeamsMessageRemoveCommand_initOptionSets = function _TeamsMessageRemoveCommand_initOptionSets() {
|
|
102
|
+
this.optionSets.push({
|
|
103
|
+
options: ['teamId', 'teamName']
|
|
104
|
+
}, {
|
|
105
|
+
options: ['channelId', 'channelName']
|
|
106
|
+
});
|
|
107
|
+
}, _TeamsMessageRemoveCommand_initTypes = function _TeamsMessageRemoveCommand_initTypes() {
|
|
108
|
+
this.types.string.push('teamId', 'teamName', 'channelId', 'channelName', 'id');
|
|
109
|
+
this.types.boolean.push('force');
|
|
110
|
+
};
|
|
111
|
+
export default new TeamsMessageRemoveCommand();
|
|
112
|
+
//# sourceMappingURL=message-remove.js.map
|
|
@@ -30,12 +30,14 @@ export default {
|
|
|
30
30
|
MEETING_ADD: `${prefix} meeting add`,
|
|
31
31
|
MEETING_GET: `${prefix} meeting get`,
|
|
32
32
|
MEETING_LIST: `${prefix} meeting list`,
|
|
33
|
+
MEETING_ATTENDANCEREPORT_GET: `${prefix} meeting attendancereport get`,
|
|
33
34
|
MEETING_ATTENDANCEREPORT_LIST: `${prefix} meeting attendancereport list`,
|
|
34
35
|
MEETING_TRANSCRIPT_LIST: `${prefix} meeting transcript list`,
|
|
35
36
|
MEMBERSETTINGS_LIST: `${prefix} membersettings list`,
|
|
36
37
|
MEMBERSETTINGS_SET: `${prefix} membersettings set`,
|
|
37
38
|
MESSAGE_GET: `${prefix} message get`,
|
|
38
39
|
MESSAGE_LIST: `${prefix} message list`,
|
|
40
|
+
MESSAGE_REMOVE: `${prefix} message remove`,
|
|
39
41
|
MESSAGE_REPLY_LIST: `${prefix} message reply list`,
|
|
40
42
|
MESSAGE_SEND: `${prefix} message send`,
|
|
41
43
|
MESSAGINGSETTINGS_LIST: `${prefix} messagingsettings list`,
|