@pnp/cli-microsoft365 6.4.0-beta.3946b02 → 6.4.0-beta.a194ba2

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.
@@ -77,14 +77,26 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
77
77
  }
78
78
  return customAction;
79
79
  }
80
- const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
81
- if (customActions.length === 1) {
82
- return customActions[0];
80
+ else if (options.title) {
81
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
82
+ if (customActions.length === 1) {
83
+ return customActions[0];
84
+ }
85
+ if (customActions.length === 0) {
86
+ throw `No user custom action with title '${options.title}' found`;
87
+ }
88
+ throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
83
89
  }
84
- if (customActions.length === 0) {
85
- throw `No user custom action with title '${options.title}' found`;
90
+ else {
91
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `ClientSideComponentId eq guid'${options.clientSideComponentId}'`);
92
+ if (customActions.length === 0) {
93
+ throw `No user custom action with ClientSideComponentId '${options.clientSideComponentId}' found`;
94
+ }
95
+ if (customActions.length > 1) {
96
+ throw `Multiple user custom actions with ClientSideComponentId '${options.clientSideComponentId}' found. Please disambiguate using IDs: ${customActions.map((customAction) => customAction.Id).join(', ')}`;
97
+ }
98
+ return customActions[0];
86
99
  }
87
- throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
88
100
  });
89
101
  }
90
102
  humanizeScope(scope) {
@@ -100,6 +112,9 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
100
112
  _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand_initTelemetry = function _SpoCustomActionGetCommand_initTelemetry() {
101
113
  this.telemetry.push((args) => {
102
114
  Object.assign(this.telemetryProperties, {
115
+ id: typeof args.options.id !== 'undefined',
116
+ title: typeof args.options.title !== 'undefined',
117
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
103
118
  scope: args.options.scope || 'All'
104
119
  });
105
120
  });
@@ -108,6 +123,8 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
108
123
  option: '-i, --id [id]'
109
124
  }, {
110
125
  option: '-t, --title [title]'
126
+ }, {
127
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
111
128
  }, {
112
129
  option: '-u, --webUrl <webUrl>'
113
130
  }, {
@@ -130,10 +147,13 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
130
147
  return `${args.options.scope} is not a valid custom action scope. Allowed values are Site|Web|All`;
131
148
  }
132
149
  }
150
+ if (args.options.clientSideComponentId && validation_1.validation.isValidGuid(args.options.clientSideComponentId) === false) {
151
+ return `${args.options.clientSideComponentId} is not a valid GUID.`;
152
+ }
133
153
  return true;
134
154
  }));
135
155
  }, _SpoCustomActionGetCommand_initOptionSets = function _SpoCustomActionGetCommand_initOptionSets() {
136
- this.optionSets.push({ options: ['id', 'title'] });
156
+ this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
137
157
  };
138
158
  module.exports = new SpoCustomActionGetCommand();
139
159
  //# sourceMappingURL=customaction-get.js.map
@@ -11,10 +11,13 @@ m365 spo customaction get [options]
11
11
  ## Options
12
12
 
13
13
  `-i, --id [id]`
14
- : ID of the user custom action to retrieve information for. Specify either `id` or `title`
14
+ : ID of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
15
15
 
16
16
  `-t, --title [title]`
17
- : Title of the user custom action to retrieve information for. Specify either `id` or `title`
17
+ : Title of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
18
+
19
+ `-c, --clientSideComponentId [clientSideComponentId]`
20
+ : clientSideComponentId of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
18
21
 
19
22
  `-u, --webUrl <webUrl>`
20
23
  : Url of the site or site collection to retrieve the custom action from
@@ -26,34 +29,133 @@ m365 spo customaction get [options]
26
29
 
27
30
  ## Remarks
28
31
 
29
- If the command finds multiple user custom actions with the specified title, it will prompt you to disambiguate which user custom action it should use, listing the discovered IDs.
32
+ If the command finds multiple user custom actions with the specified `title` or `clientSideComponentId`, it will prompt you to disambiguate which user custom action it should get, listing the discovered IDs.
30
33
 
31
34
  ## Examples
32
35
 
33
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
36
+ Return details about the user custom action based on the id and a given url
34
37
 
35
38
  ```sh
36
39
  m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test
37
40
  ```
38
41
 
39
- Return details about the user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
42
+ Return details about the user custom action based on the title and a given url
40
43
 
41
44
  ```sh
42
45
  m365 spo customaction get --title "YourAppCustomizer" --webUrl https://contoso.sharepoint.com/sites/test
43
46
  ```
44
47
 
45
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site collection _https://contoso.sharepoint.com/sites/test_
48
+ Return details about the user custom action based on the clientSideComponentId and a given url
49
+
50
+ ```sh
51
+ m365 spo customaction get --clientSideComponentId "34a019f9-6198-4053-a3b6-fbdea9a107fd" --webUrl https://contoso.sharepoint.com/sites/test
52
+ ```
53
+
54
+ Return details about the user custom action based on the id and a given url and the scope
46
55
 
47
56
  ```sh
48
- m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --scope Site
57
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Site
49
58
  ```
50
59
 
51
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site _https://contoso.sharepoint.com/sites/test_
60
+ Return details about the user custom action based on the id and a given url and the scope
52
61
 
53
62
  ```sh
54
- m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --scope Web
63
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Web
55
64
  ```
56
65
 
57
- ## More information
66
+ Return details about the user custom action based on the id and a given url and the scope
67
+
68
+ ```sh
69
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Web
70
+ ```
58
71
 
59
- - UserCustomAction REST API resources: [https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction](https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction)
72
+ ## Response
73
+
74
+ === "JSON"
75
+
76
+ ```json
77
+ {
78
+ "ClientSideComponentId": "34a019f9-6198-4053-a3b6-fbdea9a107fd",
79
+ "ClientSideComponentProperties": "{\"sampleTextOne\":\"One item is selected in the list.\", \"sampleTextTwo\":\"This command is always visible.\"}",
80
+ "CommandUIExtension": null,
81
+ "Description": null,
82
+ "Group": null,
83
+ "Id": "158cb0d1-8703-4a36-866d-84aed8233bd3",
84
+ "ImageUrl": null,
85
+ "Location": "ClientSideExtension.ListViewCommandSet.CommandBar",
86
+ "Name": "{158cb0d1-8703-4a36-866d-84aed8233bd3}",
87
+ "RegistrationId": "100",
88
+ "RegistrationType": 1,
89
+ "Rights": "{\"High\":0,\"Low\":0}",
90
+ "Scope": "Web",
91
+ "ScriptBlock": null,
92
+ "ScriptSrc": null,
93
+ "Sequence": 65536,
94
+ "Title": "ExtensionTraining",
95
+ "Url": null,
96
+ "VersionOfUserCustomAction": "1.0.1.0"
97
+ }
98
+ ```
99
+
100
+ === "Text"
101
+
102
+ ```text
103
+ ClientSideComponentId : 34a019f9-6198-4053-a3b6-fbdea9a107fd
104
+ ClientSideComponentProperties: {"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}
105
+ CommandUIExtension : null
106
+ Description : null
107
+ Group : null
108
+ Id : 158cb0d1-8703-4a36-866d-84aed8233bd3
109
+ ImageUrl : null
110
+ Location : ClientSideExtension.ListViewCommandSet.CommandBar
111
+ Name : {158cb0d1-8703-4a36-866d-84aed8233bd3}
112
+ RegistrationId : 100
113
+ RegistrationType : 1
114
+ Rights : {"High":0,"Low":0}
115
+ Scope : Web
116
+ ScriptBlock : null
117
+ ScriptSrc : null
118
+ Sequence : 65536
119
+ Title : ExtensionTraining
120
+ Url : null
121
+ VersionOfUserCustomAction : 1.0.1.0
122
+ ```
123
+
124
+ === "CSV"
125
+
126
+ ```csv
127
+ ClientSideComponentId,ClientSideComponentProperties,CommandUIExtension,Description,Group,Id,ImageUrl,Location,Name,RegistrationId,RegistrationType,Rights,Scope,ScriptBlock,ScriptSrc,Sequence,Title,Url,VersionOfUserCustomAction
128
+ 34a019f9-6198-4053-a3b6-fbdea9a107fd,"{""sampleTextOne"":""One item is selected in the list."", ""sampleTextTwo"":""This command is always visible.""}",,,,158cb0d1-8703-4a36-866d-84aed8233bd3,,ClientSideExtension.ListViewCommandSet.CommandBar,{158cb0d1-8703-4a36-866d-84aed8233bd3},100,1,"{""High"":0,""Low"":0}",Web,,,65536,ExtensionTraining,,1.0.1.0
129
+ ```
130
+
131
+ === "Markdown"
132
+
133
+ ```md
134
+ # spo customaction get --webUrl "https://contoso.sharepoint.com" --clientSideComponentId "34a019f9-6198-4053-a3b6-fbdea9a107fd" --scope "Web"
135
+
136
+ Date: 27/1/2023
137
+
138
+ ## ExtensionTraining (158cb0d1-8703-4a36-866d-84aed8233bd3)
139
+
140
+ Property | Value
141
+ ---------|-------
142
+ ClientSideComponentId | 34a019f9-6198-4053-a3b6-fbdea9a107fd
143
+ ClientSideComponentProperties | {"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}
144
+ CommandUIExtension | null
145
+ Description | null
146
+ Group | null
147
+ Id | 158cb0d1-8703-4a36-866d-84aed8233bd3
148
+ ImageUrl | null
149
+ Location | ClientSideExtension.ListViewCommandSet.CommandBar
150
+ Name | {158cb0d1-8703-4a36-866d-84aed8233bd3}
151
+ RegistrationId | 100
152
+ RegistrationType | 1
153
+ Rights | {"High":0,"Low":0}
154
+ Scope | Web
155
+ ScriptBlock | null
156
+ ScriptSrc | null
157
+ Sequence | 65536
158
+ Title | ExtensionTraining
159
+ Url | null
160
+ VersionOfUserCustomAction | 1.0.1.0
161
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.4.0-beta.3946b02",
3
+ "version": "6.4.0-beta.a194ba2",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",