@pnp/cli-microsoft365 6.1.0 → 6.2.0-beta.329fd79

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.
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ 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");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _PurviewRetentionLabelGetCommand_instances, _PurviewRetentionLabelGetCommand_initOptions, _PurviewRetentionLabelGetCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const GraphCommand_1 = require("../../../base/GraphCommand");
19
+ const commands_1 = require("../../commands");
20
+ const request_1 = require("../../../../request");
21
+ const validation_1 = require("../../../../utils/validation");
22
+ class PurviewRetentionLabelGetCommand extends GraphCommand_1.default {
23
+ get name() {
24
+ return commands_1.default.RETENTIONLABEL_GET;
25
+ }
26
+ get description() {
27
+ return 'Retrieve the specified retention label';
28
+ }
29
+ constructor() {
30
+ super();
31
+ _PurviewRetentionLabelGetCommand_instances.add(this);
32
+ __classPrivateFieldGet(this, _PurviewRetentionLabelGetCommand_instances, "m", _PurviewRetentionLabelGetCommand_initOptions).call(this);
33
+ __classPrivateFieldGet(this, _PurviewRetentionLabelGetCommand_instances, "m", _PurviewRetentionLabelGetCommand_initValidators).call(this);
34
+ }
35
+ commandAction(logger, args) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ try {
38
+ if (this.verbose) {
39
+ logger.logToStderr(`Retrieving retention label with id ${args.options.id}`);
40
+ }
41
+ const requestOptions = {
42
+ url: `${this.resource}/beta/security/labels/retentionLabels/${args.options.id}`,
43
+ headers: {
44
+ accept: 'application/json;odata.metadata=none'
45
+ },
46
+ responseType: 'json'
47
+ };
48
+ const res = yield request_1.default.get(requestOptions);
49
+ logger.log(res);
50
+ }
51
+ catch (err) {
52
+ this.handleRejectedODataJsonPromise(err);
53
+ }
54
+ });
55
+ }
56
+ }
57
+ _PurviewRetentionLabelGetCommand_instances = new WeakSet(), _PurviewRetentionLabelGetCommand_initOptions = function _PurviewRetentionLabelGetCommand_initOptions() {
58
+ this.options.unshift({
59
+ option: '-i, --id <id>'
60
+ });
61
+ }, _PurviewRetentionLabelGetCommand_initValidators = function _PurviewRetentionLabelGetCommand_initValidators() {
62
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
63
+ if (!validation_1.validation.isValidGuid(args.options.id)) {
64
+ return `'${args.options.id}' is not a valid GUID.`;
65
+ }
66
+ return true;
67
+ }));
68
+ };
69
+ module.exports = new PurviewRetentionLabelGetCommand();
70
+ //# sourceMappingURL=retentionlabel-get.js.map
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const prefix = 'purview';
4
4
  exports.default = {
5
+ RETENTIONLABEL_GET: `${prefix} retentionlabel get`,
5
6
  RETENTIONLABEL_LIST: `${prefix} retentionlabel list`,
6
7
  RETENTIONLABEL_REMOVE: `${prefix} retentionlabel remove`,
7
8
  RETENTIONLABEL_SET: `${prefix} retentionlabel set`
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ 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");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _SpoListItemRecordLockCommand_instances, _SpoListItemRecordLockCommand_initTelemetry, _SpoListItemRecordLockCommand_initOptions, _SpoListItemRecordLockCommand_initValidators, _SpoListItemRecordLockCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const formatting_1 = require("../../../../utils/formatting");
20
+ const urlUtil_1 = require("../../../../utils/urlUtil");
21
+ const validation_1 = require("../../../../utils/validation");
22
+ const SpoCommand_1 = require("../../../base/SpoCommand");
23
+ const commands_1 = require("../../commands");
24
+ class SpoListItemRecordLockCommand extends SpoCommand_1.default {
25
+ get name() {
26
+ return commands_1.default.LISTITEM_RECORD_LOCK;
27
+ }
28
+ get description() {
29
+ return 'Locks the list item record';
30
+ }
31
+ constructor() {
32
+ super();
33
+ _SpoListItemRecordLockCommand_instances.add(this);
34
+ __classPrivateFieldGet(this, _SpoListItemRecordLockCommand_instances, "m", _SpoListItemRecordLockCommand_initTelemetry).call(this);
35
+ __classPrivateFieldGet(this, _SpoListItemRecordLockCommand_instances, "m", _SpoListItemRecordLockCommand_initOptions).call(this);
36
+ __classPrivateFieldGet(this, _SpoListItemRecordLockCommand_instances, "m", _SpoListItemRecordLockCommand_initValidators).call(this);
37
+ __classPrivateFieldGet(this, _SpoListItemRecordLockCommand_instances, "m", _SpoListItemRecordLockCommand_initOptionSets).call(this);
38
+ }
39
+ commandAction(logger, args) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (this.verbose) {
42
+ logger.logToStderr(`Locking the list item record ${args.options.listId || args.options.listTitle || args.options.listUrl} in site at ${args.options.webUrl}...`);
43
+ }
44
+ try {
45
+ let listRestUrl = '';
46
+ let listServerRelativeUrl = '';
47
+ if (args.options.listUrl) {
48
+ const listServerRelativeUrlFromPath = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
49
+ listServerRelativeUrl = listServerRelativeUrlFromPath;
50
+ }
51
+ else {
52
+ if (args.options.listId) {
53
+ listRestUrl = `lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
54
+ }
55
+ else {
56
+ listRestUrl = `lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
57
+ }
58
+ const requestOptions = {
59
+ url: `${args.options.webUrl}/_api/web/${listRestUrl}?$expand=RootFolder&$select=RootFolder`,
60
+ headers: {
61
+ 'accept': 'application/json;odata=nometadata'
62
+ },
63
+ responseType: 'json'
64
+ };
65
+ const listInstance = yield request_1.default.get(requestOptions);
66
+ listServerRelativeUrl = listInstance.RootFolder.ServerRelativeUrl;
67
+ }
68
+ const listAbsoluteUrl = urlUtil_1.urlUtil.getAbsoluteUrl(args.options.webUrl, listServerRelativeUrl);
69
+ const requestUrl = `${args.options.webUrl}/_api/SP.CompliancePolicy.SPPolicyStoreProxy.LockRecordItem()`;
70
+ const requestOptions = {
71
+ url: requestUrl,
72
+ headers: {
73
+ 'accept': 'application/json;odata=nometadata'
74
+ },
75
+ data: {
76
+ listUrl: listAbsoluteUrl,
77
+ itemId: args.options.listItemId
78
+ },
79
+ responseType: 'json'
80
+ };
81
+ yield request_1.default.post(requestOptions);
82
+ }
83
+ catch (err) {
84
+ this.handleRejectedODataJsonPromise(err);
85
+ }
86
+ });
87
+ }
88
+ }
89
+ _SpoListItemRecordLockCommand_instances = new WeakSet(), _SpoListItemRecordLockCommand_initTelemetry = function _SpoListItemRecordLockCommand_initTelemetry() {
90
+ this.telemetry.push((args) => {
91
+ Object.assign(this.telemetryProperties, {
92
+ listId: typeof args.options.listId !== 'undefined',
93
+ listTitle: typeof args.options.listTitle !== 'undefined',
94
+ listUrl: typeof args.options.listUrl !== 'undefined'
95
+ });
96
+ });
97
+ }, _SpoListItemRecordLockCommand_initOptions = function _SpoListItemRecordLockCommand_initOptions() {
98
+ this.options.unshift({
99
+ option: '-u, --webUrl <webUrl>'
100
+ }, {
101
+ option: '--listItemId <listItemId>'
102
+ }, {
103
+ option: '--listId [listId]'
104
+ }, {
105
+ option: '--listTitle [listTitle]'
106
+ }, {
107
+ option: '--listUrl [listUrl]'
108
+ });
109
+ }, _SpoListItemRecordLockCommand_initValidators = function _SpoListItemRecordLockCommand_initValidators() {
110
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
111
+ const id = parseInt(args.options.listItemId);
112
+ if (isNaN(id)) {
113
+ return `${args.options.listItemId} is not a valid list item ID`;
114
+ }
115
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
116
+ if (isValidSharePointUrl !== true) {
117
+ return isValidSharePointUrl;
118
+ }
119
+ if (args.options.listId &&
120
+ !validation_1.validation.isValidGuid(args.options.listId)) {
121
+ return `${args.options.listId} is not a valid GUID`;
122
+ }
123
+ return true;
124
+ }));
125
+ }, _SpoListItemRecordLockCommand_initOptionSets = function _SpoListItemRecordLockCommand_initOptionSets() {
126
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
127
+ };
128
+ module.exports = new SpoListItemRecordLockCommand();
129
+ //# sourceMappingURL=listitem-record-lock.js.map
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ 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");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _SpoListItemRecordUnlockCommand_instances, _SpoListItemRecordUnlockCommand_initTelemetry, _SpoListItemRecordUnlockCommand_initOptions, _SpoListItemRecordUnlockCommand_initValidators, _SpoListItemRecordUnlockCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const formatting_1 = require("../../../../utils/formatting");
20
+ const urlUtil_1 = require("../../../../utils/urlUtil");
21
+ const validation_1 = require("../../../../utils/validation");
22
+ const SpoCommand_1 = require("../../../base/SpoCommand");
23
+ const commands_1 = require("../../commands");
24
+ class SpoListItemRecordUnlockCommand extends SpoCommand_1.default {
25
+ get name() {
26
+ return commands_1.default.LISTITEM_RECORD_UNLOCK;
27
+ }
28
+ get description() {
29
+ return 'Unlocks the list item record';
30
+ }
31
+ constructor() {
32
+ super();
33
+ _SpoListItemRecordUnlockCommand_instances.add(this);
34
+ __classPrivateFieldGet(this, _SpoListItemRecordUnlockCommand_instances, "m", _SpoListItemRecordUnlockCommand_initTelemetry).call(this);
35
+ __classPrivateFieldGet(this, _SpoListItemRecordUnlockCommand_instances, "m", _SpoListItemRecordUnlockCommand_initOptions).call(this);
36
+ __classPrivateFieldGet(this, _SpoListItemRecordUnlockCommand_instances, "m", _SpoListItemRecordUnlockCommand_initValidators).call(this);
37
+ __classPrivateFieldGet(this, _SpoListItemRecordUnlockCommand_instances, "m", _SpoListItemRecordUnlockCommand_initOptionSets).call(this);
38
+ }
39
+ commandAction(logger, args) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (this.verbose) {
42
+ logger.logToStderr(`Unlocking the list item record ${args.options.listId || args.options.listTitle || args.options.listUrl} in site at ${args.options.webUrl}...`);
43
+ }
44
+ try {
45
+ let listRestUrl = '';
46
+ let listServerRelativeUrl = '';
47
+ if (args.options.listUrl) {
48
+ const listServerRelativeUrlFromPath = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
49
+ listServerRelativeUrl = listServerRelativeUrlFromPath;
50
+ }
51
+ else {
52
+ if (args.options.listId) {
53
+ listRestUrl = `lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')/`;
54
+ }
55
+ else {
56
+ listRestUrl = `lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')/`;
57
+ }
58
+ const requestOptions = {
59
+ url: `${args.options.webUrl}/_api/web/${listRestUrl}?$expand=RootFolder&$select=RootFolder`,
60
+ headers: {
61
+ 'accept': 'application/json;odata=nometadata'
62
+ },
63
+ responseType: 'json'
64
+ };
65
+ const listInstance = yield request_1.default.get(requestOptions);
66
+ listServerRelativeUrl = listInstance.RootFolder.ServerRelativeUrl;
67
+ }
68
+ const listAbsoluteUrl = urlUtil_1.urlUtil.getAbsoluteUrl(args.options.webUrl, listServerRelativeUrl);
69
+ const requestUrl = `${args.options.webUrl}/_api/SP.CompliancePolicy.SPPolicyStoreProxy.UnlockRecordItem()`;
70
+ const requestOptions = {
71
+ url: requestUrl,
72
+ headers: {
73
+ 'accept': 'application/json;odata=nometadata'
74
+ },
75
+ data: {
76
+ listUrl: listAbsoluteUrl,
77
+ itemId: args.options.listItemId
78
+ },
79
+ responseType: 'json'
80
+ };
81
+ yield request_1.default.post(requestOptions);
82
+ }
83
+ catch (err) {
84
+ this.handleRejectedODataJsonPromise(err);
85
+ }
86
+ });
87
+ }
88
+ }
89
+ _SpoListItemRecordUnlockCommand_instances = new WeakSet(), _SpoListItemRecordUnlockCommand_initTelemetry = function _SpoListItemRecordUnlockCommand_initTelemetry() {
90
+ this.telemetry.push((args) => {
91
+ Object.assign(this.telemetryProperties, {
92
+ listId: typeof args.options.listId !== 'undefined',
93
+ listTitle: typeof args.options.listTitle !== 'undefined',
94
+ listUrl: typeof args.options.listUrl !== 'undefined'
95
+ });
96
+ });
97
+ }, _SpoListItemRecordUnlockCommand_initOptions = function _SpoListItemRecordUnlockCommand_initOptions() {
98
+ this.options.unshift({
99
+ option: '-u, --webUrl <webUrl>'
100
+ }, {
101
+ option: '--listItemId <listItemId>'
102
+ }, {
103
+ option: '--listId [listId]'
104
+ }, {
105
+ option: '--listTitle [listTitle]'
106
+ }, {
107
+ option: '--listUrl [listUrl]'
108
+ });
109
+ }, _SpoListItemRecordUnlockCommand_initValidators = function _SpoListItemRecordUnlockCommand_initValidators() {
110
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
111
+ const id = parseInt(args.options.listItemId);
112
+ if (isNaN(id)) {
113
+ return `${args.options.listItemId} is not a valid list item ID`;
114
+ }
115
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
116
+ if (isValidSharePointUrl !== true) {
117
+ return isValidSharePointUrl;
118
+ }
119
+ if (args.options.listId &&
120
+ !validation_1.validation.isValidGuid(args.options.listId)) {
121
+ return `${args.options.listId} is not a valid GUID`;
122
+ }
123
+ return true;
124
+ }));
125
+ }, _SpoListItemRecordUnlockCommand_initOptionSets = function _SpoListItemRecordUnlockCommand_initOptionSets() {
126
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
127
+ };
128
+ module.exports = new SpoListItemRecordUnlockCommand();
129
+ //# sourceMappingURL=listitem-record-unlock.js.map
@@ -143,7 +143,9 @@ exports.default = {
143
143
  LISTITEM_ISRECORD: `${prefix} listitem isrecord`,
144
144
  LISTITEM_LIST: `${prefix} listitem list`,
145
145
  LISTITEM_RECORD_DECLARE: `${prefix} listitem record declare`,
146
+ LISTITEM_RECORD_LOCK: `${prefix} listitem record lock`,
146
147
  LISTITEM_RECORD_UNDECLARE: `${prefix} listitem record undeclare`,
148
+ LISTITEM_RECORD_UNLOCK: `${prefix} listitem record unlock`,
147
149
  LISTITEM_REMOVE: `${prefix} listitem remove`,
148
150
  LISTITEM_RETENTIONLABEL_REMOVE: `${prefix} listitem retentionlabel remove`,
149
151
  LISTITEM_ROLEASSIGNMENT_ADD: `${prefix} listitem roleassignment add`,
@@ -0,0 +1,95 @@
1
+ # purview retentionlabel get
2
+
3
+ Get a retention label
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 purview retentionlabel get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id <id>`
14
+ : The Id of the retention label.
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Get a retention label
21
+
22
+ ```sh
23
+ m365 purview retentionlabel get --id c37d695e-d581-4ae9-82a0-9364eba4291e
24
+ ```
25
+
26
+ ## Remarks
27
+
28
+ !!! attention
29
+ This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reached general availability.
30
+
31
+ ## Response
32
+
33
+
34
+ === "JSON"
35
+
36
+ ```json
37
+ {
38
+ "displayName": "TEST LABEL",
39
+ "descriptionForAdmins": "",
40
+ "descriptionForUsers": "",
41
+ "isInUse": false,
42
+ "retentionTrigger": "dateCreated",
43
+ "behaviorDuringRetentionPeriod": "retain",
44
+ "actionAfterRetentionPeriod": "delete",
45
+ "createdDateTime": "2022-12-12T15:14:53Z",
46
+ "lastModifiedDateTime": "2022-12-12T15:43:06Z",
47
+ "labelToBeApplied": "",
48
+ "defaultRecordBehavior": "startLocked",
49
+ "id": "5c8af2e2-b489-4fa0-9c16-180180245ac8",
50
+ "retentionDuration": {
51
+ "days": 100
52
+ },
53
+ "createdBy": {
54
+ "user": {
55
+ "id": null,
56
+ "displayName": "John Doe"
57
+ }
58
+ },
59
+ "lastModifiedBy": {
60
+ "user": {
61
+ "id": null,
62
+ "displayName": "John Doe"
63
+ }
64
+ },
65
+ "dispositionReviewStages": []
66
+ }
67
+ ```
68
+
69
+ === "Text"
70
+
71
+ ```text
72
+ actionAfterRetentionPeriod : delete
73
+ behaviorDuringRetentionPeriod: retain
74
+ createdBy : {"user":{"id":null,"displayName":"John Doe"}}
75
+ createdDateTime : 2022-12-12T15:14:53Z
76
+ defaultRecordBehavior : startLocked
77
+ descriptionForAdmins :
78
+ descriptionForUsers :
79
+ displayName : TEST LABEL
80
+ dispositionReviewStages : []
81
+ id : 5c8af2e2-b489-4fa0-9c16-180180245ac8
82
+ isInUse : false
83
+ labelToBeApplied :
84
+ lastModifiedBy : {"user":{"id":null,"displayName":"John Doe"}}
85
+ lastModifiedDateTime : 2022-12-12T15:43:06Z
86
+ retentionDuration : {"days":100}
87
+ retentionTrigger : dateCreated
88
+ ```
89
+
90
+ === "CSV"
91
+
92
+ ```csv
93
+ displayName,descriptionForAdmins,descriptionForUsers,isInUse,retentionTrigger,behaviorDuringRetentionPeriod,actionAfterRetentionPeriod,createdDateTime,lastModifiedDateTime,labelToBeApplied,defaultRecordBehavior,id,retentionDuration,createdBy,lastModifiedBy,dispositionReviewStages
94
+ TEST LABEL,,,,dateCreated,retain,delete,2022-12-12T15:14:53Z,2022-12-12T15:43:06Z,,startLocked,5c8af2e2-b489-4fa0-9c16-180180245ac8,"{""days"":100}","{""user"":{""id"":null,""displayName"":""John Doe""}}","{""user"":{""id"":null,""displayName"":""John Doe""}}",[]
95
+ ```
@@ -0,0 +1,52 @@
1
+ # spo listitem record lock
2
+
3
+ Locks the list item record
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo listitem record lock [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : The url of the web
15
+
16
+ `--listItemId <listItemId>`
17
+ : ID of the list item that should be locked
18
+
19
+ `--listId [listId]`
20
+ : ID of the list. Specify either `listTitle`, `listId` or `listUrl`
21
+
22
+ `--listTitle [listTitle]`
23
+ : Title of the list. Specify either `listTitle`, `listId` or `listUrl`
24
+
25
+ `--listUrl [listUrl]`
26
+ : Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl`
27
+
28
+ --8<-- "docs/cmd/_global.md"
29
+
30
+ ## Examples
31
+
32
+ Locks the list item record in a given site based on the list id
33
+
34
+ ```sh
35
+ m365 spo listitem record lock --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --listItemId 1
36
+ ```
37
+
38
+ Locks the list item record in a given site based on the list title
39
+
40
+ ```sh
41
+ m365 spo listitem record lock --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle 'List 1' --listItemId 1
42
+ ```
43
+
44
+ Locks the list item record in a given site based on the server relative list url
45
+
46
+ ```sh
47
+ m365 spo listitem record lock --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl /sites/project-x/lists/TestList --listItemId 1
48
+ ```
49
+
50
+ ## Response
51
+
52
+ The command won't return a response on success.
@@ -0,0 +1,52 @@
1
+ # spo listitem record unlock
2
+
3
+ Unlocks the list item record
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo listitem record unlock [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : The url of the web
15
+
16
+ `--listItemId <listItemId>`
17
+ : ID of the list item that should be unlocked
18
+
19
+ `--listId [listId]`
20
+ : ID of the list. Specify either `listTitle`, `listId` or `listUrl`
21
+
22
+ `--listTitle [listTitle]`
23
+ : Title of the list. Specify either `listTitle`, `listId` or `listUrl`
24
+
25
+ `--listUrl [listUrl]`
26
+ : Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl`
27
+
28
+ --8<-- "docs/cmd/_global.md"
29
+
30
+ ## Examples
31
+
32
+ Unlocks the list item record in a given site based on the list id
33
+
34
+ ```sh
35
+ m365 spo listitem record unlock --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --listItemId 1
36
+ ```
37
+
38
+ Unlocks the list item record in a given site based on the list title
39
+
40
+ ```sh
41
+ m365 spo listitem record unlock --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle 'List 1' --listItemId 1
42
+ ```
43
+
44
+ Unlocks the list item record in a given site based on the server relative list url
45
+
46
+ ```sh
47
+ m365 spo listitem record unlock --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl /sites/project-x/lists/TestList --listItemId 1
48
+ ```
49
+
50
+ ## Response
51
+
52
+ The command won't return a response on success.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@pnp/cli-microsoft365",
9
- "version": "6.1.0",
9
+ "version": "6.2.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@azure/msal-node": "^1.14.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.1.0",
3
+ "version": "6.2.0-beta.329fd79",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -271,4 +271,4 @@
271
271
  "sinon": "^14.0.2",
272
272
  "source-map-support": "^0.5.21"
273
273
  }
274
- }
274
+ }