@pnp/cli-microsoft365 8.0.0-beta.e6f9331 → 8.1.0-beta.3bc5759

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.
Files changed (60) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Auth.js +9 -17
  5. package/dist/Command.js +49 -2
  6. package/dist/chili/chili.js +0 -23
  7. package/dist/cli/cli.js +61 -101
  8. package/dist/m365/commands/login.js +44 -96
  9. package/dist/m365/commands/setup.js +0 -4
  10. package/dist/m365/entra/commands/m365group/m365group-set.js +66 -29
  11. package/dist/m365/entra/commands/multitenant/MultitenantOrganization.js +2 -0
  12. package/dist/m365/entra/commands/multitenant/multitenant-get.js +32 -0
  13. package/dist/m365/entra/commands.js +1 -0
  14. package/dist/m365/external/commands/connection/connection-doctor.js +10 -24
  15. package/dist/m365/flow/commands/flow-list.js +2 -1
  16. package/dist/m365/graph/commands/subscription/subscription-add.js +4 -2
  17. package/dist/m365/spe/ContainerTypeProperties.js +2 -0
  18. package/dist/m365/spe/commands/containertype/containertype-list.js +49 -0
  19. package/dist/m365/spe/commands.js +2 -1
  20. package/dist/m365/spfx/commands/project/base-project-command.js +36 -126
  21. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +16 -21
  22. package/dist/m365/spo/commands/commandset/commandset-get.js +31 -17
  23. package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +124 -0
  24. package/dist/m365/spo/commands/field/field-list.js +1 -1
  25. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +2 -3
  26. package/dist/m365/spo/commands/page/page-text-add.js +2 -3
  27. package/dist/m365/spo/commands/spo-search.js +3 -4
  28. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +19 -5
  29. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +20 -6
  30. package/dist/m365/spo/commands.js +1 -0
  31. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +119 -0
  32. package/dist/m365/teams/commands/message/message-remove.js +112 -0
  33. package/dist/m365/teams/commands.js +2 -0
  34. package/dist/m365/viva/commands/engage/engage-community-add.js +166 -0
  35. package/dist/m365/viva/commands.js +1 -0
  36. package/dist/utils/formatting.js +30 -1
  37. package/dist/utils/teams.js +49 -0
  38. package/dist/utils/zod.js +124 -0
  39. package/docs/docs/cmd/entra/m365group/m365group-set.mdx +37 -7
  40. package/docs/docs/cmd/entra/multitenant/multitenant-get.mdx +94 -0
  41. package/docs/docs/cmd/external/connection/connection-doctor.mdx +9 -9
  42. package/docs/docs/cmd/graph/subscription/subscription-add.mdx +18 -0
  43. package/docs/docs/cmd/spe/containertype/containertype-list.mdx +131 -0
  44. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +85 -36
  45. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +18 -24
  46. package/docs/docs/cmd/spo/commandset/commandset-get.mdx +75 -24
  47. package/docs/docs/cmd/spo/commandset/commandset-list.mdx +26 -32
  48. package/docs/docs/cmd/spo/contenttype/contenttype-field-list.mdx +172 -0
  49. package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +3 -3
  50. package/docs/docs/cmd/spo/field/field-list.mdx +3 -3
  51. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.mdx +79 -30
  52. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +20 -19
  53. package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +84 -38
  54. package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +20 -19
  55. package/docs/docs/cmd/teams/meeting/meeting-attendancereport-get.mdx +138 -0
  56. package/docs/docs/cmd/teams/meeting/meeting-list.mdx +7 -3
  57. package/docs/docs/cmd/teams/message/message-remove.mdx +63 -0
  58. package/docs/docs/cmd/viva/engage/engage-community-add.mdx +168 -0
  59. package/npm-shrinkwrap.json +590 -1024
  60. package/package.json +7 -3
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
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
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _SpoApplicationCustomizerGetCommand_instances, _SpoApplicationCustomizerGetCommand_initTelemetry, _SpoApplicationCustomizerGetCommand_initOptions, _SpoApplicationCustomizerGetCommand_initValidators, _SpoApplicationCustomizerGetCommand_initOptionSets;
6
+ var _SpoApplicationCustomizerGetCommand_instances, _SpoApplicationCustomizerGetCommand_initTelemetry, _SpoApplicationCustomizerGetCommand_initOptions, _SpoApplicationCustomizerGetCommand_initValidators, _SpoApplicationCustomizerGetCommand_initOptionSets, _SpoApplicationCustomizerGetCommand_initTypes;
7
7
  import { formatting } from '../../../../utils/formatting.js';
8
8
  import { spo } from '../../../../utils/spo.js';
9
9
  import { validation } from '../../../../utils/validation.js';
@@ -25,33 +25,22 @@ class SpoApplicationCustomizerGetCommand extends SpoCommand {
25
25
  __classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initOptions).call(this);
26
26
  __classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initValidators).call(this);
27
27
  __classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initOptionSets).call(this);
28
+ __classPrivateFieldGet(this, _SpoApplicationCustomizerGetCommand_instances, "m", _SpoApplicationCustomizerGetCommand_initTypes).call(this);
28
29
  }
29
30
  async commandAction(logger, args) {
30
31
  try {
31
32
  const customAction = await this.getCustomAction(args.options);
32
- if (customAction) {
33
+ if (!args.options.clientSideComponentProperties) {
33
34
  await logger.log({
34
- ClientSideComponentId: customAction.ClientSideComponentId,
35
- ClientSideComponentProperties: customAction.ClientSideComponentProperties,
36
- CommandUIExtension: customAction.CommandUIExtension,
37
- Description: customAction.Description,
38
- Group: customAction.Group,
39
- Id: customAction.Id,
40
- ImageUrl: customAction.ImageUrl,
41
- Location: customAction.Location,
42
- Name: customAction.Name,
43
- RegistrationId: customAction.RegistrationId,
44
- RegistrationType: customAction.RegistrationType,
35
+ ...customAction,
45
36
  Rights: JSON.stringify(customAction.Rights),
46
- Scope: this.humanizeScope(customAction.Scope),
47
- ScriptBlock: customAction.ScriptBlock,
48
- ScriptSrc: customAction.ScriptSrc,
49
- Sequence: customAction.Sequence,
50
- Title: customAction.Title,
51
- Url: customAction.Url,
52
- VersionOfUserCustomAction: customAction.VersionOfUserCustomAction
37
+ Scope: this.humanizeScope(customAction.Scope)
53
38
  });
54
39
  }
40
+ else {
41
+ const properties = formatting.tryParseJson(customAction.ClientSideComponentProperties);
42
+ await logger.log(properties);
43
+ }
55
44
  }
56
45
  catch (err) {
57
46
  this.handleRejectedPromise(err);
@@ -95,7 +84,8 @@ _SpoApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoApplicationCu
95
84
  title: typeof args.options.title !== 'undefined',
96
85
  id: typeof args.options.id !== 'undefined',
97
86
  clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
98
- scope: typeof args.options.scope !== 'undefined'
87
+ scope: typeof args.options.scope !== 'undefined',
88
+ clientSideComponentProperties: !!args.options.clientSideComponentProperties
99
89
  });
100
90
  });
101
91
  }, _SpoApplicationCustomizerGetCommand_initOptions = function _SpoApplicationCustomizerGetCommand_initOptions() {
@@ -110,6 +100,8 @@ _SpoApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoApplicationCu
110
100
  }, {
111
101
  option: '-s, --scope [scope]',
112
102
  autocomplete: this.allowedScopes
103
+ }, {
104
+ option: '-p, --clientSideComponentProperties'
113
105
  });
114
106
  }, _SpoApplicationCustomizerGetCommand_initValidators = function _SpoApplicationCustomizerGetCommand_initValidators() {
115
107
  this.validators.push(async (args) => {
@@ -126,6 +118,9 @@ _SpoApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoApplicationCu
126
118
  });
127
119
  }, _SpoApplicationCustomizerGetCommand_initOptionSets = function _SpoApplicationCustomizerGetCommand_initOptionSets() {
128
120
  this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
121
+ }, _SpoApplicationCustomizerGetCommand_initTypes = function _SpoApplicationCustomizerGetCommand_initTypes() {
122
+ this.types.string.push('webUrl', 'title', 'id', 'clientSideComponentId', 'scope');
123
+ this.types.boolean.push('clientSideComponentProperties');
129
124
  };
130
125
  export default new SpoApplicationCustomizerGetCommand();
131
126
  //# sourceMappingURL=applicationcustomizer-get.js.map
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
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
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
6
+ var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets, _SpoCommandSetGetCommand_initTypes;
7
7
  import { formatting } from '../../../../utils/formatting.js';
8
8
  import { spo } from '../../../../utils/spo.js';
9
9
  import { validation } from '../../../../utils/validation.js';
@@ -24,45 +24,53 @@ class SpoCommandSetGetCommand extends SpoCommand {
24
24
  __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptions).call(this);
25
25
  __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initValidators).call(this);
26
26
  __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptionSets).call(this);
27
+ __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initTypes).call(this);
27
28
  }
28
29
  async commandAction(logger, args) {
29
30
  try {
30
31
  if (this.verbose) {
31
- await logger.logToStderr(`Attempt to get a specific commandset by property ${args.options.title || args.options.id || args.options.clientSideComponentId}.`);
32
+ await logger.logToStderr(`Attempt to get a specific Command Set by property ${args.options.title || args.options.id || args.options.clientSideComponentId}.`);
32
33
  }
34
+ let commandSet;
33
35
  if (args.options.id) {
34
- const commandSet = await spo.getCustomActionById(args.options.webUrl, args.options.id, args.options.scope);
35
- if (commandSet === undefined) {
36
+ const customAction = await spo.getCustomActionById(args.options.webUrl, args.options.id, args.options.scope);
37
+ if (customAction === undefined) {
36
38
  throw `Command set with id ${args.options.id} can't be found.`;
37
39
  }
38
- else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === commandSet.Location)) {
40
+ else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === customAction.Location)) {
39
41
  throw `Custom action with id ${args.options.id} is not a command set.`;
40
42
  }
41
- await logger.log(commandSet);
43
+ commandSet = customAction;
42
44
  }
43
45
  else if (args.options.clientSideComponentId) {
44
46
  const filter = `${this.getBaseFilter()} ClientSideComponentId eq guid'${args.options.clientSideComponentId}'`;
45
- const commandSets = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
46
- if (commandSets.length === 0) {
47
+ const customActions = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
48
+ if (customActions.length === 0) {
47
49
  throw `No command set with clientSideComponentId '${args.options.clientSideComponentId}' found.`;
48
50
  }
49
- await logger.log(commandSets[0]);
51
+ commandSet = customActions[0];
50
52
  }
51
53
  else if (args.options.title) {
52
54
  const filter = `${this.getBaseFilter()} Title eq '${formatting.encodeQueryParameter(args.options.title)}'`;
53
- const commandSets = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
54
- if (commandSets.length === 1) {
55
- await logger.log(commandSets[0]);
55
+ const customActions = await spo.getCustomActions(args.options.webUrl, args.options.scope, filter);
56
+ if (customActions.length === 1) {
57
+ commandSet = customActions[0];
56
58
  }
57
- else if (commandSets.length === 0) {
59
+ else if (customActions.length === 0) {
58
60
  throw `No command set with title '${args.options.title}' found.`;
59
61
  }
60
62
  else {
61
- const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', commandSets);
62
- const commandSet = await cli.handleMultipleResultsFound(`Multiple command sets with title '${args.options.title}' found.`, resultAsKeyValuePair);
63
- await logger.log(commandSet);
63
+ const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
64
+ commandSet = await cli.handleMultipleResultsFound(`Multiple command sets with title '${args.options.title}' found.`, resultAsKeyValuePair);
64
65
  }
65
66
  }
67
+ if (!args.options.clientSideComponentProperties) {
68
+ await logger.log(commandSet);
69
+ }
70
+ else {
71
+ const properties = formatting.tryParseJson(commandSet.ClientSideComponentProperties);
72
+ await logger.log(properties);
73
+ }
66
74
  }
67
75
  catch (err) {
68
76
  this.handleRejectedODataJsonPromise(err);
@@ -78,7 +86,8 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
78
86
  title: typeof args.options.title !== 'undefined',
79
87
  id: typeof args.options.id !== 'undefined',
80
88
  clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
81
- scope: typeof args.options.scope !== 'undefined'
89
+ scope: typeof args.options.scope !== 'undefined',
90
+ clientSideComponentProperties: !!args.options.clientSideComponentProperties
82
91
  });
83
92
  });
84
93
  }, _SpoCommandSetGetCommand_initOptions = function _SpoCommandSetGetCommand_initOptions() {
@@ -93,6 +102,8 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
93
102
  }, {
94
103
  option: '-s, --scope [scope]',
95
104
  autocomplete: _a.scopes
105
+ }, {
106
+ option: '-p, --clientSideComponentProperties'
96
107
  });
97
108
  }, _SpoCommandSetGetCommand_initValidators = function _SpoCommandSetGetCommand_initValidators() {
98
109
  this.validators.push(async (args) => {
@@ -109,6 +120,9 @@ _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet()
109
120
  });
110
121
  }, _SpoCommandSetGetCommand_initOptionSets = function _SpoCommandSetGetCommand_initOptionSets() {
111
122
  this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
123
+ }, _SpoCommandSetGetCommand_initTypes = function _SpoCommandSetGetCommand_initTypes() {
124
+ this.types.string.push('webUrl', 'title', 'id', 'clientSideComponentId', 'scope');
125
+ this.types.boolean.push('clientSideComponentProperties');
112
126
  };
113
127
  SpoCommandSetGetCommand.scopes = ['All', 'Site', 'Web'];
114
128
  SpoCommandSetGetCommand.baseLocation = 'ClientSideExtension.ListViewCommandSet';
@@ -0,0 +1,124 @@
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 _SpoContentTypeFieldListCommand_instances, _SpoContentTypeFieldListCommand_initTelemetry, _SpoContentTypeFieldListCommand_initOptions, _SpoContentTypeFieldListCommand_initValidators, _SpoContentTypeFieldListCommand_initTypes, _SpoContentTypeFieldListCommand_initOptionSets;
7
+ import { formatting } from '../../../../utils/formatting.js';
8
+ import { odata } from '../../../../utils/odata.js';
9
+ import { urlUtil } from '../../../../utils/urlUtil.js';
10
+ import { validation } from '../../../../utils/validation.js';
11
+ import SpoCommand from '../../../base/SpoCommand.js';
12
+ import commands from '../../commands.js';
13
+ class SpoContentTypeFieldListCommand extends SpoCommand {
14
+ get name() {
15
+ return commands.CONTENTTYPE_FIELD_LIST;
16
+ }
17
+ get description() {
18
+ return 'Lists fields for a given site or list content type';
19
+ }
20
+ defaultProperties() {
21
+ return ['Id', 'Title', 'InternalName', 'Hidden'];
22
+ }
23
+ constructor() {
24
+ super();
25
+ _SpoContentTypeFieldListCommand_instances.add(this);
26
+ __classPrivateFieldGet(this, _SpoContentTypeFieldListCommand_instances, "m", _SpoContentTypeFieldListCommand_initTelemetry).call(this);
27
+ __classPrivateFieldGet(this, _SpoContentTypeFieldListCommand_instances, "m", _SpoContentTypeFieldListCommand_initOptions).call(this);
28
+ __classPrivateFieldGet(this, _SpoContentTypeFieldListCommand_instances, "m", _SpoContentTypeFieldListCommand_initValidators).call(this);
29
+ __classPrivateFieldGet(this, _SpoContentTypeFieldListCommand_instances, "m", _SpoContentTypeFieldListCommand_initTypes).call(this);
30
+ __classPrivateFieldGet(this, _SpoContentTypeFieldListCommand_instances, "m", _SpoContentTypeFieldListCommand_initOptionSets).call(this);
31
+ }
32
+ async commandAction(logger, args) {
33
+ try {
34
+ if (this.verbose) {
35
+ await logger.logToStderr(`Retrieving fields for content type '${args.options.contentTypeId || args.options.contentTypeName}' in site ${args.options.webUrl}...`);
36
+ }
37
+ let requestUrl = `${args.options.webUrl}/_api/web`;
38
+ if (args.options.listId) {
39
+ requestUrl += `/lists(guid'${formatting.encodeQueryParameter(args.options.listId)}')`;
40
+ }
41
+ else if (args.options.listTitle) {
42
+ requestUrl += `/lists/getByTitle('${formatting.encodeQueryParameter(args.options.listTitle)}')`;
43
+ }
44
+ else if (args.options.listUrl) {
45
+ const listServerRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
46
+ requestUrl += `/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
47
+ }
48
+ requestUrl += '/contentTypes';
49
+ const contentTypeId = await this.getContentTypeId(requestUrl, logger, args.options.contentTypeId, args.options.contentTypeName);
50
+ requestUrl += `('${formatting.encodeQueryParameter(contentTypeId)}')/fields`;
51
+ if (args.options.properties) {
52
+ requestUrl += `?$select=${args.options.properties}`;
53
+ }
54
+ const res = await odata.getAllItems(requestUrl);
55
+ await logger.log(res);
56
+ }
57
+ catch (err) {
58
+ this.handleRejectedODataJsonPromise(err);
59
+ }
60
+ }
61
+ async getContentTypeId(requestUrl, logger, contentTypeId, contentTypeName) {
62
+ if (contentTypeId) {
63
+ return contentTypeId;
64
+ }
65
+ if (this.verbose) {
66
+ await logger.logToStderr(`Retrieving content type id for content type '${contentTypeName}'.`);
67
+ }
68
+ const res = await odata.getAllItems(`${requestUrl}?$filter=Name eq '${formatting.encodeQueryParameter(contentTypeName)}'&$select=StringId`);
69
+ if (res.length === 0) {
70
+ throw `Content type with name ${contentTypeName} not found.`;
71
+ }
72
+ return res[0].StringId;
73
+ }
74
+ }
75
+ _SpoContentTypeFieldListCommand_instances = new WeakSet(), _SpoContentTypeFieldListCommand_initTelemetry = function _SpoContentTypeFieldListCommand_initTelemetry() {
76
+ this.telemetry.push((args) => {
77
+ Object.assign(this.telemetryProperties, {
78
+ contentTypeId: typeof args.options.contentTypeId !== 'undefined',
79
+ contentTypeName: typeof args.options.contentTypeName !== 'undefined',
80
+ listId: typeof args.options.listId !== 'undefined',
81
+ listTitle: typeof args.options.listTitle !== 'undefined',
82
+ listUrl: typeof args.options.listUrl !== 'undefined',
83
+ properties: typeof args.options.properties !== 'undefined'
84
+ });
85
+ });
86
+ }, _SpoContentTypeFieldListCommand_initOptions = function _SpoContentTypeFieldListCommand_initOptions() {
87
+ this.options.unshift({
88
+ option: '-u, --webUrl <webUrl>'
89
+ }, {
90
+ option: '-i, --contentTypeId [contentTypeId]'
91
+ }, {
92
+ option: '-n, --contentTypeName [contentTypeName]'
93
+ }, {
94
+ option: '-l, --listTitle [listTitle]'
95
+ }, {
96
+ option: '--listId [listId]'
97
+ }, {
98
+ option: '--listUrl [listUrl]'
99
+ }, {
100
+ option: '-p, --properties [properties]'
101
+ });
102
+ }, _SpoContentTypeFieldListCommand_initValidators = function _SpoContentTypeFieldListCommand_initValidators() {
103
+ this.validators.push(async (args) => {
104
+ const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
105
+ if (isValidSharePointUrl !== true) {
106
+ return isValidSharePointUrl;
107
+ }
108
+ if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
109
+ return `${args.options.listId} is not a valid GUID for option 'listId'.`;
110
+ }
111
+ return true;
112
+ });
113
+ }, _SpoContentTypeFieldListCommand_initTypes = function _SpoContentTypeFieldListCommand_initTypes() {
114
+ this.types.string.push('webUrl', 'contentTypeId', 'contentTypeName', 'listTitle', 'listId', 'listUrl', 'properties');
115
+ }, _SpoContentTypeFieldListCommand_initOptionSets = function _SpoContentTypeFieldListCommand_initOptionSets() {
116
+ this.optionSets.push({
117
+ options: ['contentTypeId', 'contentTypeName']
118
+ }, {
119
+ options: ['listId', 'listTitle', 'listUrl'],
120
+ runsWhen: (args) => args.options.listId || args.options.listTitle || args.options.listUrl
121
+ });
122
+ };
123
+ export default new SpoContentTypeFieldListCommand();
124
+ //# sourceMappingURL=contenttype-field-list.js.map
@@ -18,7 +18,7 @@ class SpoFieldListCommand extends SpoCommand {
18
18
  return 'Retrieves columns for the specified list or site';
19
19
  }
20
20
  defaultProperties() {
21
- return ['Id', 'Title', 'Group', 'Hidden'];
21
+ return ['Id', 'Title', 'InternalName', 'Hidden'];
22
22
  }
23
23
  constructor() {
24
24
  super();
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _SpoPageClientSideWebPartAddCommand_instances, _SpoPageClientSideWebPartAddCommand_initTelemetry, _SpoPageClientSideWebPartAddCommand_initOptions, _SpoPageClientSideWebPartAddCommand_initValidators, _SpoPageClientSideWebPartAddCommand_initOptionSets;
7
- import { isNumber } from 'util';
8
7
  import { v4 } from 'uuid';
9
8
  import request from '../../../../request.js';
10
9
  import { formatting } from '../../../../utils/formatting.js';
@@ -370,10 +369,10 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
370
369
  .webPartData}. Error: ${e}`;
371
370
  }
372
371
  }
373
- if (args.options.section && (!isNumber(args.options.section) || args.options.section < 1)) {
372
+ if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
374
373
  return 'The value of parameter section must be 1 or higher';
375
374
  }
376
- if (args.options.column && (!isNumber(args.options.column) || args.options.column < 1)) {
375
+ if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
377
376
  return 'The value of parameter column must be 1 or higher';
378
377
  }
379
378
  return validation.isValidSharePointUrl(args.options.webUrl);
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _SpoPageTextAddCommand_instances, _SpoPageTextAddCommand_initTelemetry, _SpoPageTextAddCommand_initOptions, _SpoPageTextAddCommand_initValidators;
7
- import { isNumber } from 'util';
8
7
  import request from '../../../../request.js';
9
8
  import { spo } from '../../../../utils/spo.js';
10
9
  import { urlUtil } from '../../../../utils/urlUtil.js';
@@ -119,10 +118,10 @@ _SpoPageTextAddCommand_instances = new WeakSet(), _SpoPageTextAddCommand_initTel
119
118
  });
120
119
  }, _SpoPageTextAddCommand_initValidators = function _SpoPageTextAddCommand_initValidators() {
121
120
  this.validators.push(async (args) => {
122
- if (args.options.section && (!isNumber(args.options.section) || args.options.section < 1)) {
121
+ if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
123
122
  return 'The value of parameter section must be 1 or higher';
124
123
  }
125
- if (args.options.column && (!isNumber(args.options.column) || args.options.column < 1)) {
124
+ if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
126
125
  return 'The value of parameter column must be 1 or higher';
127
126
  }
128
127
  return validation.isValidSharePointUrl(args.options.webUrl);
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _SpoSearchCommand_instances, _SpoSearchCommand_initTelemetry, _SpoSearchCommand_initOptions, _SpoSearchCommand_initValidators;
7
- import { isNumber } from 'util';
8
7
  import { cli } from '../../../cli/cli.js';
9
8
  import request from '../../../request.js';
10
9
  import { formatting } from '../../../utils/formatting.js';
@@ -266,16 +265,16 @@ _SpoSearchCommand_instances = new WeakSet(), _SpoSearchCommand_initTelemetry = f
266
265
  if (args.options.sortList && !/^([a-z0-9_]+:(ascending|descending))(,([a-z0-9_]+:(ascending|descending)))*$/gi.test(args.options.sortList)) {
267
266
  return `sortlist parameter value '${args.options.sortList}' does not match the required pattern (=comma-separated list of '<property>:(ascending|descending)'-pattern)`;
268
267
  }
269
- if (args.options.rowLimit && !isNumber(args.options.rowLimit)) {
268
+ if (args.options.rowLimit && !Number.isInteger(args.options.rowLimit)) {
270
269
  return `${args.options.rowLimit} is not a valid number`;
271
270
  }
272
- if (args.options.startRow && !isNumber(args.options.startRow)) {
271
+ if (args.options.startRow && !Number.isInteger(args.options.startRow)) {
273
272
  return `${args.options.startRow} is not a valid number`;
274
273
  }
275
274
  if (args.options.startRow && args.options.allResults) {
276
275
  return 'You cannot specify startRow when allResults is set';
277
276
  }
278
- if (args.options.culture && !isNumber(args.options.culture)) {
277
+ if (args.options.culture && !Number.isInteger(args.options.culture)) {
279
278
  return `${args.options.culture} is not a valid number`;
280
279
  }
281
280
  return true;
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
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
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
6
+ var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets, _SpoTenantApplicationCustomizerGetCommand_initTypes;
7
7
  import { formatting } from '../../../../utils/formatting.js';
8
8
  import { odata } from '../../../../utils/odata.js';
9
9
  import { spo } from '../../../../utils/spo.js';
@@ -26,6 +26,7 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
26
26
  __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
27
27
  __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
28
28
  __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
29
+ __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTypes).call(this);
29
30
  }
30
31
  async commandAction(logger, args) {
31
32
  try {
@@ -50,13 +51,20 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
50
51
  throw 'The specified application customizer was not found';
51
52
  }
52
53
  listItemInstances.forEach(v => delete v['ID']);
54
+ let listItemInstance;
53
55
  if (listItemInstances.length > 1) {
54
56
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
55
- const result = await cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
56
- await logger.log(result);
57
+ listItemInstance = await cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
57
58
  }
58
59
  else {
59
- await logger.log(listItemInstances[0]);
60
+ listItemInstance = listItemInstances[0];
61
+ }
62
+ if (!args.options.tenantWideExtensionComponentProperties) {
63
+ await logger.log(listItemInstance);
64
+ }
65
+ else {
66
+ const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
67
+ await logger.log(properties);
60
68
  }
61
69
  }
62
70
  else {
@@ -73,7 +81,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
73
81
  Object.assign(this.telemetryProperties, {
74
82
  title: typeof args.options.title !== 'undefined',
75
83
  id: typeof args.options.id !== 'undefined',
76
- clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
84
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
85
+ tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
77
86
  });
78
87
  });
79
88
  }, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
@@ -83,6 +92,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
83
92
  option: '-i, --id [id]'
84
93
  }, {
85
94
  option: '-c, --clientSideComponentId [clientSideComponentId]'
95
+ }, {
96
+ option: '-p, --tenantWideExtensionComponentProperties'
86
97
  });
87
98
  }, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
88
99
  this.validators.push(async (args) => {
@@ -96,6 +107,9 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
96
107
  });
97
108
  }, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
98
109
  this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
110
+ }, _SpoTenantApplicationCustomizerGetCommand_initTypes = function _SpoTenantApplicationCustomizerGetCommand_initTypes() {
111
+ this.types.string.push('title', 'id', 'clientSideComponentId');
112
+ this.types.boolean.push('tenantWideExtensionComponentProperties');
99
113
  };
100
114
  export default new SpoTenantApplicationCustomizerGetCommand();
101
115
  //# sourceMappingURL=tenant-applicationcustomizer-get.js.map
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
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
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets;
6
+ var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets, _SpoTenantCommandSetGetCommand_initTypes;
7
7
  import { cli } from '../../../../cli/cli.js';
8
8
  import { CommandError } from '../../../../Command.js';
9
9
  import request from '../../../../request.js';
@@ -27,6 +27,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
27
27
  __classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptions).call(this);
28
28
  __classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initValidators).call(this);
29
29
  __classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptionSets).call(this);
30
+ __classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initTypes).call(this);
30
31
  }
31
32
  async commandAction(logger, args) {
32
33
  const appCatalogUrl = await spo.getTenantAppCatalogUrl(logger, this.debug);
@@ -47,7 +48,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
47
48
  const reqOptions = {
48
49
  url: `${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
49
50
  headers: {
50
- 'accept': 'application/json;odata=nometadata'
51
+ accept: 'application/json;odata=nometadata'
51
52
  },
52
53
  responseType: 'json'
53
54
  };
@@ -55,13 +56,20 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
55
56
  const listItemInstances = await request.get(reqOptions);
56
57
  if (listItemInstances?.value.length > 0) {
57
58
  listItemInstances.value.forEach(v => delete v['ID']);
59
+ let listItemInstance;
58
60
  if (listItemInstances.value.length > 1) {
59
61
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances.value);
60
- const result = await cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
61
- await logger.log(result);
62
+ listItemInstance = await cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
62
63
  }
63
64
  else {
64
- await logger.log(listItemInstances.value[0]);
65
+ listItemInstance = listItemInstances.value[0];
66
+ }
67
+ if (!args.options.tenantWideExtensionComponentProperties) {
68
+ await logger.log(listItemInstance);
69
+ }
70
+ else {
71
+ const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
72
+ await logger.log(properties);
65
73
  }
66
74
  }
67
75
  else {
@@ -78,7 +86,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
78
86
  Object.assign(this.telemetryProperties, {
79
87
  title: typeof args.options.title !== 'undefined',
80
88
  id: typeof args.options.id !== 'undefined',
81
- clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
89
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
90
+ tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
82
91
  });
83
92
  });
84
93
  }, _SpoTenantCommandSetGetCommand_initOptions = function _SpoTenantCommandSetGetCommand_initOptions() {
@@ -88,6 +97,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
88
97
  option: '-i, --id [id]'
89
98
  }, {
90
99
  option: '-c, --clientSideComponentId [clientSideComponentId]'
100
+ }, {
101
+ option: '-p, --tenantWideExtensionComponentProperties'
91
102
  });
92
103
  }, _SpoTenantCommandSetGetCommand_initValidators = function _SpoTenantCommandSetGetCommand_initValidators() {
93
104
  this.validators.push(async (args) => {
@@ -101,6 +112,9 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
101
112
  });
102
113
  }, _SpoTenantCommandSetGetCommand_initOptionSets = function _SpoTenantCommandSetGetCommand_initOptionSets() {
103
114
  this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
115
+ }, _SpoTenantCommandSetGetCommand_initTypes = function _SpoTenantCommandSetGetCommand_initTypes() {
116
+ this.types.string.push('title', 'id', 'clientSideComponentId');
117
+ this.types.boolean.push('tenantWideExtensionComponentProperties');
104
118
  };
105
119
  export default new SpoTenantCommandSetGetCommand();
106
120
  //# sourceMappingURL=tenant-commandset-get.js.map
@@ -31,6 +31,7 @@ export default {
31
31
  COMMANDSET_REMOVE: `${prefix} commandset remove`,
32
32
  COMMANDSET_SET: `${prefix} commandset set`,
33
33
  CONTENTTYPE_ADD: `${prefix} contenttype add`,
34
+ CONTENTTYPE_FIELD_LIST: `${prefix} contenttype field list`,
34
35
  CONTENTTYPE_FIELD_REMOVE: `${prefix} contenttype field remove`,
35
36
  CONTENTTYPE_FIELD_SET: `${prefix} contenttype field set`,
36
37
  CONTENTTYPE_GET: `${prefix} contenttype get`,