@pnp/cli-microsoft365 12.0.0-beta.c9bd7f3 → 12.0.0-beta.d0b29c1
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/googleAnalytics.js +96 -0
- package/dist/m365/entra/commands/m365group/m365group-remove.js +2 -8
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.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-rc.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spo/commands/app/app-add.js +35 -56
- package/dist/m365/spo/commands/app/app-deploy.js +41 -59
- package/dist/m365/spo/commands/app/app-get.js +40 -56
- package/dist/m365/spo/commands/app/app-install.js +20 -41
- package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
- package/dist/m365/spo/commands/app/app-list.js +26 -44
- package/dist/m365/spo/commands/app/app-remove.js +32 -52
- package/dist/m365/spo/commands/app/app-retract.js +32 -51
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
- package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
- package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
- package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
- package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
- package/dist/m365/spo/commands/feature/feature-list.js +11 -36
- package/dist/m365/spo/commands/field/field-add.js +33 -62
- package/dist/m365/spo/commands/field/field-get.js +30 -57
- package/dist/m365/spo/commands/field/field-list.js +21 -46
- package/dist/m365/spo/commands/field/field-remove.js +32 -63
- package/dist/m365/spo/commands/field/field-set.js +34 -66
- package/dist/m365/spo/commands/file/file-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-get.js +1 -12
- 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-list.js +6 -4
- 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/site/site-remove.js +3 -9
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
- package/dist/m365/spo/commands/web/web-rule-list.js +113 -0
- package/dist/m365/spo/commands/web/web-rule-remove.js +54 -0
- package/dist/m365/spo/commands.js +6 -1
- 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/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/docs/docs/cmd/entra/m365group/m365group-remove.mdx +0 -3
- 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-list.mdx +37 -27
- 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/spo/site/site-remove.mdx +0 -3
- package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
- package/docs/docs/cmd/spo/web/web-rule-list.mdx +189 -0
- package/docs/docs/cmd/spo/web/web-rule-remove.mdx +65 -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/tenant/people/people-profilecardproperty-add.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
- package/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 +702 -3230
- package/package.json +20 -38
- package/dist/appInsights.js +0 -43
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import { cli } from '../../../../cli/cli.js';
|
|
7
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
})
|
|
16
|
+
.alias('u'),
|
|
17
|
+
url: z.string().optional(),
|
|
18
|
+
id: z.uuid().optional().alias('i'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
21
|
+
class SpoFolderUnarchiveCommand extends SpoCommand {
|
|
22
|
+
get name() {
|
|
23
|
+
return commands.FOLDER_UNARCHIVE;
|
|
24
|
+
}
|
|
25
|
+
get description() {
|
|
26
|
+
return 'Unarchives a folder';
|
|
27
|
+
}
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(options => [options.url, options.id].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: `Specify 'url' or 'id', but not both.`
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getExcludedOptionsWithUrls() {
|
|
38
|
+
return ['url'];
|
|
39
|
+
}
|
|
40
|
+
async commandAction(logger, args) {
|
|
41
|
+
const { webUrl, url, id, force } = args.options;
|
|
42
|
+
const identifier = url || id;
|
|
43
|
+
if (!force) {
|
|
44
|
+
const result = await cli.promptForConfirmation({ message: `Reactivation could take up to 24 hours. Folders that are reactivated cannot be archived again for a period of time. Are you sure you would like to unarchive this folder?` });
|
|
45
|
+
if (!result) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
if (this.verbose) {
|
|
51
|
+
await logger.logToStderr(`Unarchiving folder ${identifier} at site ${webUrl}...`);
|
|
52
|
+
}
|
|
53
|
+
let requestUrl = `${webUrl}/_api/web`;
|
|
54
|
+
if (id) {
|
|
55
|
+
requestUrl += `/GetFolderById('${formatting.encodeQueryParameter(id)}')`;
|
|
56
|
+
}
|
|
57
|
+
else if (url) {
|
|
58
|
+
const serverRelativePath = urlUtil.getServerRelativePath(webUrl, url);
|
|
59
|
+
requestUrl += `/GetFolderByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
|
|
60
|
+
}
|
|
61
|
+
requestUrl += '?$select=Exists,ListItemAllFields/Id,ListItemAllFields/ParentList/Id&$expand=ListItemAllFields,ListItemAllFields/ParentList';
|
|
62
|
+
const folderInfo = await request.get({
|
|
63
|
+
url: requestUrl,
|
|
64
|
+
headers: {
|
|
65
|
+
accept: 'application/json;odata=nometadata'
|
|
66
|
+
},
|
|
67
|
+
responseType: 'json'
|
|
68
|
+
});
|
|
69
|
+
if (!folderInfo.Exists) {
|
|
70
|
+
throw `The folder '${identifier}' does not exist.`;
|
|
71
|
+
}
|
|
72
|
+
if (!folderInfo.ListItemAllFields?.ParentList) {
|
|
73
|
+
throw `The folder '${identifier}' is the root folder of a document library and cannot be unarchived. Unarchive a subfolder instead.`;
|
|
74
|
+
}
|
|
75
|
+
const requestOptions = {
|
|
76
|
+
url: `${webUrl}/_api/Lists(guid'${folderInfo.ListItemAllFields.ParentList.Id}')/items(${folderInfo.ListItemAllFields.Id})/UnArchive`,
|
|
77
|
+
headers: {
|
|
78
|
+
accept: 'application/json;odata=nometadata'
|
|
79
|
+
},
|
|
80
|
+
responseType: 'json'
|
|
81
|
+
};
|
|
82
|
+
await request.post(requestOptions);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
this.handleRejectedODataJsonPromise(err);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export default new SpoFolderUnarchiveCommand();
|
|
90
|
+
//# sourceMappingURL=folder-unarchive.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 _SpoHubSiteConnectCommand_instances, _SpoHubSiteConnectCommand_initTelemetry, _SpoHubSiteConnectCommand_initOptions, _SpoHubSiteConnectCommand_initOptionSets, _SpoHubSiteConnectCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -11,6 +7,23 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
11
7
|
import commands from '../../commands.js';
|
|
12
8
|
import { cli } from '../../../../cli/cli.js';
|
|
13
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
13
|
+
error: e => `'${e.input}' is not a valid GUID`
|
|
14
|
+
}).optional().alias('i'),
|
|
15
|
+
title: z.string().optional().alias('t'),
|
|
16
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
17
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
18
|
+
}).optional().alias('u'),
|
|
19
|
+
parentId: z.string().refine(id => validation.isValidGuid(id), {
|
|
20
|
+
error: e => `'${e.input}' is not a valid GUID`
|
|
21
|
+
}).optional(),
|
|
22
|
+
parentTitle: z.string().optional(),
|
|
23
|
+
parentUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
24
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
25
|
+
}).optional()
|
|
26
|
+
});
|
|
14
27
|
class SpoHubSiteConnectCommand extends SpoCommand {
|
|
15
28
|
get name() {
|
|
16
29
|
return commands.HUBSITE_CONNECT;
|
|
@@ -18,13 +31,25 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
18
31
|
get description() {
|
|
19
32
|
return 'Connects a hub site to a parent hub site';
|
|
20
33
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
getRefinedSchema(schema) {
|
|
38
|
+
return schema
|
|
39
|
+
.refine(opts => [opts.id, opts.title, opts.url].filter(x => x !== undefined).length === 1, {
|
|
40
|
+
error: `Specify either 'id', 'title', or 'url', but not multiple.`,
|
|
41
|
+
params: {
|
|
42
|
+
customCode: 'optionSet',
|
|
43
|
+
options: ['id', 'title', 'url']
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.refine(opts => [opts.parentId, opts.parentTitle, opts.parentUrl].filter(x => x !== undefined).length === 1, {
|
|
47
|
+
error: `Specify either 'parentId', 'parentTitle', or 'parentUrl', but not multiple.`,
|
|
48
|
+
params: {
|
|
49
|
+
customCode: 'optionSet',
|
|
50
|
+
options: ['parentId', 'parentTitle', 'parentUrl']
|
|
51
|
+
}
|
|
52
|
+
});
|
|
28
53
|
}
|
|
29
54
|
async commandAction(logger, args) {
|
|
30
55
|
if (this.verbose) {
|
|
@@ -84,55 +109,5 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
84
109
|
return filteredHubSites[0];
|
|
85
110
|
}
|
|
86
111
|
}
|
|
87
|
-
_SpoHubSiteConnectCommand_instances = new WeakSet(), _SpoHubSiteConnectCommand_initTelemetry = function _SpoHubSiteConnectCommand_initTelemetry() {
|
|
88
|
-
this.telemetry.push((args) => {
|
|
89
|
-
Object.assign(this.telemetryProperties, {
|
|
90
|
-
id: typeof args.options.id !== 'undefined',
|
|
91
|
-
title: typeof args.options.title !== 'undefined',
|
|
92
|
-
url: typeof args.options.url !== 'undefined',
|
|
93
|
-
parentId: typeof args.options.parentId !== 'undefined',
|
|
94
|
-
parentTitle: typeof args.options.parentTitle !== 'undefined',
|
|
95
|
-
parentUrl: typeof args.options.parentUrl !== 'undefined'
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}, _SpoHubSiteConnectCommand_initOptions = function _SpoHubSiteConnectCommand_initOptions() {
|
|
99
|
-
this.options.unshift({
|
|
100
|
-
option: '-i, --id [id]'
|
|
101
|
-
}, {
|
|
102
|
-
option: '-t, --title [title]'
|
|
103
|
-
}, {
|
|
104
|
-
option: '-u, --url [url]'
|
|
105
|
-
}, {
|
|
106
|
-
option: '--parentId [parentId]'
|
|
107
|
-
}, {
|
|
108
|
-
option: '--parentTitle [parentTitle]'
|
|
109
|
-
}, {
|
|
110
|
-
option: '--parentUrl [parentUrl]'
|
|
111
|
-
});
|
|
112
|
-
}, _SpoHubSiteConnectCommand_initOptionSets = function _SpoHubSiteConnectCommand_initOptionSets() {
|
|
113
|
-
this.optionSets.push({ options: ['id', 'title', 'url'] }, { options: ['parentId', 'parentTitle', 'parentUrl'] });
|
|
114
|
-
}, _SpoHubSiteConnectCommand_initValidators = function _SpoHubSiteConnectCommand_initValidators() {
|
|
115
|
-
this.validators.push(async (args) => {
|
|
116
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
117
|
-
return `'${args.options.id}' is not a valid GUID`;
|
|
118
|
-
}
|
|
119
|
-
if (args.options.parentId && !validation.isValidGuid(args.options.parentId)) {
|
|
120
|
-
return `'${args.options.parentId}' is not a valid GUID`;
|
|
121
|
-
}
|
|
122
|
-
if (args.options.url) {
|
|
123
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
124
|
-
if (isValidSharePointUrl !== true) {
|
|
125
|
-
return isValidSharePointUrl;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (args.options.parentUrl) {
|
|
129
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.parentUrl);
|
|
130
|
-
if (isValidSharePointUrl !== true) {
|
|
131
|
-
return isValidSharePointUrl;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return true;
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
112
|
export default new SpoHubSiteConnectCommand();
|
|
138
113
|
//# sourceMappingURL=hubsite-connect.js.map
|
|
@@ -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 _SpoHubSiteDataGetCommand_instances, _SpoHubSiteDataGetCommand_initTelemetry, _SpoHubSiteDataGetCommand_initOptions, _SpoHubSiteDataGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
10
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
11
|
+
}).alias('u'),
|
|
12
|
+
forceRefresh: z.boolean().optional()
|
|
13
|
+
});
|
|
11
14
|
class SpoHubSiteDataGetCommand extends SpoCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.HUBSITE_DATA_GET;
|
|
@@ -15,12 +18,8 @@ class SpoHubSiteDataGetCommand extends SpoCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Gets hub site data for the specified site';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoHubSiteDataGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoHubSiteDataGetCommand_instances, "m", _SpoHubSiteDataGetCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoHubSiteDataGetCommand_instances, "m", _SpoHubSiteDataGetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoHubSiteDataGetCommand_instances, "m", _SpoHubSiteDataGetCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
24
23
|
}
|
|
25
24
|
async commandAction(logger, args) {
|
|
26
25
|
if (this.verbose) {
|
|
@@ -50,20 +49,5 @@ class SpoHubSiteDataGetCommand extends SpoCommand {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
_SpoHubSiteDataGetCommand_instances = new WeakSet(), _SpoHubSiteDataGetCommand_initTelemetry = function _SpoHubSiteDataGetCommand_initTelemetry() {
|
|
54
|
-
this.telemetry.push((args) => {
|
|
55
|
-
Object.assign(this.telemetryProperties, {
|
|
56
|
-
forceRefresh: args.options.forceRefresh === true
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _SpoHubSiteDataGetCommand_initOptions = function _SpoHubSiteDataGetCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-u, --webUrl <webUrl>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '--forceRefresh'
|
|
64
|
-
});
|
|
65
|
-
}, _SpoHubSiteDataGetCommand_initValidators = function _SpoHubSiteDataGetCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
67
|
-
};
|
|
68
52
|
export default new SpoHubSiteDataGetCommand();
|
|
69
53
|
//# sourceMappingURL=hubsite-data-get.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 _SpoHubSiteDisconnectCommand_instances, _SpoHubSiteDisconnectCommand_initTelemetry, _SpoHubSiteDisconnectCommand_initOptions, _SpoHubSiteDisconnectCommand_initOptionSets, _SpoHubSiteDisconnectCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { spo } from '../../../../utils/spo.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
13
|
+
error: e => `'${e.input}' is not a valid GUID`
|
|
14
|
+
}).optional().alias('i'),
|
|
15
|
+
title: z.string().optional().alias('t'),
|
|
16
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
17
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
18
|
+
}).optional().alias('u'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
14
21
|
class SpoHubSiteDisconnectCommand extends SpoCommand {
|
|
15
22
|
get name() {
|
|
16
23
|
return commands.HUBSITE_DISCONNECT;
|
|
@@ -18,13 +25,18 @@ class SpoHubSiteDisconnectCommand extends SpoCommand {
|
|
|
18
25
|
get description() {
|
|
19
26
|
return 'Disconnects a hub site from its parent hub site';
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(opts => [opts.id, opts.title, opts.url].filter(x => x !== undefined).length === 1, {
|
|
34
|
+
error: `Specify either 'id', 'title', or 'url', but not multiple.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['id', 'title', 'url']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
28
40
|
}
|
|
29
41
|
async commandAction(logger, args) {
|
|
30
42
|
const disconnectHubSite = async () => {
|
|
@@ -94,39 +106,5 @@ class SpoHubSiteDisconnectCommand extends SpoCommand {
|
|
|
94
106
|
return filteredHubSites[0];
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
|
-
_SpoHubSiteDisconnectCommand_instances = new WeakSet(), _SpoHubSiteDisconnectCommand_initTelemetry = function _SpoHubSiteDisconnectCommand_initTelemetry() {
|
|
98
|
-
this.telemetry.push((args) => {
|
|
99
|
-
Object.assign(this.telemetryProperties, {
|
|
100
|
-
id: typeof args.options.id !== 'undefined',
|
|
101
|
-
title: typeof args.options.title !== 'undefined',
|
|
102
|
-
url: typeof args.options.url !== 'undefined'
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}, _SpoHubSiteDisconnectCommand_initOptions = function _SpoHubSiteDisconnectCommand_initOptions() {
|
|
106
|
-
this.options.unshift({
|
|
107
|
-
option: '-i, --id [id]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '-t, --title [title]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '-u, --url [url]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '-f, --force'
|
|
114
|
-
});
|
|
115
|
-
}, _SpoHubSiteDisconnectCommand_initOptionSets = function _SpoHubSiteDisconnectCommand_initOptionSets() {
|
|
116
|
-
this.optionSets.push({ options: ['id', 'title', 'url'] });
|
|
117
|
-
}, _SpoHubSiteDisconnectCommand_initValidators = function _SpoHubSiteDisconnectCommand_initValidators() {
|
|
118
|
-
this.validators.push(async (args) => {
|
|
119
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
120
|
-
return `'${args.options.id}' is not a valid GUID`;
|
|
121
|
-
}
|
|
122
|
-
if (args.options.url) {
|
|
123
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
124
|
-
if (isValidSharePointUrl !== true) {
|
|
125
|
-
return isValidSharePointUrl;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return true;
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
109
|
export default new SpoHubSiteDisconnectCommand();
|
|
132
110
|
//# sourceMappingURL=hubsite-disconnect.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 _SpoHubSiteGetCommand_instances, _SpoHubSiteGetCommand_initTelemetry, _SpoHubSiteGetCommand_initOptions, _SpoHubSiteGetCommand_initValidators, _SpoHubSiteGetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -12,6 +8,17 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
14
10
|
import spoListItemListCommand from '../listitem/listitem-list.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
14
|
+
error: e => `${e.input} is not a valid GUID`
|
|
15
|
+
}).optional().alias('i'),
|
|
16
|
+
title: z.string().optional().alias('t'),
|
|
17
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
18
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
19
|
+
}).optional().alias('u'),
|
|
20
|
+
withAssociatedSites: z.boolean().optional()
|
|
21
|
+
});
|
|
15
22
|
class SpoHubSiteGetCommand extends SpoCommand {
|
|
16
23
|
get name() {
|
|
17
24
|
return commands.HUBSITE_GET;
|
|
@@ -19,13 +26,18 @@ class SpoHubSiteGetCommand extends SpoCommand {
|
|
|
19
26
|
get description() {
|
|
20
27
|
return 'Gets information about the specified hub site';
|
|
21
28
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(opts => [opts.id, opts.title, opts.url].filter(x => x !== undefined).length === 1, {
|
|
35
|
+
error: `Specify either 'id', 'title', or 'url', but not multiple.`,
|
|
36
|
+
params: {
|
|
37
|
+
customCode: 'optionSet',
|
|
38
|
+
options: ['id', 'title', 'url']
|
|
39
|
+
}
|
|
40
|
+
});
|
|
29
41
|
}
|
|
30
42
|
async commandAction(logger, args) {
|
|
31
43
|
try {
|
|
@@ -94,29 +106,5 @@ class SpoHubSiteGetCommand extends SpoCommand {
|
|
|
94
106
|
return hubSites[0];
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
|
-
_SpoHubSiteGetCommand_instances = new WeakSet(), _SpoHubSiteGetCommand_initTelemetry = function _SpoHubSiteGetCommand_initTelemetry() {
|
|
98
|
-
this.telemetry.push((args) => {
|
|
99
|
-
Object.assign(this.telemetryProperties, {
|
|
100
|
-
id: typeof args.options.id !== 'undefined',
|
|
101
|
-
title: typeof args.options.title !== 'undefined',
|
|
102
|
-
url: typeof args.options.url !== 'undefined',
|
|
103
|
-
withAssociatedSites: args.options.withAssociatedSites === true
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}, _SpoHubSiteGetCommand_initOptions = function _SpoHubSiteGetCommand_initOptions() {
|
|
107
|
-
this.options.unshift({ option: '-i, --id [id]' }, { option: '-t, --title [title]' }, { option: '-u, --url [url]' }, { option: '--withAssociatedSites' });
|
|
108
|
-
}, _SpoHubSiteGetCommand_initValidators = function _SpoHubSiteGetCommand_initValidators() {
|
|
109
|
-
this.validators.push(async (args) => {
|
|
110
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
111
|
-
return `${args.options.id} is not a valid GUID`;
|
|
112
|
-
}
|
|
113
|
-
if (args.options.url) {
|
|
114
|
-
return validation.isValidSharePointUrl(args.options.url);
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
});
|
|
118
|
-
}, _SpoHubSiteGetCommand_initOptionSets = function _SpoHubSiteGetCommand_initOptionSets() {
|
|
119
|
-
this.optionSets.push({ options: ['id', 'title', 'url'] });
|
|
120
|
-
};
|
|
121
109
|
export default new SpoHubSiteGetCommand();
|
|
122
110
|
//# sourceMappingURL=hubsite-get.js.map
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoHubSiteListCommand_instances, _SpoHubSiteListCommand_initTelemetry, _SpoHubSiteListCommand_initOptions;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
withAssociatedSites: z.boolean().optional()
|
|
11
|
+
});
|
|
12
12
|
class SpoHubSiteListCommand extends SpoCommand {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.batchSize = 30;
|
|
16
|
+
}
|
|
13
17
|
get name() {
|
|
14
18
|
return commands.HUBSITE_LIST;
|
|
15
19
|
}
|
|
@@ -19,13 +23,8 @@ class SpoHubSiteListCommand extends SpoCommand {
|
|
|
19
23
|
defaultProperties() {
|
|
20
24
|
return ['ID', 'SiteUrl', 'Title'];
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_SpoHubSiteListCommand_instances.add(this);
|
|
25
|
-
this.batchSize = 30;
|
|
26
|
-
this.batchSize = 30;
|
|
27
|
-
__classPrivateFieldGet(this, _SpoHubSiteListCommand_instances, "m", _SpoHubSiteListCommand_initTelemetry).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpoHubSiteListCommand_instances, "m", _SpoHubSiteListCommand_initOptions).call(this);
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
29
28
|
}
|
|
30
29
|
async commandAction(logger, args) {
|
|
31
30
|
try {
|
|
@@ -101,16 +100,5 @@ class SpoHubSiteListCommand extends SpoCommand {
|
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
_SpoHubSiteListCommand_instances = new WeakSet(), _SpoHubSiteListCommand_initTelemetry = function _SpoHubSiteListCommand_initTelemetry() {
|
|
105
|
-
this.telemetry.push((args) => {
|
|
106
|
-
Object.assign(this.telemetryProperties, {
|
|
107
|
-
withAssociatedSites: args.options.withAssociatedSites === true
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}, _SpoHubSiteListCommand_initOptions = function _SpoHubSiteListCommand_initOptions() {
|
|
111
|
-
this.options.unshift({
|
|
112
|
-
option: '--withAssociatedSites'
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
103
|
export default new SpoHubSiteListCommand();
|
|
116
104
|
//# sourceMappingURL=hubsite-list.js.map
|
|
@@ -1,14 +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 _SpoHubSiteRegisterCommand_instances, _SpoHubSiteRegisterCommand_initOptions, _SpoHubSiteRegisterCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
siteUrl: 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
|
+
});
|
|
12
14
|
class SpoHubSiteRegisterCommand extends SpoCommand {
|
|
13
15
|
get name() {
|
|
14
16
|
return commands.HUBSITE_REGISTER;
|
|
@@ -16,11 +18,8 @@ class SpoHubSiteRegisterCommand extends SpoCommand {
|
|
|
16
18
|
get description() {
|
|
17
19
|
return 'Registers the specified site collection as a hub site';
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoHubSiteRegisterCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoHubSiteRegisterCommand_instances, "m", _SpoHubSiteRegisterCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoHubSiteRegisterCommand_instances, "m", _SpoHubSiteRegisterCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
24
23
|
}
|
|
25
24
|
async commandAction(logger, args) {
|
|
26
25
|
try {
|
|
@@ -41,12 +40,5 @@ class SpoHubSiteRegisterCommand extends SpoCommand {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
_SpoHubSiteRegisterCommand_instances = new WeakSet(), _SpoHubSiteRegisterCommand_initOptions = function _SpoHubSiteRegisterCommand_initOptions() {
|
|
45
|
-
this.options.unshift({
|
|
46
|
-
option: '-u, --siteUrl <siteUrl>'
|
|
47
|
-
});
|
|
48
|
-
}, _SpoHubSiteRegisterCommand_initValidators = function _SpoHubSiteRegisterCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
50
|
-
};
|
|
51
43
|
export default new SpoHubSiteRegisterCommand();
|
|
52
44
|
//# sourceMappingURL=hubsite-register.js.map
|
|
@@ -1,16 +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 _SpoHubSiteRightsGrantCommand_instances, _SpoHubSiteRightsGrantCommand_initOptions, _SpoHubSiteRightsGrantCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import config from '../../../../config.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 { spo } from '../../../../utils/spo.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
hubSiteUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
principals: z.string().alias('p'),
|
|
16
|
+
rights: z.enum(['Join'], {
|
|
17
|
+
error: e => `${e.input} is not a valid rights value. Allowed values Join`
|
|
18
|
+
}).alias('r')
|
|
19
|
+
});
|
|
14
20
|
class SpoHubSiteRightsGrantCommand extends SpoCommand {
|
|
15
21
|
get name() {
|
|
16
22
|
return commands.HUBSITE_RIGHTS_GRANT;
|
|
@@ -18,11 +24,8 @@ class SpoHubSiteRightsGrantCommand extends SpoCommand {
|
|
|
18
24
|
get description() {
|
|
19
25
|
return 'Grants permissions to join the hub site for one or more principals';
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoHubSiteRightsGrantCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoHubSiteRightsGrantCommand_instances, "m", _SpoHubSiteRightsGrantCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoHubSiteRightsGrantCommand_instances, "m", _SpoHubSiteRightsGrantCommand_initValidators).call(this);
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
26
29
|
}
|
|
27
30
|
async commandAction(logger, args) {
|
|
28
31
|
try {
|
|
@@ -55,26 +58,5 @@ class SpoHubSiteRightsGrantCommand extends SpoCommand {
|
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
_SpoHubSiteRightsGrantCommand_instances = new WeakSet(), _SpoHubSiteRightsGrantCommand_initOptions = function _SpoHubSiteRightsGrantCommand_initOptions() {
|
|
59
|
-
this.options.unshift({
|
|
60
|
-
option: '-u, --hubSiteUrl <hubSiteUrl>'
|
|
61
|
-
}, {
|
|
62
|
-
option: '-p, --principals <principals>'
|
|
63
|
-
}, {
|
|
64
|
-
option: '-r, --rights <rights>',
|
|
65
|
-
autocomplete: ['Join']
|
|
66
|
-
});
|
|
67
|
-
}, _SpoHubSiteRightsGrantCommand_initValidators = function _SpoHubSiteRightsGrantCommand_initValidators() {
|
|
68
|
-
this.validators.push(async (args) => {
|
|
69
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.hubSiteUrl);
|
|
70
|
-
if (isValidSharePointUrl !== true) {
|
|
71
|
-
return isValidSharePointUrl;
|
|
72
|
-
}
|
|
73
|
-
if (args.options.rights !== 'Join') {
|
|
74
|
-
return `${args.options.rights} is not a valid rights value. Allowed values Join`;
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
61
|
export default new SpoHubSiteRightsGrantCommand();
|
|
80
62
|
//# sourceMappingURL=hubsite-rights-grant.js.map
|