@pnp/cli-microsoft365 11.7.0-beta.b67a258 → 11.7.0-beta.ba78c1f
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/.devproxy/api-specs/sharepoint.yaml +53 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/config.js +1 -0
- package/dist/m365/context/commands/option/option-list.js +6 -1
- package/dist/m365/entra/commands/resourcenamespace/resourcenamespace-list.js +6 -0
- package/dist/m365/entra/commands/user/user-license-add.js +2 -1
- package/dist/m365/entra/commands/user/user-license-list.js +4 -9
- package/dist/m365/entra/commands/user/user-license-remove.js +2 -1
- package/dist/m365/external/commands/connection/connection-list.js +6 -0
- package/dist/m365/outlook/commands/calendar/calendar-add.js +85 -0
- package/dist/m365/outlook/commands/calendar/calendar-get.js +71 -0
- package/dist/m365/outlook/commands/calendar/calendar-remove.js +100 -0
- package/dist/m365/outlook/commands/calendar/calendar-set.js +132 -0
- package/dist/m365/outlook/commands/calendargroup/calendargroup-get.js +114 -0
- package/dist/m365/outlook/commands/calendargroup/calendargroup-set.js +115 -0
- package/dist/m365/outlook/commands/event/event-cancel.js +103 -0
- package/dist/m365/outlook/commands/event/event-list.js +115 -0
- package/dist/m365/outlook/commands/event/event-remove.js +104 -0
- package/dist/m365/outlook/commands.js +9 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +643 -0
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +2 -2
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +13 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.23.0-rc.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +16 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002032_DEVDEP_typescript_eslint_parser.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015016_FILE_eslint_config_js.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.23.0-rc.0.js +84 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spfx/commands/spfx-doctor.js +5 -631
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +13 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +24 -3
- package/dist/m365/spo/commands/brandcenter/brandcenter-colors-list.js +59 -0
- package/dist/m365/spo/commands/file/file-archive.js +83 -0
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +3 -9
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +20 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +27 -2
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +5 -1
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/chat/chat-message-list.js +43 -4
- package/dist/request.js +0 -16
- package/dist/utils/calendar.js +37 -0
- package/dist/utils/calendarGroup.js +22 -0
- package/dist/utils/entraApp.js +9 -2
- package/dist/utils/spfx.js +59 -0
- package/docs/docs/cmd/entra/license/license-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +21 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-add.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-get.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-list.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-remove.mdx +21 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-set.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx +19 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx +20 -0
- package/docs/docs/cmd/entra/user/user-groupmembership-list.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-guest-add.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-license-add.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-license-list.mdx +18 -1
- package/docs/docs/cmd/entra/user/user-license-remove.mdx +21 -0
- package/docs/docs/cmd/entra/user/user-password-validate.mdx +12 -0
- package/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx +21 -0
- package/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx +21 -0
- package/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-session-revoke.mdx +21 -0
- package/docs/docs/cmd/entra/user/user-signin-list.mdx +19 -0
- package/docs/docs/cmd/exo/approleassignment/approleassignment-add.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-add.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-doctor.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-get.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-list.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-remove.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-schema-add.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-urltoitemresolver-add.mdx +21 -0
- package/docs/docs/cmd/external/item/item-add.mdx +19 -0
- package/docs/docs/cmd/file/convert/convert-pdf.mdx +21 -0
- package/docs/docs/cmd/file/file-add.mdx +21 -0
- package/docs/docs/cmd/file/file-copy.mdx +21 -0
- package/docs/docs/cmd/file/file-list.mdx +19 -0
- package/docs/docs/cmd/file/file-move.mdx +21 -0
- package/docs/docs/cmd/outlook/calendar/calendar-add.mdx +165 -0
- package/docs/docs/cmd/outlook/calendar/calendar-get.mdx +165 -0
- package/docs/docs/cmd/outlook/calendar/calendar-remove.mdx +86 -0
- package/docs/docs/cmd/outlook/calendar/calendar-set.mdx +178 -0
- package/docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx +125 -0
- package/docs/docs/cmd/outlook/calendargroup/calendargroup-set.mdx +83 -0
- package/docs/docs/cmd/outlook/event/event-cancel.mdx +85 -0
- package/docs/docs/cmd/outlook/event/event-list.mdx +245 -0
- package/docs/docs/cmd/outlook/event/event-remove.mdx +85 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +14 -11
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +9 -6
- package/docs/docs/cmd/spo/brandcenter/brandcenter-colors-list.mdx +115 -0
- package/docs/docs/cmd/spo/file/file-archive.mdx +68 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +13 -10
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-set.mdx +7 -4
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.mdx +3 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.mdx +23 -2
- package/npm-shrinkwrap.json +0 -7
- package/package.json +2 -1
|
@@ -31,7 +31,8 @@ class SpoApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
31
31
|
Name: args.options.title,
|
|
32
32
|
Description: args.options.description,
|
|
33
33
|
Location: 'ClientSideExtension.ApplicationCustomizer',
|
|
34
|
-
ClientSideComponentId: args.options.clientSideComponentId
|
|
34
|
+
ClientSideComponentId: args.options.clientSideComponentId,
|
|
35
|
+
HostProperties: args.options.hostProperties || ''
|
|
35
36
|
};
|
|
36
37
|
if (args.options.clientSideComponentProperties) {
|
|
37
38
|
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
@@ -59,6 +60,8 @@ _a = SpoApplicationCustomizerAddCommand, _SpoApplicationCustomizerAddCommand_ins
|
|
|
59
60
|
option: '--description [description]'
|
|
60
61
|
}, {
|
|
61
62
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
63
|
+
}, {
|
|
64
|
+
option: '--hostProperties [hostProperties]'
|
|
62
65
|
}, {
|
|
63
66
|
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
64
67
|
});
|
|
@@ -67,6 +70,7 @@ _a = SpoApplicationCustomizerAddCommand, _SpoApplicationCustomizerAddCommand_ins
|
|
|
67
70
|
Object.assign(this.telemetryProperties, {
|
|
68
71
|
description: typeof args.options.description !== 'undefined',
|
|
69
72
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
73
|
+
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
70
74
|
scope: typeof args.options.scope !== 'undefined'
|
|
71
75
|
});
|
|
72
76
|
});
|
|
@@ -89,6 +93,14 @@ _a = SpoApplicationCustomizerAddCommand, _SpoApplicationCustomizerAddCommand_ins
|
|
|
89
93
|
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
90
94
|
}
|
|
91
95
|
}
|
|
96
|
+
if (args.options.hostProperties) {
|
|
97
|
+
try {
|
|
98
|
+
JSON.parse(args.options.hostProperties);
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
92
104
|
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
93
105
|
return `${args.options.scope} is not a valid value for allowedMembers. Valid values are ${_a.scopes.join(', ')}`;
|
|
94
106
|
}
|
|
@@ -37,11 +37,13 @@ class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
async updateAppCustomizer(logger, options, appCustomizer) {
|
|
40
|
-
const { clientSideComponentProperties, webUrl, newTitle, description } = options;
|
|
40
|
+
const { clientSideComponentProperties, hostProperties, webUrl, newTitle, description } = options;
|
|
41
41
|
if (this.verbose) {
|
|
42
42
|
await logger.logToStderr(`Updating application customizer with ID '${appCustomizer.Id}' on the site '${webUrl}'...`);
|
|
43
43
|
}
|
|
44
|
-
const requestBody = {
|
|
44
|
+
const requestBody = {
|
|
45
|
+
HostProperties: hostProperties
|
|
46
|
+
};
|
|
45
47
|
if (newTitle) {
|
|
46
48
|
requestBody.Title = newTitle;
|
|
47
49
|
}
|
|
@@ -106,6 +108,8 @@ _SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCu
|
|
|
106
108
|
option: '--description [description]'
|
|
107
109
|
}, {
|
|
108
110
|
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
111
|
+
}, {
|
|
112
|
+
option: '--hostProperties [hostProperties]'
|
|
109
113
|
}, {
|
|
110
114
|
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
111
115
|
});
|
|
@@ -118,6 +122,7 @@ _SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCu
|
|
|
118
122
|
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
119
123
|
description: typeof args.options.description !== 'undefined',
|
|
120
124
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
125
|
+
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
121
126
|
scope: typeof args.options.scope !== 'undefined'
|
|
122
127
|
});
|
|
123
128
|
});
|
|
@@ -132,7 +137,23 @@ _SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCu
|
|
|
132
137
|
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
133
138
|
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
134
139
|
}
|
|
135
|
-
if (
|
|
140
|
+
if (args.options.clientSideComponentProperties) {
|
|
141
|
+
try {
|
|
142
|
+
JSON.parse(args.options.clientSideComponentProperties);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (args.options.hostProperties) {
|
|
149
|
+
try {
|
|
150
|
+
JSON.parse(args.options.hostProperties);
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (!args.options.newTitle && args.options.description === undefined && !args.options.clientSideComponentProperties && args.options.hostProperties === undefined) {
|
|
136
157
|
return `Please specify an option to be updated`;
|
|
137
158
|
}
|
|
138
159
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
import { odata } from '../../../../utils/odata.js';
|
|
5
|
+
import { spo } from '../../../../utils/spo.js';
|
|
6
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
|
+
const options = globalOptionsZod.strict();
|
|
8
|
+
class SpoBrandCenterColorsListCommand extends SpoCommand {
|
|
9
|
+
get name() {
|
|
10
|
+
return commands.BRANDCENTER_COLORS_LIST;
|
|
11
|
+
}
|
|
12
|
+
get description() {
|
|
13
|
+
return 'Lists the brand center colors';
|
|
14
|
+
}
|
|
15
|
+
defaultProperties() {
|
|
16
|
+
return ['ColorCode', 'Title', 'IsVisible'];
|
|
17
|
+
}
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
21
|
+
async commandAction(logger) {
|
|
22
|
+
if (this.verbose) {
|
|
23
|
+
await logger.logToStderr(`Retrieving brand center colors...`);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const spoUrl = await spo.getSpoUrl(logger, this.verbose);
|
|
27
|
+
const configRequestOptions = {
|
|
28
|
+
url: `${spoUrl}/_api/Brandcenter/Configuration`,
|
|
29
|
+
headers: {
|
|
30
|
+
accept: 'application/json;odata=nometadata'
|
|
31
|
+
},
|
|
32
|
+
responseType: 'json'
|
|
33
|
+
};
|
|
34
|
+
const config = await request.get(configRequestOptions);
|
|
35
|
+
if (!config.BrandColorsListUrl) {
|
|
36
|
+
if (this.verbose) {
|
|
37
|
+
await logger.logToStderr('Brand colors list not found.');
|
|
38
|
+
}
|
|
39
|
+
await logger.log([]);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
await logger.logToStderr(`Brand colors list found at '${config.BrandColorsListUrl.DecodedUrl}'.`);
|
|
44
|
+
}
|
|
45
|
+
const items = await odata.getAllItems(`${config.SiteUrl}/_api/web/lists(guid'${config.BrandColorsListId}')/items?$select=OData__SPColorTitle,OData__SPColorCode,OData__SPColorVisible`);
|
|
46
|
+
const result = items.map(item => ({
|
|
47
|
+
Title: item.OData__SPColorTitle,
|
|
48
|
+
ColorCode: item.OData__SPColorCode,
|
|
49
|
+
IsVisible: item.OData__SPColorVisible
|
|
50
|
+
}));
|
|
51
|
+
await logger.log(result);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export default new SpoBrandCenterColorsListCommand();
|
|
59
|
+
//# sourceMappingURL=brandcenter-colors-list.js.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import { cli } from '../../../../cli/cli.js';
|
|
7
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
})
|
|
16
|
+
.alias('u'),
|
|
17
|
+
url: z.string().optional(),
|
|
18
|
+
id: z.uuid().optional().alias('i'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
21
|
+
class SpoFileArchiveCommand extends SpoCommand {
|
|
22
|
+
get name() {
|
|
23
|
+
return commands.FILE_ARCHIVE;
|
|
24
|
+
}
|
|
25
|
+
get description() {
|
|
26
|
+
return 'Archives a file';
|
|
27
|
+
}
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(options => [options.url, options.id].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: `Specify 'url' or 'id', but not both.`
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getExcludedOptionsWithUrls() {
|
|
38
|
+
return ['url'];
|
|
39
|
+
}
|
|
40
|
+
async commandAction(logger, args) {
|
|
41
|
+
const { webUrl, url, id, force, verbose } = args.options;
|
|
42
|
+
if (!force) {
|
|
43
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this item? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
|
|
44
|
+
if (!result) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
if (verbose) {
|
|
50
|
+
await logger.logToStderr(`Archiving file ${url || id} at site ${webUrl}...`);
|
|
51
|
+
}
|
|
52
|
+
let requestUrl = `${webUrl}/_api/web`;
|
|
53
|
+
if (id) {
|
|
54
|
+
requestUrl += `/GetFileById('${formatting.encodeQueryParameter(id)}')`;
|
|
55
|
+
}
|
|
56
|
+
else if (url) {
|
|
57
|
+
const serverRelativePath = urlUtil.getServerRelativePath(webUrl, url);
|
|
58
|
+
requestUrl += `/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
|
|
59
|
+
}
|
|
60
|
+
requestUrl += '?$select=ListId,ListItemAllFields/Id&$expand=ListItemAllFields';
|
|
61
|
+
const fileInfo = await request.get({
|
|
62
|
+
url: requestUrl,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata=nometadata'
|
|
65
|
+
},
|
|
66
|
+
responseType: 'json'
|
|
67
|
+
});
|
|
68
|
+
const requestOptions = {
|
|
69
|
+
url: `${webUrl}/_api/Lists(guid'${fileInfo.ListId}')/items(${fileInfo.ListItemAllFields.Id})/Archive`,
|
|
70
|
+
headers: {
|
|
71
|
+
accept: 'application/json;odata=nometadata'
|
|
72
|
+
},
|
|
73
|
+
responseType: 'json'
|
|
74
|
+
};
|
|
75
|
+
await request.post(requestOptions);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
this.handleRejectedODataJsonPromise(err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export default new SpoFileArchiveCommand();
|
|
83
|
+
//# sourceMappingURL=file-archive.js.map
|
|
@@ -28,12 +28,6 @@ class SpoPropertyBagSetCommand extends SpoPropertyBagBaseCommand {
|
|
|
28
28
|
this.formDigestValue = contextResponse.FormDigestValue;
|
|
29
29
|
let identityResp = await spo.getCurrentWebIdentity(args.options.webUrl, this.formDigestValue);
|
|
30
30
|
const webIdentityResp = identityResp;
|
|
31
|
-
// Check if web no script enabled or not
|
|
32
|
-
// Cannot set property bag value if no script is enabled
|
|
33
|
-
const isNoScriptSite = await this.isNoScriptSite(identityResp, args.options, logger);
|
|
34
|
-
if (isNoScriptSite) {
|
|
35
|
-
throw 'Site has NoScript enabled, and setting property bag values is not supported';
|
|
36
|
-
}
|
|
37
31
|
const opts = args.options;
|
|
38
32
|
if (opts.folder) {
|
|
39
33
|
// get the folder guid instead of the web guid
|
|
@@ -42,15 +36,15 @@ class SpoPropertyBagSetCommand extends SpoPropertyBagBaseCommand {
|
|
|
42
36
|
await this.setProperty(identityResp, args.options, logger);
|
|
43
37
|
}
|
|
44
38
|
catch (err) {
|
|
39
|
+
if (err.toString().indexOf('E_ACCESSDENIED') > -1) {
|
|
40
|
+
await logger.logToStderr('Tip: If a site has NoScript enabled, setting the property bag value may result in exceptions.');
|
|
41
|
+
}
|
|
45
42
|
this.handleRejectedPromise(err);
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
setProperty(identityResp, options, logger) {
|
|
49
46
|
return SpoPropertyBagBaseCommand.setProperty(options.key, options.value, options.webUrl, this.formDigestValue, identityResp, logger, this.debug, options.folder);
|
|
50
47
|
}
|
|
51
|
-
isNoScriptSite(webIdentityResp, options, logger) {
|
|
52
|
-
return SpoPropertyBagBaseCommand.isNoScriptSite(options.webUrl, this.formDigestValue, webIdentityResp, logger, this.debug);
|
|
53
|
-
}
|
|
54
48
|
}
|
|
55
49
|
_SpoPropertyBagSetCommand_instances = new WeakSet(), _SpoPropertyBagSetCommand_initTelemetry = function _SpoPropertyBagSetCommand_initTelemetry() {
|
|
56
50
|
this.telemetry.push((args) => {
|
|
@@ -120,6 +120,7 @@ class SpoTenantApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
120
120
|
TenantWideExtensionSequence: 0,
|
|
121
121
|
TenantWideExtensionListTemplate: 0,
|
|
122
122
|
TenantWideExtensionComponentProperties: options.clientSideComponentProperties || '',
|
|
123
|
+
TenantWideExtensionHostProperties: options.hostProperties || '',
|
|
123
124
|
TenantWideExtensionWebTemplate: options.webTemplate || '',
|
|
124
125
|
TenantWideExtensionDisabled: false,
|
|
125
126
|
verbose: this.verbose,
|
|
@@ -133,6 +134,7 @@ _SpoTenantApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
133
134
|
this.telemetry.push((args) => {
|
|
134
135
|
Object.assign(this.telemetryProperties, {
|
|
135
136
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
137
|
+
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
136
138
|
webTemplate: typeof args.options.webTemplate !== 'undefined'
|
|
137
139
|
});
|
|
138
140
|
});
|
|
@@ -143,6 +145,8 @@ _SpoTenantApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
143
145
|
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
144
146
|
}, {
|
|
145
147
|
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
148
|
+
}, {
|
|
149
|
+
option: '--hostProperties [hostProperties]'
|
|
146
150
|
}, {
|
|
147
151
|
option: '-w, --webTemplate [webTemplate]'
|
|
148
152
|
});
|
|
@@ -151,6 +155,22 @@ _SpoTenantApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
151
155
|
if (!validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
152
156
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
153
157
|
}
|
|
158
|
+
if (args.options.clientSideComponentProperties) {
|
|
159
|
+
try {
|
|
160
|
+
JSON.parse(args.options.clientSideComponentProperties);
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (args.options.hostProperties) {
|
|
167
|
+
try {
|
|
168
|
+
JSON.parse(args.options.hostProperties);
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
154
174
|
return true;
|
|
155
175
|
});
|
|
156
176
|
};
|
|
@@ -121,7 +121,7 @@ class SpoTenantApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
121
121
|
return outputParsed[0];
|
|
122
122
|
}
|
|
123
123
|
async updateTenantWideExtension(appCatalogUrl, options, listServerRelativeUrl, itemId, logger) {
|
|
124
|
-
const { title, id, clientSideComponentId, newTitle, newClientSideComponentId, clientSideComponentProperties, webTemplate } = options;
|
|
124
|
+
const { title, id, clientSideComponentId, newTitle, newClientSideComponentId, clientSideComponentProperties, hostProperties, webTemplate } = options;
|
|
125
125
|
if (this.verbose) {
|
|
126
126
|
await logger.logToStderr(`Updating tenant-wide application customizer: "${title || id || clientSideComponentId}"...`);
|
|
127
127
|
}
|
|
@@ -144,6 +144,12 @@ class SpoTenantApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
144
144
|
FieldValue: clientSideComponentProperties
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
+
if (hostProperties !== undefined) {
|
|
148
|
+
formValues.push({
|
|
149
|
+
FieldName: 'TenantWideExtensionHostProperties',
|
|
150
|
+
FieldValue: hostProperties
|
|
151
|
+
});
|
|
152
|
+
}
|
|
147
153
|
if (webTemplate !== undefined) {
|
|
148
154
|
formValues.push({
|
|
149
155
|
FieldName: 'TenantWideExtensionWebTemplate',
|
|
@@ -172,6 +178,7 @@ _SpoTenantApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
172
178
|
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
173
179
|
newClientSideComponentId: typeof args.options.newClientSideComponentId !== 'undefined',
|
|
174
180
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
181
|
+
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
175
182
|
webTemplate: typeof args.options.webTemplate !== 'undefined'
|
|
176
183
|
});
|
|
177
184
|
});
|
|
@@ -188,6 +195,8 @@ _SpoTenantApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
188
195
|
option: '--newClientSideComponentId [newClientSideComponentId]'
|
|
189
196
|
}, {
|
|
190
197
|
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
198
|
+
}, {
|
|
199
|
+
option: '--hostProperties [hostProperties]'
|
|
191
200
|
}, {
|
|
192
201
|
option: '-w, --webTemplate [webTemplate]'
|
|
193
202
|
});
|
|
@@ -202,7 +211,23 @@ _SpoTenantApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
202
211
|
if (args.options.newClientSideComponentId && !validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
203
212
|
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
204
213
|
}
|
|
205
|
-
if (
|
|
214
|
+
if (args.options.clientSideComponentProperties) {
|
|
215
|
+
try {
|
|
216
|
+
JSON.parse(args.options.clientSideComponentProperties);
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (args.options.hostProperties) {
|
|
223
|
+
try {
|
|
224
|
+
JSON.parse(args.options.hostProperties);
|
|
225
|
+
}
|
|
226
|
+
catch (e) {
|
|
227
|
+
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (!args.options.newTitle && !args.options.newClientSideComponentId && !args.options.clientSideComponentProperties && args.options.hostProperties === undefined && !args.options.webTemplate) {
|
|
206
231
|
return `Please specify an option to be updated`;
|
|
207
232
|
}
|
|
208
233
|
return true;
|
|
@@ -414,6 +414,9 @@ _a = SpoTenantSettingsSetCommand, _SpoTenantSettingsSetCommand_instances = new W
|
|
|
414
414
|
}, {
|
|
415
415
|
option: '--SyncAadB2BManagementPolicy [SyncAadB2BManagementPolicy]',
|
|
416
416
|
autocomplete: ['true', 'false']
|
|
417
|
+
}, {
|
|
418
|
+
option: '--AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled [AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled]',
|
|
419
|
+
autocomplete: ['true', 'false']
|
|
417
420
|
});
|
|
418
421
|
}, _SpoTenantSettingsSetCommand_initValidators = function _SpoTenantSettingsSetCommand_initValidators() {
|
|
419
422
|
this.validators.push(async (args) => {
|
|
@@ -496,7 +499,8 @@ SpoTenantSettingsSetCommand.booleanOptions = [
|
|
|
496
499
|
'DisableCustomAppAuthentication',
|
|
497
500
|
'CommentsOnListItemsDisabled',
|
|
498
501
|
'EnableAzureADB2BIntegration',
|
|
499
|
-
'SyncAadB2BManagementPolicy'
|
|
502
|
+
'SyncAadB2BManagementPolicy',
|
|
503
|
+
'AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled'
|
|
500
504
|
];
|
|
501
505
|
export default new SpoTenantSettingsSetCommand();
|
|
502
506
|
//# sourceMappingURL=tenant-settings-set.js.map
|
|
@@ -19,6 +19,7 @@ export default {
|
|
|
19
19
|
APPLICATIONCUSTOMIZER_SET: `${prefix} applicationcustomizer set`,
|
|
20
20
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
21
21
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
22
|
+
BRANDCENTER_COLORS_LIST: `${prefix} brandcenter colors list`,
|
|
22
23
|
BRANDCENTER_SETTINGS_LIST: `${prefix} brandcenter settings list`,
|
|
23
24
|
CDN_GET: `${prefix} cdn get`,
|
|
24
25
|
CDN_ORIGIN_ADD: `${prefix} cdn origin add`,
|
|
@@ -61,6 +62,7 @@ export default {
|
|
|
61
62
|
FIELD_REMOVE: `${prefix} field remove`,
|
|
62
63
|
FIELD_SET: `${prefix} field set`,
|
|
63
64
|
FILE_ADD: `${prefix} file add`,
|
|
65
|
+
FILE_ARCHIVE: `${prefix} file archive`,
|
|
64
66
|
FILE_CHECKIN: `${prefix} file checkin`,
|
|
65
67
|
FILE_CHECKOUT: `${prefix} file checkout`,
|
|
66
68
|
FILE_CHECKOUT_UNDO: `${prefix} file checkout undo`,
|
|
@@ -11,9 +11,24 @@ export const options = z.strictObject({
|
|
|
11
11
|
error: e => `'${e.input}' is not a valid value for option chatId.`
|
|
12
12
|
})
|
|
13
13
|
.alias('i'),
|
|
14
|
+
createdEndDateTime: z.string()
|
|
15
|
+
.refine(time => validation.isValidISODateTime(time), {
|
|
16
|
+
error: e => `'${e.input}' is not a valid ISO date-time string for option createdEndDateTime.`
|
|
17
|
+
})
|
|
18
|
+
.optional(),
|
|
14
19
|
endDateTime: z.string()
|
|
15
20
|
.refine(time => validation.isValidISODateTime(time), {
|
|
16
21
|
error: e => `'${e.input}' is not a valid ISO date-time string for option endDateTime.`
|
|
22
|
+
})
|
|
23
|
+
.optional(),
|
|
24
|
+
modifiedStartDateTime: z.string()
|
|
25
|
+
.refine(time => validation.isValidISODateTime(time), {
|
|
26
|
+
error: e => `'${e.input}' is not a valid ISO date-time string for option modifiedStartDateTime.`
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
modifiedEndDateTime: z.string()
|
|
30
|
+
.refine(time => validation.isValidISODateTime(time), {
|
|
31
|
+
error: e => `'${e.input}' is not a valid ISO date-time string for option modifiedEndDateTime.`
|
|
17
32
|
})
|
|
18
33
|
.optional()
|
|
19
34
|
});
|
|
@@ -30,13 +45,37 @@ class TeamsChatMessageListCommand extends GraphCommand {
|
|
|
30
45
|
get schema() {
|
|
31
46
|
return options;
|
|
32
47
|
}
|
|
48
|
+
getRefinedSchema(schema) {
|
|
49
|
+
return schema
|
|
50
|
+
.refine(options => !(options.endDateTime && options.createdEndDateTime), {
|
|
51
|
+
error: 'Specify either endDateTime or createdEndDateTime, but not both.'
|
|
52
|
+
})
|
|
53
|
+
.refine(options => !(options.createdEndDateTime && (options.modifiedStartDateTime || options.modifiedEndDateTime)), {
|
|
54
|
+
error: 'You cannot combine createdEndDateTime with modifiedStartDateTime or modifiedEndDateTime. These filters operate on different properties.'
|
|
55
|
+
})
|
|
56
|
+
.refine(options => !(options.endDateTime && (options.modifiedStartDateTime || options.modifiedEndDateTime)), {
|
|
57
|
+
error: 'You cannot combine endDateTime with modifiedStartDateTime or modifiedEndDateTime. These filters operate on different properties.'
|
|
58
|
+
});
|
|
59
|
+
}
|
|
33
60
|
async commandAction(logger, args) {
|
|
61
|
+
if (args.options.endDateTime) {
|
|
62
|
+
await this.warn(logger, `Option 'endDateTime' is deprecated. Please use 'createdEndDateTime' instead.`);
|
|
63
|
+
args.options.createdEndDateTime = args.options.endDateTime;
|
|
64
|
+
}
|
|
34
65
|
try {
|
|
35
66
|
let apiUrl = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
|
|
36
|
-
if (args.options.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
67
|
+
if (args.options.createdEndDateTime) {
|
|
68
|
+
apiUrl += `?$filter=createdDateTime lt ${args.options.createdEndDateTime}&$orderby=createdDateTime desc`;
|
|
69
|
+
}
|
|
70
|
+
else if (args.options.modifiedStartDateTime || args.options.modifiedEndDateTime) {
|
|
71
|
+
const filters = [];
|
|
72
|
+
if (args.options.modifiedStartDateTime) {
|
|
73
|
+
filters.push(`lastModifiedDateTime gt ${args.options.modifiedStartDateTime}`);
|
|
74
|
+
}
|
|
75
|
+
if (args.options.modifiedEndDateTime) {
|
|
76
|
+
filters.push(`lastModifiedDateTime lt ${args.options.modifiedEndDateTime}`);
|
|
77
|
+
}
|
|
78
|
+
apiUrl += `?$filter=${filters.join(' and ')}&$orderby=lastModifiedDateTime desc`;
|
|
40
79
|
}
|
|
41
80
|
const items = await odata.getAllItems(apiUrl);
|
|
42
81
|
if (args.options.output && args.options.output !== 'json') {
|
package/dist/request.js
CHANGED
|
@@ -154,10 +154,6 @@ class Request {
|
|
|
154
154
|
options.headers.authorization = `Bearer ${accessToken}`;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
|
|
158
|
-
if (proxyUrl) {
|
|
159
|
-
options.proxy = this.createProxyConfigFromUrl(proxyUrl);
|
|
160
|
-
}
|
|
161
157
|
const res = await this.req(options);
|
|
162
158
|
const end = process.hrtime.bigint();
|
|
163
159
|
timings.api.push(Number(end - start));
|
|
@@ -192,18 +188,6 @@ class Request {
|
|
|
192
188
|
options.url = options.url.substring(0, 8) +
|
|
193
189
|
options.url.substring(8).replace('//', '/');
|
|
194
190
|
}
|
|
195
|
-
createProxyConfigFromUrl(url) {
|
|
196
|
-
const parsedUrl = new URL(url);
|
|
197
|
-
const port = parsedUrl.port || (url.toLowerCase().startsWith('https') ? 443 : 80);
|
|
198
|
-
let authObject = null;
|
|
199
|
-
if (parsedUrl.username && parsedUrl.password) {
|
|
200
|
-
authObject = {
|
|
201
|
-
username: parsedUrl.username,
|
|
202
|
-
password: parsedUrl.password
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
return { host: parsedUrl.hostname, port: Number(port), protocol: 'http', ...(authObject && { auth: authObject }) };
|
|
206
|
-
}
|
|
207
191
|
}
|
|
208
192
|
export default new Request();
|
|
209
193
|
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { odata } from './odata.js';
|
|
2
|
+
import { formatting } from './formatting.js';
|
|
3
|
+
import { cli } from '../cli/cli.js';
|
|
4
|
+
import request from '../request.js';
|
|
5
|
+
export const calendar = {
|
|
6
|
+
async getUserCalendarById(userId, calendarId, calendarGroupId, properties) {
|
|
7
|
+
let url = `https://graph.microsoft.com/v1.0/users('${userId}')/${calendarGroupId ? `calendarGroups/${calendarGroupId}/` : ''}calendars/${calendarId}`;
|
|
8
|
+
if (properties) {
|
|
9
|
+
url += `?$select=${properties}`;
|
|
10
|
+
}
|
|
11
|
+
const requestOptions = {
|
|
12
|
+
url: url,
|
|
13
|
+
headers: {
|
|
14
|
+
accept: 'application/json;odata.metadata=none'
|
|
15
|
+
},
|
|
16
|
+
responseType: 'json'
|
|
17
|
+
};
|
|
18
|
+
return await request.get(requestOptions);
|
|
19
|
+
},
|
|
20
|
+
async getUserCalendarByName(userId, name, calendarGroupId, properties) {
|
|
21
|
+
let url = `https://graph.microsoft.com/v1.0/users('${userId}')/${calendarGroupId ? `calendarGroups/${calendarGroupId}/` : ''}calendars?$filter=name eq '${formatting.encodeQueryParameter(name)}'`;
|
|
22
|
+
if (properties) {
|
|
23
|
+
url += `&$select=${properties}`;
|
|
24
|
+
}
|
|
25
|
+
const calendars = await odata.getAllItems(url);
|
|
26
|
+
if (calendars.length === 0) {
|
|
27
|
+
throw new Error(`The specified calendar '${name}' does not exist.`);
|
|
28
|
+
}
|
|
29
|
+
if (calendars.length > 1) {
|
|
30
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', calendars);
|
|
31
|
+
const selectedCalendar = await cli.handleMultipleResultsFound(`Multiple calendars with name '${name}' found.`, resultAsKeyValuePair);
|
|
32
|
+
return selectedCalendar;
|
|
33
|
+
}
|
|
34
|
+
return calendars[0];
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { odata } from './odata.js';
|
|
2
|
+
import { formatting } from './formatting.js';
|
|
3
|
+
import { cli } from '../cli/cli.js';
|
|
4
|
+
export const calendarGroup = {
|
|
5
|
+
async getUserCalendarGroupByName(userId, displayName, properties) {
|
|
6
|
+
let url = `https://graph.microsoft.com/v1.0/users('${userId}')/calendarGroups?$filter=name eq '${formatting.encodeQueryParameter(displayName)}'`;
|
|
7
|
+
if (properties) {
|
|
8
|
+
url += `&$select=${properties}`;
|
|
9
|
+
}
|
|
10
|
+
const calendarGroups = await odata.getAllItems(url);
|
|
11
|
+
if (calendarGroups.length === 0) {
|
|
12
|
+
throw new Error(`The specified calendar group '${displayName}' does not exist.`);
|
|
13
|
+
}
|
|
14
|
+
if (calendarGroups.length > 1) {
|
|
15
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', calendarGroups);
|
|
16
|
+
const selectedCalendarGroup = await cli.handleMultipleResultsFound(`Multiple calendar groups with name '${displayName}' found.`, resultAsKeyValuePair);
|
|
17
|
+
return selectedCalendarGroup;
|
|
18
|
+
}
|
|
19
|
+
return calendarGroups[0];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=calendarGroup.js.map
|
package/dist/utils/entraApp.js
CHANGED
|
@@ -336,8 +336,15 @@ export const entraApp = {
|
|
|
336
336
|
},
|
|
337
337
|
responseType: 'json'
|
|
338
338
|
};
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
try {
|
|
340
|
+
return await request.get(requestOptions);
|
|
341
|
+
}
|
|
342
|
+
catch (error) {
|
|
343
|
+
if (error?.response?.status === 404) {
|
|
344
|
+
throw Error(`App with objectId '${objectId}' not found in Microsoft Entra ID.`);
|
|
345
|
+
}
|
|
346
|
+
throw error;
|
|
347
|
+
}
|
|
341
348
|
}
|
|
342
349
|
};
|
|
343
350
|
//# sourceMappingURL=entraApp.js.map
|