@pnp/cli-microsoft365 12.0.0-beta.c9bd7f3 → 12.0.0-beta.d58fb77

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 (179) hide show
  1. package/.devproxy/generate-openapi-spec.json +1 -1
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/Auth.js +15 -1
  5. package/dist/googleAnalytics.js +96 -0
  6. package/dist/m365/cli/commands/cli-consent.js +9 -2
  7. package/dist/m365/entra/commands/m365group/m365group-remove.js +2 -8
  8. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  9. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
  10. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  11. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  12. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  13. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  14. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
  15. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  16. package/dist/m365/spo/commands/app/app-add.js +35 -56
  17. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  18. package/dist/m365/spo/commands/app/app-get.js +40 -56
  19. package/dist/m365/spo/commands/app/app-install.js +20 -41
  20. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  21. package/dist/m365/spo/commands/app/app-list.js +26 -44
  22. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  23. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  24. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  25. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  26. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  27. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  28. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  29. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  30. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  31. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  32. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  33. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  34. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  35. package/dist/m365/spo/commands/field/field-add.js +33 -62
  36. package/dist/m365/spo/commands/field/field-get.js +30 -57
  37. package/dist/m365/spo/commands/field/field-list.js +21 -46
  38. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  39. package/dist/m365/spo/commands/field/field-set.js +34 -66
  40. package/dist/m365/spo/commands/file/file-get.js +4 -3
  41. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  42. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  43. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  44. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  45. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  46. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  47. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  48. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  49. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  50. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  51. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  52. package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
  53. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  54. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  55. package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
  56. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  57. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  58. package/dist/m365/spo/commands/site/site-remove.js +3 -9
  59. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  60. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  61. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  62. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  63. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  64. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
  65. package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
  66. package/dist/m365/spo/commands/web/web-rule-list.js +113 -0
  67. package/dist/m365/spo/commands/web/web-rule-remove.js +54 -0
  68. package/dist/m365/spo/commands.js +6 -1
  69. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  70. package/dist/m365/spp/commands/model/model-get.js +25 -45
  71. package/dist/m365/spp/commands/model/model-list.js +12 -23
  72. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  73. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  74. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  75. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  76. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  77. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  78. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  79. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  80. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  81. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  82. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  83. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  84. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  85. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  86. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  87. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  88. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  89. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  90. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  91. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  92. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  93. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  94. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  95. package/dist/m365/teams/commands/message/message-get.js +19 -30
  96. package/dist/m365/teams/commands/message/message-list.js +26 -43
  97. package/dist/m365/teams/commands/message/message-remove.js +43 -58
  98. package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
  99. package/dist/m365/teams/commands/message/message-restore.js +40 -50
  100. package/dist/m365/teams/commands/message/message-send.js +19 -30
  101. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  102. package/dist/telemetry.js +7 -11
  103. package/dist/utils/spo.js +40 -3
  104. package/dist/utils/urlUtil.js +2 -2
  105. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +0 -3
  106. package/docs/docs/cmd/login.mdx +15 -2
  107. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  108. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  109. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  110. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  111. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  112. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  113. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  114. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  115. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  116. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  117. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  118. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  119. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  120. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  121. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  122. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  123. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  124. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  125. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  126. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  127. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  128. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  129. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  130. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  131. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  132. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  133. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  134. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  135. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  136. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  137. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  138. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  139. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  140. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  141. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  142. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  143. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  144. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  145. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  146. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  147. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  148. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  149. package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
  150. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  151. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  152. package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
  153. package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
  154. package/docs/docs/cmd/spo/web/web-rule-list.mdx +189 -0
  155. package/docs/docs/cmd/spo/web/web-rule-remove.mdx +65 -0
  156. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  157. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  158. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  159. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  160. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  161. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  162. package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
  163. package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
  164. package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
  165. package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
  166. package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
  167. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
  168. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
  169. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
  170. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
  171. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
  172. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
  173. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  174. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  175. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  176. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  177. package/npm-shrinkwrap.json +702 -3230
  178. package/package.json +21 -38
  179. package/dist/appInsights.js +0 -43
@@ -1,16 +1,30 @@
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 _SpoAppRetractCommand_instances, _SpoAppRetractCommand_initTelemetry, _SpoAppRetractCommand_initOptions, _SpoAppRetractCommand_initValidators;
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 { spo } from '../../../../utils/spo.js';
11
7
  import { validation } from '../../../../utils/validation.js';
8
+ import { zod } from '../../../../utils/zod.js';
12
9
  import commands from '../../commands.js';
13
10
  import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
11
+ const appCatalogScopeOptions = { tenant: 'tenant', sitecollection: 'sitecollection' };
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ id: z.string()
15
+ .refine(id => validation.isValidGuid(id), {
16
+ error: e => `${e.input} is not a valid GUID`
17
+ })
18
+ .alias('i'),
19
+ appCatalogUrl: z.string()
20
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
21
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
22
+ })
23
+ .optional()
24
+ .alias('u'),
25
+ appCatalogScope: zod.coercedEnum(appCatalogScopeOptions).optional().alias('s'),
26
+ force: z.boolean().optional().alias('f')
27
+ });
14
28
  class SpoAppRetractCommand extends SpoAppBaseCommand {
15
29
  get name() {
16
30
  return commands.APP_RETRACT;
@@ -18,12 +32,18 @@ class SpoAppRetractCommand extends SpoAppBaseCommand {
18
32
  get description() {
19
33
  return 'Retracts the specified app from the specified app catalog';
20
34
  }
21
- constructor() {
22
- super();
23
- _SpoAppRetractCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _SpoAppRetractCommand_instances, "m", _SpoAppRetractCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _SpoAppRetractCommand_instances, "m", _SpoAppRetractCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _SpoAppRetractCommand_instances, "m", _SpoAppRetractCommand_initValidators).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => opts.appCatalogScope !== 'sitecollection' || opts.appCatalogUrl !== undefined, {
41
+ error: 'You must specify appCatalogUrl when the appCatalogScope is sitecollection',
42
+ path: ['appCatalogUrl'],
43
+ params: {
44
+ customCode: 'required'
45
+ }
46
+ });
27
47
  }
28
48
  async commandAction(logger, args) {
29
49
  const scope = (args.options.appCatalogScope) ? args.options.appCatalogScope.toLowerCase() : 'tenant';
@@ -57,44 +77,5 @@ class SpoAppRetractCommand extends SpoAppBaseCommand {
57
77
  }
58
78
  }
59
79
  }
60
- _SpoAppRetractCommand_instances = new WeakSet(), _SpoAppRetractCommand_initTelemetry = function _SpoAppRetractCommand_initTelemetry() {
61
- this.telemetry.push((args) => {
62
- Object.assign(this.telemetryProperties, {
63
- appCatalogUrl: (!(!args.options.appCatalogUrl)).toString(),
64
- force: (!(!args.options.force)).toString(),
65
- appCatalogScope: args.options.appCatalogScope || 'tenant'
66
- });
67
- });
68
- }, _SpoAppRetractCommand_initOptions = function _SpoAppRetractCommand_initOptions() {
69
- this.options.unshift({
70
- option: '-i, --id <id>'
71
- }, {
72
- option: '-u, --appCatalogUrl [appCatalogUrl]'
73
- }, {
74
- option: '-s, --appCatalogScope [appCatalogScope]',
75
- autocomplete: ['tenant', 'sitecollection']
76
- }, {
77
- option: '-f, --force'
78
- });
79
- }, _SpoAppRetractCommand_initValidators = function _SpoAppRetractCommand_initValidators() {
80
- this.validators.push(async (args) => {
81
- if (args.options.appCatalogScope) {
82
- const testScope = args.options.appCatalogScope.toLowerCase();
83
- if (!(testScope === 'tenant' || testScope === 'sitecollection')) {
84
- return `appCatalogScope must be either 'tenant' or 'sitecollection' if specified`;
85
- }
86
- if (testScope === 'sitecollection' && !args.options.appCatalogUrl) {
87
- return `You must specify appCatalogUrl when the appCatalogScope is sitecollection`;
88
- }
89
- }
90
- if (!validation.isValidGuid(args.options.id)) {
91
- return `${args.options.id} is not a valid GUID`;
92
- }
93
- if (args.options.appCatalogUrl) {
94
- return validation.isValidSharePointUrl(args.options.appCatalogUrl);
95
- }
96
- return true;
97
- });
98
- };
99
80
  export default new SpoAppRetractCommand();
100
81
  //# sourceMappingURL=app-retract.js.map
@@ -1,11 +1,7 @@
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 _SpoAppTeamsPackageDownloadCommand_instances, _SpoAppTeamsPackageDownloadCommand_initTelemetry, _SpoAppTeamsPackageDownloadCommand_initOptions, _SpoAppTeamsPackageDownloadCommand_initValidators;
7
1
  import fs from 'fs';
8
2
  import path from 'path';
3
+ import { z } from 'zod';
4
+ import { globalOptionsZod } from '../../../../Command.js';
9
5
  import request from '../../../../request.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
11
7
  import { spo } from '../../../../utils/spo.js';
@@ -13,6 +9,27 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
13
9
  import { validation } from '../../../../utils/validation.js';
14
10
  import commands from '../../commands.js';
15
11
  import { SpoAppBaseCommand } from './SpoAppBaseCommand.js';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ appItemId: z.number().optional(),
15
+ appItemUniqueId: z.string()
16
+ .refine(id => validation.isValidGuid(id), {
17
+ error: e => `${e.input} is not a valid GUID`
18
+ })
19
+ .optional(),
20
+ appName: z.string().optional(),
21
+ fileName: z.string()
22
+ .refine(fileName => !fs.existsSync(fileName), {
23
+ error: e => `File ${e.input} already exists`
24
+ })
25
+ .optional(),
26
+ appCatalogUrl: z.string()
27
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
28
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
29
+ })
30
+ .optional()
31
+ .alias('u')
32
+ });
16
33
  class SpoAppTeamsPackageDownloadCommand extends SpoAppBaseCommand {
17
34
  get name() {
18
35
  return commands.APP_TEAMSPACKAGE_DOWNLOAD;
@@ -20,12 +37,18 @@ class SpoAppTeamsPackageDownloadCommand extends SpoAppBaseCommand {
20
37
  get description() {
21
38
  return 'Downloads Teams app package for an SPFx solution deployed to tenant app catalog';
22
39
  }
23
- constructor() {
24
- super();
25
- _SpoAppTeamsPackageDownloadCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _SpoAppTeamsPackageDownloadCommand_instances, "m", _SpoAppTeamsPackageDownloadCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _SpoAppTeamsPackageDownloadCommand_instances, "m", _SpoAppTeamsPackageDownloadCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _SpoAppTeamsPackageDownloadCommand_instances, "m", _SpoAppTeamsPackageDownloadCommand_initValidators).call(this);
40
+ get schema() {
41
+ return options;
42
+ }
43
+ getRefinedSchema(schema) {
44
+ return schema
45
+ .refine(opts => [opts.appItemUniqueId, opts.appItemId, opts.appName].filter(x => x !== undefined).length === 1, {
46
+ error: 'Specify appItemUniqueId, appItemId or appName but not multiple',
47
+ params: {
48
+ customCode: 'optionSet',
49
+ options: ['appItemUniqueId', 'appItemId', 'appName']
50
+ }
51
+ });
29
52
  }
30
53
  async commandAction(logger, args) {
31
54
  try {
@@ -125,47 +148,5 @@ class SpoAppTeamsPackageDownloadCommand extends SpoAppBaseCommand {
125
148
  this.appCatalogUrl = appCatalogUrl;
126
149
  }
127
150
  }
128
- _SpoAppTeamsPackageDownloadCommand_instances = new WeakSet(), _SpoAppTeamsPackageDownloadCommand_initTelemetry = function _SpoAppTeamsPackageDownloadCommand_initTelemetry() {
129
- this.telemetry.push((args) => {
130
- Object.assign(this.telemetryProperties, {
131
- appCatalogUrl: typeof args.options.appCatalogUrl !== 'undefined',
132
- appItemUniqueId: typeof args.options.appItemUniqueId !== 'undefined',
133
- appItemId: typeof args.options.appItemId !== 'undefined',
134
- appName: typeof args.options.appName !== 'undefined',
135
- fileName: typeof args.options.fileName !== 'undefined'
136
- });
137
- });
138
- }, _SpoAppTeamsPackageDownloadCommand_initOptions = function _SpoAppTeamsPackageDownloadCommand_initOptions() {
139
- this.options.unshift({ option: '--appItemId [appItemId]' }, { option: '--appItemUniqueId [appItemUniqueId]' }, { option: '--appName [appName]' }, { option: '--fileName [fileName]' }, { option: '-u, --appCatalogUrl [appCatalogUrl]' });
140
- }, _SpoAppTeamsPackageDownloadCommand_initValidators = function _SpoAppTeamsPackageDownloadCommand_initValidators() {
141
- this.validators.push(async (args) => {
142
- if (!args.options.appItemUniqueId &&
143
- !args.options.appItemId &&
144
- !args.options.appName) {
145
- return `Specify appItemUniqueId, appItemId or appName`;
146
- }
147
- if ((args.options.appItemUniqueId && args.options.appItemId) ||
148
- (args.options.appItemUniqueId && args.options.appName) ||
149
- (args.options.appItemId && args.options.appName)) {
150
- return `Specify appItemUniqueId, appItemId or appName but not multiple`;
151
- }
152
- if (args.options.appItemUniqueId &&
153
- !validation.isValidGuid(args.options.appItemUniqueId)) {
154
- return `${args.options.appItemUniqueId} is not a valid GUID`;
155
- }
156
- if (args.options.appItemId &&
157
- isNaN(args.options.appItemId)) {
158
- return `${args.options.appItemId} is not a number`;
159
- }
160
- if (args.options.fileName &&
161
- fs.existsSync(args.options.fileName)) {
162
- return `File ${args.options.fileName} already exists`;
163
- }
164
- if (args.options.appCatalogUrl) {
165
- return validation.isValidSharePointUrl(args.options.appCatalogUrl);
166
- }
167
- return true;
168
- });
169
- };
170
151
  export default new SpoAppTeamsPackageDownloadCommand();
171
152
  //# sourceMappingURL=app-teamspackage-download.js.map
@@ -1,15 +1,28 @@
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 _SpoAppUninstallCommand_instances, _SpoAppUninstallCommand_initTelemetry, _SpoAppUninstallCommand_initOptions, _SpoAppUninstallCommand_initValidators;
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 { 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';
10
+ const appCatalogScopeOptions = { tenant: 'tenant', sitecollection: 'sitecollection' };
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ id: z.string()
14
+ .refine(id => validation.isValidGuid(id), {
15
+ error: e => `${e.input} is not a valid GUID`
16
+ })
17
+ .alias('i'),
18
+ siteUrl: z.string()
19
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
20
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
21
+ })
22
+ .alias('s'),
23
+ appCatalogScope: zod.coercedEnum(appCatalogScopeOptions).optional(),
24
+ force: z.boolean().optional().alias('f')
25
+ });
13
26
  class SpoAppUninstallCommand extends SpoCommand {
14
27
  get name() {
15
28
  return commands.APP_UNINSTALL;
@@ -17,12 +30,8 @@ class SpoAppUninstallCommand extends SpoCommand {
17
30
  get description() {
18
31
  return 'Uninstalls an app from the site';
19
32
  }
20
- constructor() {
21
- super();
22
- _SpoAppUninstallCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _SpoAppUninstallCommand_instances, "m", _SpoAppUninstallCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _SpoAppUninstallCommand_instances, "m", _SpoAppUninstallCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _SpoAppUninstallCommand_instances, "m", _SpoAppUninstallCommand_initValidators).call(this);
33
+ get schema() {
34
+ return options;
26
35
  }
27
36
  async commandAction(logger, args) {
28
37
  const uninstallApp = async () => {
@@ -54,37 +63,5 @@ class SpoAppUninstallCommand extends SpoCommand {
54
63
  }
55
64
  }
56
65
  }
57
- _SpoAppUninstallCommand_instances = new WeakSet(), _SpoAppUninstallCommand_initTelemetry = function _SpoAppUninstallCommand_initTelemetry() {
58
- this.telemetry.push((args) => {
59
- Object.assign(this.telemetryProperties, {
60
- force: (!(!args.options.force)).toString(),
61
- appCatalogScope: args.options.appCatalogScope || 'tenant'
62
- });
63
- });
64
- }, _SpoAppUninstallCommand_initOptions = function _SpoAppUninstallCommand_initOptions() {
65
- this.options.unshift({
66
- option: '-i, --id <id>'
67
- }, {
68
- option: '-s, --siteUrl <siteUrl>'
69
- }, {
70
- option: '--appCatalogScope [appCatalogScope]',
71
- autocomplete: ['tenant', 'sitecollection']
72
- }, {
73
- option: '-f, --force'
74
- });
75
- }, _SpoAppUninstallCommand_initValidators = function _SpoAppUninstallCommand_initValidators() {
76
- this.validators.push(async (args) => {
77
- if (args.options.appCatalogScope) {
78
- const testScope = args.options.appCatalogScope.toLowerCase();
79
- if (!(testScope === 'tenant' || testScope === 'sitecollection')) {
80
- return `appCatalogScope must be either 'tenant' or 'sitecollection' if specified`;
81
- }
82
- }
83
- if (!validation.isValidGuid(args.options.id)) {
84
- return `${args.options.id} is not a valid GUID`;
85
- }
86
- return validation.isValidSharePointUrl(args.options.siteUrl);
87
- });
88
- };
89
66
  export default new SpoAppUninstallCommand();
90
67
  //# sourceMappingURL=app-uninstall.js.map
@@ -1,14 +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 _SpoAppUpgradeCommand_instances, _SpoAppUpgradeCommand_initTelemetry, _SpoAppUpgradeCommand_initOptions, _SpoAppUpgradeCommand_initValidators;
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 { validation } from '../../../../utils/validation.js';
6
+ import { zod } from '../../../../utils/zod.js';
10
7
  import SpoCommand from '../../../base/SpoCommand.js';
11
8
  import commands from '../../commands.js';
9
+ const appCatalogScopeOptions = { tenant: 'tenant', sitecollection: 'sitecollection' };
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ id: z.string()
13
+ .refine(id => validation.isValidGuid(id), {
14
+ error: e => `${e.input} is not a valid GUID`
15
+ })
16
+ .alias('i'),
17
+ siteUrl: z.string()
18
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
19
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
20
+ })
21
+ .alias('s'),
22
+ appCatalogScope: zod.coercedEnum(appCatalogScopeOptions).optional()
23
+ });
12
24
  class SpoAppUpgradeCommand extends SpoCommand {
13
25
  get name() {
14
26
  return commands.APP_UPGRADE;
@@ -16,12 +28,8 @@ class SpoAppUpgradeCommand extends SpoCommand {
16
28
  get description() {
17
29
  return 'Upgrades app in the specified site';
18
30
  }
19
- constructor() {
20
- super();
21
- _SpoAppUpgradeCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _SpoAppUpgradeCommand_instances, "m", _SpoAppUpgradeCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _SpoAppUpgradeCommand_instances, "m", _SpoAppUpgradeCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _SpoAppUpgradeCommand_instances, "m", _SpoAppUpgradeCommand_initValidators).call(this);
31
+ get schema() {
32
+ return options;
25
33
  }
26
34
  async commandAction(logger, args) {
27
35
  const scope = (args.options.appCatalogScope) ? args.options.appCatalogScope.toLowerCase() : 'tenant';
@@ -42,34 +50,5 @@ class SpoAppUpgradeCommand extends SpoCommand {
42
50
  }
43
51
  }
44
52
  }
45
- _SpoAppUpgradeCommand_instances = new WeakSet(), _SpoAppUpgradeCommand_initTelemetry = function _SpoAppUpgradeCommand_initTelemetry() {
46
- this.telemetry.push((args) => {
47
- Object.assign(this.telemetryProperties, {
48
- appCatalogScope: args.options.appCatalogScope || 'tenant'
49
- });
50
- });
51
- }, _SpoAppUpgradeCommand_initOptions = function _SpoAppUpgradeCommand_initOptions() {
52
- this.options.unshift({
53
- option: '-i, --id <id>'
54
- }, {
55
- option: '-s, --siteUrl <siteUrl>'
56
- }, {
57
- option: '--appCatalogScope [appCatalogScope]',
58
- autocomplete: ['tenant', 'sitecollection']
59
- });
60
- }, _SpoAppUpgradeCommand_initValidators = function _SpoAppUpgradeCommand_initValidators() {
61
- this.validators.push(async (args) => {
62
- if (args.options.appCatalogScope) {
63
- const testScope = args.options.appCatalogScope.toLowerCase();
64
- if (!(testScope === 'tenant' || testScope === 'sitecollection')) {
65
- return `appCatalogScope must be either 'tenant' or 'sitecollection' if specified`;
66
- }
67
- }
68
- if (!validation.isValidGuid(args.options.id)) {
69
- return `${args.options.id} is not a valid GUID`;
70
- }
71
- return validation.isValidSharePointUrl(args.options.siteUrl);
72
- });
73
- };
74
53
  export default new SpoAppUpgradeCommand();
75
54
  //# sourceMappingURL=app-upgrade.js.map
@@ -1,13 +1,22 @@
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 _SpoCommandSetAddCommand_instances, _a, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
1
+ import { globalOptionsZod } from '../../../../Command.js';
7
2
  import commands from '../../commands.js';
8
3
  import { validation } from '../../../../utils/validation.js';
9
4
  import SpoCommand from '../../../base/SpoCommand.js';
10
5
  import request from '../../../../request.js';
6
+ import { z } from 'zod';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ title: z.string().alias('t'),
10
+ webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
11
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
12
+ }).alias('u'),
13
+ listType: z.enum(['List', 'Library', 'SitePages']).alias('l'),
14
+ clientSideComponentId: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).alias('i'),
15
+ description: z.string().optional(),
16
+ clientSideComponentProperties: z.string().optional(),
17
+ scope: z.enum(['Site', 'Web']).optional().alias('s'),
18
+ location: z.enum(['ContextMenu', 'CommandBar', 'Both']).optional()
19
+ });
11
20
  class SpoCommandSetAddCommand extends SpoCommand {
12
21
  get name() {
13
22
  return commands.COMMANDSET_ADD;
@@ -15,12 +24,8 @@ class SpoCommandSetAddCommand extends SpoCommand {
15
24
  get description() {
16
25
  return 'Adds a ListView Command Set to a site.';
17
26
  }
18
- constructor() {
19
- super();
20
- _SpoCommandSetAddCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _SpoCommandSetAddCommand_instances, "m", _SpoCommandSetAddCommand_initValidators).call(this);
27
+ get schema() {
28
+ return options;
24
29
  }
25
30
  async commandAction(logger, args) {
26
31
  if (this.verbose) {
@@ -79,52 +84,5 @@ class SpoCommandSetAddCommand extends SpoCommand {
79
84
  }
80
85
  }
81
86
  }
82
- _a = SpoCommandSetAddCommand, _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
83
- this.telemetry.push((args) => {
84
- Object.assign(this.telemetryProperties, {
85
- description: typeof args.options.description !== 'undefined',
86
- clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
87
- scope: typeof args.options.scope !== 'undefined',
88
- location: typeof args.options.location !== 'undefined'
89
- });
90
- });
91
- }, _SpoCommandSetAddCommand_initOptions = function _SpoCommandSetAddCommand_initOptions() {
92
- this.options.unshift({
93
- option: '-t, --title <title>'
94
- }, {
95
- option: '-u, --webUrl <webUrl>'
96
- }, {
97
- option: '-l, --listType <listType>', autocomplete: _a.listTypes
98
- }, {
99
- option: '-i, --clientSideComponentId <clientSideComponentId>'
100
- }, {
101
- option: '--description [description]'
102
- }, {
103
- option: '--clientSideComponentProperties [clientSideComponentProperties]'
104
- }, {
105
- option: '-s, --scope [scope]', autocomplete: _a.scopes
106
- }, {
107
- option: '--location [location]', autocomplete: _a.locations
108
- });
109
- }, _SpoCommandSetAddCommand_initValidators = function _SpoCommandSetAddCommand_initValidators() {
110
- this.validators.push(async (args) => {
111
- if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
112
- return `${args.options.clientSideComponentId} is not a valid GUID`;
113
- }
114
- if (_a.listTypes.indexOf(args.options.listType) < 0) {
115
- return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
116
- }
117
- if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
118
- return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
119
- }
120
- if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
121
- return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
122
- }
123
- return validation.isValidSharePointUrl(args.options.webUrl);
124
- });
125
- };
126
- SpoCommandSetAddCommand.listTypes = ['List', 'Library', 'SitePages'];
127
- SpoCommandSetAddCommand.scopes = ['Site', 'Web'];
128
- SpoCommandSetAddCommand.locations = ['ContextMenu', 'CommandBar', 'Both'];
129
87
  export default new SpoCommandSetAddCommand();
130
88
  //# sourceMappingURL=commandset-add.js.map
@@ -1,15 +1,22 @@
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 _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets, _SpoCommandSetGetCommand_initTypes;
1
+ import { globalOptionsZod } from '../../../../Command.js';
7
2
  import { formatting } from '../../../../utils/formatting.js';
8
3
  import { spo } from '../../../../utils/spo.js';
9
4
  import { validation } from '../../../../utils/validation.js';
10
5
  import SpoCommand from '../../../base/SpoCommand.js';
11
6
  import commands from '../../commands.js';
12
7
  import { cli } from '../../../../cli/cli.js';
8
+ import { z } from 'zod';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
12
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
13
+ }).alias('u'),
14
+ title: z.string().optional().alias('t'),
15
+ id: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).optional().alias('i'),
16
+ clientSideComponentId: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).optional().alias('c'),
17
+ scope: z.enum(['All', 'Site', 'Web']).optional().alias('s'),
18
+ clientSideComponentProperties: z.boolean().optional().alias('p')
19
+ });
13
20
  class SpoCommandSetGetCommand extends SpoCommand {
14
21
  get name() {
15
22
  return commands.COMMANDSET_GET;
@@ -17,14 +24,14 @@ class SpoCommandSetGetCommand extends SpoCommand {
17
24
  get description() {
18
25
  return 'Gets a ListView Command Set that is added to a site.';
19
26
  }
20
- constructor() {
21
- super();
22
- _SpoCommandSetGetCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initOptionSets).call(this);
27
- __classPrivateFieldGet(this, _SpoCommandSetGetCommand_instances, "m", _SpoCommandSetGetCommand_initTypes).call(this);
27
+ get schema() {
28
+ return options;
29
+ }
30
+ getRefinedSchema(schema) {
31
+ return schema.refine(opts => [opts.title, opts.id, opts.clientSideComponentId].filter(x => x !== undefined).length === 1, {
32
+ message: `Specify either 'title', 'id' or 'clientSideComponentId', but not multiple.`,
33
+ params: { customCode: 'optionSet', options: ['title', 'id', 'clientSideComponentId'] }
34
+ });
28
35
  }
29
36
  async commandAction(logger, args) {
30
37
  try {
@@ -37,7 +44,7 @@ class SpoCommandSetGetCommand extends SpoCommand {
37
44
  if (customAction === undefined) {
38
45
  throw `Command set with id ${args.options.id} can't be found.`;
39
46
  }
40
- else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === customAction.Location)) {
47
+ else if (!SpoCommandSetGetCommand.allowedCommandSetLocations.some(allowedLocation => allowedLocation === customAction.Location)) {
41
48
  throw `Custom action with id ${args.options.id} is not a command set.`;
42
49
  }
43
50
  commandSet = customAction;
@@ -77,55 +84,10 @@ class SpoCommandSetGetCommand extends SpoCommand {
77
84
  }
78
85
  }
79
86
  getBaseFilter() {
80
- return `startswith(Location,'${_a.baseLocation}') and`;
87
+ return `startswith(Location,'${SpoCommandSetGetCommand.baseLocation}') and`;
81
88
  }
82
89
  }
83
- _a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_initTelemetry = function _SpoCommandSetGetCommand_initTelemetry() {
84
- this.telemetry.push((args) => {
85
- Object.assign(this.telemetryProperties, {
86
- title: typeof args.options.title !== 'undefined',
87
- id: typeof args.options.id !== 'undefined',
88
- clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
89
- scope: typeof args.options.scope !== 'undefined',
90
- clientSideComponentProperties: !!args.options.clientSideComponentProperties
91
- });
92
- });
93
- }, _SpoCommandSetGetCommand_initOptions = function _SpoCommandSetGetCommand_initOptions() {
94
- this.options.unshift({
95
- option: '-u, --webUrl <webUrl>'
96
- }, {
97
- option: '-t, --title [title]'
98
- }, {
99
- option: '-i, --id [id]'
100
- }, {
101
- option: '-c, --clientSideComponentId [clientSideComponentId]'
102
- }, {
103
- option: '-s, --scope [scope]',
104
- autocomplete: _a.scopes
105
- }, {
106
- option: '-p, --clientSideComponentProperties'
107
- });
108
- }, _SpoCommandSetGetCommand_initValidators = function _SpoCommandSetGetCommand_initValidators() {
109
- this.validators.push(async (args) => {
110
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
111
- return `${args.options.id} is not a valid GUID.`;
112
- }
113
- if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
114
- return `${args.options.clientSideComponentId} is not a valid GUID.`;
115
- }
116
- if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
117
- return `${args.options.scope} is not a valid scope. Valid scopes are ${_a.scopes.join(', ')}`;
118
- }
119
- return validation.isValidSharePointUrl(args.options.webUrl);
120
- });
121
- }, _SpoCommandSetGetCommand_initOptionSets = function _SpoCommandSetGetCommand_initOptionSets() {
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');
126
- };
127
- SpoCommandSetGetCommand.scopes = ['All', 'Site', 'Web'];
128
90
  SpoCommandSetGetCommand.baseLocation = 'ClientSideExtension.ListViewCommandSet';
129
- SpoCommandSetGetCommand.allowedCommandSetLocations = [_a.baseLocation, `${_a.baseLocation}.CommandBar`, `${_a.baseLocation}.ContextMenu`];
91
+ SpoCommandSetGetCommand.allowedCommandSetLocations = [SpoCommandSetGetCommand.baseLocation, `${SpoCommandSetGetCommand.baseLocation}.CommandBar`, `${SpoCommandSetGetCommand.baseLocation}.ContextMenu`];
130
92
  export default new SpoCommandSetGetCommand();
131
93
  //# sourceMappingURL=commandset-get.js.map