@pnp/cli-microsoft365 12.1.0-beta.dbc076e → 12.1.0-beta.f55735f
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/m365/spfx/commands/package/package-generate.js +30 -51
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +27 -62
- package/dist/m365/spfx/commands/project/project-doctor.js +20 -51
- package/dist/m365/spfx/commands/project/project-externalize.js +16 -26
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +28 -65
- package/dist/m365/spfx/commands/project/project-permissions-grant.js +4 -2
- package/dist/m365/spfx/commands/project/project-rename.js +17 -29
- package/dist/m365/spfx/commands/project/project-upgrade.js +0 -3
- package/dist/m365/spfx/commands/spfx-doctor.js +23 -47
- package/dist/m365/spo/commands/file/file-add.js +51 -77
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-checkin.js +35 -64
- package/dist/m365/spo/commands/file/file-checkout-undo.js +25 -49
- package/dist/m365/spo/commands/file/file-checkout.js +24 -47
- package/dist/m365/spo/commands/file/file-copy.js +37 -68
- package/dist/m365/spo/commands/file/file-get.js +44 -79
- package/dist/m365/spo/commands/file/file-list.js +16 -39
- package/dist/m365/spo/commands/file/file-move.js +30 -68
- package/dist/m365/spo/commands/file/file-remove.js +27 -56
- package/dist/m365/spo/commands/file/file-rename.js +15 -36
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +26 -51
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +25 -50
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +47 -75
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +39 -70
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +26 -52
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +25 -49
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +24 -47
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +46 -70
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +33 -57
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +25 -47
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +32 -53
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +26 -51
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +29 -55
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +25 -45
- package/dist/m365/spo/commands/file/file-version-get.js +25 -43
- package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +24 -41
- package/dist/m365/spo/commands/file/file-version-remove.js +26 -47
- package/dist/m365/spo/commands/file/file-version-restore.js +26 -47
- package/dist/m365/spo/commands/folder/folder-add.js +19 -48
- package/dist/m365/spo/commands/folder/folder-copy.js +36 -62
- package/dist/m365/spo/commands/folder/folder-get.js +30 -51
- package/dist/m365/spo/commands/folder/folder-list.js +16 -39
- package/dist/m365/spo/commands/folder/folder-move.js +36 -62
- package/dist/m365/spo/commands/folder/folder-remove.js +15 -36
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +30 -48
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +30 -50
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +49 -79
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +37 -67
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +15 -36
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +14 -33
- package/dist/m365/spo/commands/folder/folder-set.js +28 -48
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +58 -86
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +33 -50
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +33 -42
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +32 -47
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +34 -41
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +38 -43
- package/dist/m365/spo/commands/page/page-add.js +31 -68
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +74 -101
- package/dist/m365/spo/commands/page/page-column-get.js +15 -32
- package/dist/m365/spo/commands/page/page-column-list.js +14 -27
- package/dist/m365/spo/commands/page/page-control-get.js +18 -27
- package/dist/m365/spo/commands/page/page-control-list.js +13 -20
- package/dist/m365/spo/commands/page/page-control-remove.js +1 -1
- package/dist/m365/spo/commands/page/page-control-set.js +51 -61
- package/dist/m365/spo/commands/page/page-copy.js +15 -31
- package/dist/m365/spo/commands/page/page-header-set.js +25 -89
- package/dist/m365/spo/commands/page/page-list.js +12 -18
- package/dist/m365/spo/commands/page/page-remove.js +16 -39
- package/dist/m365/spo/commands/page/page-section-add.js +108 -173
- package/dist/m365/spo/commands/page/page-section-get.js +17 -27
- package/dist/m365/spo/commands/page/page-section-list.js +13 -20
- package/dist/m365/spo/commands/page/page-section-remove.js +4 -1
- package/dist/m365/spo/commands/page/page-set.js +50 -100
- package/dist/m365/spo/commands/page/page-template-list.js +12 -18
- package/dist/m365/spo/commands/page/page-text-add.js +23 -45
- package/dist/m365/viva/commands/connections/connections-app-create.js +36 -42
- package/dist/m365/viva/commands/engage/engage-community-add.js +75 -71
- package/dist/m365/viva/commands/engage/engage-community-get.js +8 -16
- package/dist/m365/viva/commands/engage/engage-community-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-community-remove.js +28 -48
- package/dist/m365/viva/commands/engage/engage-community-set.js +43 -66
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +7 -12
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-message-add.js +22 -52
- package/dist/m365/viva/commands/engage/engage-message-get.js +8 -23
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +10 -39
- package/dist/m365/viva/commands/engage/engage-message-list.js +22 -66
- package/dist/m365/viva/commands/engage/engage-message-remove.js +9 -32
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -22
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-role-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-role-member-add.js +3 -5
- package/dist/m365/viva/commands/engage/engage-role-member-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-role-member-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-search.js +16 -65
- package/dist/m365/viva/commands/engage/engage-user-get.js +15 -33
- package/dist/m365/viva/commands/engage/engage-user-list.js +22 -57
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-lock.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-unlock.mdx +21 -0
- package/docs/docs/cmd/spo/page/page-text-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-get.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +19 -0
- package/package.json +1 -1
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
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 _SpfxProjectRenameCommand_instances, _SpfxProjectRenameCommand_initTelemetry, _SpfxProjectRenameCommand_initOptions;
|
|
7
1
|
import fs from 'fs';
|
|
8
2
|
import path from 'path';
|
|
9
3
|
import { v4 } from 'uuid';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
10
6
|
import { CommandError } from '../../../../Command.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
12
8
|
import { BaseProjectCommand } from './base-project-command.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
newName: z.string().alias('n'),
|
|
12
|
+
generateNewId: z.boolean().optional()
|
|
13
|
+
});
|
|
13
14
|
class SpfxProjectRenameCommand extends BaseProjectCommand {
|
|
14
|
-
get name() {
|
|
15
|
-
return commands.PROJECT_RENAME;
|
|
16
|
-
}
|
|
17
|
-
get description() {
|
|
18
|
-
return 'Renames SharePoint Framework project';
|
|
19
|
-
}
|
|
20
15
|
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
_SpfxProjectRenameCommand_instances.add(this);
|
|
16
|
+
super(...arguments);
|
|
23
17
|
this.generateNewId = () => {
|
|
24
18
|
return v4();
|
|
25
19
|
};
|
|
@@ -132,8 +126,15 @@ class SpfxProjectRenameCommand extends BaseProjectCommand {
|
|
|
132
126
|
}
|
|
133
127
|
}
|
|
134
128
|
};
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
}
|
|
130
|
+
get name() {
|
|
131
|
+
return commands.PROJECT_RENAME;
|
|
132
|
+
}
|
|
133
|
+
get description() {
|
|
134
|
+
return 'Renames SharePoint Framework project';
|
|
135
|
+
}
|
|
136
|
+
get schema() {
|
|
137
|
+
return options;
|
|
137
138
|
}
|
|
138
139
|
async commandAction(logger, args) {
|
|
139
140
|
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
@@ -165,19 +166,6 @@ class SpfxProjectRenameCommand extends BaseProjectCommand {
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
_SpfxProjectRenameCommand_instances = new WeakSet(), _SpfxProjectRenameCommand_initTelemetry = function _SpfxProjectRenameCommand_initTelemetry() {
|
|
169
|
-
this.telemetry.push((args) => {
|
|
170
|
-
Object.assign(this.telemetryProperties, {
|
|
171
|
-
generateNewId: args.options.generateNewId
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
}, _SpfxProjectRenameCommand_initOptions = function _SpfxProjectRenameCommand_initOptions() {
|
|
175
|
-
this.options.unshift({
|
|
176
|
-
option: '-n, --newName <newName>'
|
|
177
|
-
}, {
|
|
178
|
-
option: '--generateNewId'
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
169
|
SpfxProjectRenameCommand.ERROR_NO_PROJECT_ROOT_FOLDER = 1;
|
|
182
170
|
export default new SpfxProjectRenameCommand();
|
|
183
171
|
//# sourceMappingURL=project-rename.js.map
|
|
@@ -25,9 +25,6 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
25
25
|
get description() {
|
|
26
26
|
return 'Upgrades SharePoint Framework project to the specified version';
|
|
27
27
|
}
|
|
28
|
-
get allowedOutputs() {
|
|
29
|
-
return ['json', 'text', 'md', 'tour'];
|
|
30
|
-
}
|
|
31
28
|
get schema() {
|
|
32
29
|
return options;
|
|
33
30
|
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
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 _SpfxDoctorCommand_instances, _SpfxDoctorCommand_initTelemetry, _SpfxDoctorCommand_initOptions, _SpfxDoctorCommand_initValidators;
|
|
7
1
|
import child_process from 'child_process';
|
|
8
2
|
import { satisfies } from 'semver';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { globalOptionsZod } from '../../../Command.js';
|
|
9
5
|
import { CheckStatus, formatting } from '../../../utils/formatting.js';
|
|
6
|
+
import { zod } from '../../../utils/zod.js';
|
|
10
7
|
import commands from '../commands.js';
|
|
11
8
|
import { BaseProjectCommand } from './project/base-project-command.js';
|
|
12
9
|
import { SharePointVersion, versions } from './SpfxCompatibilityMatrix.js';
|
|
10
|
+
const environments = {
|
|
11
|
+
sp2016: 'sp2016',
|
|
12
|
+
sp2019: 'sp2019',
|
|
13
|
+
spo: 'spo'
|
|
14
|
+
};
|
|
15
|
+
const spfxVersions = Object.keys(versions);
|
|
16
|
+
export const options = z.strictObject({
|
|
17
|
+
...globalOptionsZod.shape,
|
|
18
|
+
env: zod.coercedEnum(environments).optional().alias('e'),
|
|
19
|
+
spfxVersion: z.enum(spfxVersions, {
|
|
20
|
+
error: `The specified version is not a supported SharePoint Framework version. Supported versions are ${spfxVersions.join(', ')}`
|
|
21
|
+
}).optional().alias('v'),
|
|
22
|
+
output: z.enum(['text', 'json']).optional().alias('o')
|
|
23
|
+
});
|
|
13
24
|
/**
|
|
14
25
|
* Where to search for the particular npm package: only in the current project,
|
|
15
26
|
* in global packages or both
|
|
@@ -29,8 +40,10 @@ var HandlePromise;
|
|
|
29
40
|
HandlePromise[HandlePromise["Continue"] = 1] = "Continue";
|
|
30
41
|
})(HandlePromise || (HandlePromise = {}));
|
|
31
42
|
class SpfxDoctorCommand extends BaseProjectCommand {
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.output = '';
|
|
46
|
+
this.resultsObject = [];
|
|
34
47
|
}
|
|
35
48
|
get name() {
|
|
36
49
|
return commands.DOCTOR;
|
|
@@ -38,14 +51,8 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
38
51
|
get description() {
|
|
39
52
|
return 'Verifies environment configuration for using the specific version of the SharePoint Framework';
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_SpfxDoctorCommand_instances.add(this);
|
|
44
|
-
this.output = '';
|
|
45
|
-
this.resultsObject = [];
|
|
46
|
-
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
47
|
-
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initOptions).call(this);
|
|
48
|
-
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initValidators).call(this);
|
|
54
|
+
get schema() {
|
|
55
|
+
return options;
|
|
49
56
|
}
|
|
50
57
|
async commandAction(logger, args) {
|
|
51
58
|
if (!args.options.output) {
|
|
@@ -430,36 +437,5 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
430
437
|
}
|
|
431
438
|
}
|
|
432
439
|
}
|
|
433
|
-
_SpfxDoctorCommand_instances = new WeakSet(), _SpfxDoctorCommand_initTelemetry = function _SpfxDoctorCommand_initTelemetry() {
|
|
434
|
-
this.telemetry.push((args) => {
|
|
435
|
-
Object.assign(this.telemetryProperties, {
|
|
436
|
-
env: args.options.env,
|
|
437
|
-
spfxVersion: args.options.spfxVersion
|
|
438
|
-
});
|
|
439
|
-
});
|
|
440
|
-
}, _SpfxDoctorCommand_initOptions = function _SpfxDoctorCommand_initOptions() {
|
|
441
|
-
this.options.unshift({
|
|
442
|
-
option: '-e, --env [env]',
|
|
443
|
-
autocomplete: ['sp2016', 'sp2019', 'spo']
|
|
444
|
-
}, {
|
|
445
|
-
option: '-v, --spfxVersion [spfxVersion]',
|
|
446
|
-
autocomplete: Object.keys(versions)
|
|
447
|
-
});
|
|
448
|
-
}, _SpfxDoctorCommand_initValidators = function _SpfxDoctorCommand_initValidators() {
|
|
449
|
-
this.validators.push(async (args) => {
|
|
450
|
-
if (args.options.env) {
|
|
451
|
-
const sp = this.spVersionStringToEnum(args.options.env);
|
|
452
|
-
if (!sp) {
|
|
453
|
-
return `${args.options.env} is not a valid SharePoint version. Valid versions are sp2016, sp2019 or spo`;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (args.options.spfxVersion) {
|
|
457
|
-
if (!versions[args.options.spfxVersion]) {
|
|
458
|
-
return `${args.options.spfxVersion} is not a supported SharePoint Framework version. Supported versions are ${Object.keys(versions).join(', ')}`;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return true;
|
|
462
|
-
});
|
|
463
|
-
};
|
|
464
440
|
export default new SpfxDoctorCommand();
|
|
465
441
|
//# sourceMappingURL=spfx-doctor.js.map
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
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 _SpoFileAddCommand_instances, _SpoFileAddCommand_initTelemetry, _SpoFileAddCommand_initOptions, _SpoFileAddCommand_initValidators, _SpoFileAddCommand_initTypes;
|
|
7
1
|
import fs from 'fs';
|
|
8
2
|
import path from 'path';
|
|
9
3
|
import { v4 } from 'uuid';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
10
6
|
import request from '../../../../request.js';
|
|
11
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
12
8
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -14,7 +10,37 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
14
10
|
import { validation } from '../../../../utils/validation.js';
|
|
15
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
16
12
|
import commands from '../../commands.js';
|
|
13
|
+
export const options = z.object({
|
|
14
|
+
...globalOptionsZod.shape,
|
|
15
|
+
webUrl: z.string()
|
|
16
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
17
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
18
|
+
})
|
|
19
|
+
.alias('u'),
|
|
20
|
+
folder: z.string(),
|
|
21
|
+
path: z.string()
|
|
22
|
+
.refine(filePath => fs.existsSync(filePath), {
|
|
23
|
+
error: 'Specified path of the file to add does not exist',
|
|
24
|
+
abort: true
|
|
25
|
+
})
|
|
26
|
+
.alias('p'),
|
|
27
|
+
contentType: z.string().optional().alias('c'),
|
|
28
|
+
checkOut: z.boolean().optional(),
|
|
29
|
+
checkInComment: z.string().optional(),
|
|
30
|
+
approve: z.boolean().optional(),
|
|
31
|
+
approveComment: z.string().optional(),
|
|
32
|
+
publish: z.boolean().optional(),
|
|
33
|
+
publishComment: z.string().optional(),
|
|
34
|
+
overwrite: z.boolean().optional(),
|
|
35
|
+
fileName: z.string().optional()
|
|
36
|
+
}).catchall(z.unknown());
|
|
17
37
|
class SpoFileAddCommand extends SpoCommand {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.fileChunkingThreshold = 250 * 1024 * 1024; // max 250 MB
|
|
41
|
+
this.fileChunkSize = 250 * 1024 * 1024; // max fileChunkingThreshold
|
|
42
|
+
this.fileChunkRetryAttempts = 5;
|
|
43
|
+
}
|
|
18
44
|
get name() {
|
|
19
45
|
return commands.FILE_ADD;
|
|
20
46
|
}
|
|
@@ -24,16 +50,25 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
24
50
|
allowUnknownOptions() {
|
|
25
51
|
return true;
|
|
26
52
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
get schema() {
|
|
54
|
+
return options;
|
|
55
|
+
}
|
|
56
|
+
getRefinedSchema(schema) {
|
|
57
|
+
return schema
|
|
58
|
+
.refine(opts => !opts.publishComment || opts.publish, {
|
|
59
|
+
error: '--publishComment cannot be used without --publish',
|
|
60
|
+
path: ['publish'],
|
|
61
|
+
params: {
|
|
62
|
+
customCode: 'required'
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
.refine(opts => !opts.approveComment || opts.approve, {
|
|
66
|
+
error: '--approveComment cannot be used without --approve',
|
|
67
|
+
path: ['approve'],
|
|
68
|
+
params: {
|
|
69
|
+
customCode: 'required'
|
|
70
|
+
}
|
|
71
|
+
});
|
|
37
72
|
}
|
|
38
73
|
async commandAction(logger, args) {
|
|
39
74
|
const folderPath = urlUtil.getServerRelativePath(args.options.webUrl, args.options.folder);
|
|
@@ -452,66 +487,5 @@ class SpoFileAddCommand extends SpoCommand {
|
|
|
452
487
|
return result;
|
|
453
488
|
}
|
|
454
489
|
}
|
|
455
|
-
_SpoFileAddCommand_instances = new WeakSet(), _SpoFileAddCommand_initTelemetry = function _SpoFileAddCommand_initTelemetry() {
|
|
456
|
-
this.telemetry.push((args) => {
|
|
457
|
-
Object.assign(this.telemetryProperties, {
|
|
458
|
-
contentType: typeof args.options.contentType !== 'undefined',
|
|
459
|
-
checkOut: !!args.options.checkOut,
|
|
460
|
-
checkInComment: typeof args.options.checkInComment !== 'undefined',
|
|
461
|
-
approve: !!args.options.approve,
|
|
462
|
-
approveComment: typeof args.options.approveComment !== 'undefined',
|
|
463
|
-
publish: !!args.options.publish,
|
|
464
|
-
publishComment: typeof args.options.publishComment !== 'undefined',
|
|
465
|
-
overwrite: !!args.options.overwrite,
|
|
466
|
-
fileName: typeof args.options.fileName !== 'undefined'
|
|
467
|
-
});
|
|
468
|
-
});
|
|
469
|
-
}, _SpoFileAddCommand_initOptions = function _SpoFileAddCommand_initOptions() {
|
|
470
|
-
this.options.unshift({
|
|
471
|
-
option: '-u, --webUrl <webUrl>'
|
|
472
|
-
}, {
|
|
473
|
-
option: '--folder <folder>'
|
|
474
|
-
}, {
|
|
475
|
-
option: '-p, --path <path>'
|
|
476
|
-
}, {
|
|
477
|
-
option: '-c, --contentType [contentType]'
|
|
478
|
-
}, {
|
|
479
|
-
option: '--checkOut'
|
|
480
|
-
}, {
|
|
481
|
-
option: '--checkInComment [checkInComment]'
|
|
482
|
-
}, {
|
|
483
|
-
option: '--approve'
|
|
484
|
-
}, {
|
|
485
|
-
option: '--approveComment [approveComment]'
|
|
486
|
-
}, {
|
|
487
|
-
option: '--publish'
|
|
488
|
-
}, {
|
|
489
|
-
option: '--publishComment [publishComment]'
|
|
490
|
-
}, {
|
|
491
|
-
option: '--overwrite'
|
|
492
|
-
}, {
|
|
493
|
-
option: '--fileName [fileName]'
|
|
494
|
-
});
|
|
495
|
-
}, _SpoFileAddCommand_initValidators = function _SpoFileAddCommand_initValidators() {
|
|
496
|
-
this.validators.push(async (args) => {
|
|
497
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
498
|
-
if (isValidSharePointUrl !== true) {
|
|
499
|
-
return isValidSharePointUrl;
|
|
500
|
-
}
|
|
501
|
-
if (args.options.path && !fs.existsSync(args.options.path)) {
|
|
502
|
-
return 'Specified path of the file to add does not exist';
|
|
503
|
-
}
|
|
504
|
-
if (args.options.publishComment && !args.options.publish) {
|
|
505
|
-
return '--publishComment cannot be used without --publish';
|
|
506
|
-
}
|
|
507
|
-
if (args.options.approveComment && !args.options.approve) {
|
|
508
|
-
return '--approveComment cannot be used without --approve';
|
|
509
|
-
}
|
|
510
|
-
return true;
|
|
511
|
-
});
|
|
512
|
-
}, _SpoFileAddCommand_initTypes = function _SpoFileAddCommand_initTypes() {
|
|
513
|
-
this.types.string.push('webUrl', 'folder', 'path', 'contentType', 'checkInComment', 'approveComment', 'publishComment', 'fileName');
|
|
514
|
-
this.types.boolean.push('checkOut', 'approve', 'publish', 'overwrite');
|
|
515
|
-
};
|
|
516
490
|
export default new SpoFileAddCommand();
|
|
517
491
|
//# sourceMappingURL=file-add.js.map
|
|
@@ -15,7 +15,7 @@ export const options = z.strictObject({
|
|
|
15
15
|
})
|
|
16
16
|
.alias('u'),
|
|
17
17
|
url: z.string().optional(),
|
|
18
|
-
id: z.
|
|
18
|
+
id: z.guid().optional().alias('i'),
|
|
19
19
|
force: z.boolean().optional().alias('f')
|
|
20
20
|
});
|
|
21
21
|
class SpoFileArchiveCommand extends SpoCommand {
|
|
@@ -1,13 +1,10 @@
|
|
|
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 _SpoFileCheckinCommand_instances, _SpoFileCheckinCommand_initTelemetry, _SpoFileCheckinCommand_initOptions, _SpoFileCheckinCommand_initValidators, _SpoFileCheckinCommand_initOptionSets, _SpoFileCheckinCommand_initTypes;
|
|
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';
|
|
7
|
+
import { zod } from '../../../../utils/zod.js';
|
|
11
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
9
|
import commands from '../../commands.js';
|
|
13
10
|
var CheckinType;
|
|
@@ -16,6 +13,26 @@ var CheckinType;
|
|
|
16
13
|
CheckinType[CheckinType["Major"] = 1] = "Major";
|
|
17
14
|
CheckinType[CheckinType["Overwrite"] = 2] = "Overwrite";
|
|
18
15
|
})(CheckinType || (CheckinType = {}));
|
|
16
|
+
var CheckinTypeOption;
|
|
17
|
+
(function (CheckinTypeOption) {
|
|
18
|
+
CheckinTypeOption["Minor"] = "Minor";
|
|
19
|
+
CheckinTypeOption["Major"] = "Major";
|
|
20
|
+
CheckinTypeOption["Overwrite"] = "Overwrite";
|
|
21
|
+
})(CheckinTypeOption || (CheckinTypeOption = {}));
|
|
22
|
+
export const options = z.strictObject({
|
|
23
|
+
...globalOptionsZod.shape,
|
|
24
|
+
webUrl: z.string()
|
|
25
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
26
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
27
|
+
})
|
|
28
|
+
.alias('u'),
|
|
29
|
+
url: z.string().optional(),
|
|
30
|
+
id: z.guid().optional().alias('i'),
|
|
31
|
+
type: zod.coercedEnum(CheckinTypeOption).optional().alias('t'),
|
|
32
|
+
comment: z.string()
|
|
33
|
+
.max(1023, { error: 'The length of the comment must be less than 1024 letters' })
|
|
34
|
+
.optional()
|
|
35
|
+
});
|
|
19
36
|
class SpoFileCheckinCommand extends SpoCommand {
|
|
20
37
|
get name() {
|
|
21
38
|
return commands.FILE_CHECKIN;
|
|
@@ -23,14 +40,18 @@ class SpoFileCheckinCommand extends SpoCommand {
|
|
|
23
40
|
get description() {
|
|
24
41
|
return 'Checks in specified file';
|
|
25
42
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
get schema() {
|
|
44
|
+
return options;
|
|
45
|
+
}
|
|
46
|
+
getRefinedSchema(schema) {
|
|
47
|
+
return schema
|
|
48
|
+
.refine(opts => [opts.url, opts.id].filter(o => o !== undefined).length === 1, {
|
|
49
|
+
error: `Specify 'url' or 'id', but not both.`,
|
|
50
|
+
params: {
|
|
51
|
+
customCode: 'optionSet',
|
|
52
|
+
options: ['url', 'id']
|
|
53
|
+
}
|
|
54
|
+
});
|
|
34
55
|
}
|
|
35
56
|
getExcludedOptionsWithUrls() {
|
|
36
57
|
return ['url'];
|
|
@@ -73,55 +94,5 @@ class SpoFileCheckinCommand extends SpoCommand {
|
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
96
|
}
|
|
76
|
-
_SpoFileCheckinCommand_instances = new WeakSet(), _SpoFileCheckinCommand_initTelemetry = function _SpoFileCheckinCommand_initTelemetry() {
|
|
77
|
-
this.telemetry.push((args) => {
|
|
78
|
-
Object.assign(this.telemetryProperties, {
|
|
79
|
-
id: typeof args.options.id !== 'undefined',
|
|
80
|
-
url: typeof args.options.url !== 'undefined',
|
|
81
|
-
type: args.options.type || 'Major',
|
|
82
|
-
comment: typeof args.options.comment !== 'undefined'
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}, _SpoFileCheckinCommand_initOptions = function _SpoFileCheckinCommand_initOptions() {
|
|
86
|
-
this.options.unshift({
|
|
87
|
-
option: '-u, --webUrl <webUrl>'
|
|
88
|
-
}, {
|
|
89
|
-
option: '--url [url]'
|
|
90
|
-
}, {
|
|
91
|
-
option: '-i, --id [id]'
|
|
92
|
-
}, {
|
|
93
|
-
option: '-t, --type [type]',
|
|
94
|
-
autocomplete: ['Minor', 'Major', 'Overwrite']
|
|
95
|
-
}, {
|
|
96
|
-
option: '--comment [comment]'
|
|
97
|
-
});
|
|
98
|
-
}, _SpoFileCheckinCommand_initValidators = function _SpoFileCheckinCommand_initValidators() {
|
|
99
|
-
this.validators.push(async (args) => {
|
|
100
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
101
|
-
if (isValidSharePointUrl !== true) {
|
|
102
|
-
return isValidSharePointUrl;
|
|
103
|
-
}
|
|
104
|
-
if (args.options.id) {
|
|
105
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
106
|
-
return `${args.options.id} is not a valid GUID`;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (args.options.comment && args.options.comment.length > 1023) {
|
|
110
|
-
return 'The length of the comment must be less than 1024 letters';
|
|
111
|
-
}
|
|
112
|
-
if (args.options.type) {
|
|
113
|
-
const allowedValues = ['minor', 'major', 'overwrite'];
|
|
114
|
-
const type = args.options.type.toLowerCase();
|
|
115
|
-
if (allowedValues.indexOf(type) === -1) {
|
|
116
|
-
return 'Wrong type specified. Available values are Minor|Major|Overwrite';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return true;
|
|
120
|
-
});
|
|
121
|
-
}, _SpoFileCheckinCommand_initOptionSets = function _SpoFileCheckinCommand_initOptionSets() {
|
|
122
|
-
this.optionSets.push({ options: ['url', 'id'] });
|
|
123
|
-
}, _SpoFileCheckinCommand_initTypes = function _SpoFileCheckinCommand_initTypes() {
|
|
124
|
-
this.types.string.push('webUrl', 'url', 'id', 'type', 'comment');
|
|
125
|
-
};
|
|
126
97
|
export default new SpoFileCheckinCommand();
|
|
127
98
|
//# sourceMappingURL=file-checkin.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 _SpoFileCheckoutUndoCommand_instances, _SpoFileCheckoutUndoCommand_initTelemetry, _SpoFileCheckoutUndoCommand_initOptions, _SpoFileCheckoutUndoCommand_initValidators, _SpoFileCheckoutUndoCommand_initOptionSets, _SpoFileCheckoutUndoCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { 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
|
+
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
|
+
fileUrl: z.string().optional(),
|
|
18
|
+
fileId: z.guid().optional().alias('i'),
|
|
19
|
+
force: z.boolean().optional().alias('f')
|
|
20
|
+
});
|
|
14
21
|
class SpoFileCheckoutUndoCommand extends SpoCommand {
|
|
15
22
|
get name() {
|
|
16
23
|
return commands.FILE_CHECKOUT_UNDO;
|
|
@@ -18,14 +25,18 @@ class SpoFileCheckoutUndoCommand extends SpoCommand {
|
|
|
18
25
|
get description() {
|
|
19
26
|
return 'Discards a checked out file';
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
30
|
+
}
|
|
31
|
+
getRefinedSchema(schema) {
|
|
32
|
+
return schema
|
|
33
|
+
.refine(opts => [opts.fileId, opts.fileUrl].filter(o => o !== undefined).length === 1, {
|
|
34
|
+
error: `Specify 'fileId' or 'fileUrl', but not both.`,
|
|
35
|
+
params: {
|
|
36
|
+
customCode: 'optionSet',
|
|
37
|
+
options: ['fileId', 'fileUrl']
|
|
38
|
+
}
|
|
39
|
+
});
|
|
29
40
|
}
|
|
30
41
|
async commandAction(logger, args) {
|
|
31
42
|
const undoCheckout = async () => {
|
|
@@ -66,40 +77,5 @@ class SpoFileCheckoutUndoCommand extends SpoCommand {
|
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
|
-
_SpoFileCheckoutUndoCommand_instances = new WeakSet(), _SpoFileCheckoutUndoCommand_initTelemetry = function _SpoFileCheckoutUndoCommand_initTelemetry() {
|
|
70
|
-
this.telemetry.push((args) => {
|
|
71
|
-
Object.assign(this.telemetryProperties, {
|
|
72
|
-
fileId: typeof args.options.fileId !== 'undefined',
|
|
73
|
-
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
74
|
-
force: !!args.options.force
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}, _SpoFileCheckoutUndoCommand_initOptions = function _SpoFileCheckoutUndoCommand_initOptions() {
|
|
78
|
-
this.options.unshift({
|
|
79
|
-
option: '-u, --webUrl <webUrl>'
|
|
80
|
-
}, {
|
|
81
|
-
option: '--fileUrl [fileUrl]'
|
|
82
|
-
}, {
|
|
83
|
-
option: '-i, --fileId [fileId]'
|
|
84
|
-
}, {
|
|
85
|
-
option: '-f, --force'
|
|
86
|
-
});
|
|
87
|
-
}, _SpoFileCheckoutUndoCommand_initValidators = function _SpoFileCheckoutUndoCommand_initValidators() {
|
|
88
|
-
this.validators.push(async (args) => {
|
|
89
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
90
|
-
if (isValidSharePointUrl !== true) {
|
|
91
|
-
return isValidSharePointUrl;
|
|
92
|
-
}
|
|
93
|
-
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
94
|
-
return `${args.options.fileId} is not a valid GUID`;
|
|
95
|
-
}
|
|
96
|
-
return true;
|
|
97
|
-
});
|
|
98
|
-
}, _SpoFileCheckoutUndoCommand_initOptionSets = function _SpoFileCheckoutUndoCommand_initOptionSets() {
|
|
99
|
-
this.optionSets.push({ options: ['fileId', 'fileUrl'] });
|
|
100
|
-
}, _SpoFileCheckoutUndoCommand_initTypes = function _SpoFileCheckoutUndoCommand_initTypes() {
|
|
101
|
-
this.types.string.push('webUrl', 'fileUrl', 'fileId');
|
|
102
|
-
this.types.boolean.push('force');
|
|
103
|
-
};
|
|
104
80
|
export default new SpoFileCheckoutUndoCommand();
|
|
105
81
|
//# sourceMappingURL=file-checkout-undo.js.map
|
|
@@ -1,15 +1,21 @@
|
|
|
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 _SpoFileCheckoutCommand_instances, _SpoFileCheckoutCommand_initTelemetry, _SpoFileCheckoutCommand_initOptions, _SpoFileCheckoutCommand_initValidators, _SpoFileCheckoutCommand_initOptionSets, _SpoFileCheckoutCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
url: z.string().optional(),
|
|
17
|
+
id: z.guid().optional().alias('i')
|
|
18
|
+
});
|
|
13
19
|
class SpoFileCheckoutCommand extends SpoCommand {
|
|
14
20
|
get name() {
|
|
15
21
|
return commands.FILE_CHECKOUT;
|
|
@@ -17,14 +23,18 @@ class SpoFileCheckoutCommand extends SpoCommand {
|
|
|
17
23
|
get description() {
|
|
18
24
|
return 'Checks out specified file';
|
|
19
25
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
28
|
+
}
|
|
29
|
+
getRefinedSchema(schema) {
|
|
30
|
+
return schema
|
|
31
|
+
.refine(opts => [opts.id, opts.url].filter(o => o !== undefined).length === 1, {
|
|
32
|
+
error: `Specify 'id' or 'url', but not both.`,
|
|
33
|
+
params: {
|
|
34
|
+
customCode: 'optionSet',
|
|
35
|
+
options: ['id', 'url']
|
|
36
|
+
}
|
|
37
|
+
});
|
|
28
38
|
}
|
|
29
39
|
getExcludedOptionsWithUrls() {
|
|
30
40
|
return ['url'];
|
|
@@ -53,38 +63,5 @@ class SpoFileCheckoutCommand extends SpoCommand {
|
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
}
|
|
56
|
-
_SpoFileCheckoutCommand_instances = new WeakSet(), _SpoFileCheckoutCommand_initTelemetry = function _SpoFileCheckoutCommand_initTelemetry() {
|
|
57
|
-
this.telemetry.push((args) => {
|
|
58
|
-
Object.assign(this.telemetryProperties, {
|
|
59
|
-
id: typeof args.options.id !== 'undefined',
|
|
60
|
-
url: typeof args.options.url !== 'undefined'
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}, _SpoFileCheckoutCommand_initOptions = function _SpoFileCheckoutCommand_initOptions() {
|
|
64
|
-
this.options.unshift({
|
|
65
|
-
option: '-u, --webUrl <webUrl>'
|
|
66
|
-
}, {
|
|
67
|
-
option: '--url [url]'
|
|
68
|
-
}, {
|
|
69
|
-
option: '-i, --id [id]'
|
|
70
|
-
});
|
|
71
|
-
}, _SpoFileCheckoutCommand_initValidators = function _SpoFileCheckoutCommand_initValidators() {
|
|
72
|
-
this.validators.push(async (args) => {
|
|
73
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
74
|
-
if (isValidSharePointUrl !== true) {
|
|
75
|
-
return isValidSharePointUrl;
|
|
76
|
-
}
|
|
77
|
-
if (args.options.id) {
|
|
78
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
79
|
-
return `${args.options.id} is not a valid GUID`;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
});
|
|
84
|
-
}, _SpoFileCheckoutCommand_initOptionSets = function _SpoFileCheckoutCommand_initOptionSets() {
|
|
85
|
-
this.optionSets.push({ options: ['id', 'url'] });
|
|
86
|
-
}, _SpoFileCheckoutCommand_initTypes = function _SpoFileCheckoutCommand_initTypes() {
|
|
87
|
-
this.types.string.push('webUrl', 'url', 'id');
|
|
88
|
-
};
|
|
89
66
|
export default new SpoFileCheckoutCommand();
|
|
90
67
|
//# sourceMappingURL=file-checkout.js.map
|