@pnp/cli-microsoft365 12.0.0-beta.0be7d8d → 12.0.0-beta.1752794
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/generate-openapi-spec.json +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +2 -6
- package/dist/auth/FileTokenStorage.js +0 -3
- package/dist/auth/msalCachePlugin.js +201 -12
- package/dist/googleAnalytics.js +96 -0
- package/dist/m365/commands/logout.js +2 -4
- package/dist/m365/entra/commands/m365group/m365group-remove.js +4 -3
- package/dist/m365/spe/commands/container/container-remove.js +6 -7
- package/dist/m365/spo/commands/app/app-add.js +35 -56
- package/dist/m365/spo/commands/app/app-deploy.js +41 -59
- package/dist/m365/spo/commands/app/app-get.js +40 -56
- package/dist/m365/spo/commands/app/app-install.js +20 -41
- package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
- package/dist/m365/spo/commands/app/app-list.js +26 -44
- package/dist/m365/spo/commands/app/app-remove.js +32 -52
- package/dist/m365/spo/commands/app/app-retract.js +32 -51
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
- package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
- package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
- package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
- package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
- package/dist/m365/spo/commands/feature/feature-list.js +11 -36
- package/dist/m365/spo/commands/field/field-add.js +33 -62
- package/dist/m365/spo/commands/field/field-get.js +30 -57
- package/dist/m365/spo/commands/field/field-list.js +21 -46
- package/dist/m365/spo/commands/field/field-remove.js +32 -63
- package/dist/m365/spo/commands/field/field-set.js +34 -66
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-get.js +4 -3
- package/dist/m365/spo/commands/file/file-remove.js +5 -5
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
- package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
- package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
- package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
- package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
- package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
- package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
- package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
- package/dist/m365/spo/commands/list/list-remove.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
- package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
- package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
- package/dist/m365/spo/commands/page/page-remove.js +7 -7
- package/dist/m365/spo/commands/site/site-list.js +60 -49
- package/dist/m365/spo/commands/site/site-remove.js +7 -7
- package/dist/m365/spo/commands/spo-get.js +5 -0
- package/dist/m365/spo/commands/spo-set.js +10 -21
- package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
- package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
- package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/user/user-ensure.js +24 -60
- package/dist/m365/spo/commands/user/user-get.js +25 -65
- package/dist/m365/spo/commands/user/user-list.js +10 -18
- package/dist/m365/spo/commands/user/user-remove.js +26 -68
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
- package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
- package/dist/m365/spo/commands/web/web-add.js +20 -55
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
- package/dist/m365/spo/commands/web/web-get.js +12 -30
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
- package/dist/m365/spo/commands/web/web-list.js +10 -18
- package/dist/m365/spo/commands/web/web-reindex.js +10 -18
- package/dist/m365/spo/commands/web/web-remove.js +11 -27
- package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
- package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
- package/dist/m365/spo/commands/web/web-rule-list.js +6 -4
- package/dist/m365/spo/commands/web/web-rule-remove.js +0 -3
- package/dist/m365/spo/commands/web/web-set.js +26 -96
- package/dist/m365/spo/commands.js +3 -3
- package/dist/m365/teams/commands/channel/channel-add.js +46 -57
- package/dist/m365/teams/commands/channel/channel-get.js +41 -48
- package/dist/m365/teams/commands/channel/channel-list.js +30 -48
- package/dist/m365/teams/commands/channel/channel-member-add.js +55 -60
- package/dist/m365/teams/commands/channel/channel-member-list.js +49 -61
- package/dist/m365/teams/commands/channel/channel-member-remove.js +64 -68
- package/dist/m365/teams/commands/channel/channel-member-set.js +63 -71
- package/dist/m365/teams/commands/channel/channel-remove.js +49 -57
- package/dist/m365/teams/commands/channel/channel-set.js +49 -62
- package/dist/m365/teams/commands/chat/chat-get.js +30 -45
- package/dist/m365/teams/commands/chat/chat-list.js +22 -42
- package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
- package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
- package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
- package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
- package/dist/m365/teams/commands/tab/tab-get.js +2 -6
- package/dist/m365/teams/commands/team/team-archive.js +2 -6
- package/dist/m365/teams/commands/team/team-remove.js +2 -6
- package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
- package/dist/telemetry.js +7 -11
- package/dist/utils/spo.js +1 -3
- package/dist/utils/urlUtil.js +2 -2
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +4 -4
- package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
- package/docs/docs/cmd/spo/file/file-archive.mdx +9 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
- package/docs/docs/cmd/spo/file/file-remove.mdx +4 -4
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +9 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-archive.mdx +7 -1
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
- package/docs/docs/cmd/spo/list/list-remove.mdx +4 -4
- package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
- package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
- package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
- package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
- package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
- package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
- package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
- package/docs/docs/cmd/spo/site/site-remove.mdx +3 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
- package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
- package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
- package/docs/docs/cmd/spo/web/web-rule-list.mdx +8 -12
- package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -6
- package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
- package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
- package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
- package/npm-shrinkwrap.json +1120 -3216
- package/package.json +23 -33
- package/dist/appInsights.js +0 -43
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoWebRoleAssignmentRemoveCommand_instances, _SpoWebRoleAssignmentRemoveCommand_initTelemetry, _SpoWebRoleAssignmentRemoveCommand_initOptions, _SpoWebRoleAssignmentRemoveCommand_initValidators, _SpoWebRoleAssignmentRemoveCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -11,6 +7,20 @@ import commands from '../../commands.js';
|
|
|
11
7
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
12
8
|
import { spo } from '../../../../utils/spo.js';
|
|
13
9
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
principalId: z.number().optional(),
|
|
16
|
+
upn: z.string().optional(),
|
|
17
|
+
groupName: z.string().optional(),
|
|
18
|
+
entraGroupId: z.string().refine(id => validation.isValidGuid(id), {
|
|
19
|
+
error: e => `'${e.input}' is not a valid GUID for option entraGroupId.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
entraGroupName: z.string().optional(),
|
|
22
|
+
force: z.boolean().optional().alias('f')
|
|
23
|
+
});
|
|
14
24
|
class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
15
25
|
get name() {
|
|
16
26
|
return commands.WEB_ROLEASSIGNMENT_REMOVE;
|
|
@@ -18,13 +28,17 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
18
28
|
get description() {
|
|
19
29
|
return 'Removes a role assignment from web permissions';
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema.refine(options => [options.principalId, options.upn, options.groupName, options.entraGroupId, options.entraGroupName].filter(x => x !== undefined).length === 1, {
|
|
36
|
+
error: `Specify either 'principalId', 'upn', 'groupName', 'entraGroupId', or 'entraGroupName'.`,
|
|
37
|
+
params: {
|
|
38
|
+
customCode: 'optionSet',
|
|
39
|
+
options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName']
|
|
40
|
+
}
|
|
41
|
+
});
|
|
28
42
|
}
|
|
29
43
|
async commandAction(logger, args) {
|
|
30
44
|
if (args.options.force) {
|
|
@@ -42,7 +56,10 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
42
56
|
await logger.logToStderr(`Removing role assignment from web ${options.webUrl}...`);
|
|
43
57
|
}
|
|
44
58
|
try {
|
|
45
|
-
if (options.
|
|
59
|
+
if (options.principalId) {
|
|
60
|
+
await this.removeRoleAssignmentWithOptions(options.webUrl, options.principalId, logger);
|
|
61
|
+
}
|
|
62
|
+
else if (options.upn) {
|
|
46
63
|
const principalId = await this.getUserPrincipalId(options, logger);
|
|
47
64
|
await this.removeRoleAssignmentWithOptions(options.webUrl, principalId, logger);
|
|
48
65
|
}
|
|
@@ -89,49 +106,5 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
89
106
|
return user.Id;
|
|
90
107
|
}
|
|
91
108
|
}
|
|
92
|
-
_SpoWebRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoWebRoleAssignmentRemoveCommand_initTelemetry = function _SpoWebRoleAssignmentRemoveCommand_initTelemetry() {
|
|
93
|
-
this.telemetry.push((args) => {
|
|
94
|
-
Object.assign(this.telemetryProperties, {
|
|
95
|
-
principalId: typeof args.options.principalId !== 'undefined',
|
|
96
|
-
upn: typeof args.options.upn !== 'undefined',
|
|
97
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
98
|
-
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
99
|
-
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
100
|
-
force: (!(!args.options.force)).toString()
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initOptions = function _SpoWebRoleAssignmentRemoveCommand_initOptions() {
|
|
104
|
-
this.options.unshift({
|
|
105
|
-
option: '-u, --webUrl <webUrl>'
|
|
106
|
-
}, {
|
|
107
|
-
option: '--principalId [principalId]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '--upn [upn]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '--groupName [groupName]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '--entraGroupId [entraGroupId]'
|
|
114
|
-
}, {
|
|
115
|
-
option: '--entraGroupName [entraGroupName]'
|
|
116
|
-
}, {
|
|
117
|
-
option: '-f, --force'
|
|
118
|
-
});
|
|
119
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initValidators = function _SpoWebRoleAssignmentRemoveCommand_initValidators() {
|
|
120
|
-
this.validators.push(async (args) => {
|
|
121
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
122
|
-
if (isValidSharePointUrl !== true) {
|
|
123
|
-
return isValidSharePointUrl;
|
|
124
|
-
}
|
|
125
|
-
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
126
|
-
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
127
|
-
}
|
|
128
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
129
|
-
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
});
|
|
133
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initOptionSets = function _SpoWebRoleAssignmentRemoveCommand_initOptionSets() {
|
|
134
|
-
this.optionSets.push({ options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] });
|
|
135
|
-
};
|
|
136
109
|
export default new SpoWebRoleAssignmentRemoveCommand();
|
|
137
110
|
//# sourceMappingURL=web-roleassignment-remove.js.map
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
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 _SpoWebRoleInheritanceBreakCommand_instances, _SpoWebRoleInheritanceBreakCommand_initTelemetry, _SpoWebRoleInheritanceBreakCommand_initOptions, _SpoWebRoleInheritanceBreakCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
clearExistingPermissions: z.boolean().optional().alias('c'),
|
|
14
|
+
force: z.boolean().optional().alias('f')
|
|
15
|
+
});
|
|
12
16
|
class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
13
17
|
get name() {
|
|
14
18
|
return commands.WEB_ROLEINHERITANCE_BREAK;
|
|
@@ -16,12 +20,8 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
16
20
|
get description() {
|
|
17
21
|
return 'Breaks role inheritance of subsite';
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoWebRoleInheritanceBreakCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initValidators).call(this);
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
27
|
if (this.verbose) {
|
|
@@ -54,29 +54,5 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
_SpoWebRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoWebRoleInheritanceBreakCommand_initTelemetry = function _SpoWebRoleInheritanceBreakCommand_initTelemetry() {
|
|
58
|
-
this.telemetry.push((args) => {
|
|
59
|
-
Object.assign(this.telemetryProperties, {
|
|
60
|
-
clearExistingPermissions: !!args.options.clearExistingPermissions,
|
|
61
|
-
force: !!args.options.force
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _SpoWebRoleInheritanceBreakCommand_initOptions = function _SpoWebRoleInheritanceBreakCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '-u, --webUrl <webUrl>'
|
|
67
|
-
}, {
|
|
68
|
-
option: '-c, --clearExistingPermissions'
|
|
69
|
-
}, {
|
|
70
|
-
option: '-f, --force'
|
|
71
|
-
});
|
|
72
|
-
}, _SpoWebRoleInheritanceBreakCommand_initValidators = function _SpoWebRoleInheritanceBreakCommand_initValidators() {
|
|
73
|
-
this.validators.push(async (args) => {
|
|
74
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
75
|
-
if (isValidSharePointUrl !== true) {
|
|
76
|
-
return isValidSharePointUrl;
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
57
|
export default new SpoWebRoleInheritanceBreakCommand();
|
|
82
58
|
//# sourceMappingURL=web-roleinheritance-break.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
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 _SpoWebRoleInheritanceResetCommand_instances, _SpoWebRoleInheritanceResetCommand_initTelemetry, _SpoWebRoleInheritanceResetCommand_initOptions, _SpoWebRoleInheritanceResetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
12
15
|
class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.WEB_ROLEINHERITANCE_RESET;
|
|
@@ -16,12 +19,8 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
|
16
19
|
get description() {
|
|
17
20
|
return 'Restores role inheritance of subsite';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoWebRoleInheritanceResetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
if (this.verbose) {
|
|
@@ -55,22 +54,5 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
_SpoWebRoleInheritanceResetCommand_instances = new WeakSet(), _SpoWebRoleInheritanceResetCommand_initTelemetry = function _SpoWebRoleInheritanceResetCommand_initTelemetry() {
|
|
59
|
-
this.telemetry.push((args) => {
|
|
60
|
-
Object.assign(this.telemetryProperties, {
|
|
61
|
-
force: (!(!args.options.force)).toString()
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _SpoWebRoleInheritanceResetCommand_initOptions = function _SpoWebRoleInheritanceResetCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '-u, --webUrl <webUrl>'
|
|
67
|
-
}, {
|
|
68
|
-
option: '-f, --force'
|
|
69
|
-
});
|
|
70
|
-
}, _SpoWebRoleInheritanceResetCommand_initValidators = function _SpoWebRoleInheritanceResetCommand_initValidators() {
|
|
71
|
-
this.validators.push(async (args) => {
|
|
72
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
57
|
export default new SpoWebRoleInheritanceResetCommand();
|
|
76
58
|
//# sourceMappingURL=web-roleinheritance-reset.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
|
+
import commands from '../../commands.js';
|
|
8
|
+
const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().alias('u')
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint URL.`
|
|
13
|
+
}),
|
|
14
|
+
id: z.uuid()
|
|
15
|
+
});
|
|
16
|
+
class SpoWebRuleGetCommand extends SpoCommand {
|
|
17
|
+
get name() {
|
|
18
|
+
return commands.WEB_RULE_GET;
|
|
19
|
+
}
|
|
20
|
+
get description() {
|
|
21
|
+
return 'Retrieves details of a specific rule from a SharePoint site list';
|
|
22
|
+
}
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
|
+
}
|
|
26
|
+
async commandAction(logger, args) {
|
|
27
|
+
try {
|
|
28
|
+
if (this.verbose) {
|
|
29
|
+
await logger.logToStderr(`Retrieving rule with id '${args.options.id}' from site '${args.options.webUrl}'...`);
|
|
30
|
+
}
|
|
31
|
+
const requestOptions = {
|
|
32
|
+
url: `${args.options.webUrl}/_api/web/alerts/GetById('${formatting.encodeQueryParameter(args.options.id)}')?$expand=List,User,List/Rootfolder&$select=*,List/Id,List/Title,List/Rootfolder/ServerRelativeUrl`,
|
|
33
|
+
headers: {
|
|
34
|
+
accept: 'application/json;odata=nometadata'
|
|
35
|
+
},
|
|
36
|
+
responseType: 'json'
|
|
37
|
+
};
|
|
38
|
+
const res = await request.get(requestOptions);
|
|
39
|
+
await logger.log(res);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
this.handleRejectedODataJsonPromise(err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default new SpoWebRuleGetCommand();
|
|
47
|
+
//# sourceMappingURL=web-rule-get.js.map
|
|
@@ -29,9 +29,6 @@ class SpoWebRuleListCommand extends SpoCommand {
|
|
|
29
29
|
get description() {
|
|
30
30
|
return 'Lists all SharePoint list alerts';
|
|
31
31
|
}
|
|
32
|
-
alias() {
|
|
33
|
-
return [commands.WEB_ALERT_LIST];
|
|
34
|
-
}
|
|
35
32
|
defaultProperties() {
|
|
36
33
|
return ['ID', 'Title', 'UserPrincipalName'];
|
|
37
34
|
}
|
|
@@ -75,7 +72,12 @@ class SpoWebRuleListCommand extends SpoCommand {
|
|
|
75
72
|
listId = args.options.listId;
|
|
76
73
|
}
|
|
77
74
|
else if (args.options.listUrl || args.options.listTitle) {
|
|
78
|
-
|
|
75
|
+
try {
|
|
76
|
+
listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
this.handleRejectedODataJsonPromise(err);
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
if (listId) {
|
|
81
83
|
filters.push(`List/Id eq guid'${formatting.encodeQueryParameter(listId)}'`);
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoWebSetCommand_instances, _a, _SpoWebSetCommand_initTelemetry, _SpoWebSetCommand_initOptions, _SpoWebSetCommand_initTypes, _SpoWebSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.looseObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
description: z.string().optional().alias('d'),
|
|
10
|
+
headerEmphasis: z.enum(['0', '1', '2', '3'], {
|
|
11
|
+
error: e => `${e.input} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`
|
|
12
|
+
}).optional(),
|
|
13
|
+
headerLayout: z.enum(['standard', 'compact']).optional(),
|
|
14
|
+
megaMenuEnabled: z.boolean().optional(),
|
|
15
|
+
quickLaunchEnabled: z.boolean().optional(),
|
|
16
|
+
siteLogoUrl: z.string().optional(),
|
|
17
|
+
title: z.string().optional().alias('t'),
|
|
18
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
19
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
20
|
+
}).alias('u'),
|
|
21
|
+
footerEnabled: z.boolean().optional(),
|
|
22
|
+
navAudienceTargetingEnabled: z.boolean().optional(),
|
|
23
|
+
searchScope: z.preprocess(value => String(value).toLowerCase(), z.enum(['defaultscope', 'tenant', 'hub', 'site'])).optional(),
|
|
24
|
+
welcomePage: z.string().optional()
|
|
25
|
+
});
|
|
11
26
|
class SpoWebSetCommand extends SpoCommand {
|
|
12
27
|
get name() {
|
|
13
28
|
return commands.WEB_SET;
|
|
@@ -15,17 +30,12 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
15
30
|
get description() {
|
|
16
31
|
return 'Updates subsite properties';
|
|
17
32
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoWebSetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTypes).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initValidators).call(this);
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
25
35
|
}
|
|
26
36
|
async commandAction(logger, args) {
|
|
27
37
|
const payload = {};
|
|
28
|
-
this.
|
|
38
|
+
this.addUnknownOptionsToPayloadZod(payload, args.options);
|
|
29
39
|
if (args.options.title) {
|
|
30
40
|
payload.Title = args.options.title;
|
|
31
41
|
}
|
|
@@ -39,7 +49,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
39
49
|
payload.QuickLaunchEnabled = args.options.quickLaunchEnabled;
|
|
40
50
|
}
|
|
41
51
|
if (typeof args.options.headerEmphasis !== 'undefined') {
|
|
42
|
-
payload.HeaderEmphasis = args.options.headerEmphasis;
|
|
52
|
+
payload.HeaderEmphasis = Number(args.options.headerEmphasis);
|
|
43
53
|
}
|
|
44
54
|
if (typeof args.options.headerLayout !== 'undefined') {
|
|
45
55
|
payload.HeaderLayout = args.options.headerLayout === 'standard' ? 1 : 2;
|
|
@@ -55,7 +65,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
55
65
|
}
|
|
56
66
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
57
67
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
58
|
-
payload.SearchScope =
|
|
68
|
+
payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
|
|
59
69
|
}
|
|
60
70
|
try {
|
|
61
71
|
const requestOptions = {
|
|
@@ -97,86 +107,6 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
97
107
|
return true;
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
|
-
_a = SpoWebSetCommand, _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = function _SpoWebSetCommand_initTelemetry() {
|
|
101
|
-
this.telemetry.push((args) => {
|
|
102
|
-
Object.assign(this.telemetryProperties, {
|
|
103
|
-
description: typeof args.options.description !== 'undefined',
|
|
104
|
-
headerEmphasis: typeof args.options.headerEmphasis !== 'undefined',
|
|
105
|
-
headerLayout: typeof args.options.headerLayout !== 'undefined',
|
|
106
|
-
megaMenuEnabled: typeof args.options.megaMenuEnabled !== 'undefined',
|
|
107
|
-
siteLogoUrl: typeof args.options.siteLogoUrl !== 'undefined',
|
|
108
|
-
title: typeof args.options.title !== 'undefined',
|
|
109
|
-
quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
|
|
110
|
-
footerEnabled: typeof args.options.footerEnabled !== 'undefined',
|
|
111
|
-
navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
|
|
112
|
-
searchScope: typeof args.options.searchScope !== 'undefined',
|
|
113
|
-
welcomePage: typeof args.options.welcomePage !== 'undefined'
|
|
114
|
-
});
|
|
115
|
-
this.trackUnknownOptions(this.telemetryProperties, args.options);
|
|
116
|
-
});
|
|
117
|
-
}, _SpoWebSetCommand_initOptions = function _SpoWebSetCommand_initOptions() {
|
|
118
|
-
this.options.unshift({
|
|
119
|
-
option: '-u, --url <url>'
|
|
120
|
-
}, {
|
|
121
|
-
option: '-t, --title [title]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '-d, --description [description]'
|
|
124
|
-
}, {
|
|
125
|
-
option: '--siteLogoUrl [siteLogoUrl]'
|
|
126
|
-
}, {
|
|
127
|
-
option: '--quickLaunchEnabled [quickLaunchEnabled]',
|
|
128
|
-
autocomplete: ['true', 'false']
|
|
129
|
-
}, {
|
|
130
|
-
option: '--headerLayout [headerLayout]',
|
|
131
|
-
autocomplete: ['standard', 'compact']
|
|
132
|
-
}, {
|
|
133
|
-
option: '--headerEmphasis [headerEmphasis]',
|
|
134
|
-
autocomplete: ['0', '1', '2', '3']
|
|
135
|
-
}, {
|
|
136
|
-
option: '--megaMenuEnabled [megaMenuEnabled]',
|
|
137
|
-
autocomplete: ['true', 'false']
|
|
138
|
-
}, {
|
|
139
|
-
option: '--footerEnabled [footerEnabled]',
|
|
140
|
-
autocomplete: ['true', 'false']
|
|
141
|
-
}, {
|
|
142
|
-
option: '--navAudienceTargetingEnabled [navAudienceTargetingEnabled]',
|
|
143
|
-
autocomplete: ['true', 'false']
|
|
144
|
-
}, {
|
|
145
|
-
option: '--searchScope [searchScope]',
|
|
146
|
-
autocomplete: _a.searchScopeOptions
|
|
147
|
-
}, {
|
|
148
|
-
option: '--welcomePage [welcomePage]'
|
|
149
|
-
});
|
|
150
|
-
}, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
|
|
151
|
-
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
|
|
152
|
-
}, _SpoWebSetCommand_initValidators = function _SpoWebSetCommand_initValidators() {
|
|
153
|
-
this.validators.push(async (args) => {
|
|
154
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
155
|
-
if (isValidSharePointUrl !== true) {
|
|
156
|
-
return isValidSharePointUrl;
|
|
157
|
-
}
|
|
158
|
-
if (typeof args.options.headerEmphasis !== 'undefined') {
|
|
159
|
-
if (isNaN(args.options.headerEmphasis)) {
|
|
160
|
-
return `${args.options.headerEmphasis} is not a number`;
|
|
161
|
-
}
|
|
162
|
-
if ([0, 1, 2, 3].indexOf(args.options.headerEmphasis) < 0) {
|
|
163
|
-
return `${args.options.headerEmphasis} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (typeof args.options.headerLayout !== 'undefined') {
|
|
167
|
-
if (['standard', 'compact'].indexOf(args.options.headerLayout) < 0) {
|
|
168
|
-
return `${args.options.headerLayout} is not a valid value for headerLayout. Allowed values are standard|compact`;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (typeof args.options.searchScope !== 'undefined') {
|
|
172
|
-
const searchScope = args.options.searchScope.toString().toLowerCase();
|
|
173
|
-
if (_a.searchScopeOptions.indexOf(searchScope) < 0) {
|
|
174
|
-
return `${args.options.searchScope} is not a valid value for searchScope. Allowed values are DefaultScope|Tenant|Hub|Site`;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return true;
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
110
|
SpoWebSetCommand.searchScopeOptions = ['defaultscope', 'tenant', 'hub', 'site'];
|
|
181
111
|
export default new SpoWebSetCommand();
|
|
182
112
|
//# sourceMappingURL=web-set.js.map
|
|
@@ -72,6 +72,7 @@ export default {
|
|
|
72
72
|
FILE_MOVE: `${prefix} file move`,
|
|
73
73
|
FILE_REMOVE: `${prefix} file remove`,
|
|
74
74
|
FILE_RENAME: `${prefix} file rename`,
|
|
75
|
+
FILE_UNARCHIVE: `${prefix} file unarchive`,
|
|
75
76
|
FILE_RETENTIONLABEL_ENSURE: `${prefix} file retentionlabel ensure`,
|
|
76
77
|
FILE_RETENTIONLABEL_REMOVE: `${prefix} file retentionlabel remove`,
|
|
77
78
|
FILE_ROLEASSIGNMENT_ADD: `${prefix} file roleassignment add`,
|
|
@@ -85,7 +86,6 @@ export default {
|
|
|
85
86
|
FILE_SHARINGLINK_LIST: `${prefix} file sharinglink list`,
|
|
86
87
|
FILE_SHARINGLINK_REMOVE: `${prefix} file sharinglink remove`,
|
|
87
88
|
FILE_SHARINGLINK_SET: `${prefix} file sharinglink set`,
|
|
88
|
-
FILE_UNARCHIVE: `${prefix} file unarchive`,
|
|
89
89
|
FILE_VERSION_CLEAR: `${prefix} file version clear`,
|
|
90
90
|
FILE_VERSION_GET: `${prefix} file version get`,
|
|
91
91
|
FILE_VERSION_KEEP: `${prefix} file version keep`,
|
|
@@ -112,6 +112,7 @@ export default {
|
|
|
112
112
|
FOLDER_SHARINGLINK_LIST: `${prefix} folder sharinglink list`,
|
|
113
113
|
FOLDER_SHARINGLINK_REMOVE: `${prefix} folder sharinglink remove`,
|
|
114
114
|
FOLDER_SHARINGLINK_SET: `${prefix} folder sharinglink set`,
|
|
115
|
+
FOLDER_UNARCHIVE: `${prefix} folder unarchive`,
|
|
115
116
|
GET: `${prefix} get`,
|
|
116
117
|
GROUP_ADD: `${prefix} group add`,
|
|
117
118
|
GROUP_GET: `${prefix} group get`,
|
|
@@ -366,8 +367,6 @@ export default {
|
|
|
366
367
|
USERPROFILE_GET: `${prefix} userprofile get`,
|
|
367
368
|
USERPROFILE_SET: `${prefix} userprofile set`,
|
|
368
369
|
WEB_ADD: `${prefix} web add`,
|
|
369
|
-
WEB_ALERT_LIST: `${prefix} web alert list`,
|
|
370
|
-
WEB_ALERT_REMOVE: `${prefix} web alert remove`,
|
|
371
370
|
WEB_CLIENTSIDEWEBPART_LIST: `${prefix} web clientsidewebpart list`,
|
|
372
371
|
WEB_GET: `${prefix} web get`,
|
|
373
372
|
WEB_INSTALLEDLANGUAGE_LIST: `${prefix} web installedlanguage list`,
|
|
@@ -379,6 +378,7 @@ export default {
|
|
|
379
378
|
WEB_ROLEASSIGNMENT_ADD: `${prefix} web roleassignment add`,
|
|
380
379
|
WEB_ROLEINHERITANCE_BREAK: `${prefix} web roleinheritance break`,
|
|
381
380
|
WEB_ROLEINHERITANCE_RESET: `${prefix} web roleinheritance reset`,
|
|
381
|
+
WEB_RULE_GET: `${prefix} web rule get`,
|
|
382
382
|
WEB_RULE_LIST: `${prefix} web rule list`,
|
|
383
383
|
WEB_RULE_REMOVE: `${prefix} web rule remove`,
|
|
384
384
|
WEB_SET: `${prefix} web set`
|
|
@@ -1,14 +1,30 @@
|
|
|
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 _TeamsChannelAddCommand_instances, _TeamsChannelAddCommand_initTelemetry, _TeamsChannelAddCommand_initOptions, _TeamsChannelAddCommand_initValidators, _TeamsChannelAddCommand_initOptionSets;
|
|
7
1
|
import request from '../../../../request.js';
|
|
8
2
|
import { validation } from '../../../../utils/validation.js';
|
|
9
3
|
import GraphCommand from "../../../base/GraphCommand.js";
|
|
10
4
|
import commands from '../../commands.js';
|
|
11
5
|
import { teams } from '../../../../utils/teams.js';
|
|
6
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
teamId: z.string()
|
|
11
|
+
.refine(val => validation.isValidGuid(val), {
|
|
12
|
+
message: 'The value must be a valid GUID.'
|
|
13
|
+
})
|
|
14
|
+
.optional()
|
|
15
|
+
.alias('i'),
|
|
16
|
+
teamName: z.string()
|
|
17
|
+
.optional(),
|
|
18
|
+
name: z.string()
|
|
19
|
+
.alias('n'),
|
|
20
|
+
description: z.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.alias('d'),
|
|
23
|
+
type: z.enum(['standard', 'private', 'shared'])
|
|
24
|
+
.optional(),
|
|
25
|
+
owner: z.string()
|
|
26
|
+
.optional()
|
|
27
|
+
});
|
|
12
28
|
class TeamsChannelAddCommand extends GraphCommand {
|
|
13
29
|
get name() {
|
|
14
30
|
return commands.CHANNEL_ADD;
|
|
@@ -16,13 +32,30 @@ class TeamsChannelAddCommand extends GraphCommand {
|
|
|
16
32
|
get description() {
|
|
17
33
|
return 'Adds a channel to the specified Microsoft Teams team';
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
get schema() {
|
|
36
|
+
return options;
|
|
37
|
+
}
|
|
38
|
+
getRefinedSchema(schema) {
|
|
39
|
+
return schema
|
|
40
|
+
.refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
|
|
41
|
+
message: 'Specify either teamId or teamName, but not both.',
|
|
42
|
+
params: {
|
|
43
|
+
customCode: 'optionSet',
|
|
44
|
+
options: ['teamId', 'teamName']
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
.refine(opts => !((opts.type === 'private' || opts.type === 'shared') && !opts.owner), {
|
|
48
|
+
message: 'Specify owner when creating a private or shared channel.',
|
|
49
|
+
params: {
|
|
50
|
+
customCode: 'required'
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
.refine(opts => !((opts.type !== 'private' && opts.type !== 'shared') && opts.owner), {
|
|
54
|
+
message: 'Specify owner only when creating a private or shared channel.',
|
|
55
|
+
params: {
|
|
56
|
+
customCode: 'required'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
26
59
|
}
|
|
27
60
|
async commandAction(logger, args) {
|
|
28
61
|
try {
|
|
@@ -66,49 +99,5 @@ class TeamsChannelAddCommand extends GraphCommand {
|
|
|
66
99
|
return request.post(requestOptions);
|
|
67
100
|
}
|
|
68
101
|
}
|
|
69
|
-
_TeamsChannelAddCommand_instances = new WeakSet(), _TeamsChannelAddCommand_initTelemetry = function _TeamsChannelAddCommand_initTelemetry() {
|
|
70
|
-
this.telemetry.push((args) => {
|
|
71
|
-
Object.assign(this.telemetryProperties, {
|
|
72
|
-
description: typeof args.options.description !== 'undefined',
|
|
73
|
-
teamId: typeof args.options.teamId !== 'undefined',
|
|
74
|
-
teamName: typeof args.options.teamName !== 'undefined',
|
|
75
|
-
type: args.options.type || 'standard',
|
|
76
|
-
owner: typeof args.options.owner !== 'undefined'
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}, _TeamsChannelAddCommand_initOptions = function _TeamsChannelAddCommand_initOptions() {
|
|
80
|
-
this.options.unshift({
|
|
81
|
-
option: '-i, --teamId [teamId]'
|
|
82
|
-
}, {
|
|
83
|
-
option: '--teamName [teamName]'
|
|
84
|
-
}, {
|
|
85
|
-
option: '-n, --name <name>'
|
|
86
|
-
}, {
|
|
87
|
-
option: '-d, --description [description]'
|
|
88
|
-
}, {
|
|
89
|
-
option: '--type [type]',
|
|
90
|
-
autocomplete: ['standard', 'private', 'shared']
|
|
91
|
-
}, {
|
|
92
|
-
option: '--owner [owner]'
|
|
93
|
-
});
|
|
94
|
-
}, _TeamsChannelAddCommand_initValidators = function _TeamsChannelAddCommand_initValidators() {
|
|
95
|
-
this.validators.push(async (args) => {
|
|
96
|
-
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
97
|
-
return `${args.options.teamId} is not a valid GUID`;
|
|
98
|
-
}
|
|
99
|
-
if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type) === -1) {
|
|
100
|
-
return `${args.options.type} is not a valid type value. Allowed values standard|private|shared.`;
|
|
101
|
-
}
|
|
102
|
-
if ((args.options.type === 'private' || args.options.type === 'shared') && !args.options.owner) {
|
|
103
|
-
return `Specify owner when creating a ${args.options.type} channel.`;
|
|
104
|
-
}
|
|
105
|
-
if ((args.options.type !== 'private' && args.options.type !== 'shared') && args.options.owner) {
|
|
106
|
-
return `Specify owner only when creating a private or shared channel.`;
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
109
|
-
});
|
|
110
|
-
}, _TeamsChannelAddCommand_initOptionSets = function _TeamsChannelAddCommand_initOptionSets() {
|
|
111
|
-
this.optionSets.push({ options: ['teamId', 'teamName'] });
|
|
112
|
-
};
|
|
113
102
|
export default new TeamsChannelAddCommand();
|
|
114
103
|
//# sourceMappingURL=channel-add.js.map
|