@pnp/cli-microsoft365 12.0.0-beta.d654135 → 12.0.0-beta.e3af9f8
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 +19 -2
- package/dist/cli/cli.js +3 -0
- package/dist/googleAnalytics.js +96 -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/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/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 -79
- 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/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.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/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 +28 -42
- package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
- package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
- package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
- package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
- package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
- package/dist/m365/teams/commands/channel/channel-set.js +47 -54
- 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/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
- package/dist/telemetry.js +7 -11
- package/dist/utils/spo.js +40 -3
- package/dist/utils/urlUtil.js +2 -2
- 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/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 +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 +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 +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/listitem/listitem-get.mdx +0 -6
- 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/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/npm-shrinkwrap.json +324 -3116
- package/package.json +18 -35
- package/dist/appInsights.js +0 -43
|
@@ -1,41 +1,63 @@
|
|
|
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 _SpoListItemGetCommand_instances, _SpoListItemGetCommand_initTelemetry, _SpoListItemGetCommand_initOptions, _SpoListItemGetCommand_initValidators, _SpoListItemGetCommand_initTypes, _SpoListItemGetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.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(webUrl => validation.isValidSharePointUrl(webUrl) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
listId: z.string()
|
|
17
|
+
.refine(listId => validation.isValidGuid(listId), {
|
|
18
|
+
error: e => `${e.input} in option listId is not a valid GUID`
|
|
19
|
+
})
|
|
20
|
+
.optional()
|
|
21
|
+
.alias('l'),
|
|
22
|
+
listTitle: z.string().optional().alias('t'),
|
|
23
|
+
listUrl: z.string().optional(),
|
|
24
|
+
id: z.number().int().positive().optional().alias('i'),
|
|
25
|
+
uniqueId: z.string()
|
|
26
|
+
.refine(uniqueId => validation.isValidGuid(uniqueId), {
|
|
27
|
+
error: e => `${e.input} in option uniqueId is not a valid GUID`
|
|
28
|
+
})
|
|
29
|
+
.optional(),
|
|
30
|
+
fields: z.string().optional(),
|
|
31
|
+
withPermissions: z.boolean().optional()
|
|
32
|
+
});
|
|
13
33
|
class SpoListItemGetCommand extends SpoCommand {
|
|
14
|
-
allowUnknownOptions() {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
34
|
get name() {
|
|
18
35
|
return commands.LISTITEM_GET;
|
|
19
36
|
}
|
|
20
37
|
get description() {
|
|
21
38
|
return 'Gets a list item from the specified list';
|
|
22
39
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_SpoListItemGetCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initTelemetry).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initValidators).call(this);
|
|
29
|
-
__classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initTypes).call(this);
|
|
30
|
-
__classPrivateFieldGet(this, _SpoListItemGetCommand_instances, "m", _SpoListItemGetCommand_initOptionSets).call(this);
|
|
40
|
+
get schema() {
|
|
41
|
+
return options;
|
|
31
42
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
getRefinedSchema(schema) {
|
|
44
|
+
return schema
|
|
45
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
46
|
+
error: 'Specify one of the following options: listId, listTitle, listUrl.',
|
|
47
|
+
params: {
|
|
48
|
+
customCode: 'optionSet',
|
|
49
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
37
50
|
}
|
|
38
|
-
}
|
|
51
|
+
})
|
|
52
|
+
.refine(opts => [opts.id, opts.uniqueId].filter(o => o !== undefined).length === 1, {
|
|
53
|
+
error: 'Specify one of the following options: id, uniqueId.',
|
|
54
|
+
params: {
|
|
55
|
+
customCode: 'optionSet',
|
|
56
|
+
options: ['id', 'uniqueId']
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async commandAction(logger, args) {
|
|
39
61
|
let requestUrl = `${args.options.webUrl}/_api/web`;
|
|
40
62
|
if (args.options.listId) {
|
|
41
63
|
requestUrl += `/lists(guid'${formatting.encodeQueryParameter(args.options.listId)}')`;
|
|
@@ -83,61 +105,5 @@ class SpoListItemGetCommand extends SpoCommand {
|
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
107
|
}
|
|
86
|
-
_SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTelemetry = function _SpoListItemGetCommand_initTelemetry() {
|
|
87
|
-
this.telemetry.push((args) => {
|
|
88
|
-
Object.assign(this.telemetryProperties, {
|
|
89
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
90
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
91
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
92
|
-
id: typeof args.options.id !== 'undefined',
|
|
93
|
-
uniqueId: typeof args.options.uniqueId !== 'undefined',
|
|
94
|
-
withPermissions: !!args.options.withPermissions
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}, _SpoListItemGetCommand_initOptions = function _SpoListItemGetCommand_initOptions() {
|
|
98
|
-
this.options.unshift({
|
|
99
|
-
option: '-u, --webUrl <webUrl>'
|
|
100
|
-
}, {
|
|
101
|
-
option: '-i, --id [id]'
|
|
102
|
-
}, {
|
|
103
|
-
option: '--uniqueId [uniqueId]'
|
|
104
|
-
}, {
|
|
105
|
-
option: '-l, --listId [listId]'
|
|
106
|
-
}, {
|
|
107
|
-
option: '-t, --listTitle [listTitle]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '--listUrl [listUrl]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '--fields [fields]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '-p, --properties [properties]'
|
|
114
|
-
}, {
|
|
115
|
-
option: '--withPermissions'
|
|
116
|
-
});
|
|
117
|
-
}, _SpoListItemGetCommand_initValidators = function _SpoListItemGetCommand_initValidators() {
|
|
118
|
-
this.validators.push(async (args) => {
|
|
119
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
120
|
-
if (isValidSharePointUrl !== true) {
|
|
121
|
-
return isValidSharePointUrl;
|
|
122
|
-
}
|
|
123
|
-
if (args.options.listId &&
|
|
124
|
-
!validation.isValidGuid(args.options.listId)) {
|
|
125
|
-
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
126
|
-
}
|
|
127
|
-
if (args.options.id &&
|
|
128
|
-
isNaN(parseInt(args.options.id))) {
|
|
129
|
-
return `${args.options.id} is not a number`;
|
|
130
|
-
}
|
|
131
|
-
if (args.options.uniqueId &&
|
|
132
|
-
!validation.isValidGuid(args.options.uniqueId)) {
|
|
133
|
-
return `${args.options.uniqueId} in option uniqueId is not a valid GUID`;
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
136
|
-
});
|
|
137
|
-
}, _SpoListItemGetCommand_initTypes = function _SpoListItemGetCommand_initTypes() {
|
|
138
|
-
this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'uniqueId', 'fields', 'properties');
|
|
139
|
-
}, _SpoListItemGetCommand_initOptionSets = function _SpoListItemGetCommand_initOptionSets() {
|
|
140
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['id', 'uniqueId'] });
|
|
141
|
-
};
|
|
142
108
|
export default new SpoListItemGetCommand();
|
|
143
109
|
//# sourceMappingURL=listitem-get.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 _SpoListItemIsRecordCommand_instances, _SpoListItemIsRecordCommand_initTelemetry, _SpoListItemIsRecordCommand_initOptions, _SpoListItemIsRecordCommand_initValidators, _SpoListItemIsRecordCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { Auth } from '../../../../Auth.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import config from '../../../../config.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -13,6 +9,23 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
13
9
|
import { validation } from '../../../../utils/validation.js';
|
|
14
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
15
11
|
import commands from '../../commands.js';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
id: z.number().int().positive().alias('i'),
|
|
15
|
+
listId: z.string()
|
|
16
|
+
.refine(listId => validation.isValidGuid(listId), {
|
|
17
|
+
error: e => `${e.input} in option listId is not a valid GUID`
|
|
18
|
+
})
|
|
19
|
+
.optional()
|
|
20
|
+
.alias('l'),
|
|
21
|
+
listTitle: z.string().optional().alias('t'),
|
|
22
|
+
listUrl: z.string().optional(),
|
|
23
|
+
webUrl: z.string()
|
|
24
|
+
.refine(webUrl => validation.isValidSharePointUrl(webUrl) === true, {
|
|
25
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
26
|
+
})
|
|
27
|
+
.alias('u')
|
|
28
|
+
});
|
|
16
29
|
class SpoListItemIsRecordCommand extends SpoCommand {
|
|
17
30
|
get name() {
|
|
18
31
|
return commands.LISTITEM_ISRECORD;
|
|
@@ -20,13 +33,18 @@ class SpoListItemIsRecordCommand extends SpoCommand {
|
|
|
20
33
|
get description() {
|
|
21
34
|
return 'Checks if the specified list item is a record';
|
|
22
35
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 one of the following options: listId, listTitle, listUrl.',
|
|
43
|
+
params: {
|
|
44
|
+
customCode: 'optionSet',
|
|
45
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
46
|
+
}
|
|
47
|
+
});
|
|
30
48
|
}
|
|
31
49
|
async commandAction(logger, args) {
|
|
32
50
|
const resource = Auth.getResourceFromUrl(args.options.webUrl);
|
|
@@ -111,47 +129,5 @@ class SpoListItemIsRecordCommand extends SpoCommand {
|
|
|
111
129
|
return requestBody;
|
|
112
130
|
}
|
|
113
131
|
}
|
|
114
|
-
_SpoListItemIsRecordCommand_instances = new WeakSet(), _SpoListItemIsRecordCommand_initTelemetry = function _SpoListItemIsRecordCommand_initTelemetry() {
|
|
115
|
-
this.telemetry.push((args) => {
|
|
116
|
-
Object.assign(this.telemetryProperties, {
|
|
117
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
118
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
119
|
-
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}, _SpoListItemIsRecordCommand_initOptions = function _SpoListItemIsRecordCommand_initOptions() {
|
|
123
|
-
this.options.unshift({
|
|
124
|
-
option: '-u, --webUrl <webUrl>'
|
|
125
|
-
}, {
|
|
126
|
-
option: '-i, --id <id>'
|
|
127
|
-
}, {
|
|
128
|
-
option: '-l, --listId [listId]'
|
|
129
|
-
}, {
|
|
130
|
-
option: '-t, --listTitle [listTitle]'
|
|
131
|
-
}, {
|
|
132
|
-
option: '--listUrl [listUrl]'
|
|
133
|
-
});
|
|
134
|
-
}, _SpoListItemIsRecordCommand_initValidators = function _SpoListItemIsRecordCommand_initValidators() {
|
|
135
|
-
this.validators.push(async (args) => {
|
|
136
|
-
const id = parseInt(args.options.id);
|
|
137
|
-
if (isNaN(id)) {
|
|
138
|
-
return `${args.options.id} is not a valid list item ID`;
|
|
139
|
-
}
|
|
140
|
-
if (id < 1) {
|
|
141
|
-
return `Item ID must be a positive number`;
|
|
142
|
-
}
|
|
143
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
144
|
-
if (isValidSharePointUrl !== true) {
|
|
145
|
-
return isValidSharePointUrl;
|
|
146
|
-
}
|
|
147
|
-
if (args.options.listId &&
|
|
148
|
-
!validation.isValidGuid(args.options.listId)) {
|
|
149
|
-
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
150
|
-
}
|
|
151
|
-
return true;
|
|
152
|
-
});
|
|
153
|
-
}, _SpoListItemIsRecordCommand_initOptionSets = function _SpoListItemIsRecordCommand_initOptionSets() {
|
|
154
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
155
|
-
};
|
|
156
132
|
export default new SpoListItemIsRecordCommand();
|
|
157
133
|
//# sourceMappingURL=listitem-isrecord.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 _SpoListItemListCommand_instances, _SpoListItemListCommand_initTelemetry, _SpoListItemListCommand_initOptions, _SpoListItemListCommand_initValidators, _SpoListItemListCommand_initOptionSets, _SpoListItemListCommand_initTypes;
|
|
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 { odata } from '../../../../utils/odata.js';
|
|
@@ -13,6 +9,27 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
13
9
|
import { validation } from '../../../../utils/validation.js';
|
|
14
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
15
11
|
import commands from '../../commands.js';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
webUrl: z.string()
|
|
15
|
+
.refine(webUrl => validation.isValidSharePointUrl(webUrl) === true, {
|
|
16
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
17
|
+
})
|
|
18
|
+
.alias('u'),
|
|
19
|
+
listId: z.string()
|
|
20
|
+
.refine(listId => validation.isValidGuid(listId), {
|
|
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
|
+
pageSize: z.number().int().positive().optional().alias('s'),
|
|
28
|
+
pageNumber: z.number().int().nonnegative().optional().alias('n'),
|
|
29
|
+
camlQuery: z.string().optional().alias('q'),
|
|
30
|
+
fields: z.string().optional(),
|
|
31
|
+
filter: z.string().optional().alias('l')
|
|
32
|
+
});
|
|
16
33
|
class SpoListItemListCommand extends SpoCommand {
|
|
17
34
|
get name() {
|
|
18
35
|
return commands.LISTITEM_LIST;
|
|
@@ -20,14 +37,30 @@ class SpoListItemListCommand extends SpoCommand {
|
|
|
20
37
|
get description() {
|
|
21
38
|
return 'Gets a list of items from the specified list';
|
|
22
39
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 one of the following options: listId, listTitle, listUrl.',
|
|
47
|
+
params: {
|
|
48
|
+
customCode: 'optionSet',
|
|
49
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.refine(opts => !opts.camlQuery || !opts.fields, {
|
|
53
|
+
error: 'You cannot use the fields-option when specifying a camlQuery'
|
|
54
|
+
})
|
|
55
|
+
.refine(opts => !opts.camlQuery || !opts.pageSize, {
|
|
56
|
+
error: 'You cannot use the pageSize-option when specifying a camlQuery'
|
|
57
|
+
})
|
|
58
|
+
.refine(opts => !opts.camlQuery || opts.pageNumber === undefined, {
|
|
59
|
+
error: 'You cannot use the pageNumber-option when specifying a camlQuery'
|
|
60
|
+
})
|
|
61
|
+
.refine(opts => opts.pageNumber === undefined || opts.pageSize !== undefined, {
|
|
62
|
+
error: 'pageSize must be specified if pageNumber is specified'
|
|
63
|
+
});
|
|
31
64
|
}
|
|
32
65
|
async commandAction(logger, args) {
|
|
33
66
|
let listApiUrl = `${args.options.webUrl}/_api/web`;
|
|
@@ -153,72 +186,5 @@ class SpoListItemListCommand extends SpoCommand {
|
|
|
153
186
|
return response.value[response.value.length - 1]?.Id;
|
|
154
187
|
}
|
|
155
188
|
}
|
|
156
|
-
_SpoListItemListCommand_instances = new WeakSet(), _SpoListItemListCommand_initTelemetry = function _SpoListItemListCommand_initTelemetry() {
|
|
157
|
-
this.telemetry.push((args) => {
|
|
158
|
-
Object.assign(this.telemetryProperties, {
|
|
159
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
160
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
161
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
162
|
-
fields: typeof args.options.fields !== 'undefined',
|
|
163
|
-
filter: typeof args.options.filter !== 'undefined',
|
|
164
|
-
pageNumber: typeof args.options.pageNumber !== 'undefined',
|
|
165
|
-
pageSize: typeof args.options.pageSize !== 'undefined',
|
|
166
|
-
camlQuery: typeof args.options.camlQuery !== 'undefined'
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}, _SpoListItemListCommand_initOptions = function _SpoListItemListCommand_initOptions() {
|
|
170
|
-
this.options.unshift({
|
|
171
|
-
option: '-u, --webUrl <webUrl>'
|
|
172
|
-
}, {
|
|
173
|
-
option: '-i, --listId [listId]'
|
|
174
|
-
}, {
|
|
175
|
-
option: '-t, --listTitle [listTitle]'
|
|
176
|
-
}, {
|
|
177
|
-
option: '--listUrl [listUrl]'
|
|
178
|
-
}, {
|
|
179
|
-
option: '-s, --pageSize [pageSize]'
|
|
180
|
-
}, {
|
|
181
|
-
option: '-n, --pageNumber [pageNumber]'
|
|
182
|
-
}, {
|
|
183
|
-
option: '-q, --camlQuery [camlQuery]'
|
|
184
|
-
}, {
|
|
185
|
-
option: '--fields [fields]'
|
|
186
|
-
}, {
|
|
187
|
-
option: '-l, --filter [filter]'
|
|
188
|
-
});
|
|
189
|
-
}, _SpoListItemListCommand_initValidators = function _SpoListItemListCommand_initValidators() {
|
|
190
|
-
this.validators.push(async (args) => {
|
|
191
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
192
|
-
if (isValidSharePointUrl !== true) {
|
|
193
|
-
return isValidSharePointUrl;
|
|
194
|
-
}
|
|
195
|
-
if (args.options.camlQuery && args.options.fields) {
|
|
196
|
-
return `You cannot use the fields-option when specifying a camlQuery`;
|
|
197
|
-
}
|
|
198
|
-
if (args.options.camlQuery && args.options.pageSize) {
|
|
199
|
-
return `You cannot use the pageSize-option when specifying a camlQuery`;
|
|
200
|
-
}
|
|
201
|
-
if (args.options.camlQuery && args.options.pageNumber) {
|
|
202
|
-
return `You cannot use the pageNumber-option when specifying a camlQuery`;
|
|
203
|
-
}
|
|
204
|
-
if (args.options.pageSize && isNaN(Number(args.options.pageSize))) {
|
|
205
|
-
return `pageSize ${args.options.pageSize} must be numeric`;
|
|
206
|
-
}
|
|
207
|
-
if (args.options.pageNumber && !args.options.pageSize) {
|
|
208
|
-
return `pageSize must be specified if pageNumber is specified`;
|
|
209
|
-
}
|
|
210
|
-
if (args.options.pageNumber && isNaN(Number(args.options.pageNumber))) {
|
|
211
|
-
return `pageNumber must be numeric`;
|
|
212
|
-
}
|
|
213
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
214
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
215
|
-
}
|
|
216
|
-
return true;
|
|
217
|
-
});
|
|
218
|
-
}, _SpoListItemListCommand_initOptionSets = function _SpoListItemListCommand_initOptionSets() {
|
|
219
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
220
|
-
}, _SpoListItemListCommand_initTypes = function _SpoListItemListCommand_initTypes() {
|
|
221
|
-
this.types.string.push('webUrl', 'camlQuery', 'pageSize', 'pageNumber', 'fields', 'filter');
|
|
222
|
-
};
|
|
223
189
|
export default new SpoListItemListCommand();
|
|
224
190
|
//# sourceMappingURL=listitem-list.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 _SpoListItemRecordDeclareCommand_instances, _SpoListItemRecordDeclareCommand_initTelemetry, _SpoListItemRecordDeclareCommand_initOptions, _SpoListItemRecordDeclareCommand_initValidators, _SpoListItemRecordDeclareCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import config from "../../../../config.js";
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from "../../../../utils/formatting.js";
|
|
@@ -12,6 +8,29 @@ 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.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(webUrl => validation.isValidSharePointUrl(webUrl) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
listId: z.string()
|
|
19
|
+
.refine(listId => validation.isValidGuid(listId), {
|
|
20
|
+
error: e => `${e.input} in option listId is not a valid GUID`
|
|
21
|
+
})
|
|
22
|
+
.optional()
|
|
23
|
+
.alias('l'),
|
|
24
|
+
listTitle: z.string().optional().alias('t'),
|
|
25
|
+
listUrl: z.string().optional(),
|
|
26
|
+
listItemId: z.number().int().positive().alias('i'),
|
|
27
|
+
date: z.string()
|
|
28
|
+
.refine(date => validation.isValidISODate(date), {
|
|
29
|
+
error: e => `${e.input} in option date is not in ISO format (yyyy-mm-dd)`
|
|
30
|
+
})
|
|
31
|
+
.optional()
|
|
32
|
+
.alias('d')
|
|
33
|
+
});
|
|
15
34
|
class SpoListItemRecordDeclareCommand extends SpoCommand {
|
|
16
35
|
get name() {
|
|
17
36
|
return commands.LISTITEM_RECORD_DECLARE;
|
|
@@ -19,13 +38,18 @@ class SpoListItemRecordDeclareCommand extends SpoCommand {
|
|
|
19
38
|
get description() {
|
|
20
39
|
return "Declares the specified list item as a record";
|
|
21
40
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
get schema() {
|
|
42
|
+
return options;
|
|
43
|
+
}
|
|
44
|
+
getRefinedSchema(schema) {
|
|
45
|
+
return schema
|
|
46
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
47
|
+
error: 'Specify one of the following options: listId, listTitle, listUrl.',
|
|
48
|
+
params: {
|
|
49
|
+
customCode: 'optionSet',
|
|
50
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
51
|
+
}
|
|
52
|
+
});
|
|
29
53
|
}
|
|
30
54
|
async commandAction(logger, args) {
|
|
31
55
|
try {
|
|
@@ -91,52 +115,5 @@ class SpoListItemRecordDeclareCommand extends SpoCommand {
|
|
|
91
115
|
return requestBody;
|
|
92
116
|
}
|
|
93
117
|
}
|
|
94
|
-
_SpoListItemRecordDeclareCommand_instances = new WeakSet(), _SpoListItemRecordDeclareCommand_initTelemetry = function _SpoListItemRecordDeclareCommand_initTelemetry() {
|
|
95
|
-
this.telemetry.push((args) => {
|
|
96
|
-
Object.assign(this.telemetryProperties, {
|
|
97
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
98
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
99
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
100
|
-
date: typeof args.options.date !== 'undefined'
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}, _SpoListItemRecordDeclareCommand_initOptions = function _SpoListItemRecordDeclareCommand_initOptions() {
|
|
104
|
-
this.options.unshift({
|
|
105
|
-
option: '-u, --webUrl <webUrl>'
|
|
106
|
-
}, {
|
|
107
|
-
option: '-l, --listId [listId]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '-t, --listTitle [listTitle]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '--listUrl [listUrl]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '-i, --listItemId <listItemId>'
|
|
114
|
-
}, {
|
|
115
|
-
option: '-d, --date [date]'
|
|
116
|
-
});
|
|
117
|
-
}, _SpoListItemRecordDeclareCommand_initValidators = function _SpoListItemRecordDeclareCommand_initValidators() {
|
|
118
|
-
this.validators.push(async (args) => {
|
|
119
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
120
|
-
if (isValidSharePointUrl !== true) {
|
|
121
|
-
return isValidSharePointUrl;
|
|
122
|
-
}
|
|
123
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
124
|
-
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
125
|
-
}
|
|
126
|
-
const id = parseInt(args.options.listItemId);
|
|
127
|
-
if (isNaN(id)) {
|
|
128
|
-
return `${args.options.listItemId} is not a number`;
|
|
129
|
-
}
|
|
130
|
-
if (id < 1) {
|
|
131
|
-
return `Item ID must be a positive number`;
|
|
132
|
-
}
|
|
133
|
-
if (args.options.date && !validation.isValidISODate(args.options.date)) {
|
|
134
|
-
return `${args.options.date} in option date is not in ISO format (yyyy-mm-dd)`;
|
|
135
|
-
}
|
|
136
|
-
return true;
|
|
137
|
-
});
|
|
138
|
-
}, _SpoListItemRecordDeclareCommand_initOptionSets = function _SpoListItemRecordDeclareCommand_initOptionSets() {
|
|
139
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
140
|
-
};
|
|
141
118
|
export default new SpoListItemRecordDeclareCommand();
|
|
142
119
|
//# sourceMappingURL=listitem-record-declare.js.map
|
|
@@ -1,15 +1,27 @@
|
|
|
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 _SpoListItemRecordLockCommand_instances, _SpoListItemRecordLockCommand_initTelemetry, _SpoListItemRecordLockCommand_initOptions, _SpoListItemRecordLockCommand_initValidators, _SpoListItemRecordLockCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.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(webUrl => validation.isValidSharePointUrl(webUrl) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
listId: z.string()
|
|
17
|
+
.refine(listId => validation.isValidGuid(listId), {
|
|
18
|
+
error: e => `${e.input} is not a valid GUID`
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
listTitle: z.string().optional(),
|
|
22
|
+
listUrl: z.string().optional(),
|
|
23
|
+
listItemId: z.number().int().positive()
|
|
24
|
+
});
|
|
13
25
|
class SpoListItemRecordLockCommand extends SpoCommand {
|
|
14
26
|
get name() {
|
|
15
27
|
return commands.LISTITEM_RECORD_LOCK;
|
|
@@ -17,13 +29,18 @@ class SpoListItemRecordLockCommand extends SpoCommand {
|
|
|
17
29
|
get description() {
|
|
18
30
|
return 'Locks the list item record';
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
get schema() {
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
getRefinedSchema(schema) {
|
|
36
|
+
return schema
|
|
37
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length === 1, {
|
|
38
|
+
error: 'Specify one of the following options: listId, listTitle, listUrl.',
|
|
39
|
+
params: {
|
|
40
|
+
customCode: 'optionSet',
|
|
41
|
+
options: ['listId', 'listTitle', 'listUrl']
|
|
42
|
+
}
|
|
43
|
+
});
|
|
27
44
|
}
|
|
28
45
|
async commandAction(logger, args) {
|
|
29
46
|
if (this.verbose) {
|
|
@@ -73,44 +90,5 @@ class SpoListItemRecordLockCommand extends SpoCommand {
|
|
|
73
90
|
}
|
|
74
91
|
}
|
|
75
92
|
}
|
|
76
|
-
_SpoListItemRecordLockCommand_instances = new WeakSet(), _SpoListItemRecordLockCommand_initTelemetry = function _SpoListItemRecordLockCommand_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
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}, _SpoListItemRecordLockCommand_initOptions = function _SpoListItemRecordLockCommand_initOptions() {
|
|
85
|
-
this.options.unshift({
|
|
86
|
-
option: '-u, --webUrl <webUrl>'
|
|
87
|
-
}, {
|
|
88
|
-
option: '--listItemId <listItemId>'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--listId [listId]'
|
|
91
|
-
}, {
|
|
92
|
-
option: '--listTitle [listTitle]'
|
|
93
|
-
}, {
|
|
94
|
-
option: '--listUrl [listUrl]'
|
|
95
|
-
});
|
|
96
|
-
}, _SpoListItemRecordLockCommand_initValidators = function _SpoListItemRecordLockCommand_initValidators() {
|
|
97
|
-
this.validators.push(async (args) => {
|
|
98
|
-
const id = parseInt(args.options.listItemId);
|
|
99
|
-
if (isNaN(id)) {
|
|
100
|
-
return `${args.options.listItemId} is not a valid list item ID`;
|
|
101
|
-
}
|
|
102
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
103
|
-
if (isValidSharePointUrl !== true) {
|
|
104
|
-
return isValidSharePointUrl;
|
|
105
|
-
}
|
|
106
|
-
if (args.options.listId &&
|
|
107
|
-
!validation.isValidGuid(args.options.listId)) {
|
|
108
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
109
|
-
}
|
|
110
|
-
return true;
|
|
111
|
-
});
|
|
112
|
-
}, _SpoListItemRecordLockCommand_initOptionSets = function _SpoListItemRecordLockCommand_initOptionSets() {
|
|
113
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
|
|
114
|
-
};
|
|
115
93
|
export default new SpoListItemRecordLockCommand();
|
|
116
94
|
//# sourceMappingURL=listitem-record-lock.js.map
|