@pnp/cli-microsoft365 11.12.0-beta.8589b73 → 12.0.0-beta.8dff3ac
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 +2 -6
- package/dist/auth/FileTokenStorage.js +0 -3
- package/dist/auth/msalCachePlugin.js +201 -12
- package/dist/m365/commands/logout.js +2 -4
- package/dist/m365/entra/commands/m365group/m365group-remove.js +4 -3
- package/dist/m365/spe/commands/container/container-remove.js +6 -7
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +7 -15
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +30 -2
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +12 -2
- package/dist/m365/spo/commands/cdn/cdn-get.js +8 -35
- package/dist/m365/spo/commands/cdn/cdn-origin-add.js +9 -36
- package/dist/m365/spo/commands/cdn/cdn-origin-list.js +8 -34
- package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +10 -39
- package/dist/m365/spo/commands/cdn/cdn-policy-list.js +8 -34
- package/dist/m365/spo/commands/cdn/cdn-policy-set.js +10 -45
- package/dist/m365/spo/commands/cdn/cdn-set.js +10 -46
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +12 -24
- package/dist/m365/spo/commands/file/file-add.js +2 -6
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-remove.js +5 -5
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
- package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
- package/dist/m365/spo/commands/list/list-remove.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
- package/dist/m365/spo/commands/listitem/listitem-get.js +15 -7
- package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
- package/dist/m365/spo/commands/page/page-header-set.js +123 -64
- package/dist/m365/spo/commands/page/page-remove.js +7 -7
- package/dist/m365/spo/commands/site/site-list.js +60 -49
- package/dist/m365/spo/commands/site/site-remove.js +7 -7
- package/dist/m365/spo/commands/spo-get.js +5 -0
- package/dist/m365/spo/commands/spo-set.js +10 -21
- package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
- package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
- package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/user/user-ensure.js +24 -60
- package/dist/m365/spo/commands/user/user-get.js +25 -65
- package/dist/m365/spo/commands/user/user-list.js +10 -18
- package/dist/m365/spo/commands/user/user-remove.js +26 -68
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
- package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
- package/dist/m365/spo/commands/web/web-add.js +20 -55
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
- package/dist/m365/spo/commands/web/web-get.js +12 -30
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
- package/dist/m365/spo/commands/web/web-list.js +10 -18
- package/dist/m365/spo/commands/web/web-reindex.js +10 -18
- package/dist/m365/spo/commands/web/web-remove.js +11 -27
- package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
- package/dist/m365/spo/commands/web/web-rule-list.js +6 -4
- package/dist/m365/spo/commands/web/web-rule-remove.js +0 -3
- package/dist/m365/spo/commands/web/web-set.js +26 -96
- package/dist/m365/spo/commands.js +0 -2
- package/dist/m365/teams/commands/channel/channel-list.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-add.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-list.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-remove.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-set.js +2 -6
- package/dist/m365/teams/commands/channel/channel-remove.js +2 -8
- package/dist/m365/teams/commands/channel/channel-set.js +2 -8
- package/dist/m365/teams/commands/tab/tab-get.js +2 -6
- package/dist/m365/teams/commands/team/team-archive.js +2 -6
- package/dist/m365/teams/commands/team/team-remove.js +2 -6
- package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +4 -4
- package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
- package/docs/docs/cmd/spo/contenttype/contenttype-sync.mdx +4 -4
- package/docs/docs/cmd/spo/file/file-add.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-archive.mdx +8 -0
- package/docs/docs/cmd/spo/file/file-checkin.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-checkout.mdx +21 -0
- package/docs/docs/cmd/spo/file/file-copy.mdx +19 -0
- package/docs/docs/cmd/spo/file/file-get.mdx +19 -0
- package/docs/docs/cmd/spo/file/file-list.mdx +19 -0
- package/docs/docs/cmd/spo/file/file-move.mdx +19 -0
- package/docs/docs/cmd/spo/file/file-remove.mdx +25 -4
- package/docs/docs/cmd/spo/file/file-rename.mdx +19 -0
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +8 -0
- package/docs/docs/cmd/spo/folder/folder-archive.mdx +6 -0
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-add.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-contenttype-add.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-contenttype-default-set.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-contenttype-list.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-clear.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-list.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-set.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-get.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-list.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-remove.mdx +25 -4
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-retentionlabel-get.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-retentionlabel-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-roleassignment-add.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-sensitivitylabel-ensure.mdx +23 -0
- package/docs/docs/cmd/spo/list/list-set.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-sitescript-get.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-view-add.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-view-field-add.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-view-field-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-view-field-set.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-view-get.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-view-list.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-view-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-view-set.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-add.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-get.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-list.mdx +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-remove.mdx +21 -0
- package/docs/docs/cmd/spo/list/list-webhook-set.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-add.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-get.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-remove.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-set.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
- package/docs/docs/cmd/spo/listitem/listitem-get.mdx +13 -7
- package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
- package/docs/docs/cmd/spo/page/page-header-set.mdx +9 -9
- package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
- package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
- package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
- package/docs/docs/cmd/spo/site/site-remove.mdx +3 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
- package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
- package/docs/docs/cmd/spo/web/web-rule-list.mdx +8 -12
- package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -6
- package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
- package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
- package/docs/docs/cmd/tenant/id/id-get.mdx +15 -0
- package/docs/docs/cmd/tenant/info/info-get.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-pronouns-get.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-pronouns-set.mdx +19 -0
- package/docs/docs/cmd/tenant/report/report-settings-get.mdx +19 -0
- package/docs/docs/cmd/tenant/report/report-settings-set.mdx +21 -0
- package/docs/docs/cmd/tenant/security/security-alerts-list.mdx +19 -0
- package/npm-shrinkwrap.json +1541 -1163
- package/package.json +22 -17
|
@@ -1,14 +1,14 @@
|
|
|
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 _SpoCdnOriginListCommand_instances, _SpoCdnOriginListCommand_initTelemetry, _SpoCdnOriginListCommand_initOptions, _SpoCdnOriginListCommand_initValidators;
|
|
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 { 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
|
+
type: z.enum(['Public', 'Private']).optional().alias('t')
|
|
11
|
+
});
|
|
12
12
|
class SpoCdnOriginListCommand extends SpoCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.CDN_ORIGIN_LIST;
|
|
@@ -16,12 +16,8 @@ class SpoCdnOriginListCommand extends SpoCommand {
|
|
|
16
16
|
get description() {
|
|
17
17
|
return 'Lists CDN origins settings for the current SharePoint Online tenant';
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoCdnOriginListCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoCdnOriginListCommand_instances, "m", _SpoCdnOriginListCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoCdnOriginListCommand_instances, "m", _SpoCdnOriginListCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoCdnOriginListCommand_instances, "m", _SpoCdnOriginListCommand_initValidators).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
25
21
|
}
|
|
26
22
|
async commandAction(logger, args) {
|
|
27
23
|
const cdnTypeString = args.options.type || 'Public';
|
|
@@ -56,27 +52,5 @@ class SpoCdnOriginListCommand extends SpoCommand {
|
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
|
-
_SpoCdnOriginListCommand_instances = new WeakSet(), _SpoCdnOriginListCommand_initTelemetry = function _SpoCdnOriginListCommand_initTelemetry() {
|
|
60
|
-
this.telemetry.push((args) => {
|
|
61
|
-
Object.assign(this.telemetryProperties, {
|
|
62
|
-
cdnType: args.options.type || 'Public'
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}, _SpoCdnOriginListCommand_initOptions = function _SpoCdnOriginListCommand_initOptions() {
|
|
66
|
-
this.options.unshift({
|
|
67
|
-
option: '-t, --type [type]',
|
|
68
|
-
autocomplete: ['Public', 'Private']
|
|
69
|
-
});
|
|
70
|
-
}, _SpoCdnOriginListCommand_initValidators = function _SpoCdnOriginListCommand_initValidators() {
|
|
71
|
-
this.validators.push(async (args) => {
|
|
72
|
-
if (args.options.type) {
|
|
73
|
-
if (args.options.type !== 'Public' &&
|
|
74
|
-
args.options.type !== 'Private') {
|
|
75
|
-
return `${args.options.type} is not a valid CDN type. Allowed values are Public|Private`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
55
|
export default new SpoCdnOriginListCommand();
|
|
82
56
|
//# sourceMappingURL=cdn-origin-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 _SpoCdnOriginRemoveCommand_instances, _SpoCdnOriginRemoveCommand_initTelemetry, _SpoCdnOriginRemoveCommand_initOptions, _SpoCdnOriginRemoveCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { cli } from '../../../../cli/cli.js';
|
|
8
4
|
import config from '../../../../config.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
@@ -11,6 +7,12 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
11
7
|
import { spo } from '../../../../utils/spo.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
|
+
type: z.enum(['Public', 'Private']).optional().alias('t'),
|
|
13
|
+
origin: z.string().alias('r'),
|
|
14
|
+
force: z.boolean().optional().alias('f')
|
|
15
|
+
});
|
|
14
16
|
class SpoCdnOriginRemoveCommand extends SpoCommand {
|
|
15
17
|
get name() {
|
|
16
18
|
return commands.CDN_ORIGIN_REMOVE;
|
|
@@ -18,12 +20,8 @@ class SpoCdnOriginRemoveCommand extends SpoCommand {
|
|
|
18
20
|
get description() {
|
|
19
21
|
return 'Removes CDN origin for the current SharePoint Online tenant';
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoCdnOriginRemoveCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoCdnOriginRemoveCommand_instances, "m", _SpoCdnOriginRemoveCommand_initTelemetry).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoCdnOriginRemoveCommand_instances, "m", _SpoCdnOriginRemoveCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoCdnOriginRemoveCommand_instances, "m", _SpoCdnOriginRemoveCommand_initValidators).call(this);
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
27
25
|
}
|
|
28
26
|
async commandAction(logger, args) {
|
|
29
27
|
const cdnTypeString = args.options.type || 'Public';
|
|
@@ -68,32 +66,5 @@ class SpoCdnOriginRemoveCommand extends SpoCommand {
|
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
|
-
_SpoCdnOriginRemoveCommand_instances = new WeakSet(), _SpoCdnOriginRemoveCommand_initTelemetry = function _SpoCdnOriginRemoveCommand_initTelemetry() {
|
|
72
|
-
this.telemetry.push((args) => {
|
|
73
|
-
Object.assign(this.telemetryProperties, {
|
|
74
|
-
cdnType: args.options.type || 'Public',
|
|
75
|
-
force: (!(!args.options.force)).toString()
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}, _SpoCdnOriginRemoveCommand_initOptions = function _SpoCdnOriginRemoveCommand_initOptions() {
|
|
79
|
-
this.options.unshift({
|
|
80
|
-
option: '-t, --type [type]',
|
|
81
|
-
autocomplete: ['Public', 'Private']
|
|
82
|
-
}, {
|
|
83
|
-
option: '-r, --origin <origin>'
|
|
84
|
-
}, {
|
|
85
|
-
option: '-f, --force'
|
|
86
|
-
});
|
|
87
|
-
}, _SpoCdnOriginRemoveCommand_initValidators = function _SpoCdnOriginRemoveCommand_initValidators() {
|
|
88
|
-
this.validators.push(async (args) => {
|
|
89
|
-
if (args.options.type) {
|
|
90
|
-
if (args.options.type !== 'Public' &&
|
|
91
|
-
args.options.type !== 'Private') {
|
|
92
|
-
return `${args.options.type} is not a valid CDN type. Allowed values are Public|Private`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
69
|
export default new SpoCdnOriginRemoveCommand();
|
|
99
70
|
//# sourceMappingURL=cdn-origin-remove.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
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 _SpoCdnPolicyListCommand_instances, _SpoCdnPolicyListCommand_initTelemetry, _SpoCdnPolicyListCommand_initOptions, _SpoCdnPolicyListCommand_initValidators;
|
|
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 { 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
|
+
cdnType: z.enum(['Public', 'Private']).optional().alias('t')
|
|
11
|
+
});
|
|
12
12
|
class SpoCdnPolicyListCommand extends SpoCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.CDN_POLICY_LIST;
|
|
@@ -16,12 +16,8 @@ class SpoCdnPolicyListCommand extends SpoCommand {
|
|
|
16
16
|
get description() {
|
|
17
17
|
return 'Lists CDN policies settings for the current SharePoint Online tenant';
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoCdnPolicyListCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoCdnPolicyListCommand_instances, "m", _SpoCdnPolicyListCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoCdnPolicyListCommand_instances, "m", _SpoCdnPolicyListCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoCdnPolicyListCommand_instances, "m", _SpoCdnPolicyListCommand_initValidators).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
25
21
|
}
|
|
26
22
|
async commandAction(logger, args) {
|
|
27
23
|
const cdnTypeString = args.options.cdnType || 'Public';
|
|
@@ -65,27 +61,5 @@ class SpoCdnPolicyListCommand extends SpoCommand {
|
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
_SpoCdnPolicyListCommand_instances = new WeakSet(), _SpoCdnPolicyListCommand_initTelemetry = function _SpoCdnPolicyListCommand_initTelemetry() {
|
|
69
|
-
this.telemetry.push((args) => {
|
|
70
|
-
Object.assign(this.telemetryProperties, {
|
|
71
|
-
cdnType: args.options.cdnType || 'Public'
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}, _SpoCdnPolicyListCommand_initOptions = function _SpoCdnPolicyListCommand_initOptions() {
|
|
75
|
-
this.options.unshift({
|
|
76
|
-
option: '-t, --cdnType [cdnType]',
|
|
77
|
-
autocomplete: ['Public', 'Private']
|
|
78
|
-
});
|
|
79
|
-
}, _SpoCdnPolicyListCommand_initValidators = function _SpoCdnPolicyListCommand_initValidators() {
|
|
80
|
-
this.validators.push(async (args) => {
|
|
81
|
-
if (args.options.cdnType) {
|
|
82
|
-
if (args.options.cdnType !== 'Public' &&
|
|
83
|
-
args.options.cdnType !== 'Private') {
|
|
84
|
-
return `${args.options.cdnType} is not a valid CDN type. Allowed values are Public|Private`;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return true;
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
64
|
export default new SpoCdnPolicyListCommand();
|
|
91
65
|
//# sourceMappingURL=cdn-policy-list.js.map
|
|
@@ -1,15 +1,17 @@
|
|
|
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 _SpoCdnPolicySetCommand_instances, _SpoCdnPolicySetCommand_initTelemetry, _SpoCdnPolicySetCommand_initOptions, _SpoCdnPolicySetCommand_initValidators;
|
|
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';
|
|
10
6
|
import { spo } from '../../../../utils/spo.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
|
+
cdnType: z.enum(['Public', 'Private']).optional().alias('t'),
|
|
12
|
+
policy: z.enum(['IncludeFileExtensions', 'ExcludeRestrictedSiteClassifications']).alias('p'),
|
|
13
|
+
value: z.string().alias('v')
|
|
14
|
+
});
|
|
13
15
|
class SpoCdnPolicySetCommand extends SpoCommand {
|
|
14
16
|
get name() {
|
|
15
17
|
return commands.CDN_POLICY_SET;
|
|
@@ -17,12 +19,8 @@ class SpoCdnPolicySetCommand extends SpoCommand {
|
|
|
17
19
|
get description() {
|
|
18
20
|
return 'Sets CDN policy value for the current SharePoint Online tenant';
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_SpoCdnPolicySetCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoCdnPolicySetCommand_instances, "m", _SpoCdnPolicySetCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoCdnPolicySetCommand_instances, "m", _SpoCdnPolicySetCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoCdnPolicySetCommand_instances, "m", _SpoCdnPolicySetCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
26
24
|
}
|
|
27
25
|
async commandAction(logger, args) {
|
|
28
26
|
const cdnTypeString = args.options.cdnType || 'Public';
|
|
@@ -62,38 +60,5 @@ class SpoCdnPolicySetCommand extends SpoCommand {
|
|
|
62
60
|
}
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
|
-
_SpoCdnPolicySetCommand_instances = new WeakSet(), _SpoCdnPolicySetCommand_initTelemetry = function _SpoCdnPolicySetCommand_initTelemetry() {
|
|
66
|
-
this.telemetry.push((args) => {
|
|
67
|
-
Object.assign(this.telemetryProperties, {
|
|
68
|
-
cdnType: args.options.cdnType || 'Public',
|
|
69
|
-
policy: args.options.policy
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}, _SpoCdnPolicySetCommand_initOptions = function _SpoCdnPolicySetCommand_initOptions() {
|
|
73
|
-
this.options.unshift({
|
|
74
|
-
option: '-t, --cdnType [cdnType]',
|
|
75
|
-
autocomplete: ['Public', 'Private']
|
|
76
|
-
}, {
|
|
77
|
-
option: '-p, --policy <policy>',
|
|
78
|
-
autocomplete: ['IncludeFileExtensions', 'ExcludeRestrictedSiteClassifications']
|
|
79
|
-
}, {
|
|
80
|
-
option: '-v, --value <value>'
|
|
81
|
-
});
|
|
82
|
-
}, _SpoCdnPolicySetCommand_initValidators = function _SpoCdnPolicySetCommand_initValidators() {
|
|
83
|
-
this.validators.push(async (args) => {
|
|
84
|
-
if (args.options.cdnType) {
|
|
85
|
-
if (args.options.cdnType !== 'Public' &&
|
|
86
|
-
args.options.cdnType !== 'Private') {
|
|
87
|
-
return `${args.options.cdnType} is not a valid CDN type. Allowed values are Public|Private`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (!args.options.policy ||
|
|
91
|
-
(args.options.policy !== 'IncludeFileExtensions' &&
|
|
92
|
-
args.options.policy !== 'ExcludeRestrictedSiteClassifications')) {
|
|
93
|
-
return `${args.options.policy} is not a valid CDN policy. Allowed values are IncludeFileExtensions|ExcludeRestrictedSiteClassifications`;
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
63
|
export default new SpoCdnPolicySetCommand();
|
|
99
64
|
//# sourceMappingURL=cdn-policy-set.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 _SpoCdnSetCommand_instances, _SpoCdnSetCommand_initTelemetry, _SpoCdnSetCommand_initOptions, _SpoCdnSetCommand_initTypes, _SpoCdnSetCommand_initValidators;
|
|
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 { 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
|
+
type: z.enum(['Public', 'Private', 'Both']).optional().alias('t'),
|
|
11
|
+
enabled: z.boolean().alias('e'),
|
|
12
|
+
noDefaultOrigins: z.boolean().optional()
|
|
13
|
+
});
|
|
12
14
|
class SpoCdnSetCommand extends SpoCommand {
|
|
13
15
|
get name() {
|
|
14
16
|
return commands.CDN_SET;
|
|
@@ -16,14 +18,8 @@ class SpoCdnSetCommand extends SpoCommand {
|
|
|
16
18
|
get description() {
|
|
17
19
|
return 'Enables or disables the specified Microsoft 365 CDN';
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoCdnSetCommand_instances.add(this);
|
|
22
|
-
this.validTypes = ['Public', 'Private', 'Both'];
|
|
23
|
-
__classPrivateFieldGet(this, _SpoCdnSetCommand_instances, "m", _SpoCdnSetCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoCdnSetCommand_instances, "m", _SpoCdnSetCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoCdnSetCommand_instances, "m", _SpoCdnSetCommand_initTypes).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoCdnSetCommand_instances, "m", _SpoCdnSetCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
27
23
|
}
|
|
28
24
|
async commandAction(logger, args) {
|
|
29
25
|
const cdnTypeString = args.options.type || 'Public';
|
|
@@ -99,37 +95,5 @@ class SpoCdnSetCommand extends SpoCommand {
|
|
|
99
95
|
}
|
|
100
96
|
}
|
|
101
97
|
}
|
|
102
|
-
_SpoCdnSetCommand_instances = new WeakSet(), _SpoCdnSetCommand_initTelemetry = function _SpoCdnSetCommand_initTelemetry() {
|
|
103
|
-
this.telemetry.push((args) => {
|
|
104
|
-
Object.assign(this.telemetryProperties, {
|
|
105
|
-
cdnType: args.options.type || 'Public',
|
|
106
|
-
enabled: args.options.enabled,
|
|
107
|
-
noDefaultOrigins: !!args.options.noDefaultOrigins
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}, _SpoCdnSetCommand_initOptions = function _SpoCdnSetCommand_initOptions() {
|
|
111
|
-
this.options.unshift({
|
|
112
|
-
option: '-e, --enabled <enabled>',
|
|
113
|
-
autocomplete: ['true', 'false']
|
|
114
|
-
}, {
|
|
115
|
-
option: '-t, --type [type]',
|
|
116
|
-
autocomplete: this.validTypes
|
|
117
|
-
}, {
|
|
118
|
-
option: '--noDefaultOrigins'
|
|
119
|
-
});
|
|
120
|
-
}, _SpoCdnSetCommand_initTypes = function _SpoCdnSetCommand_initTypes() {
|
|
121
|
-
this.types.boolean.push('enabled', 'noDefaultOrigins');
|
|
122
|
-
this.types.string.push('type');
|
|
123
|
-
}, _SpoCdnSetCommand_initValidators = function _SpoCdnSetCommand_initValidators() {
|
|
124
|
-
this.validators.push(async (args) => {
|
|
125
|
-
if (args.options.type) {
|
|
126
|
-
if (args.options.type !== 'Public' && args.options.type !== 'Both' &&
|
|
127
|
-
args.options.type !== 'Private') {
|
|
128
|
-
return `${args.options.type} is not a valid CDN type. Allowed values are ${this.validTypes.join(', ')}.`;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
98
|
export default new SpoCdnSetCommand();
|
|
135
99
|
//# sourceMappingURL=cdn-set.js.map
|
|
@@ -9,7 +9,6 @@ import request from '../../../../request.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
-
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
13
12
|
import { odata } from '../../../../utils/odata.js';
|
|
14
13
|
import { spo } from '../../../../utils/spo.js';
|
|
15
14
|
class SpoContentTypeSyncCommand extends SpoCommand {
|
|
@@ -31,11 +30,16 @@ class SpoContentTypeSyncCommand extends SpoCommand {
|
|
|
31
30
|
async commandAction(logger, args) {
|
|
32
31
|
const { listId, listTitle, listUrl, webUrl } = args.options;
|
|
33
32
|
const url = new URL(webUrl);
|
|
34
|
-
const baseUrl =
|
|
33
|
+
const baseUrl = `${url.origin}/_api/v2.0/sites/`;
|
|
35
34
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const [siteId, webId] = await Promise.all([
|
|
36
|
+
spo.getSiteIdBySPApi(webUrl, logger, this.verbose),
|
|
37
|
+
spo.getWebId(webUrl, logger, this.verbose)
|
|
38
|
+
]);
|
|
39
|
+
const siteUrl = `${url.host},${siteId},${webId}`;
|
|
40
|
+
const targetListId = listId || (listTitle || listUrl ? await spo.getListId(webUrl, listTitle, listUrl, logger, this.verbose) : undefined);
|
|
41
|
+
const listPath = targetListId ? `/lists/${targetListId}` : '';
|
|
42
|
+
const contentTypeId = await this.getContentTypeId(webUrl, args.options, logger);
|
|
39
43
|
if (this.verbose) {
|
|
40
44
|
await logger.logToStderr(`Adding or syncing the content type...`);
|
|
41
45
|
}
|
|
@@ -60,34 +64,18 @@ class SpoContentTypeSyncCommand extends SpoCommand {
|
|
|
60
64
|
this.handleRejectedODataJsonPromise(err);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
async getContentTypeId(
|
|
67
|
+
async getContentTypeId(webUrl, options, logger) {
|
|
64
68
|
if (options.id) {
|
|
65
69
|
return options.id;
|
|
66
70
|
}
|
|
67
|
-
const siteId = await spo.getSiteIdByMSGraph(`${url.origin}/sites/contenttypehub`, logger, this.verbose);
|
|
68
71
|
if (this.verbose) {
|
|
69
72
|
await logger.logToStderr(`Retrieving content type Id by name...`);
|
|
70
73
|
}
|
|
71
|
-
const contentTypes = await odata.getAllItems(`${
|
|
74
|
+
const contentTypes = await odata.getAllItems(`${webUrl}/_api/web/AvailableContentTypes?$filter=Name eq '${formatting.encodeQueryParameter(options.name)}'&$select=StringId,Name`);
|
|
72
75
|
if (contentTypes.length === 0) {
|
|
73
76
|
throw `Content type with name ${options.name} not found.`;
|
|
74
77
|
}
|
|
75
|
-
return contentTypes[0].
|
|
76
|
-
}
|
|
77
|
-
async getListIdByUrl(webUrl, listUrl, logger) {
|
|
78
|
-
if (this.verbose) {
|
|
79
|
-
await logger.logToStderr(`Retrieving list id to sync the content type to...`);
|
|
80
|
-
}
|
|
81
|
-
const listServerRelativeUrl = urlUtil.getServerRelativePath(webUrl, listUrl);
|
|
82
|
-
const requestOptions = {
|
|
83
|
-
url: `${webUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')?$select=id`,
|
|
84
|
-
headers: {
|
|
85
|
-
'accept': 'application/json;odata=nometadata'
|
|
86
|
-
},
|
|
87
|
-
responseType: 'json'
|
|
88
|
-
};
|
|
89
|
-
const response = await request.get(requestOptions);
|
|
90
|
-
return response.Id;
|
|
78
|
+
return contentTypes[0].StringId;
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
_SpoContentTypeSyncCommand_instances = new WeakSet(), _SpoContentTypeSyncCommand_initTelemetry = function _SpoContentTypeSyncCommand_initTelemetry() {
|
|
@@ -45,11 +45,8 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
45
45
|
await logger.logToStderr(`file name: ${fileName}...`);
|
|
46
46
|
await logger.logToStderr(`folder path: ${folderPath}...`);
|
|
47
47
|
}
|
|
48
|
-
if (args.options.overwrite === undefined) {
|
|
49
|
-
await this.warn(logger, 'In the next major version, the --overwrite option will default to false. To avoid this warning, please set the --overwrite option explicitly to true or false.');
|
|
50
|
-
}
|
|
51
48
|
try {
|
|
52
|
-
if (args.options.overwrite
|
|
49
|
+
if (!args.options.overwrite) {
|
|
53
50
|
try {
|
|
54
51
|
const requestOptions = {
|
|
55
52
|
url: `${args.options.webUrl}/_api/Web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(folderPath + '/' + fileName)}')?$select=Exists`,
|
|
@@ -491,8 +488,7 @@ _SpoFileAddCommand_instances = new WeakSet(), _SpoFileAddCommand_initTelemetry =
|
|
|
491
488
|
}, {
|
|
492
489
|
option: '--publishComment [publishComment]'
|
|
493
490
|
}, {
|
|
494
|
-
option: '--overwrite
|
|
495
|
-
autocomplete: ['true', 'false']
|
|
491
|
+
option: '--overwrite'
|
|
496
492
|
}, {
|
|
497
493
|
option: '--fileName [fileName]'
|
|
498
494
|
});
|
|
@@ -40,7 +40,7 @@ class SpoFileArchiveCommand extends SpoCommand {
|
|
|
40
40
|
async commandAction(logger, args) {
|
|
41
41
|
const { webUrl, url, id, force, verbose } = args.options;
|
|
42
42
|
if (!force) {
|
|
43
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this
|
|
43
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this file? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
|
|
44
44
|
if (!result) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -46,7 +46,7 @@ class SpoFileRemoveCommand extends SpoCommand {
|
|
|
46
46
|
const serverRelativePath = urlUtil.getServerRelativePath(args.options.webUrl, args.options.url);
|
|
47
47
|
requestUrl = `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
|
|
48
48
|
}
|
|
49
|
-
if (args.options.
|
|
49
|
+
if (!args.options.permanent) {
|
|
50
50
|
requestUrl += `/recycle()`;
|
|
51
51
|
}
|
|
52
52
|
const requestOptions = {
|
|
@@ -73,7 +73,7 @@ class SpoFileRemoveCommand extends SpoCommand {
|
|
|
73
73
|
await removeFile();
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.
|
|
76
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.permanent ? 'permanently remove' : 'recycle'} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?` });
|
|
77
77
|
if (result) {
|
|
78
78
|
await removeFile();
|
|
79
79
|
}
|
|
@@ -85,7 +85,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
|
|
|
85
85
|
Object.assign(this.telemetryProperties, {
|
|
86
86
|
id: typeof args.options.id !== 'undefined',
|
|
87
87
|
url: typeof args.options.url !== 'undefined',
|
|
88
|
-
|
|
88
|
+
permanent: !!args.options.permanent,
|
|
89
89
|
bypassSharedLock: !!args.options.bypassSharedLock,
|
|
90
90
|
force: !!args.options.force
|
|
91
91
|
});
|
|
@@ -98,7 +98,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
|
|
|
98
98
|
}, {
|
|
99
99
|
option: '--url [url]'
|
|
100
100
|
}, {
|
|
101
|
-
option: '--
|
|
101
|
+
option: '--permanent'
|
|
102
102
|
}, {
|
|
103
103
|
option: '--bypassSharedLock'
|
|
104
104
|
}, {
|
|
@@ -120,7 +120,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
|
|
|
120
120
|
this.optionSets.push({ options: ['id', 'url'] });
|
|
121
121
|
}, _SpoFileRemoveCommand_initTypes = function _SpoFileRemoveCommand_initTypes() {
|
|
122
122
|
this.types.string.push('webUrl', 'id', 'url');
|
|
123
|
-
this.types.boolean.push('
|
|
123
|
+
this.types.boolean.push('permanent', 'bypassSharedLock', 'force');
|
|
124
124
|
};
|
|
125
125
|
export default new SpoFileRemoveCommand();
|
|
126
126
|
//# sourceMappingURL=file-remove.js.map
|
|
@@ -40,7 +40,7 @@ class SpoFileUnarchiveCommand extends SpoCommand {
|
|
|
40
40
|
async commandAction(logger, args) {
|
|
41
41
|
const { webUrl, url, id, force, verbose } = args.options;
|
|
42
42
|
if (!force) {
|
|
43
|
-
const result = await cli.promptForConfirmation({ message: `Reactivation could take up to 24 hours. Files that are reactivated cannot be archived again for
|
|
43
|
+
const result = await cli.promptForConfirmation({ message: `Reactivation could take up to 24 hours. Files that are reactivated cannot be archived again for a period of time. Are you sure you would like to unarchive this file?` });
|
|
44
44
|
if (!result) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -40,7 +40,7 @@ class SpoFolderArchiveCommand extends SpoCommand {
|
|
|
40
40
|
async commandAction(logger, args) {
|
|
41
41
|
const { webUrl, url, id, force } = args.options;
|
|
42
42
|
if (!force) {
|
|
43
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this
|
|
43
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this folder? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
|
|
44
44
|
if (!result) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -34,7 +34,7 @@ class SpoFolderRemoveCommand extends SpoCommand {
|
|
|
34
34
|
await this.removeFolder(logger, args.options);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.
|
|
37
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.permanent ? 'permanently remove' : 'recycle'} the folder ${args.options.url} located in site ${args.options.webUrl}?` });
|
|
38
38
|
if (result) {
|
|
39
39
|
await this.removeFolder(logger, args.options);
|
|
40
40
|
}
|
|
@@ -46,7 +46,7 @@ class SpoFolderRemoveCommand extends SpoCommand {
|
|
|
46
46
|
}
|
|
47
47
|
const serverRelativePath = urlUtil.getServerRelativePath(options.webUrl, options.url);
|
|
48
48
|
let requestUrl = `${options.webUrl}/_api/web/GetFolderByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
|
|
49
|
-
if (options.
|
|
49
|
+
if (!options.permanent) {
|
|
50
50
|
requestUrl += `/recycle()`;
|
|
51
51
|
}
|
|
52
52
|
const requestOptions = {
|
|
@@ -70,7 +70,7 @@ class SpoFolderRemoveCommand extends SpoCommand {
|
|
|
70
70
|
_SpoFolderRemoveCommand_instances = new WeakSet(), _SpoFolderRemoveCommand_initTelemetry = function _SpoFolderRemoveCommand_initTelemetry() {
|
|
71
71
|
this.telemetry.push((args) => {
|
|
72
72
|
Object.assign(this.telemetryProperties, {
|
|
73
|
-
|
|
73
|
+
permanent: !!args.options.permanent,
|
|
74
74
|
force: !!args.options.force
|
|
75
75
|
});
|
|
76
76
|
});
|
|
@@ -80,7 +80,7 @@ _SpoFolderRemoveCommand_instances = new WeakSet(), _SpoFolderRemoveCommand_initT
|
|
|
80
80
|
}, {
|
|
81
81
|
option: '--url <url>'
|
|
82
82
|
}, {
|
|
83
|
-
option: '--
|
|
83
|
+
option: '--permanent'
|
|
84
84
|
}, {
|
|
85
85
|
option: '-f, --force'
|
|
86
86
|
});
|
|
@@ -88,7 +88,7 @@ _SpoFolderRemoveCommand_instances = new WeakSet(), _SpoFolderRemoveCommand_initT
|
|
|
88
88
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
89
89
|
}, _SpoFolderRemoveCommand_initTypes = function _SpoFolderRemoveCommand_initTypes() {
|
|
90
90
|
this.types.string.push('webUrl', 'url');
|
|
91
|
-
this.types.boolean.push('
|
|
91
|
+
this.types.boolean.push('permanent', 'force');
|
|
92
92
|
};
|
|
93
93
|
export default new SpoFolderRemoveCommand();
|
|
94
94
|
//# sourceMappingURL=folder-remove.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import request from '../../../../request.js';
|
|
2
3
|
import { spo } from '../../../../utils/spo.js';
|
|
3
4
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
4
5
|
import commands from '../../commands.js';
|
|
6
|
+
export const options = globalOptionsZod.strict();
|
|
5
7
|
class SpoHideDefaultThemesGetCommand extends SpoCommand {
|
|
6
8
|
get name() {
|
|
7
9
|
return commands.HIDEDEFAULTTHEMES_GET;
|
|
@@ -9,6 +11,9 @@ class SpoHideDefaultThemesGetCommand extends SpoCommand {
|
|
|
9
11
|
get description() {
|
|
10
12
|
return 'Gets the current value of the HideDefaultThemes setting';
|
|
11
13
|
}
|
|
14
|
+
get schema() {
|
|
15
|
+
return options;
|
|
16
|
+
}
|
|
12
17
|
async commandAction(logger) {
|
|
13
18
|
try {
|
|
14
19
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
@@ -1,13 +1,13 @@
|
|
|
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 _SpoHideDefaultThemesSetCommand_instances, _SpoHideDefaultThemesSetCommand_initTelemetry, _SpoHideDefaultThemesSetCommand_initOptions, _SpoHideDefaultThemesSetCommand_initTypes;
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
2
|
import request from '../../../../request.js';
|
|
8
3
|
import { spo } from '../../../../utils/spo.js';
|
|
9
4
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
5
|
import commands from '../../commands.js';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
hideDefaultThemes: z.enum(['true', 'false']).transform(val => val === 'true')
|
|
10
|
+
});
|
|
11
11
|
class SpoHideDefaultThemesSetCommand extends SpoCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.HIDEDEFAULTTHEMES_SET;
|
|
@@ -15,12 +15,8 @@ class SpoHideDefaultThemesSetCommand extends SpoCommand {
|
|
|
15
15
|
get description() {
|
|
16
16
|
return 'Sets the value of the HideDefaultThemes setting';
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoHideDefaultThemesSetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoHideDefaultThemesSetCommand_instances, "m", _SpoHideDefaultThemesSetCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoHideDefaultThemesSetCommand_instances, "m", _SpoHideDefaultThemesSetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoHideDefaultThemesSetCommand_instances, "m", _SpoHideDefaultThemesSetCommand_initTypes).call(this);
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
24
20
|
}
|
|
25
21
|
async commandAction(logger, args) {
|
|
26
22
|
try {
|
|
@@ -45,19 +41,5 @@ class SpoHideDefaultThemesSetCommand extends SpoCommand {
|
|
|
45
41
|
}
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
|
-
_SpoHideDefaultThemesSetCommand_instances = new WeakSet(), _SpoHideDefaultThemesSetCommand_initTelemetry = function _SpoHideDefaultThemesSetCommand_initTelemetry() {
|
|
49
|
-
this.telemetry.push((args) => {
|
|
50
|
-
Object.assign(this.telemetryProperties, {
|
|
51
|
-
hideDefaultThemes: args.options.hideDefaultThemes
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}, _SpoHideDefaultThemesSetCommand_initOptions = function _SpoHideDefaultThemesSetCommand_initOptions() {
|
|
55
|
-
this.options.unshift({
|
|
56
|
-
option: '--hideDefaultThemes <hideDefaultThemes>',
|
|
57
|
-
autocomplete: ['true', 'false']
|
|
58
|
-
});
|
|
59
|
-
}, _SpoHideDefaultThemesSetCommand_initTypes = function _SpoHideDefaultThemesSetCommand_initTypes() {
|
|
60
|
-
this.types.boolean.push('hideDefaultThemes');
|
|
61
|
-
};
|
|
62
44
|
export default new SpoHideDefaultThemesSetCommand();
|
|
63
45
|
//# sourceMappingURL=hidedefaultthemes-set.js.map
|