@pnp/cli-microsoft365 12.0.0-beta.792164a → 12.0.0-beta.93e11fb
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/Auth.js +19 -2
- package/dist/cli/cli.js +3 -0
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
- package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
- package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
- package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
- package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
- package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
- package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
- package/dist/m365/spe/commands.js +1 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- 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/commandset/commandset-add.js +17 -59
- package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
- package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
- package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
- package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +5 -14
- 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-get.js +4 -3
- package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -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/listitem/listitem-add.js +27 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
- package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
- package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
- package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
- package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
- package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
- package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
- package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
- package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +1 -1
- package/dist/m365/spo/commands/page/page-column-list.js +7 -8
- package/dist/m365/spo/commands/page/page-section-list.js +15 -17
- package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
- package/dist/m365/spo/commands/term/term-group-list.js +7 -8
- package/dist/m365/spo/commands/term/term-set-list.js +6 -9
- package/dist/m365/spo/commands.js +3 -1
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- 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/meeting/meeting-add.js +57 -68
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
- package/dist/m365/teams/commands/message/message-get.js +19 -30
- package/dist/m365/teams/commands/message/message-list.js +26 -43
- package/dist/m365/teams/commands/message/message-remove.js +43 -58
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
- package/dist/m365/teams/commands/message/message-restore.js +40 -50
- package/dist/m365/teams/commands/message/message-send.js +19 -30
- package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
- package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
- package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
- package/dist/m365/teams/commands/tab/tab-add.js +23 -49
- package/dist/m365/teams/commands/tab/tab-get.js +55 -56
- package/dist/m365/teams/commands/tab/tab-list.js +17 -28
- package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
- package/dist/m365/teams/commands/team/team-add.js +76 -114
- package/dist/m365/teams/commands/team/team-app-list.js +23 -36
- package/dist/m365/teams/commands/team/team-archive.js +24 -39
- package/dist/m365/teams/commands/team/team-clone.js +28 -62
- package/dist/m365/teams/commands/team/team-get.js +23 -36
- package/dist/m365/teams/commands/team/team-list.js +43 -57
- package/dist/m365/teams/commands/team/team-remove.js +24 -37
- package/dist/m365/teams/commands/team/team-set.js +23 -52
- package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
- package/dist/m365/teams/commands/user/user-app-add.js +40 -49
- package/dist/m365/teams/commands/user/user-app-list.js +26 -39
- package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
- package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
- package/dist/m365/teams/commands/user/user-list.js +17 -39
- package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
- package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
- package/dist/utils/formatting.js +16 -0
- package/dist/utils/pid.js +7 -16
- package/dist/utils/spo.js +39 -0
- package/dist/utils/zod.js +4 -4
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
- package/docs/docs/cmd/spo/file/file-archive.mdx +1 -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-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 +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -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 +1 -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-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 +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
- package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
- 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/tab/tab-add.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
- package/package.json +4 -6
|
@@ -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 _SpoListItemRoleAssignmentAddCommand_instances, _SpoListItemRoleAssignmentAddCommand_initTelemetry, _SpoListItemRoleAssignmentAddCommand_initOptions, _SpoListItemRoleAssignmentAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -12,6 +8,33 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import { spo } from '../../../../utils/spo.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
|
+
listItemId: z.number(),
|
|
19
|
+
listId: z.string()
|
|
20
|
+
.refine(id => validation.isValidGuid(id), {
|
|
21
|
+
error: e => `${e.input} is not a valid GUID`
|
|
22
|
+
})
|
|
23
|
+
.optional(),
|
|
24
|
+
listTitle: z.string().optional(),
|
|
25
|
+
listUrl: z.string().optional(),
|
|
26
|
+
principalId: z.number().optional(),
|
|
27
|
+
upn: z.string().optional(),
|
|
28
|
+
groupName: z.string().optional(),
|
|
29
|
+
entraGroupId: z.string()
|
|
30
|
+
.refine(id => validation.isValidGuid(id), {
|
|
31
|
+
error: e => `'${e.input}' is not a valid GUID for option entraGroupId.`
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
entraGroupName: z.string().optional(),
|
|
35
|
+
roleDefinitionId: z.number().optional(),
|
|
36
|
+
roleDefinitionName: z.string().optional()
|
|
37
|
+
});
|
|
15
38
|
class SpoListItemRoleAssignmentAddCommand extends SpoCommand {
|
|
16
39
|
get name() {
|
|
17
40
|
return commands.LISTITEM_ROLEASSIGNMENT_ADD;
|
|
@@ -19,12 +42,32 @@ class SpoListItemRoleAssignmentAddCommand extends SpoCommand {
|
|
|
19
42
|
get description() {
|
|
20
43
|
return 'Adds a role assignment to a listitem.';
|
|
21
44
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
45
|
+
get schema() {
|
|
46
|
+
return options;
|
|
47
|
+
}
|
|
48
|
+
getRefinedSchema(schema) {
|
|
49
|
+
return schema
|
|
50
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
51
|
+
error: 'Specify either listId, listTitle or listUrl.',
|
|
52
|
+
params: {
|
|
53
|
+
customCode: 'optionSet',
|
|
54
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
.refine(opts => [opts.principalId, opts.upn, opts.groupName, opts.entraGroupId, opts.entraGroupName].filter(o => o !== undefined).length === 1, {
|
|
58
|
+
error: 'Specify either principalId, upn, groupName, entraGroupId or entraGroupName.',
|
|
59
|
+
params: {
|
|
60
|
+
customCode: 'optionSet',
|
|
61
|
+
options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName']
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
.refine(opts => [opts.roleDefinitionId, opts.roleDefinitionName].filter(o => o !== undefined).length === 1, {
|
|
65
|
+
error: 'Specify either roleDefinitionId or roleDefinitionName.',
|
|
66
|
+
params: {
|
|
67
|
+
customCode: 'optionSet',
|
|
68
|
+
options: ['roleDefinitionId', 'roleDefinitionName']
|
|
69
|
+
}
|
|
70
|
+
});
|
|
28
71
|
}
|
|
29
72
|
async commandAction(logger, args) {
|
|
30
73
|
if (this.verbose) {
|
|
@@ -95,91 +138,5 @@ class SpoListItemRoleAssignmentAddCommand extends SpoCommand {
|
|
|
95
138
|
return user.Id;
|
|
96
139
|
}
|
|
97
140
|
}
|
|
98
|
-
_SpoListItemRoleAssignmentAddCommand_instances = new WeakSet(), _SpoListItemRoleAssignmentAddCommand_initTelemetry = function _SpoListItemRoleAssignmentAddCommand_initTelemetry() {
|
|
99
|
-
this.telemetry.push((args) => {
|
|
100
|
-
Object.assign(this.telemetryProperties, {
|
|
101
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
102
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
103
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
104
|
-
principalId: typeof args.options.principalId !== 'undefined',
|
|
105
|
-
upn: typeof args.options.upn !== 'undefined',
|
|
106
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
107
|
-
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
108
|
-
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
109
|
-
roleDefinitionId: typeof args.options.roleDefinitionId !== 'undefined',
|
|
110
|
-
roleDefinitionName: typeof args.options.roleDefinitionName !== 'undefined'
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
}, _SpoListItemRoleAssignmentAddCommand_initOptions = function _SpoListItemRoleAssignmentAddCommand_initOptions() {
|
|
114
|
-
this.options.unshift({
|
|
115
|
-
option: '-u, --webUrl <webUrl>'
|
|
116
|
-
}, {
|
|
117
|
-
option: '--listItemId <listItemId>'
|
|
118
|
-
}, {
|
|
119
|
-
option: '--listId [listId]'
|
|
120
|
-
}, {
|
|
121
|
-
option: '--listTitle [listTitle]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '--listUrl [listUrl]'
|
|
124
|
-
}, {
|
|
125
|
-
option: '--principalId [principalId]'
|
|
126
|
-
}, {
|
|
127
|
-
option: '--upn [upn]'
|
|
128
|
-
}, {
|
|
129
|
-
option: '--groupName [groupName]'
|
|
130
|
-
}, {
|
|
131
|
-
option: '--entraGroupId [entraGroupId]'
|
|
132
|
-
}, {
|
|
133
|
-
option: '--entraGroupName [entraGroupName]'
|
|
134
|
-
}, {
|
|
135
|
-
option: '--roleDefinitionId [roleDefinitionId]'
|
|
136
|
-
}, {
|
|
137
|
-
option: '--roleDefinitionName [roleDefinitionName]'
|
|
138
|
-
});
|
|
139
|
-
}, _SpoListItemRoleAssignmentAddCommand_initValidators = function _SpoListItemRoleAssignmentAddCommand_initValidators() {
|
|
140
|
-
this.validators.push(async (args) => {
|
|
141
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
142
|
-
if (isValidSharePointUrl !== true) {
|
|
143
|
-
return isValidSharePointUrl;
|
|
144
|
-
}
|
|
145
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
146
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
147
|
-
}
|
|
148
|
-
if (args.options.listItemId && isNaN(args.options.listItemId)) {
|
|
149
|
-
return `Specified listItemId ${args.options.listItemId} is not a number`;
|
|
150
|
-
}
|
|
151
|
-
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
152
|
-
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
153
|
-
}
|
|
154
|
-
if (args.options.roleDefinitionId && isNaN(args.options.roleDefinitionId)) {
|
|
155
|
-
return `Specified roleDefinitionId ${args.options.roleDefinitionId} is not a number`;
|
|
156
|
-
}
|
|
157
|
-
const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
|
|
158
|
-
if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
|
|
159
|
-
return `Specify either list id or title or list url`;
|
|
160
|
-
}
|
|
161
|
-
if (listOptions.filter(item => item !== undefined).length === 0) {
|
|
162
|
-
return `Specify at least list id or title or list url`;
|
|
163
|
-
}
|
|
164
|
-
const principalOptions = [args.options.principalId, args.options.upn, args.options.groupName, args.options.entraGroupId, args.options.entraGroupName];
|
|
165
|
-
if (!principalOptions.some(item => item !== undefined)) {
|
|
166
|
-
return `Specify either principalId, upn, groupName, entraGroupId or entraGroupName`;
|
|
167
|
-
}
|
|
168
|
-
if (principalOptions.filter(item => item !== undefined).length > 1) {
|
|
169
|
-
return `Specify either principalId, upn, groupName, entraGroupId or entraGroupName but not multiple`;
|
|
170
|
-
}
|
|
171
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
172
|
-
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
173
|
-
}
|
|
174
|
-
const roleDefinitionOptions = [args.options.roleDefinitionId, args.options.roleDefinitionName];
|
|
175
|
-
if (!roleDefinitionOptions.some(item => item !== undefined)) {
|
|
176
|
-
return `Specify either roleDefinitionId or roleDefinitionName`;
|
|
177
|
-
}
|
|
178
|
-
if (roleDefinitionOptions.filter(item => item !== undefined).length > 1) {
|
|
179
|
-
return `Specify either roleDefinitionId or roleDefinitionName but not multiple`;
|
|
180
|
-
}
|
|
181
|
-
return true;
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
141
|
export default new SpoListItemRoleAssignmentAddCommand();
|
|
185
142
|
//# sourceMappingURL=listitem-roleassignment-add.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 _SpoListItemRoleAssignmentRemoveCommand_instances, _SpoListItemRoleAssignmentRemoveCommand_initTelemetry, _SpoListItemRoleAssignmentRemoveCommand_initOptions, _SpoListItemRoleAssignmentRemoveCommand_initValidators, _SpoListItemRoleAssignmentRemoveCommand_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 { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -13,6 +9,33 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
15
11
|
import { spo } from '../../../../utils/spo.js';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
webUrl: z.string()
|
|
15
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
16
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
17
|
+
})
|
|
18
|
+
.alias('u'),
|
|
19
|
+
listId: z.string()
|
|
20
|
+
.refine(id => validation.isValidGuid(id), {
|
|
21
|
+
error: e => `${e.input} is not a valid GUID`
|
|
22
|
+
})
|
|
23
|
+
.optional()
|
|
24
|
+
.alias('i'),
|
|
25
|
+
listTitle: z.string().optional().alias('t'),
|
|
26
|
+
listUrl: z.string().optional(),
|
|
27
|
+
listItemId: z.number(),
|
|
28
|
+
principalId: z.number().optional(),
|
|
29
|
+
upn: z.string().optional(),
|
|
30
|
+
groupName: z.string().optional(),
|
|
31
|
+
entraGroupId: z.string()
|
|
32
|
+
.refine(id => validation.isValidGuid(id), {
|
|
33
|
+
error: e => `'${e.input}' is not a valid GUID for option entraGroupId.`
|
|
34
|
+
})
|
|
35
|
+
.optional(),
|
|
36
|
+
entraGroupName: z.string().optional(),
|
|
37
|
+
force: z.boolean().optional().alias('f')
|
|
38
|
+
});
|
|
16
39
|
class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand {
|
|
17
40
|
get name() {
|
|
18
41
|
return commands.LISTITEM_ROLEASSIGNMENT_REMOVE;
|
|
@@ -20,13 +43,25 @@ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
20
43
|
get description() {
|
|
21
44
|
return 'Removes a role assignment from list item permissions';
|
|
22
45
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
get schema() {
|
|
47
|
+
return options;
|
|
48
|
+
}
|
|
49
|
+
getRefinedSchema(schema) {
|
|
50
|
+
return schema
|
|
51
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
52
|
+
error: 'Specify either listId, listTitle or listUrl.',
|
|
53
|
+
params: {
|
|
54
|
+
customCode: 'optionSet',
|
|
55
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
.refine(opts => [opts.principalId, opts.upn, opts.groupName, opts.entraGroupId, opts.entraGroupName].filter(o => o !== undefined).length === 1, {
|
|
59
|
+
error: 'Specify either principalId, upn, groupName, entraGroupId or entraGroupName.',
|
|
60
|
+
params: {
|
|
61
|
+
customCode: 'optionSet',
|
|
62
|
+
options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName']
|
|
63
|
+
}
|
|
64
|
+
});
|
|
30
65
|
}
|
|
31
66
|
async commandAction(logger, args) {
|
|
32
67
|
if (args.options.force) {
|
|
@@ -99,66 +134,5 @@ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
99
134
|
return user.Id;
|
|
100
135
|
}
|
|
101
136
|
}
|
|
102
|
-
_SpoListItemRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListItemRoleAssignmentRemoveCommand_initTelemetry = function _SpoListItemRoleAssignmentRemoveCommand_initTelemetry() {
|
|
103
|
-
this.telemetry.push((args) => {
|
|
104
|
-
Object.assign(this.telemetryProperties, {
|
|
105
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
106
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
107
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
108
|
-
principalId: typeof args.options.principalId !== 'undefined',
|
|
109
|
-
upn: typeof args.options.upn !== 'undefined',
|
|
110
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
111
|
-
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
112
|
-
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
113
|
-
force: (!(!args.options.force)).toString()
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}, _SpoListItemRoleAssignmentRemoveCommand_initOptions = function _SpoListItemRoleAssignmentRemoveCommand_initOptions() {
|
|
117
|
-
this.options.unshift({
|
|
118
|
-
option: '-u, --webUrl <webUrl>'
|
|
119
|
-
}, {
|
|
120
|
-
option: '-i, --listId [listId]'
|
|
121
|
-
}, {
|
|
122
|
-
option: '-t, --listTitle [listTitle]'
|
|
123
|
-
}, {
|
|
124
|
-
option: '--listUrl [listUrl]'
|
|
125
|
-
}, {
|
|
126
|
-
option: '--listItemId <listItemId>'
|
|
127
|
-
}, {
|
|
128
|
-
option: '--principalId [principalId]'
|
|
129
|
-
}, {
|
|
130
|
-
option: '--upn [upn]'
|
|
131
|
-
}, {
|
|
132
|
-
option: '--groupName [groupName]'
|
|
133
|
-
}, {
|
|
134
|
-
option: '--entraGroupId [entraGroupId]'
|
|
135
|
-
}, {
|
|
136
|
-
option: '--entraGroupName [entraGroupName]'
|
|
137
|
-
}, {
|
|
138
|
-
option: '-f, --force'
|
|
139
|
-
});
|
|
140
|
-
}, _SpoListItemRoleAssignmentRemoveCommand_initValidators = function _SpoListItemRoleAssignmentRemoveCommand_initValidators() {
|
|
141
|
-
this.validators.push(async (args) => {
|
|
142
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
143
|
-
if (isValidSharePointUrl !== true) {
|
|
144
|
-
return isValidSharePointUrl;
|
|
145
|
-
}
|
|
146
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
147
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
148
|
-
}
|
|
149
|
-
if (args.options.listItemId && isNaN(args.options.listItemId)) {
|
|
150
|
-
return `Specified listItemId ${args.options.listItemId} is not a number`;
|
|
151
|
-
}
|
|
152
|
-
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
153
|
-
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
154
|
-
}
|
|
155
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
156
|
-
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
157
|
-
}
|
|
158
|
-
return true;
|
|
159
|
-
});
|
|
160
|
-
}, _SpoListItemRoleAssignmentRemoveCommand_initOptionSets = function _SpoListItemRoleAssignmentRemoveCommand_initOptionSets() {
|
|
161
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] });
|
|
162
|
-
};
|
|
163
137
|
export default new SpoListItemRoleAssignmentRemoveCommand();
|
|
164
138
|
//# sourceMappingURL=listitem-roleassignment-remove.js.map
|
|
@@ -1,16 +1,31 @@
|
|
|
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 _SpoListItemRoleInheritanceBreakCommand_instances, _SpoListItemRoleInheritanceBreakCommand_initTelemetry, _SpoListItemRoleInheritanceBreakCommand_initOptions, _SpoListItemRoleInheritanceBreakCommand_initValidators, _SpoListItemRoleInheritanceBreakCommand_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 { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.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
|
+
listItemId: z.number(),
|
|
18
|
+
listId: z.string()
|
|
19
|
+
.refine(id => validation.isValidGuid(id), {
|
|
20
|
+
error: e => `${e.input} is not a valid GUID`
|
|
21
|
+
})
|
|
22
|
+
.optional()
|
|
23
|
+
.alias('l'),
|
|
24
|
+
listTitle: z.string().optional().alias('t'),
|
|
25
|
+
listUrl: z.string().optional(),
|
|
26
|
+
clearExistingPermissions: z.boolean().optional().alias('c'),
|
|
27
|
+
force: z.boolean().optional().alias('f')
|
|
28
|
+
});
|
|
14
29
|
class SpoListItemRoleInheritanceBreakCommand extends SpoCommand {
|
|
15
30
|
get name() {
|
|
16
31
|
return commands.LISTITEM_ROLEINHERITANCE_BREAK;
|
|
@@ -18,13 +33,18 @@ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
18
33
|
get description() {
|
|
19
34
|
return 'Breaks inheritance of list item';
|
|
20
35
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
get schema() {
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
getRefinedSchema(schema) {
|
|
40
|
+
return schema
|
|
41
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
42
|
+
error: 'Specify either listId, listTitle or listUrl.',
|
|
43
|
+
params: {
|
|
44
|
+
customCode: 'optionSet',
|
|
45
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
46
|
+
}
|
|
47
|
+
});
|
|
28
48
|
}
|
|
29
49
|
async commandAction(logger, args) {
|
|
30
50
|
if (this.verbose) {
|
|
@@ -73,48 +93,5 @@ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
73
93
|
}
|
|
74
94
|
}
|
|
75
95
|
}
|
|
76
|
-
_SpoListItemRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoListItemRoleInheritanceBreakCommand_initTelemetry = function _SpoListItemRoleInheritanceBreakCommand_initTelemetry() {
|
|
77
|
-
this.telemetry.push((args) => {
|
|
78
|
-
Object.assign(this.telemetryProperties, {
|
|
79
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
80
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
81
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
82
|
-
clearExistingPermissions: args.options.clearExistingPermissions === true,
|
|
83
|
-
force: (!(!args.options.force)).toString()
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}, _SpoListItemRoleInheritanceBreakCommand_initOptions = function _SpoListItemRoleInheritanceBreakCommand_initOptions() {
|
|
87
|
-
this.options.unshift({
|
|
88
|
-
option: '-u, --webUrl <webUrl>'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--listItemId <listItemId>'
|
|
91
|
-
}, {
|
|
92
|
-
option: '-l, --listId [listId]'
|
|
93
|
-
}, {
|
|
94
|
-
option: '-t, --listTitle [listTitle]'
|
|
95
|
-
}, {
|
|
96
|
-
option: '--listUrl [listUrl]'
|
|
97
|
-
}, {
|
|
98
|
-
option: '-c, --clearExistingPermissions'
|
|
99
|
-
}, {
|
|
100
|
-
option: '-f, --force'
|
|
101
|
-
});
|
|
102
|
-
}, _SpoListItemRoleInheritanceBreakCommand_initValidators = function _SpoListItemRoleInheritanceBreakCommand_initValidators() {
|
|
103
|
-
this.validators.push(async (args) => {
|
|
104
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
105
|
-
if (isValidSharePointUrl !== true) {
|
|
106
|
-
return isValidSharePointUrl;
|
|
107
|
-
}
|
|
108
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
109
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
110
|
-
}
|
|
111
|
-
if (isNaN(args.options.listItemId)) {
|
|
112
|
-
return `${args.options.listItemId} is not a number`;
|
|
113
|
-
}
|
|
114
|
-
return true;
|
|
115
|
-
});
|
|
116
|
-
}, _SpoListItemRoleInheritanceBreakCommand_initOptionSets = function _SpoListItemRoleInheritanceBreakCommand_initOptionSets() {
|
|
117
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
118
|
-
};
|
|
119
96
|
export default new SpoListItemRoleInheritanceBreakCommand();
|
|
120
97
|
//# sourceMappingURL=listitem-roleinheritance-break.js.map
|
|
@@ -1,16 +1,29 @@
|
|
|
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 _SpoListItemRoleInheritanceResetCommand_instances, _SpoListItemRoleInheritanceResetCommand_initTelemetry, _SpoListItemRoleInheritanceResetCommand_initOptions, _SpoListItemRoleInheritanceResetCommand_initValidators, _SpoListItemRoleInheritanceResetCommand_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 { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.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
|
+
listItemId: z.number(),
|
|
18
|
+
listId: z.string()
|
|
19
|
+
.refine(id => validation.isValidGuid(id), {
|
|
20
|
+
error: e => `${e.input} is not a valid GUID`
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
23
|
+
listTitle: z.string().optional(),
|
|
24
|
+
listUrl: z.string().optional(),
|
|
25
|
+
force: z.boolean().optional().alias('f')
|
|
26
|
+
});
|
|
14
27
|
class SpoListItemRoleInheritanceResetCommand extends SpoCommand {
|
|
15
28
|
get name() {
|
|
16
29
|
return commands.LISTITEM_ROLEINHERITANCE_RESET;
|
|
@@ -18,13 +31,18 @@ class SpoListItemRoleInheritanceResetCommand extends SpoCommand {
|
|
|
18
31
|
get description() {
|
|
19
32
|
return 'Restores the role inheritance of list item, file, or folder';
|
|
20
33
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
getRefinedSchema(schema) {
|
|
38
|
+
return schema
|
|
39
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
40
|
+
error: 'Specify either listId, listTitle or listUrl.',
|
|
41
|
+
params: {
|
|
42
|
+
customCode: 'optionSet',
|
|
43
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
44
|
+
}
|
|
45
|
+
});
|
|
28
46
|
}
|
|
29
47
|
async commandAction(logger, args) {
|
|
30
48
|
if (this.verbose) {
|
|
@@ -69,45 +87,5 @@ class SpoListItemRoleInheritanceResetCommand extends SpoCommand {
|
|
|
69
87
|
}
|
|
70
88
|
}
|
|
71
89
|
}
|
|
72
|
-
_SpoListItemRoleInheritanceResetCommand_instances = new WeakSet(), _SpoListItemRoleInheritanceResetCommand_initTelemetry = function _SpoListItemRoleInheritanceResetCommand_initTelemetry() {
|
|
73
|
-
this.telemetry.push((args) => {
|
|
74
|
-
Object.assign(this.telemetryProperties, {
|
|
75
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
76
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
77
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
78
|
-
force: (!(!args.options.force)).toString()
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
}, _SpoListItemRoleInheritanceResetCommand_initOptions = function _SpoListItemRoleInheritanceResetCommand_initOptions() {
|
|
82
|
-
this.options.unshift({
|
|
83
|
-
option: '-u, --webUrl <webUrl>'
|
|
84
|
-
}, {
|
|
85
|
-
option: '--listItemId <listItemId>'
|
|
86
|
-
}, {
|
|
87
|
-
option: '--listId [listId]'
|
|
88
|
-
}, {
|
|
89
|
-
option: '--listTitle [listTitle]'
|
|
90
|
-
}, {
|
|
91
|
-
option: '--listUrl [listUrl]'
|
|
92
|
-
}, {
|
|
93
|
-
option: '-f, --force'
|
|
94
|
-
});
|
|
95
|
-
}, _SpoListItemRoleInheritanceResetCommand_initValidators = function _SpoListItemRoleInheritanceResetCommand_initValidators() {
|
|
96
|
-
this.validators.push(async (args) => {
|
|
97
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
98
|
-
if (isValidSharePointUrl !== true) {
|
|
99
|
-
return isValidSharePointUrl;
|
|
100
|
-
}
|
|
101
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
102
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
103
|
-
}
|
|
104
|
-
if (isNaN(args.options.listItemId)) {
|
|
105
|
-
return `${args.options.listItemId} is not a number`;
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
});
|
|
109
|
-
}, _SpoListItemRoleInheritanceResetCommand_initOptionSets = function _SpoListItemRoleInheritanceResetCommand_initOptionSets() {
|
|
110
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
111
|
-
};
|
|
112
90
|
export default new SpoListItemRoleInheritanceResetCommand();
|
|
113
91
|
//# sourceMappingURL=listitem-roleinheritance-reset.js.map
|
|
@@ -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 _SpoListItemSetCommand_instances, _SpoListItemSetCommand_initTelemetry, _SpoListItemSetCommand_initOptions, _SpoListItemSetCommand_initValidators, _SpoListItemSetCommand_initTypes, _SpoListItemSetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { basic } from '../../../../utils/basic.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -12,6 +8,25 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
12
8
|
import { validation } from '../../../../utils/validation.js';
|
|
13
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
10
|
import commands from '../../commands.js';
|
|
11
|
+
export const options = z.object({
|
|
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
|
+
id: z.string().alias('i'),
|
|
19
|
+
listId: z.string()
|
|
20
|
+
.refine(id => validation.isValidGuid(id), {
|
|
21
|
+
error: e => `${e.input} in option listId is not a valid GUID`
|
|
22
|
+
})
|
|
23
|
+
.optional()
|
|
24
|
+
.alias('l'),
|
|
25
|
+
listTitle: z.string().optional().alias('t'),
|
|
26
|
+
listUrl: z.string().optional(),
|
|
27
|
+
contentType: z.string().optional().alias('c'),
|
|
28
|
+
systemUpdate: z.boolean().optional().alias('s')
|
|
29
|
+
}).catchall(z.unknown());
|
|
15
30
|
class SpoListItemSetCommand extends SpoCommand {
|
|
16
31
|
allowUnknownOptions() {
|
|
17
32
|
return true;
|
|
@@ -22,14 +37,18 @@ class SpoListItemSetCommand extends SpoCommand {
|
|
|
22
37
|
get description() {
|
|
23
38
|
return 'Updates a list item in the specified list';
|
|
24
39
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
get schema() {
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
43
|
+
getRefinedSchema(schema) {
|
|
44
|
+
return schema
|
|
45
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
46
|
+
error: 'Specify either listId, listTitle or listUrl.',
|
|
47
|
+
params: {
|
|
48
|
+
customCode: 'optionSet',
|
|
49
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
50
|
+
}
|
|
51
|
+
});
|
|
33
52
|
}
|
|
34
53
|
async commandAction(logger, args) {
|
|
35
54
|
let contentTypeName = '';
|
|
@@ -122,49 +141,5 @@ class SpoListItemSetCommand extends SpoCommand {
|
|
|
122
141
|
return filteredData;
|
|
123
142
|
}
|
|
124
143
|
}
|
|
125
|
-
_SpoListItemSetCommand_instances = new WeakSet(), _SpoListItemSetCommand_initTelemetry = function _SpoListItemSetCommand_initTelemetry() {
|
|
126
|
-
this.telemetry.push((args) => {
|
|
127
|
-
Object.assign(this.telemetryProperties, {
|
|
128
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
129
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
130
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
131
|
-
contentType: typeof args.options.contentType !== 'undefined',
|
|
132
|
-
systemUpdate: typeof args.options.systemUpdate !== 'undefined'
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}, _SpoListItemSetCommand_initOptions = function _SpoListItemSetCommand_initOptions() {
|
|
136
|
-
this.options.unshift({
|
|
137
|
-
option: '-u, --webUrl <webUrl>'
|
|
138
|
-
}, {
|
|
139
|
-
option: '-i, --id <id>'
|
|
140
|
-
}, {
|
|
141
|
-
option: '-l, --listId [listId]'
|
|
142
|
-
}, {
|
|
143
|
-
option: '-t, --listTitle [listTitle]'
|
|
144
|
-
}, {
|
|
145
|
-
option: '--listUrl [listUrl]'
|
|
146
|
-
}, {
|
|
147
|
-
option: '-c, --contentType [contentType]'
|
|
148
|
-
}, {
|
|
149
|
-
option: '-s, --systemUpdate'
|
|
150
|
-
});
|
|
151
|
-
}, _SpoListItemSetCommand_initValidators = function _SpoListItemSetCommand_initValidators() {
|
|
152
|
-
this.validators.push(async (args) => {
|
|
153
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
154
|
-
if (isValidSharePointUrl !== true) {
|
|
155
|
-
return isValidSharePointUrl;
|
|
156
|
-
}
|
|
157
|
-
if (args.options.listId &&
|
|
158
|
-
!validation.isValidGuid(args.options.listId)) {
|
|
159
|
-
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
160
|
-
}
|
|
161
|
-
return true;
|
|
162
|
-
});
|
|
163
|
-
}, _SpoListItemSetCommand_initTypes = function _SpoListItemSetCommand_initTypes() {
|
|
164
|
-
this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl', 'id', 'contentType');
|
|
165
|
-
this.types.boolean.push('systemUpdate');
|
|
166
|
-
}, _SpoListItemSetCommand_initOptionSets = function _SpoListItemSetCommand_initOptionSets() {
|
|
167
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
168
|
-
};
|
|
169
144
|
export default new SpoListItemSetCommand();
|
|
170
145
|
//# sourceMappingURL=listitem-set.js.map
|