@pnp/cli-microsoft365 12.0.0-beta.0be7d8d → 12.0.0-beta.1752794

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 (190) 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 +2 -6
  5. package/dist/auth/FileTokenStorage.js +0 -3
  6. package/dist/auth/msalCachePlugin.js +201 -12
  7. package/dist/googleAnalytics.js +96 -0
  8. package/dist/m365/commands/logout.js +2 -4
  9. package/dist/m365/entra/commands/m365group/m365group-remove.js +4 -3
  10. package/dist/m365/spe/commands/container/container-remove.js +6 -7
  11. package/dist/m365/spo/commands/app/app-add.js +35 -56
  12. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  13. package/dist/m365/spo/commands/app/app-get.js +40 -56
  14. package/dist/m365/spo/commands/app/app-install.js +20 -41
  15. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  16. package/dist/m365/spo/commands/app/app-list.js +26 -44
  17. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  18. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  19. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  20. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  21. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  22. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  23. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  24. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  25. package/dist/m365/spo/commands/field/field-add.js +33 -62
  26. package/dist/m365/spo/commands/field/field-get.js +30 -57
  27. package/dist/m365/spo/commands/field/field-list.js +21 -46
  28. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  29. package/dist/m365/spo/commands/field/field-set.js +34 -66
  30. package/dist/m365/spo/commands/file/file-archive.js +1 -1
  31. package/dist/m365/spo/commands/file/file-get.js +4 -3
  32. package/dist/m365/spo/commands/file/file-remove.js +5 -5
  33. package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
  34. package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
  35. package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
  36. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  37. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
  38. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
  39. package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
  40. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  41. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  42. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  43. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  44. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  45. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  46. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  47. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  48. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  49. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  50. package/dist/m365/spo/commands/list/list-remove.js +4 -4
  51. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
  52. package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
  53. package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
  54. package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
  55. package/dist/m365/spo/commands/page/page-remove.js +7 -7
  56. package/dist/m365/spo/commands/site/site-list.js +60 -49
  57. package/dist/m365/spo/commands/site/site-remove.js +7 -7
  58. package/dist/m365/spo/commands/spo-get.js +5 -0
  59. package/dist/m365/spo/commands/spo-set.js +10 -21
  60. package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
  61. package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
  62. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
  63. package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
  64. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
  65. package/dist/m365/spo/commands/user/user-ensure.js +24 -60
  66. package/dist/m365/spo/commands/user/user-get.js +25 -65
  67. package/dist/m365/spo/commands/user/user-list.js +10 -18
  68. package/dist/m365/spo/commands/user/user-remove.js +26 -68
  69. package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
  70. package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
  71. package/dist/m365/spo/commands/web/web-add.js +20 -55
  72. package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
  73. package/dist/m365/spo/commands/web/web-get.js +12 -30
  74. package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
  75. package/dist/m365/spo/commands/web/web-list.js +10 -18
  76. package/dist/m365/spo/commands/web/web-reindex.js +10 -18
  77. package/dist/m365/spo/commands/web/web-remove.js +11 -27
  78. package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
  79. package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
  80. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
  81. package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
  82. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
  83. package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
  84. package/dist/m365/spo/commands/web/web-rule-list.js +6 -4
  85. package/dist/m365/spo/commands/web/web-rule-remove.js +0 -3
  86. package/dist/m365/spo/commands/web/web-set.js +26 -96
  87. package/dist/m365/spo/commands.js +3 -3
  88. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  89. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  90. package/dist/m365/teams/commands/channel/channel-list.js +30 -48
  91. package/dist/m365/teams/commands/channel/channel-member-add.js +55 -60
  92. package/dist/m365/teams/commands/channel/channel-member-list.js +49 -61
  93. package/dist/m365/teams/commands/channel/channel-member-remove.js +64 -68
  94. package/dist/m365/teams/commands/channel/channel-member-set.js +63 -71
  95. package/dist/m365/teams/commands/channel/channel-remove.js +49 -57
  96. package/dist/m365/teams/commands/channel/channel-set.js +49 -62
  97. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  98. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  99. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  100. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  101. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  102. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  103. package/dist/m365/teams/commands/tab/tab-get.js +2 -6
  104. package/dist/m365/teams/commands/team/team-archive.js +2 -6
  105. package/dist/m365/teams/commands/team/team-remove.js +2 -6
  106. package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
  107. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  108. package/dist/telemetry.js +7 -11
  109. package/dist/utils/spo.js +1 -3
  110. package/dist/utils/urlUtil.js +2 -2
  111. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +4 -4
  112. package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
  113. package/docs/docs/cmd/spo/file/file-archive.mdx +9 -1
  114. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  115. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  116. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  117. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  118. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  119. package/docs/docs/cmd/spo/file/file-remove.mdx +4 -4
  120. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  121. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  122. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  123. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  124. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  125. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  126. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  127. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  128. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  129. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  130. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  131. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  132. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  133. package/docs/docs/cmd/spo/file/file-unarchive.mdx +9 -1
  134. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  135. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  136. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  137. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  138. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  139. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  140. package/docs/docs/cmd/spo/folder/folder-archive.mdx +7 -1
  141. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  142. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  143. package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
  144. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  145. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  146. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  147. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  148. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  149. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  150. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  151. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  152. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  153. package/docs/docs/cmd/spo/list/list-remove.mdx +4 -4
  154. package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
  155. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  156. package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
  157. package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
  158. package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
  159. package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
  160. package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
  161. package/docs/docs/cmd/spo/site/site-remove.mdx +3 -3
  162. package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
  163. package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
  164. package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
  165. package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
  166. package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
  167. package/docs/docs/cmd/spo/web/web-rule-list.mdx +8 -12
  168. package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -6
  169. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  170. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  171. package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
  172. package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
  173. package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
  174. package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
  175. package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
  176. package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
  177. package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
  178. package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
  179. package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
  180. package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
  181. package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
  182. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
  183. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
  184. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
  185. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
  186. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
  187. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
  188. package/npm-shrinkwrap.json +1120 -3216
  189. package/package.json +23 -33
  190. package/dist/appInsights.js +0 -43
@@ -1,9 +1,5 @@
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 _SpoFieldAddCommand_instances, _SpoFieldAddCommand_initTelemetry, _SpoFieldAddCommand_initOptions, _SpoFieldAddCommand_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 { spo } from '../../../../utils/spo.js';
@@ -11,6 +7,29 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import SpoCommand from '../../../base/SpoCommand.js';
13
9
  import commands from '../../commands.js';
10
+ const fieldOptions = ['DefaultValue', 'AddToDefaultContentType', 'AddToNoContentType', 'AddToAllContentTypes', 'AddFieldInternalNameHint', 'AddFieldToDefaultView', 'AddFieldCheckDisplayName'];
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
14
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
15
+ }).alias('u'),
16
+ listTitle: z.string().optional().alias('l'),
17
+ listId: z.string().refine(id => validation.isValidGuid(id), {
18
+ error: e => `${e.input} in option listId is not a valid GUID`
19
+ }).optional(),
20
+ listUrl: z.string().optional(),
21
+ xml: z.string().alias('x'),
22
+ options: z.string().refine(val => {
23
+ const items = val.split(',').map(o => o.trim());
24
+ return items.every(item => fieldOptions.indexOf(item) !== -1);
25
+ }, {
26
+ error: e => {
27
+ const items = e.input.split(',').map((o) => o.trim());
28
+ const invalid = items.find((item) => fieldOptions.indexOf(item) === -1);
29
+ return `${invalid} is not a valid value for the options argument. Allowed values are ${fieldOptions.join('|')}`;
30
+ }
31
+ }).optional()
32
+ });
14
33
  class SpoFieldAddCommand extends SpoCommand {
15
34
  get name() {
16
35
  return commands.FIELD_ADD;
@@ -18,12 +37,14 @@ class SpoFieldAddCommand extends SpoCommand {
18
37
  get description() {
19
38
  return 'Adds a new list or site column using the CAML field definition';
20
39
  }
21
- constructor() {
22
- super();
23
- _SpoFieldAddCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _SpoFieldAddCommand_instances, "m", _SpoFieldAddCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _SpoFieldAddCommand_instances, "m", _SpoFieldAddCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _SpoFieldAddCommand_instances, "m", _SpoFieldAddCommand_initValidators).call(this);
40
+ get schema() {
41
+ return options;
42
+ }
43
+ getRefinedSchema(schema) {
44
+ return schema
45
+ .refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length <= 1, {
46
+ error: 'Specify either list id or title or list url, but not multiple'
47
+ });
27
48
  }
28
49
  async commandAction(logger, args) {
29
50
  try {
@@ -94,55 +115,5 @@ class SpoFieldAddCommand extends SpoCommand {
94
115
  return optionsValue;
95
116
  }
96
117
  }
97
- _SpoFieldAddCommand_instances = new WeakSet(), _SpoFieldAddCommand_initTelemetry = function _SpoFieldAddCommand_initTelemetry() {
98
- this.telemetry.push((args) => {
99
- Object.assign(this.telemetryProperties, {
100
- listTitle: typeof args.options.listTitle !== 'undefined',
101
- listId: typeof args.options.listId !== 'undefined',
102
- listUrl: typeof args.options.listUrl !== 'undefined',
103
- options: typeof args.options.options !== 'undefined'
104
- });
105
- });
106
- }, _SpoFieldAddCommand_initOptions = function _SpoFieldAddCommand_initOptions() {
107
- this.options.unshift({
108
- option: '-u, --webUrl <webUrl>'
109
- }, {
110
- option: '-l, --listTitle [listTitle]'
111
- }, {
112
- option: '--listId [listId]'
113
- }, {
114
- option: '--listUrl [listUrl]'
115
- }, {
116
- option: '-x, --xml <xml>'
117
- }, {
118
- option: '--options [options]'
119
- });
120
- }, _SpoFieldAddCommand_initValidators = function _SpoFieldAddCommand_initValidators() {
121
- this.validators.push(async (args) => {
122
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
123
- if (isValidSharePointUrl !== true) {
124
- return isValidSharePointUrl;
125
- }
126
- const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
127
- if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
128
- return `Specify either list id or title or list url, but not multiple`;
129
- }
130
- if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
131
- return `${args.options.listId} in option listId is not a valid GUID`;
132
- }
133
- if (args.options.options) {
134
- let optionsError = true;
135
- const options = ['DefaultValue', 'AddToDefaultContentType', 'AddToNoContentType', 'AddToAllContentTypes', 'AddFieldInternalNameHint', 'AddFieldToDefaultView', 'AddFieldCheckDisplayName'];
136
- args.options.options.split(',').forEach(o => {
137
- o = o.trim();
138
- if (options.indexOf(o) < 0) {
139
- optionsError = `${o} is not a valid value for the options argument. Allowed values are DefaultValue|AddToDefaultContentType|AddToNoContentType|AddToAllContentTypes|AddFieldInternalNameHint|AddFieldToDefaultView|AddFieldCheckDisplayName`;
140
- }
141
- });
142
- return optionsError;
143
- }
144
- return true;
145
- });
146
- };
147
118
  export default new SpoFieldAddCommand();
148
119
  //# sourceMappingURL=field-add.js.map
@@ -1,15 +1,27 @@
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 _SpoFieldGetCommand_instances, _SpoFieldGetCommand_initTelemetry, _SpoFieldGetCommand_initOptions, _SpoFieldGetCommand_initValidators, _SpoFieldGetCommand_initOptionSets;
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 { urlUtil } from '../../../../utils/urlUtil.js';
10
6
  import { validation } from '../../../../utils/validation.js';
11
7
  import SpoCommand from '../../../base/SpoCommand.js';
12
8
  import commands from '../../commands.js';
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
+ listTitle: z.string().optional().alias('l'),
15
+ listId: z.string().refine(id => validation.isValidGuid(id), {
16
+ error: e => `${e.input} is not a valid GUID`
17
+ }).optional(),
18
+ listUrl: z.string().optional(),
19
+ id: z.string().refine(id => validation.isValidGuid(id), {
20
+ error: e => `${e.input} is not a valid GUID`
21
+ }).optional().alias('i'),
22
+ title: z.string().optional().alias('t'),
23
+ internalName: z.string().optional()
24
+ });
13
25
  class SpoFieldGetCommand extends SpoCommand {
14
26
  get name() {
15
27
  return commands.FIELD_GET;
@@ -17,13 +29,18 @@ class SpoFieldGetCommand extends SpoCommand {
17
29
  get description() {
18
30
  return 'Retrieves information about the specified list- or site column';
19
31
  }
20
- constructor() {
21
- super();
22
- _SpoFieldGetCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _SpoFieldGetCommand_instances, "m", _SpoFieldGetCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _SpoFieldGetCommand_instances, "m", _SpoFieldGetCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _SpoFieldGetCommand_instances, "m", _SpoFieldGetCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _SpoFieldGetCommand_instances, "m", _SpoFieldGetCommand_initOptionSets).call(this);
32
+ get schema() {
33
+ return options;
34
+ }
35
+ getRefinedSchema(schema) {
36
+ return schema
37
+ .refine(opts => [opts.id, opts.title, opts.internalName].filter(o => o !== undefined).length === 1, {
38
+ error: 'Specify one of the following options: id, title, internalName.',
39
+ params: {
40
+ customCode: 'optionSet',
41
+ options: ['id', 'title', 'internalName']
42
+ }
43
+ });
27
44
  }
28
45
  async commandAction(logger, args) {
29
46
  let listRestUrl = '';
@@ -60,49 +77,5 @@ class SpoFieldGetCommand extends SpoCommand {
60
77
  }
61
78
  }
62
79
  }
63
- _SpoFieldGetCommand_instances = new WeakSet(), _SpoFieldGetCommand_initTelemetry = function _SpoFieldGetCommand_initTelemetry() {
64
- this.telemetry.push((args) => {
65
- Object.assign(this.telemetryProperties, {
66
- listId: typeof args.options.listId !== 'undefined',
67
- listTitle: typeof args.options.listTitle !== 'undefined',
68
- listUrl: typeof args.options.listUrl !== 'undefined',
69
- id: typeof args.options.id !== 'undefined',
70
- title: typeof args.options.title !== 'undefined',
71
- internalName: typeof args.options.internalName !== 'undefined'
72
- });
73
- });
74
- }, _SpoFieldGetCommand_initOptions = function _SpoFieldGetCommand_initOptions() {
75
- this.options.unshift({
76
- option: '-u, --webUrl <webUrl>'
77
- }, {
78
- option: '-l, --listTitle [listTitle]'
79
- }, {
80
- option: '--listId [listId]'
81
- }, {
82
- option: '--listUrl [listUrl]'
83
- }, {
84
- option: '-i, --id [id]'
85
- }, {
86
- option: '-t, --title [title]'
87
- }, {
88
- option: '--internalName [internalName]'
89
- });
90
- }, _SpoFieldGetCommand_initValidators = function _SpoFieldGetCommand_initValidators() {
91
- this.validators.push(async (args) => {
92
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
93
- if (isValidSharePointUrl !== true) {
94
- return isValidSharePointUrl;
95
- }
96
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
97
- return `${args.options.id} is not a valid GUID`;
98
- }
99
- if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
100
- return `${args.options.listId} is not a valid GUID`;
101
- }
102
- return true;
103
- });
104
- }, _SpoFieldGetCommand_initOptionSets = function _SpoFieldGetCommand_initOptionSets() {
105
- this.optionSets.push({ options: ['id', 'title', 'internalName'] });
106
- };
107
80
  export default new SpoFieldGetCommand();
108
81
  //# sourceMappingURL=field-get.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 _SpoFieldListCommand_instances, _SpoFieldListCommand_initTelemetry, _SpoFieldListCommand_initOptions, _SpoFieldListCommand_initValidators;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { formatting } from '../../../../utils/formatting.js';
8
4
  import { odata } from '../../../../utils/odata.js';
9
5
  import { urlUtil } from '../../../../utils/urlUtil.js';
10
6
  import { validation } from '../../../../utils/validation.js';
11
7
  import SpoCommand from '../../../base/SpoCommand.js';
12
8
  import commands from '../../commands.js';
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
+ listTitle: z.string().optional().alias('t'),
15
+ listId: z.string().refine(id => validation.isValidGuid(id), {
16
+ error: e => `${e.input} is not a valid GUID`
17
+ }).optional().alias('i'),
18
+ listUrl: z.string().optional()
19
+ });
13
20
  class SpoFieldListCommand extends SpoCommand {
14
21
  get name() {
15
22
  return commands.FIELD_LIST;
@@ -20,12 +27,14 @@ class SpoFieldListCommand extends SpoCommand {
20
27
  defaultProperties() {
21
28
  return ['Id', 'Title', 'InternalName', 'Hidden'];
22
29
  }
23
- constructor() {
24
- super();
25
- _SpoFieldListCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _SpoFieldListCommand_instances, "m", _SpoFieldListCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _SpoFieldListCommand_instances, "m", _SpoFieldListCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _SpoFieldListCommand_instances, "m", _SpoFieldListCommand_initValidators).call(this);
30
+ get schema() {
31
+ return options;
32
+ }
33
+ getRefinedSchema(schema) {
34
+ return schema
35
+ .refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length <= 1, {
36
+ error: 'Specify either list id or title or list url'
37
+ });
29
38
  }
30
39
  async commandAction(logger, args) {
31
40
  let listUrl = '';
@@ -48,39 +57,5 @@ class SpoFieldListCommand extends SpoCommand {
48
57
  }
49
58
  }
50
59
  }
51
- _SpoFieldListCommand_instances = new WeakSet(), _SpoFieldListCommand_initTelemetry = function _SpoFieldListCommand_initTelemetry() {
52
- this.telemetry.push((args) => {
53
- Object.assign(this.telemetryProperties, {
54
- listId: typeof args.options.listId !== 'undefined',
55
- listTitle: typeof args.options.listTitle !== 'undefined',
56
- listUrl: typeof args.options.listUrl !== 'undefined'
57
- });
58
- });
59
- }, _SpoFieldListCommand_initOptions = function _SpoFieldListCommand_initOptions() {
60
- this.options.unshift({
61
- option: '-u, --webUrl <webUrl>'
62
- }, {
63
- option: '-t, --listTitle [listTitle]'
64
- }, {
65
- option: '-i, --listId [listId]'
66
- }, {
67
- option: '--listUrl [listUrl]'
68
- });
69
- }, _SpoFieldListCommand_initValidators = function _SpoFieldListCommand_initValidators() {
70
- this.validators.push(async (args) => {
71
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
72
- if (isValidSharePointUrl !== true) {
73
- return isValidSharePointUrl;
74
- }
75
- if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
76
- return `${args.options.listId} is not a valid GUID`;
77
- }
78
- const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
79
- if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
80
- return `Specify either list id or title or list url`;
81
- }
82
- return true;
83
- });
84
- };
85
60
  export default new SpoFieldListCommand();
86
61
  //# sourceMappingURL=field-list.js.map
@@ -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 _SpoFieldRemoveCommand_instances, _SpoFieldRemoveCommand_initTelemetry, _SpoFieldRemoveCommand_initOptions, _SpoFieldRemoveCommand_initValidators, _SpoFieldRemoveCommand_initOptionSets;
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 { urlUtil } from '../../../../utils/urlUtil.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import SpoCommand from '../../../base/SpoCommand.js';
13
9
  import commands from '../../commands.js';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ }).alias('u'),
15
+ listTitle: z.string().optional().alias('l'),
16
+ listId: z.string().refine(id => validation.isValidGuid(id), {
17
+ error: e => `${e.input} is not a valid GUID`
18
+ }).optional(),
19
+ listUrl: z.string().optional(),
20
+ id: z.string().refine(id => validation.isValidGuid(id), {
21
+ error: e => `${e.input} is not a valid GUID`
22
+ }).optional().alias('i'),
23
+ title: z.string().optional().alias('t'),
24
+ internalName: z.string().optional(),
25
+ group: z.string().optional().alias('g'),
26
+ force: z.boolean().optional().alias('f')
27
+ });
14
28
  class SpoFieldRemoveCommand extends SpoCommand {
15
29
  get name() {
16
30
  return commands.FIELD_REMOVE;
@@ -18,13 +32,18 @@ class SpoFieldRemoveCommand extends SpoCommand {
18
32
  get description() {
19
33
  return 'Removes the specified list- or site column';
20
34
  }
21
- constructor() {
22
- super();
23
- _SpoFieldRemoveCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _SpoFieldRemoveCommand_instances, "m", _SpoFieldRemoveCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _SpoFieldRemoveCommand_instances, "m", _SpoFieldRemoveCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _SpoFieldRemoveCommand_instances, "m", _SpoFieldRemoveCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _SpoFieldRemoveCommand_instances, "m", _SpoFieldRemoveCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => [opts.id, opts.title, opts.internalName, opts.group].filter(o => o !== undefined).length === 1, {
41
+ error: 'Specify one of the following options: id, title, internalName, group.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['id', 'title', 'internalName', 'group']
45
+ }
46
+ });
28
47
  }
29
48
  async commandAction(logger, args) {
30
49
  let messageEnd;
@@ -117,55 +136,5 @@ class SpoFieldRemoveCommand extends SpoCommand {
117
136
  }
118
137
  }
119
138
  }
120
- _SpoFieldRemoveCommand_instances = new WeakSet(), _SpoFieldRemoveCommand_initTelemetry = function _SpoFieldRemoveCommand_initTelemetry() {
121
- this.telemetry.push((args) => {
122
- Object.assign(this.telemetryProperties, {
123
- listId: typeof args.options.listId !== 'undefined',
124
- listTitle: typeof args.options.listTitle !== 'undefined',
125
- listUrl: typeof args.options.listUrl !== 'undefined',
126
- id: typeof args.options.id !== 'undefined',
127
- group: typeof args.options.group !== 'undefined',
128
- title: typeof args.options.title !== 'undefined',
129
- internalName: typeof args.options.internalName !== 'undefined',
130
- force: (!(!args.options.force)).toString()
131
- });
132
- });
133
- }, _SpoFieldRemoveCommand_initOptions = function _SpoFieldRemoveCommand_initOptions() {
134
- this.options.unshift({
135
- option: '-u, --webUrl <webUrl>'
136
- }, {
137
- option: '-l, --listTitle [listTitle]'
138
- }, {
139
- option: '--listId [listId]'
140
- }, {
141
- option: '--listUrl [listUrl]'
142
- }, {
143
- option: '-i, --id [id]'
144
- }, {
145
- option: '-t, --title [title]'
146
- }, {
147
- option: '--internalName [internalName]'
148
- }, {
149
- option: '-g, --group [group]'
150
- }, {
151
- option: '-f, --force'
152
- });
153
- }, _SpoFieldRemoveCommand_initValidators = function _SpoFieldRemoveCommand_initValidators() {
154
- this.validators.push(async (args) => {
155
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
156
- if (isValidSharePointUrl !== true) {
157
- return isValidSharePointUrl;
158
- }
159
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
160
- return `${args.options.id} is not a valid GUID`;
161
- }
162
- if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
163
- return `${args.options.listId} is not a valid GUID`;
164
- }
165
- return true;
166
- });
167
- }, _SpoFieldRemoveCommand_initOptionSets = function _SpoFieldRemoveCommand_initOptionSets() {
168
- this.optionSets.push({ options: ['id', 'title', 'internalName', 'group'] });
169
- };
170
139
  export default new SpoFieldRemoveCommand();
171
140
  //# sourceMappingURL=field-remove.js.map
@@ -1,10 +1,6 @@
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 _SpoFieldSetCommand_instances, _SpoFieldSetCommand_initTelemetry, _SpoFieldSetCommand_initOptions, _SpoFieldSetCommand_initValidators, _SpoFieldSetCommand_initOptionSets;
1
+ import { z } from 'zod';
7
2
  import config from '../../../../config.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';
@@ -12,6 +8,23 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
12
8
  import { validation } from '../../../../utils/validation.js';
13
9
  import SpoCommand from '../../../base/SpoCommand.js';
14
10
  import commands from '../../commands.js';
11
+ export const options = z.object({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
14
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
15
+ }).alias('u'),
16
+ listId: z.string().refine(id => validation.isValidGuid(id), {
17
+ error: e => `${e.input} in option listId is not a valid GUID`
18
+ }).optional(),
19
+ listTitle: z.string().optional(),
20
+ listUrl: z.string().optional(),
21
+ id: z.string().refine(id => validation.isValidGuid(id), {
22
+ error: e => `${e.input} in option id is not a valid GUID`
23
+ }).optional().alias('i'),
24
+ title: z.string().optional().alias('t'),
25
+ internalName: z.string().optional(),
26
+ updateExistingLists: z.boolean().optional()
27
+ }).catchall(z.unknown());
15
28
  class SpoFieldSetCommand extends SpoCommand {
16
29
  get name() {
17
30
  return commands.FIELD_SET;
@@ -19,13 +32,21 @@ class SpoFieldSetCommand extends SpoCommand {
19
32
  get description() {
20
33
  return 'Updates existing list or site column';
21
34
  }
22
- constructor() {
23
- super();
24
- _SpoFieldSetCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _SpoFieldSetCommand_instances, "m", _SpoFieldSetCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _SpoFieldSetCommand_instances, "m", _SpoFieldSetCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _SpoFieldSetCommand_instances, "m", _SpoFieldSetCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _SpoFieldSetCommand_instances, "m", _SpoFieldSetCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(opts => [opts.id, opts.title, opts.internalName].filter(o => o !== undefined).length === 1, {
41
+ error: 'Specify one of the following options: id, title, internalName.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['id', 'title', 'internalName']
45
+ }
46
+ })
47
+ .refine(opts => [opts.listId, opts.listTitle, opts.listUrl].filter(o => o !== undefined).length <= 1, {
48
+ error: 'Specify either list id or title or list url, but not multiple'
49
+ });
29
50
  }
30
51
  allowUnknownOptions() {
31
52
  return true;
@@ -121,58 +142,5 @@ class SpoFieldSetCommand extends SpoCommand {
121
142
  return payload;
122
143
  }
123
144
  }
124
- _SpoFieldSetCommand_instances = new WeakSet(), _SpoFieldSetCommand_initTelemetry = function _SpoFieldSetCommand_initTelemetry() {
125
- this.telemetry.push((args) => {
126
- Object.assign(this.telemetryProperties, {
127
- id: typeof args.options.id !== 'undefined',
128
- title: typeof args.options.title !== 'undefined',
129
- internalName: typeof args.options.internalName !== 'undefined',
130
- listId: typeof args.options.listId !== 'undefined',
131
- listTitle: typeof args.options.listTitle !== 'undefined',
132
- listUrl: typeof args.options.listUrl !== 'undefined',
133
- updateExistingLists: !!args.options.updateExistingLists
134
- });
135
- });
136
- }, _SpoFieldSetCommand_initOptions = function _SpoFieldSetCommand_initOptions() {
137
- this.options.unshift({
138
- option: '-u, --webUrl <webUrl>'
139
- }, {
140
- option: '--listId [listId]'
141
- }, {
142
- option: '--listTitle [listTitle]'
143
- }, {
144
- option: '--listUrl [listUrl]'
145
- }, {
146
- option: '-i, --id [id]'
147
- }, {
148
- option: '-t, --title [title]'
149
- }, {
150
- option: '--internalName [internalName]'
151
- }, {
152
- option: '--updateExistingLists'
153
- });
154
- }, _SpoFieldSetCommand_initValidators = function _SpoFieldSetCommand_initValidators() {
155
- this.validators.push(async (args) => {
156
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
157
- if (isValidSharePointUrl !== true) {
158
- return isValidSharePointUrl;
159
- }
160
- const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
161
- if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
162
- return `Specify either list id or title or list url, but not multiple`;
163
- }
164
- if (args.options.listId &&
165
- !validation.isValidGuid(args.options.listId)) {
166
- return `${args.options.listId} in option listId is not a valid GUID`;
167
- }
168
- if (args.options.id &&
169
- !validation.isValidGuid(args.options.id)) {
170
- return `${args.options.id} in option id is not a valid GUID`;
171
- }
172
- return true;
173
- });
174
- }, _SpoFieldSetCommand_initOptionSets = function _SpoFieldSetCommand_initOptionSets() {
175
- this.optionSets.push({ options: ['id', 'title', 'internalName'] });
176
- };
177
145
  export default new SpoFieldSetCommand();
178
146
  //# sourceMappingURL=field-set.js.map
@@ -40,7 +40,7 @@ class SpoFileArchiveCommand extends SpoCommand {
40
40
  async commandAction(logger, args) {
41
41
  const { webUrl, url, id, force, verbose } = args.options;
42
42
  if (!force) {
43
- const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this item? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
43
+ const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this file? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
44
44
  if (!result) {
45
45
  return;
46
46
  }
@@ -64,9 +64,10 @@ class SpoFileGetCommand extends SpoCommand {
64
64
  headers: {
65
65
  'accept': 'application/json;odata=nometadata'
66
66
  },
67
- // Set responseType to arraybuffer, otherwise binary data will be encoded
68
- // to utf8 and binary data is corrupt
69
- responseType: args.options.asFile ? 'stream' : 'json'
67
+ // Use stream for --asFile, so binary data is piped to disk as-is and
68
+ // isn't encoded to utf8 (which would corrupt it). Use text for
69
+ // --asString. Use json for all other cases.
70
+ responseType: args.options.asFile ? 'stream' : args.options.asString ? 'text' : 'json'
70
71
  };
71
72
  try {
72
73
  const file = await request.get(requestOptions);
@@ -46,7 +46,7 @@ class SpoFileRemoveCommand extends SpoCommand {
46
46
  const serverRelativePath = urlUtil.getServerRelativePath(args.options.webUrl, args.options.url);
47
47
  requestUrl = `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
48
48
  }
49
- if (args.options.recycle) {
49
+ if (!args.options.permanent) {
50
50
  requestUrl += `/recycle()`;
51
51
  }
52
52
  const requestOptions = {
@@ -73,7 +73,7 @@ class SpoFileRemoveCommand extends SpoCommand {
73
73
  await removeFile();
74
74
  }
75
75
  else {
76
- const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.recycle ? 'recycle' : 'remove'} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?` });
76
+ const result = await cli.promptForConfirmation({ message: `Are you sure you want to ${args.options.permanent ? 'permanently remove' : 'recycle'} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?` });
77
77
  if (result) {
78
78
  await removeFile();
79
79
  }
@@ -85,7 +85,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
85
85
  Object.assign(this.telemetryProperties, {
86
86
  id: typeof args.options.id !== 'undefined',
87
87
  url: typeof args.options.url !== 'undefined',
88
- recycle: !!args.options.recycle,
88
+ permanent: !!args.options.permanent,
89
89
  bypassSharedLock: !!args.options.bypassSharedLock,
90
90
  force: !!args.options.force
91
91
  });
@@ -98,7 +98,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
98
98
  }, {
99
99
  option: '--url [url]'
100
100
  }, {
101
- option: '--recycle'
101
+ option: '--permanent'
102
102
  }, {
103
103
  option: '--bypassSharedLock'
104
104
  }, {
@@ -120,7 +120,7 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
120
120
  this.optionSets.push({ options: ['id', 'url'] });
121
121
  }, _SpoFileRemoveCommand_initTypes = function _SpoFileRemoveCommand_initTypes() {
122
122
  this.types.string.push('webUrl', 'id', 'url');
123
- this.types.boolean.push('recycle', 'bypassSharedLock', 'force');
123
+ this.types.boolean.push('permanent', 'bypassSharedLock', 'force');
124
124
  };
125
125
  export default new SpoFileRemoveCommand();
126
126
  //# sourceMappingURL=file-remove.js.map
@@ -40,7 +40,7 @@ class SpoFileUnarchiveCommand extends SpoCommand {
40
40
  async commandAction(logger, args) {
41
41
  const { webUrl, url, id, force, verbose } = args.options;
42
42
  if (!force) {
43
- const result = await cli.promptForConfirmation({ message: `Reactivation could take up to 24 hours. Files that are reactivated cannot be archived again for 30 days. Are you sure you would like to unarchive this item?` });
43
+ const result = await cli.promptForConfirmation({ message: `Reactivation could take up to 24 hours. Files that are reactivated cannot be archived again for a period of time. Are you sure you would like to unarchive this file?` });
44
44
  if (!result) {
45
45
  return;
46
46
  }
@@ -40,7 +40,7 @@ class SpoFolderArchiveCommand extends SpoCommand {
40
40
  async commandAction(logger, args) {
41
41
  const { webUrl, url, id, force } = args.options;
42
42
  if (!force) {
43
- const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this item? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
43
+ const result = await cli.promptForConfirmation({ message: `Are you sure you would like to archive this folder? You will be able to reactivate it instantly for the first 7 days. After that, it will take up to 24 hours to reactivate.` });
44
44
  if (!result) {
45
45
  return;
46
46
  }