@pnp/cli-microsoft365 5.4.0-beta.694dbc5 → 5.4.0-beta.d1a3a17

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.
@@ -1,18 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../../../../utils");
3
+ const Auth_1 = require("../../../../Auth");
4
4
  const request_1 = require("../../../../request");
5
- const utils_2 = require("../../../../utils");
5
+ const utils_1 = require("../../../../utils");
6
6
  const planner_1 = require("../../../../utils/planner");
7
7
  const GraphCommand_1 = require("../../../base/GraphCommand");
8
8
  const commands_1 = require("../../commands");
9
- const Auth_1 = require("../../../../Auth");
10
9
  class PlannerTaskGetCommand extends GraphCommand_1.default {
11
10
  get name() {
12
11
  return commands_1.default.TASK_GET;
13
12
  }
14
13
  get description() {
15
- return 'Retrieve the the specified planner task';
14
+ return 'Retrieve the specified planner task';
15
+ }
16
+ getTelemetryProperties(args) {
17
+ const telemetryProps = super.getTelemetryProperties(args);
18
+ telemetryProps.id = typeof args.options.id !== 'undefined';
19
+ telemetryProps.title = typeof args.options.title !== 'undefined';
20
+ telemetryProps.bucketId = typeof args.options.bucketId !== 'undefined';
21
+ telemetryProps.bucketName = typeof args.options.bucketName !== 'undefined';
22
+ telemetryProps.planId = typeof args.options.planId !== 'undefined';
23
+ telemetryProps.planName = typeof args.options.planName !== 'undefined';
24
+ telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
25
+ telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
26
+ return telemetryProps;
16
27
  }
17
28
  commandAction(logger, args, cb) {
18
29
  if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
@@ -23,7 +34,7 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
23
34
  .getTaskId(args.options)
24
35
  .then(taskId => {
25
36
  const requestOptions = {
26
- url: `${this.resource}/beta/planner/tasks/${encodeURIComponent(taskId)}`,
37
+ url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(taskId)}`,
27
38
  headers: {
28
39
  accept: 'application/json;odata.metadata=none'
29
40
  },
@@ -125,6 +136,11 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
125
136
  return Promise.resolve(groups[0].id);
126
137
  });
127
138
  }
139
+ optionSets() {
140
+ return [
141
+ ['id', 'title']
142
+ ];
143
+ }
128
144
  options() {
129
145
  const options = [
130
146
  { option: '-i, --id [id]' },
@@ -158,7 +174,7 @@ class PlannerTaskGetCommand extends GraphCommand_1.default {
158
174
  if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
159
175
  return 'Specify either ownerGroupId or ownerGroupName when using planName but not both';
160
176
  }
161
- if (args.options.ownerGroupId && !utils_2.validation.isValidGuid(args.options.ownerGroupId)) {
177
+ if (args.options.ownerGroupId && !utils_1.validation.isValidGuid(args.options.ownerGroupId)) {
162
178
  return `${args.options.ownerGroupId} is not a valid GUID`;
163
179
  }
164
180
  return true;
@@ -17,6 +17,7 @@ class SpoListViewAddCommand extends SpoCommand_1.default {
17
17
  telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
18
18
  telemetryProps.listUrl = typeof args.options.listUrl !== 'undefined';
19
19
  telemetryProps.title = typeof args.options.title !== 'undefined';
20
+ telemetryProps.viewQuery = typeof args.options.viewQuery !== 'undefined';
20
21
  telemetryProps.personal = !!args.options.personal;
21
22
  telemetryProps.default = !!args.options.default;
22
23
  telemetryProps.orderedView = !!args.options.orderedView;
@@ -38,6 +39,7 @@ class SpoListViewAddCommand extends SpoCommand_1.default {
38
39
  ViewFields: {
39
40
  results: args.options.fields.split(',')
40
41
  },
42
+ Query: args.options.viewQuery,
41
43
  PersonalView: !!args.options.personal,
42
44
  SetAsDefaultView: !!args.options.default,
43
45
  Paged: !!args.options.paged,
@@ -79,6 +81,7 @@ class SpoListViewAddCommand extends SpoCommand_1.default {
79
81
  { option: '--listUrl [listUrl]' },
80
82
  { option: '--title <title>' },
81
83
  { option: '--fields <fields>' },
84
+ { option: '--viewQuery [viewQuery]' },
82
85
  { option: '--personal' },
83
86
  { option: '--default' },
84
87
  { option: '--paged' },
@@ -1,6 +1,6 @@
1
1
  # planner task get
2
2
 
3
- Retrieve the the specified planner task
3
+ Retrieve the specified planner task
4
4
 
5
5
  ## Usage
6
6
 
@@ -36,20 +36,15 @@ m365 planner task get [options]
36
36
 
37
37
  --8<-- "docs/cmd/_global.md"
38
38
 
39
- ## Remarks
40
-
41
- !!! attention
42
- This command uses an API that is currently in preview to enrich the results with the `priority` field. Keep in mind that this preview API is subject to change once the API reached general availability.
43
-
44
39
  ## Examples
45
40
 
46
- Retrieve the the specified planner task by id.
41
+ Retrieve the specified planner task by id
47
42
 
48
43
  ```sh
49
- m365 planner task get --id 'vzCcZoOv-U27PwydxHB8opcADJo-'
44
+ m365 planner task get --id "vzCcZoOv-U27PwydxHB8opcADJo-"
50
45
  ```
51
46
 
52
- Retrieve the the specified planner task with the title _My Planner Task_ from the bucket named _My Planner Bucket_. Based on the plan with the name _My Planner Plan_ owned by the group _My Planner Group_.
47
+ Retrieve the specified planner task with the title _My Planner Task_ from the bucket named _My Planner Bucket_ based on the plan with the name _My Planner Plan_ owned by the group _My Planner Group_
53
48
 
54
49
  ```sh
55
50
  m365 planner task get --title "My Planner Task" --bucketName "My Planner Bucket" --planName "My Planner Plan" --ownerGroupName "My Planner Group"
@@ -26,7 +26,10 @@ m365 spo list view add [options]
26
26
  : Title of the view to be created for the list.
27
27
 
28
28
  `--fields <fields>`
29
- : Comma-separated list of **case-sensitive** internal names of the fields to add to the view.
29
+ : Comma-separated list of **case-sensitive** internal names of the fields to add to the view.
30
+
31
+ `--viewQuery [viewQuery]`
32
+ : XML representation of the list query for the underlying view.
30
33
 
31
34
  `--personal`
32
35
  : View will be created as personal view, if specified.
@@ -51,17 +54,23 @@ We recommend using the `paged` option. When specified, the view supports display
51
54
  Add a view called _All events_ to a list with specific title.
52
55
 
53
56
  ```sh
54
- spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "My List" --title "All events" --fields "FieldName1,FieldName2,Created,Author,Modified,Editor" --paged
57
+ m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "My List" --title "All events" --fields "FieldName1,FieldName2,Created,Author,Modified,Editor" --paged
55
58
  ```
56
59
 
57
60
  Add a view as default view with title _All events_ to a list with a specific URL.
58
61
 
59
62
  ```sh
60
- spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl "/Lists/MyList" --title "All events" --fields "FieldName1,Created" --paged --default
63
+ m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl "/Lists/MyList" --title "All events" --fields "FieldName1,Created" --paged --default
61
64
  ```
62
65
 
63
66
  Add a personal view called _All events_ to a list with a specific ID.
64
67
 
65
68
  ```sh
66
- spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listId 00000000-0000-0000-0000-000000000000 --title "All events" --fields "FieldName1,Created" --paged --personal
69
+ m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listId 00000000-0000-0000-0000-000000000000 --title "All events" --fields "FieldName1,Created" --paged --personal
70
+ ```
71
+
72
+ Add a view called _All events_ with defined filter and sorting.
73
+
74
+ ```sh
75
+ m365 spo list view add --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "My List" --title "All events" --fields "FieldName1" --viewQuery "<OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='TextFieldName' /><Value Type='Text'>Field value</Value></Eq></Where>" --paged
67
76
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.4.0-beta.694dbc5",
3
+ "version": "5.4.0-beta.d1a3a17",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",