@pnp/cli-microsoft365 12.0.0 → 12.1.0-beta.0c2915d
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +19 -18
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +39 -65
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +28 -56
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +40 -68
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +24 -66
- package/dist/m365/spo/commands/file/file-add.js +51 -77
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-checkin.js +35 -64
- package/dist/m365/spo/commands/file/file-checkout-undo.js +25 -49
- package/dist/m365/spo/commands/file/file-checkout.js +24 -47
- package/dist/m365/spo/commands/file/file-copy.js +37 -68
- package/dist/m365/spo/commands/file/file-get.js +44 -79
- package/dist/m365/spo/commands/file/file-list.js +16 -39
- package/dist/m365/spo/commands/file/file-move.js +30 -68
- package/dist/m365/spo/commands/file/file-remove.js +27 -56
- package/dist/m365/spo/commands/file/file-rename.js +15 -36
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +26 -51
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +25 -50
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +47 -75
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +39 -70
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +26 -52
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +25 -49
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +24 -47
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +46 -70
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +33 -57
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +25 -47
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +32 -53
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +26 -51
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +29 -55
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +25 -45
- package/dist/m365/spo/commands/file/file-version-get.js +25 -43
- package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +24 -41
- package/dist/m365/spo/commands/file/file-version-remove.js +26 -47
- package/dist/m365/spo/commands/file/file-version-restore.js +26 -47
- package/dist/m365/spo/commands/folder/folder-add.js +19 -48
- package/dist/m365/spo/commands/folder/folder-copy.js +36 -62
- package/dist/m365/spo/commands/folder/folder-get.js +30 -51
- package/dist/m365/spo/commands/folder/folder-list.js +16 -39
- package/dist/m365/spo/commands/folder/folder-move.js +36 -62
- package/dist/m365/spo/commands/folder/folder-remove.js +15 -36
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +30 -48
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +30 -50
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +49 -79
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +37 -67
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +15 -36
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +14 -33
- package/dist/m365/spo/commands/folder/folder-set.js +28 -48
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +58 -86
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +33 -50
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +33 -42
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +32 -47
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +34 -41
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +38 -43
- package/dist/m365/spo/commands/group/group-add.js +19 -60
- package/dist/m365/spo/commands/group/group-get.js +32 -45
- package/dist/m365/spo/commands/group/group-list.js +13 -27
- package/dist/m365/spo/commands/group/group-member-add.js +52 -84
- package/dist/m365/spo/commands/group/group-member-list.js +24 -38
- package/dist/m365/spo/commands/group/group-member-remove.js +49 -68
- package/dist/m365/spo/commands/group/group-remove.js +25 -45
- package/dist/m365/spo/commands/group/group-set.js +36 -79
- package/dist/m365/spo/commands/propertybag/propertybag-get.js +14 -29
- package/dist/m365/spo/commands/propertybag/propertybag-list.js +13 -27
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +15 -32
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +15 -31
- package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +45 -44
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +14 -25
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +12 -18
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +15 -35
- package/npm-shrinkwrap.json +57 -57
- package/package.json +2 -2
|
@@ -1,14 +1,20 @@
|
|
|
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 _SpoGroupMemberListCommand_instances, _SpoGroupMemberListCommand_initTelemetry, _SpoGroupMemberListCommand_initOptions, _SpoGroupMemberListCommand_initValidators, _SpoGroupMemberListCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.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()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
groupId: z.coerce.number().int().positive().optional(),
|
|
16
|
+
groupName: z.string().optional()
|
|
17
|
+
});
|
|
12
18
|
class SpoGroupMemberListCommand extends SpoCommand {
|
|
13
19
|
get name() {
|
|
14
20
|
return commands.GROUP_MEMBER_LIST;
|
|
@@ -19,13 +25,18 @@ class SpoGroupMemberListCommand extends SpoCommand {
|
|
|
19
25
|
defaultProperties() {
|
|
20
26
|
return ['Title', 'UserPrincipalName', 'Id', 'Email'];
|
|
21
27
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(o => [o.groupId, o.groupName].filter(x => x !== undefined).length === 1, {
|
|
34
|
+
error: `Specify either 'groupId' or 'groupName', but not both.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['groupId', 'groupName']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
29
40
|
}
|
|
30
41
|
async commandAction(logger, args) {
|
|
31
42
|
if (this.verbose) {
|
|
@@ -43,30 +54,5 @@ class SpoGroupMemberListCommand extends SpoCommand {
|
|
|
43
54
|
}
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
_SpoGroupMemberListCommand_instances = new WeakSet(), _SpoGroupMemberListCommand_initTelemetry = function _SpoGroupMemberListCommand_initTelemetry() {
|
|
47
|
-
this.telemetry.push((args) => {
|
|
48
|
-
Object.assign(this.telemetryProperties, {
|
|
49
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
50
|
-
groupName: typeof args.options.groupName !== 'undefined'
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}, _SpoGroupMemberListCommand_initOptions = function _SpoGroupMemberListCommand_initOptions() {
|
|
54
|
-
this.options.unshift({
|
|
55
|
-
option: '-u, --webUrl <webUrl>'
|
|
56
|
-
}, {
|
|
57
|
-
option: '--groupId [groupId]'
|
|
58
|
-
}, {
|
|
59
|
-
option: '--groupName [groupName]'
|
|
60
|
-
});
|
|
61
|
-
}, _SpoGroupMemberListCommand_initValidators = function _SpoGroupMemberListCommand_initValidators() {
|
|
62
|
-
this.validators.push(async (args) => {
|
|
63
|
-
if (args.options.groupId && isNaN(args.options.groupId)) {
|
|
64
|
-
return `Specified "groupId" ${args.options.groupId} is not valid`;
|
|
65
|
-
}
|
|
66
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
67
|
-
});
|
|
68
|
-
}, _SpoGroupMemberListCommand_initOptionSets = function _SpoGroupMemberListCommand_initOptionSets() {
|
|
69
|
-
this.optionSets.push({ options: ['groupName', 'groupId'] });
|
|
70
|
-
};
|
|
71
57
|
export default new SpoGroupMemberListCommand();
|
|
72
58
|
//# sourceMappingURL=group-member-list.js.map
|
|
@@ -1,10 +1,6 @@
|
|
|
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 _SpoGroupMemberRemoveCommand_instances, _SpoGroupMemberRemoveCommand_initTelemetry, _SpoGroupMemberRemoveCommand_initOptions, _SpoGroupMemberRemoveCommand_initValidators, _SpoGroupMemberRemoveCommand_initOptionSets;
|
|
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 { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -12,6 +8,34 @@ import entraUserGetCommand from '../../../entra/commands/user/user-get.js';
|
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import SpoGroupMemberListCommand from './group-member-list.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
groupId: z.coerce.number().int().positive().optional(),
|
|
19
|
+
groupName: z.string().optional(),
|
|
20
|
+
userName: z.string()
|
|
21
|
+
.refine(userName => validation.isValidUserPrincipalName(userName), {
|
|
22
|
+
error: e => `'${e.input}' is not a valid userName.`
|
|
23
|
+
})
|
|
24
|
+
.optional(),
|
|
25
|
+
email: z.string()
|
|
26
|
+
.refine(email => validation.isValidUserPrincipalName(email), {
|
|
27
|
+
error: e => `'${e.input}' is not a valid email.`
|
|
28
|
+
})
|
|
29
|
+
.optional(),
|
|
30
|
+
userId: z.number().optional(),
|
|
31
|
+
entraGroupId: z.string()
|
|
32
|
+
.refine(id => validation.isValidGuid(id), {
|
|
33
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
34
|
+
})
|
|
35
|
+
.optional(),
|
|
36
|
+
entraGroupName: z.string().optional(),
|
|
37
|
+
force: z.boolean().optional().alias('f')
|
|
38
|
+
});
|
|
15
39
|
class SpoGroupMemberRemoveCommand extends SpoCommand {
|
|
16
40
|
get name() {
|
|
17
41
|
return commands.GROUP_MEMBER_REMOVE;
|
|
@@ -19,13 +43,25 @@ class SpoGroupMemberRemoveCommand extends SpoCommand {
|
|
|
19
43
|
get description() {
|
|
20
44
|
return 'Removes the specified member from a SharePoint group';
|
|
21
45
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
get schema() {
|
|
47
|
+
return options;
|
|
48
|
+
}
|
|
49
|
+
getRefinedSchema(schema) {
|
|
50
|
+
return schema
|
|
51
|
+
.refine(o => [o.groupId, o.groupName].filter(x => x !== undefined).length === 1, {
|
|
52
|
+
error: `Specify either 'groupId' or 'groupName', but not both.`,
|
|
53
|
+
params: {
|
|
54
|
+
customCode: 'optionSet',
|
|
55
|
+
options: ['groupId', 'groupName']
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
.refine(o => [o.userName, o.email, o.userId, o.entraGroupId, o.entraGroupName].filter(x => x !== undefined).length === 1, {
|
|
59
|
+
error: `Specify either 'userName', 'email', 'userId', 'entraGroupId', or 'entraGroupName', but not multiple.`,
|
|
60
|
+
params: {
|
|
61
|
+
customCode: 'optionSet',
|
|
62
|
+
options: ['userName', 'email', 'userId', 'entraGroupId', 'entraGroupName']
|
|
63
|
+
}
|
|
64
|
+
});
|
|
29
65
|
}
|
|
30
66
|
async getUserName(logger, args) {
|
|
31
67
|
if (args.options.userName) {
|
|
@@ -119,60 +155,5 @@ class SpoGroupMemberRemoveCommand extends SpoCommand {
|
|
|
119
155
|
return foundGroups[0].Id;
|
|
120
156
|
}
|
|
121
157
|
}
|
|
122
|
-
_SpoGroupMemberRemoveCommand_instances = new WeakSet(), _SpoGroupMemberRemoveCommand_initTelemetry = function _SpoGroupMemberRemoveCommand_initTelemetry() {
|
|
123
|
-
this.telemetry.push((args) => {
|
|
124
|
-
Object.assign(this.telemetryProperties, {
|
|
125
|
-
groupId: (!(!args.options.groupId)).toString(),
|
|
126
|
-
groupName: (!(!args.options.groupName)).toString(),
|
|
127
|
-
userName: (!(!args.options.userName)).toString(),
|
|
128
|
-
email: (!(!args.options.email)).toString(),
|
|
129
|
-
userId: (!(!args.options.userId)).toString(),
|
|
130
|
-
entraGroupId: (!(!args.options.entraGroupId)).toString(),
|
|
131
|
-
entraGroupName: (!(!args.options.entraGroupName)).toString(),
|
|
132
|
-
force: (!(!args.options.force)).toString()
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}, _SpoGroupMemberRemoveCommand_initOptions = function _SpoGroupMemberRemoveCommand_initOptions() {
|
|
136
|
-
this.options.unshift({
|
|
137
|
-
option: '-u, --webUrl <webUrl>'
|
|
138
|
-
}, {
|
|
139
|
-
option: '--groupId [groupId]'
|
|
140
|
-
}, {
|
|
141
|
-
option: '--groupName [groupName]'
|
|
142
|
-
}, {
|
|
143
|
-
option: '--userName [userName]'
|
|
144
|
-
}, {
|
|
145
|
-
option: '--email [email]'
|
|
146
|
-
}, {
|
|
147
|
-
option: '--userId [userId]'
|
|
148
|
-
}, {
|
|
149
|
-
option: '--entraGroupId [entraGroupId]'
|
|
150
|
-
}, {
|
|
151
|
-
option: '--entraGroupName [entraGroupName]'
|
|
152
|
-
}, {
|
|
153
|
-
option: '-f, --force'
|
|
154
|
-
});
|
|
155
|
-
}, _SpoGroupMemberRemoveCommand_initValidators = function _SpoGroupMemberRemoveCommand_initValidators() {
|
|
156
|
-
this.validators.push(async (args) => {
|
|
157
|
-
if (args.options.groupId && isNaN(args.options.groupId)) {
|
|
158
|
-
return `Specified "groupId" ${args.options.groupId} is not valid`;
|
|
159
|
-
}
|
|
160
|
-
if (args.options.userId && isNaN(args.options.userId)) {
|
|
161
|
-
return `Specified "userId" ${args.options.userId} is not valid`;
|
|
162
|
-
}
|
|
163
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
164
|
-
return `${args.options.userName} is not a valid userName`;
|
|
165
|
-
}
|
|
166
|
-
if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
|
|
167
|
-
return `${args.options.email} is not a valid email`;
|
|
168
|
-
}
|
|
169
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
170
|
-
return `${args.options.entraGroupId} is not a valid GUID`;
|
|
171
|
-
}
|
|
172
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
173
|
-
});
|
|
174
|
-
}, _SpoGroupMemberRemoveCommand_initOptionSets = function _SpoGroupMemberRemoveCommand_initOptionSets() {
|
|
175
|
-
this.optionSets.push({ options: ['groupName', 'groupId'] }, { options: ['userName', 'email', 'userId', 'entraGroupId', 'entraGroupName'] });
|
|
176
|
-
};
|
|
177
158
|
export default new SpoGroupMemberRemoveCommand();
|
|
178
159
|
//# sourceMappingURL=group-member-remove.js.map
|
|
@@ -1,14 +1,21 @@
|
|
|
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 _SpoGroupRemoveCommand_instances, _SpoGroupRemoveCommand_initTelemetry, _SpoGroupRemoveCommand_initOptions, _SpoGroupRemoveCommand_initValidators, _SpoGroupRemoveCommand_initOptionSets;
|
|
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()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
id: z.number().optional(),
|
|
16
|
+
name: z.string().optional(),
|
|
17
|
+
force: z.boolean().optional().alias('f')
|
|
18
|
+
});
|
|
12
19
|
class SpoGroupRemoveCommand extends SpoCommand {
|
|
13
20
|
get name() {
|
|
14
21
|
return commands.GROUP_REMOVE;
|
|
@@ -16,13 +23,18 @@ class SpoGroupRemoveCommand extends SpoCommand {
|
|
|
16
23
|
get description() {
|
|
17
24
|
return 'Removes group from specific web';
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
28
|
+
}
|
|
29
|
+
getRefinedSchema(schema) {
|
|
30
|
+
return schema
|
|
31
|
+
.refine(o => [o.id, o.name].filter(x => x !== undefined).length === 1, {
|
|
32
|
+
error: `Specify either 'id' or 'name', but not both.`,
|
|
33
|
+
params: {
|
|
34
|
+
customCode: 'optionSet',
|
|
35
|
+
options: ['id', 'name']
|
|
36
|
+
}
|
|
37
|
+
});
|
|
26
38
|
}
|
|
27
39
|
async commandAction(logger, args) {
|
|
28
40
|
const removeGroup = async () => {
|
|
@@ -73,37 +85,5 @@ class SpoGroupRemoveCommand extends SpoCommand {
|
|
|
73
85
|
}
|
|
74
86
|
}
|
|
75
87
|
}
|
|
76
|
-
_SpoGroupRemoveCommand_instances = new WeakSet(), _SpoGroupRemoveCommand_initTelemetry = function _SpoGroupRemoveCommand_initTelemetry() {
|
|
77
|
-
this.telemetry.push((args) => {
|
|
78
|
-
Object.assign(this.telemetryProperties, {
|
|
79
|
-
id: (!(!args.options.id)).toString(),
|
|
80
|
-
name: (!(!args.options.name)).toString(),
|
|
81
|
-
force: (!(!args.options.force)).toString()
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}, _SpoGroupRemoveCommand_initOptions = function _SpoGroupRemoveCommand_initOptions() {
|
|
85
|
-
this.options.unshift({
|
|
86
|
-
option: '-u, --webUrl <webUrl>'
|
|
87
|
-
}, {
|
|
88
|
-
option: '--id [id]'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--name [name]'
|
|
91
|
-
}, {
|
|
92
|
-
option: '-f, --force'
|
|
93
|
-
});
|
|
94
|
-
}, _SpoGroupRemoveCommand_initValidators = function _SpoGroupRemoveCommand_initValidators() {
|
|
95
|
-
this.validators.push(async (args) => {
|
|
96
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
97
|
-
if (isValidSharePointUrl !== true) {
|
|
98
|
-
return isValidSharePointUrl;
|
|
99
|
-
}
|
|
100
|
-
if (args.options.id && typeof args.options.id !== 'number') {
|
|
101
|
-
return `${args.options.id} is not a number`;
|
|
102
|
-
}
|
|
103
|
-
return true;
|
|
104
|
-
});
|
|
105
|
-
}, _SpoGroupRemoveCommand_initOptionSets = function _SpoGroupRemoveCommand_initOptionSets() {
|
|
106
|
-
this.optionSets.push({ options: ['id', 'name'] });
|
|
107
|
-
};
|
|
108
88
|
export default new SpoGroupRemoveCommand();
|
|
109
89
|
//# sourceMappingURL=group-remove.js.map
|
|
@@ -1,15 +1,30 @@
|
|
|
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 _SpoGroupSetCommand_instances, _SpoGroupSetCommand_initTelemetry, _SpoGroupSetCommand_initOptions, _SpoGroupSetCommand_initTypes, _SpoGroupSetCommand_initValidators, _SpoGroupSetCommand_initOptionSets;
|
|
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 entraUserGetCommand from '../../../entra/commands/user/user-get.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
id: z.coerce.number().int().positive().optional().alias('i'),
|
|
17
|
+
name: z.string().optional().alias('n'),
|
|
18
|
+
newName: z.string().optional(),
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
allowMembersEditMembership: z.boolean().optional(),
|
|
21
|
+
onlyAllowMembersViewMembership: z.boolean().optional(),
|
|
22
|
+
allowRequestToJoinLeave: z.boolean().optional(),
|
|
23
|
+
autoAcceptRequestToJoinLeave: z.boolean().optional(),
|
|
24
|
+
requestToJoinLeaveEmailSetting: z.string().optional(),
|
|
25
|
+
ownerEmail: z.string().optional(),
|
|
26
|
+
ownerUserName: z.string().optional()
|
|
27
|
+
});
|
|
13
28
|
class SpoGroupSetCommand extends SpoCommand {
|
|
14
29
|
get name() {
|
|
15
30
|
return commands.GROUP_SET;
|
|
@@ -17,14 +32,21 @@ class SpoGroupSetCommand extends SpoCommand {
|
|
|
17
32
|
get description() {
|
|
18
33
|
return 'Updates a group in the specified site';
|
|
19
34
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
get schema() {
|
|
36
|
+
return options;
|
|
37
|
+
}
|
|
38
|
+
getRefinedSchema(schema) {
|
|
39
|
+
return schema
|
|
40
|
+
.refine(o => [o.id, o.name].filter(x => x !== undefined).length === 1, {
|
|
41
|
+
error: `Specify either 'id' or 'name', but not both.`,
|
|
42
|
+
params: {
|
|
43
|
+
customCode: 'optionSet',
|
|
44
|
+
options: ['id', 'name']
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
.refine(o => [o.ownerEmail, o.ownerUserName].filter(x => x !== undefined).length <= 1, {
|
|
48
|
+
error: `Specify either 'ownerEmail' or 'ownerUserName', but not both.`
|
|
49
|
+
});
|
|
28
50
|
}
|
|
29
51
|
async commandAction(logger, args) {
|
|
30
52
|
if (this.verbose) {
|
|
@@ -91,70 +113,5 @@ class SpoGroupSetCommand extends SpoCommand {
|
|
|
91
113
|
return response.Id;
|
|
92
114
|
}
|
|
93
115
|
}
|
|
94
|
-
_SpoGroupSetCommand_instances = new WeakSet(), _SpoGroupSetCommand_initTelemetry = function _SpoGroupSetCommand_initTelemetry() {
|
|
95
|
-
this.telemetry.push((args) => {
|
|
96
|
-
Object.assign(this.telemetryProperties, {
|
|
97
|
-
id: typeof args.options.id !== 'undefined',
|
|
98
|
-
name: typeof args.options.name !== 'undefined',
|
|
99
|
-
newName: typeof args.options.newName !== 'undefined',
|
|
100
|
-
description: typeof args.options.description !== 'undefined',
|
|
101
|
-
allowMembersEditMembership: args.options.allowMembersEditMembership,
|
|
102
|
-
onlyAllowMembersViewMembership: args.options.onlyAllowMembersViewMembership,
|
|
103
|
-
allowRequestToJoinLeave: args.options.allowRequestToJoinLeave,
|
|
104
|
-
autoAcceptRequestToJoinLeave: args.options.autoAcceptRequestToJoinLeave,
|
|
105
|
-
requestToJoinLeaveEmailSetting: typeof args.options.requestToJoinLeaveEmailSetting !== 'undefined',
|
|
106
|
-
ownerEmail: typeof args.options.ownerEmail !== 'undefined',
|
|
107
|
-
ownerUserName: typeof args.options.ownerUserName !== 'undefined'
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}, _SpoGroupSetCommand_initOptions = function _SpoGroupSetCommand_initOptions() {
|
|
111
|
-
this.options.unshift({
|
|
112
|
-
option: '-u, --webUrl <webUrl>'
|
|
113
|
-
}, {
|
|
114
|
-
option: '-i, --id [id]'
|
|
115
|
-
}, {
|
|
116
|
-
option: '-n, --name [name]'
|
|
117
|
-
}, {
|
|
118
|
-
option: '--newName [newName]'
|
|
119
|
-
}, {
|
|
120
|
-
option: '--description [description]'
|
|
121
|
-
}, {
|
|
122
|
-
option: '--allowMembersEditMembership [allowMembersEditMembership]',
|
|
123
|
-
autocomplete: ['true', 'false']
|
|
124
|
-
}, {
|
|
125
|
-
option: '--onlyAllowMembersViewMembership [onlyAllowMembersViewMembership]',
|
|
126
|
-
autocomplete: ['true', 'false']
|
|
127
|
-
}, {
|
|
128
|
-
option: '--allowRequestToJoinLeave [allowRequestToJoinLeave]',
|
|
129
|
-
autocomplete: ['true', 'false']
|
|
130
|
-
}, {
|
|
131
|
-
option: '--autoAcceptRequestToJoinLeave [autoAcceptRequestToJoinLeave]',
|
|
132
|
-
autocomplete: ['true', 'false']
|
|
133
|
-
}, {
|
|
134
|
-
option: '--requestToJoinLeaveEmailSetting [requestToJoinLeaveEmailSetting]'
|
|
135
|
-
}, {
|
|
136
|
-
option: '--ownerEmail [ownerEmail]'
|
|
137
|
-
}, {
|
|
138
|
-
option: '--ownerUserName [ownerUserName]'
|
|
139
|
-
});
|
|
140
|
-
}, _SpoGroupSetCommand_initTypes = function _SpoGroupSetCommand_initTypes() {
|
|
141
|
-
this.types.boolean.push('allowMembersEditMembership', 'onlyAllowMembersViewMembership', 'allowRequestToJoinLeave', 'autoAcceptRequestToJoinLeave');
|
|
142
|
-
}, _SpoGroupSetCommand_initValidators = function _SpoGroupSetCommand_initValidators() {
|
|
143
|
-
this.validators.push(async (args) => {
|
|
144
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
145
|
-
if (isValidSharePointUrl !== true) {
|
|
146
|
-
return isValidSharePointUrl;
|
|
147
|
-
}
|
|
148
|
-
if (args.options.id && isNaN(args.options.id)) {
|
|
149
|
-
return `Specified id ${args.options.id} is not a number`;
|
|
150
|
-
}
|
|
151
|
-
if (args.options.ownerEmail && args.options.ownerUserName) {
|
|
152
|
-
return 'Specify either ownerEmail or ownerUserName but not both';
|
|
153
|
-
}
|
|
154
|
-
return true;
|
|
155
|
-
});
|
|
156
|
-
}, _SpoGroupSetCommand_initOptionSets = function _SpoGroupSetCommand_initOptionSets() {
|
|
157
|
-
this.optionSets.push({ options: ['id', 'name'] });
|
|
158
|
-
};
|
|
159
116
|
export default new SpoGroupSetCommand();
|
|
160
117
|
//# sourceMappingURL=group-set.js.map
|
|
@@ -1,13 +1,19 @@
|
|
|
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 _SpoPropertyBagGetCommand_instances, _SpoPropertyBagGetCommand_initTelemetry, _SpoPropertyBagGetCommand_initOptions, _SpoPropertyBagGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { spo } from '../../../../utils/spo.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
10
6
|
import { SpoPropertyBagBaseCommand } from './propertybag-base.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u'),
|
|
14
|
+
key: z.string().alias('k'),
|
|
15
|
+
folder: z.string().optional()
|
|
16
|
+
});
|
|
11
17
|
class SpoPropertyBagGetCommand extends SpoPropertyBagBaseCommand {
|
|
12
18
|
get name() {
|
|
13
19
|
return commands.PROPERTYBAG_GET;
|
|
@@ -15,12 +21,8 @@ class SpoPropertyBagGetCommand extends SpoPropertyBagBaseCommand {
|
|
|
15
21
|
get description() {
|
|
16
22
|
return 'Gets the value of the specified property from the property bag';
|
|
17
23
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoPropertyBagGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoPropertyBagGetCommand_instances, "m", _SpoPropertyBagGetCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoPropertyBagGetCommand_instances, "m", _SpoPropertyBagGetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoPropertyBagGetCommand_instances, "m", _SpoPropertyBagGetCommand_initValidators).call(this);
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
24
26
|
}
|
|
25
27
|
async commandAction(logger, args) {
|
|
26
28
|
try {
|
|
@@ -61,22 +63,5 @@ class SpoPropertyBagGetCommand extends SpoPropertyBagBaseCommand {
|
|
|
61
63
|
return null;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
_SpoPropertyBagGetCommand_instances = new WeakSet(), _SpoPropertyBagGetCommand_initTelemetry = function _SpoPropertyBagGetCommand_initTelemetry() {
|
|
65
|
-
this.telemetry.push((args) => {
|
|
66
|
-
Object.assign(this.telemetryProperties, {
|
|
67
|
-
folder: typeof args.options.folder !== 'undefined'
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}, _SpoPropertyBagGetCommand_initOptions = function _SpoPropertyBagGetCommand_initOptions() {
|
|
71
|
-
this.options.unshift({
|
|
72
|
-
option: '-u, --webUrl <webUrl>'
|
|
73
|
-
}, {
|
|
74
|
-
option: '-k, --key <key>'
|
|
75
|
-
}, {
|
|
76
|
-
option: '--folder [folder]'
|
|
77
|
-
});
|
|
78
|
-
}, _SpoPropertyBagGetCommand_initValidators = function _SpoPropertyBagGetCommand_initValidators() {
|
|
79
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
80
|
-
};
|
|
81
66
|
export default new SpoPropertyBagGetCommand();
|
|
82
67
|
//# sourceMappingURL=propertybag-get.js.map
|
|
@@ -1,13 +1,18 @@
|
|
|
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 _SpoPropertyBagListCommand_instances, _SpoPropertyBagListCommand_initTelemetry, _SpoPropertyBagListCommand_initOptions, _SpoPropertyBagListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { spo } from '../../../../utils/spo.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
10
6
|
import { SpoPropertyBagBaseCommand } from './propertybag-base.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u'),
|
|
14
|
+
folder: z.string().optional()
|
|
15
|
+
});
|
|
11
16
|
class SpoPropertyBagListCommand extends SpoPropertyBagBaseCommand {
|
|
12
17
|
get name() {
|
|
13
18
|
return commands.PROPERTYBAG_LIST;
|
|
@@ -15,12 +20,8 @@ class SpoPropertyBagListCommand extends SpoPropertyBagBaseCommand {
|
|
|
15
20
|
get description() {
|
|
16
21
|
return 'Gets property bag values';
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoPropertyBagListCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoPropertyBagListCommand_instances, "m", _SpoPropertyBagListCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoPropertyBagListCommand_instances, "m", _SpoPropertyBagListCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoPropertyBagListCommand_instances, "m", _SpoPropertyBagListCommand_initValidators).call(this);
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
24
25
|
}
|
|
25
26
|
async commandAction(logger, args) {
|
|
26
27
|
try {
|
|
@@ -61,20 +62,5 @@ class SpoPropertyBagListCommand extends SpoPropertyBagBaseCommand {
|
|
|
61
62
|
return result;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
_SpoPropertyBagListCommand_instances = new WeakSet(), _SpoPropertyBagListCommand_initTelemetry = function _SpoPropertyBagListCommand_initTelemetry() {
|
|
65
|
-
this.telemetry.push((args) => {
|
|
66
|
-
Object.assign(this.telemetryProperties, {
|
|
67
|
-
folder: typeof args.options.folder !== 'undefined'
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}, _SpoPropertyBagListCommand_initOptions = function _SpoPropertyBagListCommand_initOptions() {
|
|
71
|
-
this.options.unshift({
|
|
72
|
-
option: '-u, --webUrl <webUrl>'
|
|
73
|
-
}, {
|
|
74
|
-
option: '--folder [folder]'
|
|
75
|
-
});
|
|
76
|
-
}, _SpoPropertyBagListCommand_initValidators = function _SpoPropertyBagListCommand_initValidators() {
|
|
77
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
78
|
-
};
|
|
79
65
|
export default new SpoPropertyBagListCommand();
|
|
80
66
|
//# sourceMappingURL=propertybag-list.js.map
|
|
@@ -1,17 +1,24 @@
|
|
|
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 _SpoPropertyBagRemoveCommand_instances, _SpoPropertyBagRemoveCommand_initTelemetry, _SpoPropertyBagRemoveCommand_initOptions, _SpoPropertyBagRemoveCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
8
3
|
import config from '../../../../config.js';
|
|
4
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
7
|
import { spo } from '../../../../utils/spo.js';
|
|
12
8
|
import { validation } from '../../../../utils/validation.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import { SpoPropertyBagBaseCommand } from './propertybag-base.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
key: z.string().alias('k'),
|
|
19
|
+
folder: z.string().optional(),
|
|
20
|
+
force: z.boolean().optional().alias('f')
|
|
21
|
+
});
|
|
15
22
|
class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand {
|
|
16
23
|
get name() {
|
|
17
24
|
return commands.PROPERTYBAG_REMOVE;
|
|
@@ -19,12 +26,8 @@ class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand {
|
|
|
19
26
|
get description() {
|
|
20
27
|
return 'Removes specified property from the property bag';
|
|
21
28
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_SpoPropertyBagRemoveCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoPropertyBagRemoveCommand_instances, "m", _SpoPropertyBagRemoveCommand_initTelemetry).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoPropertyBagRemoveCommand_instances, "m", _SpoPropertyBagRemoveCommand_initOptions).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoPropertyBagRemoveCommand_instances, "m", _SpoPropertyBagRemoveCommand_initValidators).call(this);
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
28
31
|
}
|
|
29
32
|
async commandAction(logger, args) {
|
|
30
33
|
if (args.options.force) {
|
|
@@ -76,25 +79,5 @@ class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand {
|
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
|
-
_SpoPropertyBagRemoveCommand_instances = new WeakSet(), _SpoPropertyBagRemoveCommand_initTelemetry = function _SpoPropertyBagRemoveCommand_initTelemetry() {
|
|
80
|
-
this.telemetry.push((args) => {
|
|
81
|
-
Object.assign(this.telemetryProperties, {
|
|
82
|
-
folder: (!(!args.options.folder)).toString(),
|
|
83
|
-
force: args.options.force === true
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}, _SpoPropertyBagRemoveCommand_initOptions = function _SpoPropertyBagRemoveCommand_initOptions() {
|
|
87
|
-
this.options.unshift({
|
|
88
|
-
option: '-u, --webUrl <webUrl>'
|
|
89
|
-
}, {
|
|
90
|
-
option: '-k, --key <key>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--folder [folder]'
|
|
93
|
-
}, {
|
|
94
|
-
option: '-f, --force'
|
|
95
|
-
});
|
|
96
|
-
}, _SpoPropertyBagRemoveCommand_initValidators = function _SpoPropertyBagRemoveCommand_initValidators() {
|
|
97
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
98
|
-
};
|
|
99
82
|
export default new SpoPropertyBagRemoveCommand();
|
|
100
83
|
//# sourceMappingURL=propertybag-remove.js.map
|