@pnp/cli-microsoft365 12.0.0-beta.4ac11a7 → 12.0.0-beta.8769a5e
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 +4 -1
- package/dist/Command.js +11 -8
- package/dist/cli/cli.js +15 -0
- package/dist/config.js +2 -0
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- package/dist/m365/entra/commands/agent/agent-blueprint-list.js +52 -0
- package/dist/m365/entra/commands/agent/agent-blueprintprincipal-list.js +56 -0
- 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/entra/commands.js +2 -0
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
- package/dist/m365/outlook/commands/calendargroup/calendargroup-add.js +97 -0
- package/dist/m365/outlook/commands/event/event-add.js +324 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/spe/commands/container/container-activate.js +8 -16
- package/dist/m365/spe/commands/container/container-list.js +21 -42
- package/dist/m365/spe/commands/container/container-permission-add.js +114 -0
- package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
- package/dist/m365/spe/commands/container/container-permission-set.js +90 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +5 -0
- package/dist/m365/spe/commands.js +3 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.24.0-rc.0.js → doctor-1.24.0.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.24.0-rc.0.js → upgrade-1.24.0.js} +27 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +11 -11
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +38 -71
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +25 -59
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +11 -34
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +25 -54
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +52 -83
- package/dist/m365/spo/commands/apppage/apppage-add.js +21 -39
- package/dist/m365/spo/commands/apppage/apppage-set.js +20 -30
- 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/contenttype/contenttype-add.js +22 -51
- package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +38 -62
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +25 -54
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +20 -43
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +29 -54
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +13 -30
- package/dist/m365/spo/commands/contenttype/contenttype-remove.js +24 -39
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +42 -63
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +37 -59
- package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +5 -0
- package/dist/m365/spo/commands/customaction/customaction-add.js +124 -145
- package/dist/m365/spo/commands/customaction/customaction-clear.js +12 -43
- package/dist/m365/spo/commands/customaction/customaction-get.js +28 -59
- package/dist/m365/spo/commands/customaction/customaction-list.js +12 -42
- package/dist/m365/spo/commands/customaction/customaction-remove.js +26 -54
- package/dist/m365/spo/commands/customaction/customaction-set.js +75 -132
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +5 -14
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +5 -0
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +8 -22
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +10 -18
- 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 +1 -1
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +1 -1
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +1 -1
- package/dist/m365/spo/commands/navigation/navigation-node-remove.js +13 -47
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +15 -49
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +6 -1
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +9 -17
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +5 -0
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +11 -27
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +10 -18
- 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/serviceprincipal/serviceprincipal-grant-add.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +29 -39
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +10 -23
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +19 -28
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +24 -59
- package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +19 -36
- package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +8 -0
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +9 -32
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +10 -31
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +9 -38
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +9 -29
- package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +27 -80
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +8 -18
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +9 -32
- package/dist/m365/spo/commands/spo-search.js +43 -116
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +15 -46
- package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +20 -57
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +47 -79
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +23 -54
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +25 -50
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +41 -65
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +10 -30
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +8 -21
- package/dist/m365/spo/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +104 -386
- package/dist/m365/spo/commands/term/term-add.js +95 -110
- package/dist/m365/spo/commands/term/term-get.js +63 -75
- package/dist/m365/spo/commands/term/term-group-add.js +11 -41
- package/dist/m365/spo/commands/term/term-group-get.js +16 -47
- package/dist/m365/spo/commands/term/term-group-list.js +16 -42
- package/dist/m365/spo/commands/term/term-list.js +42 -57
- package/dist/m365/spo/commands/term/term-set-add.js +50 -71
- package/dist/m365/spo/commands/term/term-set-get.js +41 -58
- package/dist/m365/spo/commands/term/term-set-list.js +22 -56
- package/dist/m365/spo/commands/theme/theme-apply.js +27 -43
- package/dist/m365/spo/commands/theme/theme-get.js +8 -15
- package/dist/m365/spo/commands/theme/theme-list.js +5 -0
- package/dist/m365/spo/commands/theme/theme-remove.js +9 -24
- package/dist/m365/spo/commands/theme/theme-set.js +12 -34
- package/dist/m365/teams/commands/app/app-install.js +35 -44
- package/dist/m365/teams/commands/app/app-list.js +8 -33
- package/dist/m365/teams/commands/app/app-publish.js +21 -27
- package/dist/m365/teams/commands/app/app-remove.js +22 -39
- package/dist/m365/teams/commands/app/app-uninstall.js +12 -34
- package/dist/m365/teams/commands/app/app-update.js +35 -45
- package/dist/m365/teams/commands/funsettings/funsettings-list.js +12 -23
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +18 -54
- package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +12 -23
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +15 -40
- 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/membersettings/membersettings-list.js +12 -23
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +18 -49
- 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/messagingsettings/messagingsettings-list.js +12 -23
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +18 -60
- 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/id/id-get.js +8 -22
- package/dist/m365/tenant/commands/info/info-get.js +23 -36
- package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +67 -55
- package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +11 -24
- package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +5 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +12 -33
- package/dist/m365/tenant/commands/people/people-profilecardproperty-set.js +31 -51
- package/dist/m365/tenant/commands/people/people-pronouns-get.js +5 -0
- package/dist/m365/tenant/commands/people/profileCardProperties.js +10 -7
- 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/security/security-alerts-list.js +8 -20
- 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/calendar.js +1 -1
- package/dist/utils/formatting.js +16 -0
- package/dist/utils/pid.js +7 -16
- package/dist/utils/spe.js +1 -1
- package/dist/utils/validation.js +36 -0
- package/dist/utils/zod.js +18 -7
- package/docs/docs/cmd/entra/agent/agent-blueprint-list.mdx +175 -0
- package/docs/docs/cmd/entra/agent/agent-blueprintprincipal-list.mdx +156 -0
- package/docs/docs/cmd/outlook/calendargroup/calendargroup-add.mdx +126 -0
- package/docs/docs/cmd/outlook/event/event-add.mdx +390 -0
- package/docs/docs/cmd/spe/container/container-add.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-list.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-permission-add.mdx +140 -0
- package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
- package/docs/docs/cmd/spe/container/container-permission-set.mdx +78 -0
- package/docs/docs/cmd/spe/container/container-recyclebinitem-list.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-recyclebinitem-restore.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-remove.mdx +0 -8
- package/docs/docs/cmd/spe/containertype/containertype-add.mdx +1 -1
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +1 -1
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
- package/package.json +1 -1
|
@@ -1,13 +1,16 @@
|
|
|
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 _SpoApplicationCustomizerListCommand_instances, _a, _SpoApplicationCustomizerListCommand_initOptions, _SpoApplicationCustomizerListCommand_initTelemetry, _SpoApplicationCustomizerListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { spo } from '../../../../utils/spo.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, {
|
|
10
|
+
error: e => `${e.input} is not a valid SharePoint URL`
|
|
11
|
+
}).alias('u'),
|
|
12
|
+
scope: z.enum(['All', 'Site', 'Web']).optional().alias('s')
|
|
13
|
+
});
|
|
11
14
|
class SpoApplicationCustomizerListCommand extends SpoCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.APPLICATIONCUSTOMIZER_LIST;
|
|
@@ -18,12 +21,8 @@ class SpoApplicationCustomizerListCommand extends SpoCommand {
|
|
|
18
21
|
defaultProperties() {
|
|
19
22
|
return ['Name', 'Location', 'Scope', 'Id'];
|
|
20
23
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoApplicationCustomizerListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initTelemetry).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerListCommand_instances, "m", _SpoApplicationCustomizerListCommand_initValidators).call(this);
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
27
26
|
}
|
|
28
27
|
async commandAction(logger, args) {
|
|
29
28
|
if (this.verbose) {
|
|
@@ -33,27 +32,5 @@ class SpoApplicationCustomizerListCommand extends SpoCommand {
|
|
|
33
32
|
await logger.log(applicationCustomizers);
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
_a = SpoApplicationCustomizerListCommand, _SpoApplicationCustomizerListCommand_instances = new WeakSet(), _SpoApplicationCustomizerListCommand_initOptions = function _SpoApplicationCustomizerListCommand_initOptions() {
|
|
37
|
-
this.options.unshift({
|
|
38
|
-
option: '-u, --webUrl <webUrl>'
|
|
39
|
-
}, {
|
|
40
|
-
option: '-s, --scope [scope]',
|
|
41
|
-
autocomplete: _a.scopes
|
|
42
|
-
});
|
|
43
|
-
}, _SpoApplicationCustomizerListCommand_initTelemetry = function _SpoApplicationCustomizerListCommand_initTelemetry() {
|
|
44
|
-
this.telemetry.push((args) => {
|
|
45
|
-
Object.assign(this.telemetryProperties, {
|
|
46
|
-
scope: typeof args.options.scope !== 'undefined'
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}, _SpoApplicationCustomizerListCommand_initValidators = function _SpoApplicationCustomizerListCommand_initValidators() {
|
|
50
|
-
this.validators.push(async (args) => {
|
|
51
|
-
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
52
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
53
|
-
}
|
|
54
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
SpoApplicationCustomizerListCommand.scopes = ['All', 'Site', 'Web'];
|
|
58
35
|
export default new SpoApplicationCustomizerListCommand();
|
|
59
36
|
//# sourceMappingURL=applicationcustomizer-list.js.map
|
|
@@ -1,16 +1,23 @@
|
|
|
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 _SpoApplicationCustomizerRemoveCommand_instances, _SpoApplicationCustomizerRemoveCommand_initOptions, _SpoApplicationCustomizerRemoveCommand_initTelemetry, _SpoApplicationCustomizerRemoveCommand_initValidators, _SpoApplicationCustomizerRemoveCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
12
8
|
import { spo } from '../../../../utils/spo.js';
|
|
13
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, {
|
|
13
|
+
error: e => `${e.input} is not a valid SharePoint URL`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
title: z.string().optional().alias('t'),
|
|
16
|
+
id: z.guid().optional().alias('i'),
|
|
17
|
+
clientSideComponentId: z.guid().optional().alias('c'),
|
|
18
|
+
scope: z.enum(['Site', 'Web', 'All']).optional().alias('s'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
14
21
|
class SpoApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
15
22
|
get name() {
|
|
16
23
|
return commands.APPLICATIONCUSTOMIZER_REMOVE;
|
|
@@ -18,14 +25,18 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
|
18
25
|
get description() {
|
|
19
26
|
return 'Removes an application customizer that is added to a site';
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(args => [args.id, args.title, args.clientSideComponentId].filter(value => value !== undefined).length === 1, {
|
|
34
|
+
error: `Specify either 'id', 'title', or 'clientSideComponentId'.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['id', 'title', 'clientSideComponentId']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
29
40
|
}
|
|
30
41
|
async commandAction(logger, args) {
|
|
31
42
|
try {
|
|
@@ -80,45 +91,5 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
|
80
91
|
return appCustomizers[0];
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
|
-
_SpoApplicationCustomizerRemoveCommand_instances = new WeakSet(), _SpoApplicationCustomizerRemoveCommand_initOptions = function _SpoApplicationCustomizerRemoveCommand_initOptions() {
|
|
84
|
-
this.options.unshift({
|
|
85
|
-
option: '-u, --webUrl <webUrl>'
|
|
86
|
-
}, {
|
|
87
|
-
option: '-t, --title [title]'
|
|
88
|
-
}, {
|
|
89
|
-
option: '-i, --id [id]'
|
|
90
|
-
}, {
|
|
91
|
-
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
92
|
-
}, {
|
|
93
|
-
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
94
|
-
}, {
|
|
95
|
-
option: '-f, --force'
|
|
96
|
-
});
|
|
97
|
-
}, _SpoApplicationCustomizerRemoveCommand_initTelemetry = function _SpoApplicationCustomizerRemoveCommand_initTelemetry() {
|
|
98
|
-
this.telemetry.push((args) => {
|
|
99
|
-
Object.assign(this.telemetryProperties, {
|
|
100
|
-
title: typeof args.options.title !== 'undefined',
|
|
101
|
-
id: typeof args.options.id !== 'undefined',
|
|
102
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
103
|
-
scope: typeof args.options.scope !== 'undefined',
|
|
104
|
-
force: !!args.options.force
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
}, _SpoApplicationCustomizerRemoveCommand_initValidators = function _SpoApplicationCustomizerRemoveCommand_initValidators() {
|
|
108
|
-
this.validators.push(async (args) => {
|
|
109
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
110
|
-
return `${args.options.id} is not a valid GUID`;
|
|
111
|
-
}
|
|
112
|
-
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
113
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
114
|
-
}
|
|
115
|
-
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
116
|
-
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
117
|
-
}
|
|
118
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
119
|
-
});
|
|
120
|
-
}, _SpoApplicationCustomizerRemoveCommand_initOptionSets = function _SpoApplicationCustomizerRemoveCommand_initOptionSets() {
|
|
121
|
-
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
122
|
-
};
|
|
123
94
|
export default new SpoApplicationCustomizerRemoveCommand();
|
|
124
95
|
//# sourceMappingURL=applicationcustomizer-remove.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 _SpoApplicationCustomizerSetCommand_instances, _SpoApplicationCustomizerSetCommand_initOptions, _SpoApplicationCustomizerSetCommand_initTelemetry, _SpoApplicationCustomizerSetCommand_initValidators, _SpoApplicationCustomizerSetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -11,6 +7,40 @@ import commands from '../../commands.js';
|
|
|
11
7
|
import { spo } from '../../../../utils/spo.js';
|
|
12
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
13
9
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, {
|
|
13
|
+
error: e => `${e.input} is not a valid SharePoint URL`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
title: z.string().optional().alias('t'),
|
|
16
|
+
id: z.guid().optional().alias('i'),
|
|
17
|
+
clientSideComponentId: z.guid().optional().alias('c'),
|
|
18
|
+
newTitle: z.string().optional(),
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
clientSideComponentProperties: z.string().refine(val => {
|
|
21
|
+
try {
|
|
22
|
+
JSON.parse(val);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
error: 'Specified clientSideComponentProperties is not a valid JSON string.'
|
|
30
|
+
}).optional().alias('p'),
|
|
31
|
+
hostProperties: z.string().refine(val => {
|
|
32
|
+
try {
|
|
33
|
+
JSON.parse(val);
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
error: 'Specified hostProperties is not a valid JSON string.'
|
|
41
|
+
}).optional(),
|
|
42
|
+
scope: z.enum(['Site', 'Web', 'All']).optional().alias('s')
|
|
43
|
+
});
|
|
14
44
|
class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
15
45
|
get name() {
|
|
16
46
|
return commands.APPLICATIONCUSTOMIZER_SET;
|
|
@@ -18,14 +48,21 @@ class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
18
48
|
get description() {
|
|
19
49
|
return 'Updates an existing Application Customizer on a site';
|
|
20
50
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
get schema() {
|
|
52
|
+
return options;
|
|
53
|
+
}
|
|
54
|
+
getRefinedSchema(schema) {
|
|
55
|
+
return schema
|
|
56
|
+
.refine(args => [args.id, args.title, args.clientSideComponentId].filter(value => value !== undefined).length === 1, {
|
|
57
|
+
error: `Specify either 'id', 'title', or 'clientSideComponentId'.`,
|
|
58
|
+
params: {
|
|
59
|
+
customCode: 'optionSet',
|
|
60
|
+
options: ['id', 'title', 'clientSideComponentId']
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.refine(args => args.newTitle !== undefined || args.description !== undefined || args.clientSideComponentProperties !== undefined || args.hostProperties !== undefined, {
|
|
64
|
+
error: `Please specify an option to be updated`
|
|
65
|
+
});
|
|
29
66
|
}
|
|
30
67
|
async commandAction(logger, args) {
|
|
31
68
|
try {
|
|
@@ -44,7 +81,7 @@ class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
44
81
|
const requestBody = {
|
|
45
82
|
HostProperties: hostProperties
|
|
46
83
|
};
|
|
47
|
-
if (newTitle) {
|
|
84
|
+
if (newTitle !== undefined) {
|
|
48
85
|
requestBody.Title = newTitle;
|
|
49
86
|
}
|
|
50
87
|
if (description !== undefined) {
|
|
@@ -93,73 +130,5 @@ class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
93
130
|
return appCustomizers[0];
|
|
94
131
|
}
|
|
95
132
|
}
|
|
96
|
-
_SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCustomizerSetCommand_initOptions = function _SpoApplicationCustomizerSetCommand_initOptions() {
|
|
97
|
-
this.options.unshift({
|
|
98
|
-
option: '-u, --webUrl <webUrl>'
|
|
99
|
-
}, {
|
|
100
|
-
option: '-t, --title [title]'
|
|
101
|
-
}, {
|
|
102
|
-
option: '-i, --id [id]'
|
|
103
|
-
}, {
|
|
104
|
-
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
105
|
-
}, {
|
|
106
|
-
option: '--newTitle [newTitle]'
|
|
107
|
-
}, {
|
|
108
|
-
option: '--description [description]'
|
|
109
|
-
}, {
|
|
110
|
-
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
111
|
-
}, {
|
|
112
|
-
option: '--hostProperties [hostProperties]'
|
|
113
|
-
}, {
|
|
114
|
-
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
115
|
-
});
|
|
116
|
-
}, _SpoApplicationCustomizerSetCommand_initTelemetry = function _SpoApplicationCustomizerSetCommand_initTelemetry() {
|
|
117
|
-
this.telemetry.push((args) => {
|
|
118
|
-
Object.assign(this.telemetryProperties, {
|
|
119
|
-
title: typeof args.options.title !== 'undefined',
|
|
120
|
-
id: typeof args.options.id !== 'undefined',
|
|
121
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
122
|
-
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
123
|
-
description: typeof args.options.description !== 'undefined',
|
|
124
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
125
|
-
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
126
|
-
scope: typeof args.options.scope !== 'undefined'
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}, _SpoApplicationCustomizerSetCommand_initValidators = function _SpoApplicationCustomizerSetCommand_initValidators() {
|
|
130
|
-
this.validators.push(async (args) => {
|
|
131
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
132
|
-
return `${args.options.id} is not a valid GUID`;
|
|
133
|
-
}
|
|
134
|
-
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
135
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
136
|
-
}
|
|
137
|
-
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
138
|
-
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
139
|
-
}
|
|
140
|
-
if (args.options.clientSideComponentProperties) {
|
|
141
|
-
try {
|
|
142
|
-
JSON.parse(args.options.clientSideComponentProperties);
|
|
143
|
-
}
|
|
144
|
-
catch (e) {
|
|
145
|
-
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (args.options.hostProperties) {
|
|
149
|
-
try {
|
|
150
|
-
JSON.parse(args.options.hostProperties);
|
|
151
|
-
}
|
|
152
|
-
catch (e) {
|
|
153
|
-
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (!args.options.newTitle && args.options.description === undefined && !args.options.clientSideComponentProperties && args.options.hostProperties === undefined) {
|
|
157
|
-
return `Please specify an option to be updated`;
|
|
158
|
-
}
|
|
159
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
160
|
-
});
|
|
161
|
-
}, _SpoApplicationCustomizerSetCommand_initOptionSets = function _SpoApplicationCustomizerSetCommand_initOptionSets() {
|
|
162
|
-
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
163
|
-
};
|
|
164
133
|
export default new SpoApplicationCustomizerSetCommand();
|
|
165
134
|
//# sourceMappingURL=applicationcustomizer-set.js.map
|
|
@@ -1,13 +1,26 @@
|
|
|
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 _SpoAppPageAddCommand_instances, _SpoAppPageAddCommand_initTelemetry, _SpoAppPageAddCommand_initOptions, _SpoAppPageAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().alias('u'),
|
|
10
|
+
title: z.string().alias('t'),
|
|
11
|
+
webPartData: z.string().refine(val => {
|
|
12
|
+
try {
|
|
13
|
+
JSON.parse(val);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
error: 'Specified webPartData is not a valid JSON string.'
|
|
21
|
+
}).alias('d'),
|
|
22
|
+
addToQuickLaunch: z.boolean().optional()
|
|
23
|
+
});
|
|
11
24
|
class SpoAppPageAddCommand extends SpoCommand {
|
|
12
25
|
get name() {
|
|
13
26
|
return commands.APPPAGE_ADD;
|
|
@@ -15,12 +28,8 @@ class SpoAppPageAddCommand extends SpoCommand {
|
|
|
15
28
|
get description() {
|
|
16
29
|
return 'Creates a single-part app page';
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoAppPageAddCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoAppPageAddCommand_instances, "m", _SpoAppPageAddCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoAppPageAddCommand_instances, "m", _SpoAppPageAddCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoAppPageAddCommand_instances, "m", _SpoAppPageAddCommand_initValidators).call(this);
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
24
33
|
}
|
|
25
34
|
async commandAction(logger, args) {
|
|
26
35
|
const createPageRequestOptions = {
|
|
@@ -68,32 +77,5 @@ class SpoAppPageAddCommand extends SpoCommand {
|
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
|
-
_SpoAppPageAddCommand_instances = new WeakSet(), _SpoAppPageAddCommand_initTelemetry = function _SpoAppPageAddCommand_initTelemetry() {
|
|
72
|
-
this.telemetry.push((args) => {
|
|
73
|
-
Object.assign(this.telemetryProperties, {
|
|
74
|
-
addToQuickLaunch: args.options.addToQuickLaunch
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}, _SpoAppPageAddCommand_initOptions = function _SpoAppPageAddCommand_initOptions() {
|
|
78
|
-
this.options.unshift({
|
|
79
|
-
option: '-u, --webUrl <webUrl>'
|
|
80
|
-
}, {
|
|
81
|
-
option: '-t, --title <title>'
|
|
82
|
-
}, {
|
|
83
|
-
option: '-d, --webPartData <webPartData>'
|
|
84
|
-
}, {
|
|
85
|
-
option: '--addToQuickLaunch'
|
|
86
|
-
});
|
|
87
|
-
}, _SpoAppPageAddCommand_initValidators = function _SpoAppPageAddCommand_initValidators() {
|
|
88
|
-
this.validators.push(async (args) => {
|
|
89
|
-
try {
|
|
90
|
-
JSON.parse(args.options.webPartData);
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
93
|
-
return `Specified webPartData is not a valid JSON string. Error: ${e}`;
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
80
|
export default new SpoAppPageAddCommand();
|
|
99
81
|
//# sourceMappingURL=apppage-add.js.map
|
|
@@ -1,13 +1,25 @@
|
|
|
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 _SpoAppPageSetCommand_instances, _SpoAppPageSetCommand_initOptions, _SpoAppPageSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().alias('u'),
|
|
10
|
+
name: z.string().alias('n'),
|
|
11
|
+
webPartData: z.string().refine(val => {
|
|
12
|
+
try {
|
|
13
|
+
JSON.parse(val);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
error: 'Specified webPartData is not a valid JSON string.'
|
|
21
|
+
}).alias('d')
|
|
22
|
+
});
|
|
11
23
|
class SpoAppPageSetCommand extends SpoCommand {
|
|
12
24
|
get name() {
|
|
13
25
|
return commands.APPPAGE_SET;
|
|
@@ -15,11 +27,8 @@ class SpoAppPageSetCommand extends SpoCommand {
|
|
|
15
27
|
get description() {
|
|
16
28
|
return 'Updates the single-part app page';
|
|
17
29
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoAppPageSetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoAppPageSetCommand_instances, "m", _SpoAppPageSetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoAppPageSetCommand_instances, "m", _SpoAppPageSetCommand_initValidators).call(this);
|
|
30
|
+
get schema() {
|
|
31
|
+
return options;
|
|
23
32
|
}
|
|
24
33
|
async commandAction(logger, args) {
|
|
25
34
|
const requestOptions = {
|
|
@@ -42,24 +51,5 @@ class SpoAppPageSetCommand extends SpoCommand {
|
|
|
42
51
|
}
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
|
-
_SpoAppPageSetCommand_instances = new WeakSet(), _SpoAppPageSetCommand_initOptions = function _SpoAppPageSetCommand_initOptions() {
|
|
46
|
-
this.options.unshift({
|
|
47
|
-
option: '-u, --webUrl <webUrl>'
|
|
48
|
-
}, {
|
|
49
|
-
option: '-n, --name <name>'
|
|
50
|
-
}, {
|
|
51
|
-
option: '-d, --webPartData <webPartData>'
|
|
52
|
-
});
|
|
53
|
-
}, _SpoAppPageSetCommand_initValidators = function _SpoAppPageSetCommand_initValidators() {
|
|
54
|
-
this.validators.push(async (args) => {
|
|
55
|
-
try {
|
|
56
|
-
JSON.parse(args.options.webPartData);
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
return `Specified webPartData is not a valid JSON string. Error: ${e}`;
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
54
|
export default new SpoAppPageSetCommand();
|
|
65
55
|
//# sourceMappingURL=apppage-set.js.map
|
|
@@ -1,13 +1,22 @@
|
|
|
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 _SpoCommandSetAddCommand_instances, _a, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
2
|
import commands from '../../commands.js';
|
|
8
3
|
import { validation } from '../../../../utils/validation.js';
|
|
9
4
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
5
|
import request from '../../../../request.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
title: z.string().alias('t'),
|
|
10
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
listType: z.enum(['List', 'Library', 'SitePages']).alias('l'),
|
|
14
|
+
clientSideComponentId: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).alias('i'),
|
|
15
|
+
description: z.string().optional(),
|
|
16
|
+
clientSideComponentProperties: z.string().optional(),
|
|
17
|
+
scope: z.enum(['Site', 'Web']).optional().alias('s'),
|
|
18
|
+
location: z.enum(['ContextMenu', 'CommandBar', 'Both']).optional()
|
|
19
|
+
});
|
|
11
20
|
class SpoCommandSetAddCommand extends SpoCommand {
|
|
12
21
|
get name() {
|
|
13
22
|
return commands.COMMANDSET_ADD;
|
|
@@ -15,12 +24,8 @@ class SpoCommandSetAddCommand extends SpoCommand {
|
|
|
15
24
|
get description() {
|
|
16
25
|
return 'Adds a ListView Command Set to a site.';
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoCommandSetAddCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initValidators).call(this);
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
24
29
|
}
|
|
25
30
|
async commandAction(logger, args) {
|
|
26
31
|
if (this.verbose) {
|
|
@@ -79,52 +84,5 @@ class SpoCommandSetAddCommand extends SpoCommand {
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
|
-
_a = SpoCommandSetAddCommand, _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
|
|
83
|
-
this.telemetry.push((args) => {
|
|
84
|
-
Object.assign(this.telemetryProperties, {
|
|
85
|
-
description: typeof args.options.description !== 'undefined',
|
|
86
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
87
|
-
scope: typeof args.options.scope !== 'undefined',
|
|
88
|
-
location: typeof args.options.location !== 'undefined'
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}, _SpoCommandSetAddCommand_initOptions = function _SpoCommandSetAddCommand_initOptions() {
|
|
92
|
-
this.options.unshift({
|
|
93
|
-
option: '-t, --title <title>'
|
|
94
|
-
}, {
|
|
95
|
-
option: '-u, --webUrl <webUrl>'
|
|
96
|
-
}, {
|
|
97
|
-
option: '-l, --listType <listType>', autocomplete: _a.listTypes
|
|
98
|
-
}, {
|
|
99
|
-
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
100
|
-
}, {
|
|
101
|
-
option: '--description [description]'
|
|
102
|
-
}, {
|
|
103
|
-
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
104
|
-
}, {
|
|
105
|
-
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
106
|
-
}, {
|
|
107
|
-
option: '--location [location]', autocomplete: _a.locations
|
|
108
|
-
});
|
|
109
|
-
}, _SpoCommandSetAddCommand_initValidators = function _SpoCommandSetAddCommand_initValidators() {
|
|
110
|
-
this.validators.push(async (args) => {
|
|
111
|
-
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
112
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
113
|
-
}
|
|
114
|
-
if (_a.listTypes.indexOf(args.options.listType) < 0) {
|
|
115
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
116
|
-
}
|
|
117
|
-
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
118
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
119
|
-
}
|
|
120
|
-
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
121
|
-
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
122
|
-
}
|
|
123
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
SpoCommandSetAddCommand.listTypes = ['List', 'Library', 'SitePages'];
|
|
127
|
-
SpoCommandSetAddCommand.scopes = ['Site', 'Web'];
|
|
128
|
-
SpoCommandSetAddCommand.locations = ['ContextMenu', 'CommandBar', 'Both'];
|
|
129
87
|
export default new SpoCommandSetAddCommand();
|
|
130
88
|
//# sourceMappingURL=commandset-add.js.map
|