@pnp/cli-microsoft365 12.0.0-beta.10c5833 → 12.0.0-beta.1752794
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/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-list.js +6 -4
- package/dist/m365/spo/commands.js +2 -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 +1 -3
- package/dist/utils/urlUtil.js +2 -2
- 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-list.mdx +37 -27
- package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
- package/npm-shrinkwrap.json +702 -3230
- package/package.json +18 -33
- package/dist/appInsights.js +0 -43
|
@@ -1,13 +1,24 @@
|
|
|
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 _SpoFeatureDisableCommand_instances, _SpoFeatureDisableCommand_initTelemetry, _SpoFeatureDisableCommand_initOptions, _SpoFeatureDisableCommand_initValidators, _SpoFeatureDisableCommand_initTypes;
|
|
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';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import SpoCommand from "../../../base/SpoCommand.js";
|
|
10
7
|
import commands from "../../commands.js";
|
|
8
|
+
var FeatureScope;
|
|
9
|
+
(function (FeatureScope) {
|
|
10
|
+
FeatureScope["Site"] = "Site";
|
|
11
|
+
FeatureScope["Web"] = "Web";
|
|
12
|
+
})(FeatureScope || (FeatureScope = {}));
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
15
|
+
webUrl: z.string().alias('u'),
|
|
16
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
17
|
+
error: e => `${e.input} is not a valid GUID for option id.`
|
|
18
|
+
}).alias('i'),
|
|
19
|
+
scope: zod.coercedEnum(FeatureScope).optional().alias('s'),
|
|
20
|
+
force: z.boolean().optional()
|
|
21
|
+
});
|
|
11
22
|
class SpoFeatureDisableCommand extends SpoCommand {
|
|
12
23
|
get name() {
|
|
13
24
|
return commands.FEATURE_DISABLE;
|
|
@@ -15,20 +26,12 @@ class SpoFeatureDisableCommand extends SpoCommand {
|
|
|
15
26
|
get description() {
|
|
16
27
|
return 'Disables feature for the specified site or web';
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoFeatureDisableCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoFeatureDisableCommand_instances, "m", _SpoFeatureDisableCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoFeatureDisableCommand_instances, "m", _SpoFeatureDisableCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoFeatureDisableCommand_instances, "m", _SpoFeatureDisableCommand_initValidators).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoFeatureDisableCommand_instances, "m", _SpoFeatureDisableCommand_initTypes).call(this);
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
25
31
|
}
|
|
26
32
|
async commandAction(logger, args) {
|
|
27
|
-
|
|
33
|
+
const scope = args.options.scope ?? 'Web';
|
|
28
34
|
const force = !!args.options.force;
|
|
29
|
-
if (!scope) {
|
|
30
|
-
scope = "web";
|
|
31
|
-
}
|
|
32
35
|
if (this.verbose) {
|
|
33
36
|
await logger.logToStderr(`Disabling feature '${args.options.id}' on scope '${scope}' for url '${args.options.webUrl}' (force='${force}')...`);
|
|
34
37
|
}
|
|
@@ -48,38 +51,5 @@ class SpoFeatureDisableCommand extends SpoCommand {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
_SpoFeatureDisableCommand_instances = new WeakSet(), _SpoFeatureDisableCommand_initTelemetry = function _SpoFeatureDisableCommand_initTelemetry() {
|
|
52
|
-
this.telemetry.push((args) => {
|
|
53
|
-
Object.assign(this.telemetryProperties, {
|
|
54
|
-
scope: args.options.scope || 'web',
|
|
55
|
-
force: args.options.force || false
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}, _SpoFeatureDisableCommand_initOptions = function _SpoFeatureDisableCommand_initOptions() {
|
|
59
|
-
this.options.unshift({
|
|
60
|
-
option: '-u, --webUrl <webUrl>'
|
|
61
|
-
}, {
|
|
62
|
-
option: '-i, --id <id>'
|
|
63
|
-
}, {
|
|
64
|
-
option: '-s, --scope [scope]',
|
|
65
|
-
autocomplete: ['Site', 'Web']
|
|
66
|
-
}, {
|
|
67
|
-
option: '--force'
|
|
68
|
-
});
|
|
69
|
-
}, _SpoFeatureDisableCommand_initValidators = function _SpoFeatureDisableCommand_initValidators() {
|
|
70
|
-
this.validators.push(async (args) => {
|
|
71
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
72
|
-
return `${args.options.id} is not a valid GUID for option id.`;
|
|
73
|
-
}
|
|
74
|
-
if (args.options.scope) {
|
|
75
|
-
if (['site', 'web'].indexOf(args.options.scope.toLowerCase()) < 0) {
|
|
76
|
-
return `${args.options.scope} is not a valid Feature scope. Allowed values are: Site, Web.`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
});
|
|
81
|
-
}, _SpoFeatureDisableCommand_initTypes = function _SpoFeatureDisableCommand_initTypes() {
|
|
82
|
-
this.types.string.push('scope', 's');
|
|
83
|
-
};
|
|
84
54
|
export default new SpoFeatureDisableCommand();
|
|
85
55
|
//# sourceMappingURL=feature-disable.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 _SpoFeatureEnableCommand_instances, _SpoFeatureEnableCommand_initTelemetry, _SpoFeatureEnableCommand_initOptions, _SpoFeatureEnableCommand_initValidators, _SpoFeatureEnableCommand_initTypes;
|
|
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';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
var FeatureScope;
|
|
9
|
+
(function (FeatureScope) {
|
|
10
|
+
FeatureScope["Site"] = "Site";
|
|
11
|
+
FeatureScope["Web"] = "Web";
|
|
12
|
+
})(FeatureScope || (FeatureScope = {}));
|
|
13
|
+
export const options = z.strictObject({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
15
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
16
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
17
|
+
}).alias('u'),
|
|
18
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
19
|
+
error: e => `${e.input} is not a valid GUID for option id.`
|
|
20
|
+
}).alias('i'),
|
|
21
|
+
scope: zod.coercedEnum(FeatureScope).optional().alias('s'),
|
|
22
|
+
force: z.boolean().optional()
|
|
23
|
+
});
|
|
11
24
|
class SpoFeatureEnableCommand extends SpoCommand {
|
|
12
25
|
get name() {
|
|
13
26
|
return commands.FEATURE_ENABLE;
|
|
@@ -15,20 +28,12 @@ class SpoFeatureEnableCommand extends SpoCommand {
|
|
|
15
28
|
get description() {
|
|
16
29
|
return 'Enables feature for the specified site or web';
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoFeatureEnableCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoFeatureEnableCommand_instances, "m", _SpoFeatureEnableCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoFeatureEnableCommand_instances, "m", _SpoFeatureEnableCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoFeatureEnableCommand_instances, "m", _SpoFeatureEnableCommand_initValidators).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoFeatureEnableCommand_instances, "m", _SpoFeatureEnableCommand_initTypes).call(this);
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
25
33
|
}
|
|
26
34
|
async commandAction(logger, args) {
|
|
27
|
-
|
|
35
|
+
const scope = args.options.scope ?? 'Web';
|
|
28
36
|
const force = !!args.options.force;
|
|
29
|
-
if (!scope) {
|
|
30
|
-
scope = "web";
|
|
31
|
-
}
|
|
32
37
|
if (this.verbose) {
|
|
33
38
|
await logger.logToStderr(`Enabling feature '${args.options.id}' on scope '${scope}' for url '${args.options.webUrl}' (force='${force}')...`);
|
|
34
39
|
}
|
|
@@ -48,38 +53,5 @@ class SpoFeatureEnableCommand extends SpoCommand {
|
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
|
-
_SpoFeatureEnableCommand_instances = new WeakSet(), _SpoFeatureEnableCommand_initTelemetry = function _SpoFeatureEnableCommand_initTelemetry() {
|
|
52
|
-
this.telemetry.push((args) => {
|
|
53
|
-
Object.assign(this.telemetryProperties, {
|
|
54
|
-
scope: args.options.scope || 'web',
|
|
55
|
-
force: args.options.force || false
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}, _SpoFeatureEnableCommand_initOptions = function _SpoFeatureEnableCommand_initOptions() {
|
|
59
|
-
this.options.unshift({
|
|
60
|
-
option: '-u, --webUrl <webUrl>'
|
|
61
|
-
}, {
|
|
62
|
-
option: '-i, --id <id>'
|
|
63
|
-
}, {
|
|
64
|
-
option: '-s, --scope [scope]',
|
|
65
|
-
autocomplete: ['Site', 'Web']
|
|
66
|
-
}, {
|
|
67
|
-
option: '--force'
|
|
68
|
-
});
|
|
69
|
-
}, _SpoFeatureEnableCommand_initValidators = function _SpoFeatureEnableCommand_initValidators() {
|
|
70
|
-
this.validators.push(async (args) => {
|
|
71
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
72
|
-
return `${args.options.id} is not a valid GUID for option id.`;
|
|
73
|
-
}
|
|
74
|
-
if (args.options.scope) {
|
|
75
|
-
if (['site', 'web'].indexOf(args.options.scope.toLowerCase()) < 0) {
|
|
76
|
-
return `${args.options.scope} is not a valid Feature scope. Allowed values are Site|Web`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
80
|
-
});
|
|
81
|
-
}, _SpoFeatureEnableCommand_initTypes = function _SpoFeatureEnableCommand_initTypes() {
|
|
82
|
-
this.types.string.push('scope', 's');
|
|
83
|
-
};
|
|
84
56
|
export default new SpoFeatureEnableCommand();
|
|
85
57
|
//# sourceMappingURL=feature-enable.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 _SpoFeatureListCommand_instances, _SpoFeatureListCommand_initTelemetry, _SpoFeatureListCommand_initOptions, _SpoFeatureListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.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
|
+
scope: z.enum(['Site', 'Web']).optional().alias('s')
|
|
13
|
+
});
|
|
11
14
|
class SpoFeatureListCommand extends SpoCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.FEATURE_LIST;
|
|
@@ -15,12 +18,8 @@ class SpoFeatureListCommand extends SpoCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Lists Features activated in the specified site or site collection';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoFeatureListCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoFeatureListCommand_instances, "m", _SpoFeatureListCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoFeatureListCommand_instances, "m", _SpoFeatureListCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoFeatureListCommand_instances, "m", _SpoFeatureListCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
24
23
|
}
|
|
25
24
|
async commandAction(logger, args) {
|
|
26
25
|
const scope = (args.options.scope) ? args.options.scope : 'Web';
|
|
@@ -33,29 +32,5 @@ class SpoFeatureListCommand extends SpoCommand {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
_SpoFeatureListCommand_instances = new WeakSet(), _SpoFeatureListCommand_initTelemetry = function _SpoFeatureListCommand_initTelemetry() {
|
|
37
|
-
this.telemetry.push((args) => {
|
|
38
|
-
Object.assign(this.telemetryProperties, {
|
|
39
|
-
scope: args.options.scope || 'Web'
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}, _SpoFeatureListCommand_initOptions = function _SpoFeatureListCommand_initOptions() {
|
|
43
|
-
this.options.unshift({
|
|
44
|
-
option: '-u, --webUrl <webUrl>'
|
|
45
|
-
}, {
|
|
46
|
-
option: '-s, --scope [scope]',
|
|
47
|
-
autocomplete: ['Site', 'Web']
|
|
48
|
-
});
|
|
49
|
-
}, _SpoFeatureListCommand_initValidators = function _SpoFeatureListCommand_initValidators() {
|
|
50
|
-
this.validators.push(async (args) => {
|
|
51
|
-
if (args.options.scope) {
|
|
52
|
-
if (args.options.scope !== 'Site' &&
|
|
53
|
-
args.options.scope !== 'Web') {
|
|
54
|
-
return `${args.options.scope} is not a valid Feature scope. Allowed values are Site|Web`;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
35
|
export default new SpoFeatureListCommand();
|
|
61
36
|
//# sourceMappingURL=feature-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 _SpoFieldAddCommand_instances, _SpoFieldAddCommand_initTelemetry, _SpoFieldAddCommand_initOptions, _SpoFieldAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -11,6 +7,29 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
const fieldOptions = ['DefaultValue', 'AddToDefaultContentType', 'AddToNoContentType', 'AddToAllContentTypes', 'AddFieldInternalNameHint', 'AddFieldToDefaultView', 'AddFieldCheckDisplayName'];
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
}).alias('u'),
|
|
16
|
+
listTitle: z.string().optional().alias('l'),
|
|
17
|
+
listId: z.string().refine(id => validation.isValidGuid(id), {
|
|
18
|
+
error: e => `${e.input} in option listId is not a valid GUID`
|
|
19
|
+
}).optional(),
|
|
20
|
+
listUrl: z.string().optional(),
|
|
21
|
+
xml: z.string().alias('x'),
|
|
22
|
+
options: z.string().refine(val => {
|
|
23
|
+
const items = val.split(',').map(o => o.trim());
|
|
24
|
+
return items.every(item => fieldOptions.indexOf(item) !== -1);
|
|
25
|
+
}, {
|
|
26
|
+
error: e => {
|
|
27
|
+
const items = e.input.split(',').map((o) => o.trim());
|
|
28
|
+
const invalid = items.find((item) => fieldOptions.indexOf(item) === -1);
|
|
29
|
+
return `${invalid} is not a valid value for the options argument. Allowed values are ${fieldOptions.join('|')}`;
|
|
30
|
+
}
|
|
31
|
+
}).optional()
|
|
32
|
+
});
|
|
14
33
|
class SpoFieldAddCommand extends SpoCommand {
|
|
15
34
|
get name() {
|
|
16
35
|
return commands.FIELD_ADD;
|
|
@@ -18,12 +37,14 @@ class SpoFieldAddCommand extends SpoCommand {
|
|
|
18
37
|
get description() {
|
|
19
38
|
return 'Adds a new list or site column using the CAML field definition';
|
|
20
39
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
get schema() {
|
|
41
|
+
return options;
|
|
42
|
+
}
|
|
43
|
+
getRefinedSchema(schema) {
|
|
44
|
+
return schema
|
|
45
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length <= 1, {
|
|
46
|
+
error: 'Specify either list id or title or list url, but not multiple'
|
|
47
|
+
});
|
|
27
48
|
}
|
|
28
49
|
async commandAction(logger, args) {
|
|
29
50
|
try {
|
|
@@ -94,55 +115,5 @@ class SpoFieldAddCommand extends SpoCommand {
|
|
|
94
115
|
return optionsValue;
|
|
95
116
|
}
|
|
96
117
|
}
|
|
97
|
-
_SpoFieldAddCommand_instances = new WeakSet(), _SpoFieldAddCommand_initTelemetry = function _SpoFieldAddCommand_initTelemetry() {
|
|
98
|
-
this.telemetry.push((args) => {
|
|
99
|
-
Object.assign(this.telemetryProperties, {
|
|
100
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
101
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
102
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
103
|
-
options: typeof args.options.options !== 'undefined'
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}, _SpoFieldAddCommand_initOptions = function _SpoFieldAddCommand_initOptions() {
|
|
107
|
-
this.options.unshift({
|
|
108
|
-
option: '-u, --webUrl <webUrl>'
|
|
109
|
-
}, {
|
|
110
|
-
option: '-l, --listTitle [listTitle]'
|
|
111
|
-
}, {
|
|
112
|
-
option: '--listId [listId]'
|
|
113
|
-
}, {
|
|
114
|
-
option: '--listUrl [listUrl]'
|
|
115
|
-
}, {
|
|
116
|
-
option: '-x, --xml <xml>'
|
|
117
|
-
}, {
|
|
118
|
-
option: '--options [options]'
|
|
119
|
-
});
|
|
120
|
-
}, _SpoFieldAddCommand_initValidators = function _SpoFieldAddCommand_initValidators() {
|
|
121
|
-
this.validators.push(async (args) => {
|
|
122
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
123
|
-
if (isValidSharePointUrl !== true) {
|
|
124
|
-
return isValidSharePointUrl;
|
|
125
|
-
}
|
|
126
|
-
const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
|
|
127
|
-
if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
|
|
128
|
-
return `Specify either list id or title or list url, but not multiple`;
|
|
129
|
-
}
|
|
130
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
131
|
-
return `${args.options.listId} in option listId is not a valid GUID`;
|
|
132
|
-
}
|
|
133
|
-
if (args.options.options) {
|
|
134
|
-
let optionsError = true;
|
|
135
|
-
const options = ['DefaultValue', 'AddToDefaultContentType', 'AddToNoContentType', 'AddToAllContentTypes', 'AddFieldInternalNameHint', 'AddFieldToDefaultView', 'AddFieldCheckDisplayName'];
|
|
136
|
-
args.options.options.split(',').forEach(o => {
|
|
137
|
-
o = o.trim();
|
|
138
|
-
if (options.indexOf(o) < 0) {
|
|
139
|
-
optionsError = `${o} is not a valid value for the options argument. Allowed values are DefaultValue|AddToDefaultContentType|AddToNoContentType|AddToAllContentTypes|AddFieldInternalNameHint|AddFieldToDefaultView|AddFieldCheckDisplayName`;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
return optionsError;
|
|
143
|
-
}
|
|
144
|
-
return true;
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
118
|
export default new SpoFieldAddCommand();
|
|
148
119
|
//# sourceMappingURL=field-add.js.map
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoFieldGetCommand_instances, _SpoFieldGetCommand_initTelemetry, _SpoFieldGetCommand_initOptions, _SpoFieldGetCommand_initValidators, _SpoFieldGetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
}).alias('u'),
|
|
14
|
+
listTitle: z.string().optional().alias('l'),
|
|
15
|
+
listId: z.string().refine(id => validation.isValidGuid(id), {
|
|
16
|
+
error: e => `${e.input} is not a valid GUID`
|
|
17
|
+
}).optional(),
|
|
18
|
+
listUrl: z.string().optional(),
|
|
19
|
+
id: z.string().refine(id => validation.isValidGuid(id), {
|
|
20
|
+
error: e => `${e.input} is not a valid GUID`
|
|
21
|
+
}).optional().alias('i'),
|
|
22
|
+
title: z.string().optional().alias('t'),
|
|
23
|
+
internalName: z.string().optional()
|
|
24
|
+
});
|
|
13
25
|
class SpoFieldGetCommand extends SpoCommand {
|
|
14
26
|
get name() {
|
|
15
27
|
return commands.FIELD_GET;
|
|
@@ -17,13 +29,18 @@ class SpoFieldGetCommand extends SpoCommand {
|
|
|
17
29
|
get description() {
|
|
18
30
|
return 'Retrieves information about the specified list- or site column';
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
get schema() {
|
|
33
|
+
return options;
|
|
34
|
+
}
|
|
35
|
+
getRefinedSchema(schema) {
|
|
36
|
+
return schema
|
|
37
|
+
.refine(opts => [opts.id, opts.title, opts.internalName].filter(o => o !== undefined).length === 1, {
|
|
38
|
+
error: 'Specify one of the following options: id, title, internalName.',
|
|
39
|
+
params: {
|
|
40
|
+
customCode: 'optionSet',
|
|
41
|
+
options: ['id', 'title', 'internalName']
|
|
42
|
+
}
|
|
43
|
+
});
|
|
27
44
|
}
|
|
28
45
|
async commandAction(logger, args) {
|
|
29
46
|
let listRestUrl = '';
|
|
@@ -60,49 +77,5 @@ class SpoFieldGetCommand extends SpoCommand {
|
|
|
60
77
|
}
|
|
61
78
|
}
|
|
62
79
|
}
|
|
63
|
-
_SpoFieldGetCommand_instances = new WeakSet(), _SpoFieldGetCommand_initTelemetry = function _SpoFieldGetCommand_initTelemetry() {
|
|
64
|
-
this.telemetry.push((args) => {
|
|
65
|
-
Object.assign(this.telemetryProperties, {
|
|
66
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
67
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
68
|
-
listUrl: typeof args.options.listUrl !== 'undefined',
|
|
69
|
-
id: typeof args.options.id !== 'undefined',
|
|
70
|
-
title: typeof args.options.title !== 'undefined',
|
|
71
|
-
internalName: typeof args.options.internalName !== 'undefined'
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}, _SpoFieldGetCommand_initOptions = function _SpoFieldGetCommand_initOptions() {
|
|
75
|
-
this.options.unshift({
|
|
76
|
-
option: '-u, --webUrl <webUrl>'
|
|
77
|
-
}, {
|
|
78
|
-
option: '-l, --listTitle [listTitle]'
|
|
79
|
-
}, {
|
|
80
|
-
option: '--listId [listId]'
|
|
81
|
-
}, {
|
|
82
|
-
option: '--listUrl [listUrl]'
|
|
83
|
-
}, {
|
|
84
|
-
option: '-i, --id [id]'
|
|
85
|
-
}, {
|
|
86
|
-
option: '-t, --title [title]'
|
|
87
|
-
}, {
|
|
88
|
-
option: '--internalName [internalName]'
|
|
89
|
-
});
|
|
90
|
-
}, _SpoFieldGetCommand_initValidators = function _SpoFieldGetCommand_initValidators() {
|
|
91
|
-
this.validators.push(async (args) => {
|
|
92
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
93
|
-
if (isValidSharePointUrl !== true) {
|
|
94
|
-
return isValidSharePointUrl;
|
|
95
|
-
}
|
|
96
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
97
|
-
return `${args.options.id} is not a valid GUID`;
|
|
98
|
-
}
|
|
99
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
100
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
101
|
-
}
|
|
102
|
-
return true;
|
|
103
|
-
});
|
|
104
|
-
}, _SpoFieldGetCommand_initOptionSets = function _SpoFieldGetCommand_initOptionSets() {
|
|
105
|
-
this.optionSets.push({ options: ['id', 'title', 'internalName'] });
|
|
106
|
-
};
|
|
107
80
|
export default new SpoFieldGetCommand();
|
|
108
81
|
//# sourceMappingURL=field-get.js.map
|
|
@@ -1,15 +1,22 @@
|
|
|
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 _SpoFieldListCommand_instances, _SpoFieldListCommand_initTelemetry, _SpoFieldListCommand_initOptions, _SpoFieldListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
}).alias('u'),
|
|
14
|
+
listTitle: z.string().optional().alias('t'),
|
|
15
|
+
listId: z.string().refine(id => validation.isValidGuid(id), {
|
|
16
|
+
error: e => `${e.input} is not a valid GUID`
|
|
17
|
+
}).optional().alias('i'),
|
|
18
|
+
listUrl: z.string().optional()
|
|
19
|
+
});
|
|
13
20
|
class SpoFieldListCommand extends SpoCommand {
|
|
14
21
|
get name() {
|
|
15
22
|
return commands.FIELD_LIST;
|
|
@@ -20,12 +27,14 @@ class SpoFieldListCommand extends SpoCommand {
|
|
|
20
27
|
defaultProperties() {
|
|
21
28
|
return ['Id', 'Title', 'InternalName', 'Hidden'];
|
|
22
29
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
get schema() {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
getRefinedSchema(schema) {
|
|
34
|
+
return schema
|
|
35
|
+
.refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length <= 1, {
|
|
36
|
+
error: 'Specify either list id or title or list url'
|
|
37
|
+
});
|
|
29
38
|
}
|
|
30
39
|
async commandAction(logger, args) {
|
|
31
40
|
let listUrl = '';
|
|
@@ -48,39 +57,5 @@ class SpoFieldListCommand extends SpoCommand {
|
|
|
48
57
|
}
|
|
49
58
|
}
|
|
50
59
|
}
|
|
51
|
-
_SpoFieldListCommand_instances = new WeakSet(), _SpoFieldListCommand_initTelemetry = function _SpoFieldListCommand_initTelemetry() {
|
|
52
|
-
this.telemetry.push((args) => {
|
|
53
|
-
Object.assign(this.telemetryProperties, {
|
|
54
|
-
listId: typeof args.options.listId !== 'undefined',
|
|
55
|
-
listTitle: typeof args.options.listTitle !== 'undefined',
|
|
56
|
-
listUrl: typeof args.options.listUrl !== 'undefined'
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _SpoFieldListCommand_initOptions = function _SpoFieldListCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-u, --webUrl <webUrl>'
|
|
62
|
-
}, {
|
|
63
|
-
option: '-t, --listTitle [listTitle]'
|
|
64
|
-
}, {
|
|
65
|
-
option: '-i, --listId [listId]'
|
|
66
|
-
}, {
|
|
67
|
-
option: '--listUrl [listUrl]'
|
|
68
|
-
});
|
|
69
|
-
}, _SpoFieldListCommand_initValidators = function _SpoFieldListCommand_initValidators() {
|
|
70
|
-
this.validators.push(async (args) => {
|
|
71
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
72
|
-
if (isValidSharePointUrl !== true) {
|
|
73
|
-
return isValidSharePointUrl;
|
|
74
|
-
}
|
|
75
|
-
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
76
|
-
return `${args.options.listId} is not a valid GUID`;
|
|
77
|
-
}
|
|
78
|
-
const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
|
|
79
|
-
if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
|
|
80
|
-
return `Specify either list id or title or list url`;
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
60
|
export default new SpoFieldListCommand();
|
|
86
61
|
//# sourceMappingURL=field-list.js.map
|