@pnp/cli-microsoft365 7.3.0-beta.ca3f7f5 → 7.3.0-beta.d293309

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 (253) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +3 -4
  4. package/dist/Command.js +10 -13
  5. package/dist/api.js +2 -3
  6. package/dist/autocomplete.js +4 -6
  7. package/dist/chili/chili.js +1 -2
  8. package/dist/cli/cli.js +880 -0
  9. package/dist/index.js +2 -2
  10. package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-list.js +138 -0
  11. package/dist/m365/aad/commands/administrativeunit/administrativeunit-remove.js +2 -2
  12. package/dist/m365/aad/commands/app/app-get.js +2 -2
  13. package/dist/m365/aad/commands/app/app-remove.js +3 -3
  14. package/dist/m365/aad/commands/app/app-role-add.js +2 -2
  15. package/dist/m365/aad/commands/app/app-role-list.js +2 -2
  16. package/dist/m365/aad/commands/app/app-role-remove.js +4 -4
  17. package/dist/m365/aad/commands/app/app-set.js +2 -2
  18. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +2 -2
  19. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +2 -2
  20. package/dist/m365/aad/commands/group/group-list.js +2 -2
  21. package/dist/m365/aad/commands/group/group-remove.js +2 -2
  22. package/dist/m365/aad/commands/groupsetting/groupsetting-remove.js +2 -2
  23. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-clear.js +2 -2
  24. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -3
  25. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +2 -2
  26. package/dist/m365/aad/commands/m365group/m365group-remove.js +2 -2
  27. package/dist/m365/aad/commands/m365group/m365group-teamify.js +2 -2
  28. package/dist/m365/aad/commands/m365group/m365group-user-remove.js +2 -2
  29. package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +2 -2
  30. package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +2 -2
  31. package/dist/m365/aad/commands/sp/sp-add.js +2 -2
  32. package/dist/m365/aad/commands/sp/sp-get.js +2 -2
  33. package/dist/m365/aad/commands/user/user-get.js +2 -2
  34. package/dist/m365/aad/commands/user/user-license-remove.js +2 -2
  35. package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +2 -2
  36. package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +2 -2
  37. package/dist/m365/aad/commands/user/user-remove.js +2 -2
  38. package/dist/m365/aad/commands.js +1 -0
  39. package/dist/m365/app/commands/app-get.js +2 -2
  40. package/dist/m365/app/commands/app-open.js +2 -2
  41. package/dist/m365/app/commands/permission/permission-list.js +2 -2
  42. package/dist/m365/base/AppCommand.js +2 -2
  43. package/dist/m365/booking/commands/business/business-get.js +2 -2
  44. package/dist/m365/cli/commands/cli-doctor.js +2 -2
  45. package/dist/m365/cli/commands/cli-reconsent.js +2 -2
  46. package/dist/m365/cli/commands/config/config-get.js +2 -2
  47. package/dist/m365/cli/commands/config/config-list.js +2 -2
  48. package/dist/m365/cli/commands/config/config-reset.js +3 -3
  49. package/dist/m365/cli/commands/config/config-set.js +4 -4
  50. package/dist/m365/commands/docs.js +2 -2
  51. package/dist/m365/commands/login.js +4 -4
  52. package/dist/m365/commands/setup.js +8 -8
  53. package/dist/m365/context/commands/context-remove.js +2 -2
  54. package/dist/m365/context/commands/option/option-remove.js +2 -2
  55. package/dist/m365/external/commands/connection/connection-doctor.js +1 -2
  56. package/dist/m365/external/commands/connection/connection-remove.js +3 -3
  57. package/dist/m365/flow/commands/flow-remove.js +2 -2
  58. package/dist/m365/flow/commands/owner/owner-list.js +2 -2
  59. package/dist/m365/flow/commands/owner/owner-remove.js +2 -2
  60. package/dist/m365/flow/commands/run/run-cancel.js +2 -2
  61. package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
  62. package/dist/m365/graph/commands/changelog/changelog-list.js +3 -3
  63. package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +2 -2
  64. package/dist/m365/outlook/commands/message/message-list.js +2 -2
  65. package/dist/m365/outlook/commands/message/message-move.js +2 -2
  66. package/dist/m365/pa/commands/app/app-consent-set.js +2 -2
  67. package/dist/m365/pa/commands/app/app-get.js +2 -2
  68. package/dist/m365/pa/commands/app/app-permission-remove.js +2 -2
  69. package/dist/m365/pa/commands/app/app-remove.js +2 -2
  70. package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
  71. package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -3
  72. package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
  73. package/dist/m365/planner/commands/plan/plan-remove.js +2 -2
  74. package/dist/m365/planner/commands/roster/roster-member-remove.js +3 -3
  75. package/dist/m365/planner/commands/roster/roster-remove.js +2 -2
  76. package/dist/m365/planner/commands/task/task-checklistitem-add.js +2 -2
  77. package/dist/m365/planner/commands/task/task-checklistitem-list.js +2 -2
  78. package/dist/m365/planner/commands/task/task-checklistitem-remove.js +2 -2
  79. package/dist/m365/planner/commands/task/task-get.js +3 -3
  80. package/dist/m365/planner/commands/task/task-reference-remove.js +2 -2
  81. package/dist/m365/planner/commands/task/task-remove.js +4 -4
  82. package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +2 -2
  83. package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-remove.js +3 -3
  84. package/dist/m365/pp/commands/card/card-clone.js +2 -2
  85. package/dist/m365/pp/commands/card/card-get.js +2 -2
  86. package/dist/m365/pp/commands/card/card-remove.js +3 -3
  87. package/dist/m365/pp/commands/chatbot/chatbot-get.js +2 -2
  88. package/dist/m365/pp/commands/chatbot/chatbot-remove.js +3 -3
  89. package/dist/m365/pp/commands/dataverse/dataverse-table-remove.js +2 -2
  90. package/dist/m365/pp/commands/dataverse/dataverse-table-row-remove.js +2 -2
  91. package/dist/m365/pp/commands/managementapp/managementapp-add.js +2 -2
  92. package/dist/m365/pp/commands/solution/solution-get.js +2 -2
  93. package/dist/m365/pp/commands/solution/solution-list.js +2 -2
  94. package/dist/m365/pp/commands/solution/solution-publish.js +2 -2
  95. package/dist/m365/pp/commands/solution/solution-publisher-remove.js +3 -3
  96. package/dist/m365/pp/commands/solution/solution-remove.js +3 -3
  97. package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +2 -2
  98. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +2 -2
  99. package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +2 -2
  100. package/dist/m365/spfx/commands/project/project-permissions-grant.js +2 -2
  101. package/dist/m365/spo/commands/app/app-add.js +2 -2
  102. package/dist/m365/spo/commands/app/app-remove.js +2 -2
  103. package/dist/m365/spo/commands/app/app-retract.js +2 -2
  104. package/dist/m365/spo/commands/app/app-uninstall.js +2 -2
  105. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +2 -2
  106. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +3 -3
  107. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +2 -2
  108. package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +2 -2
  109. package/dist/m365/spo/commands/commandset/commandset-get.js +2 -2
  110. package/dist/m365/spo/commands/commandset/commandset-remove.js +3 -3
  111. package/dist/m365/spo/commands/commandset/commandset-set.js +2 -2
  112. package/dist/m365/spo/commands/contenttype/contenttype-add.js +2 -2
  113. package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +2 -2
  114. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +2 -2
  115. package/dist/m365/spo/commands/customaction/customaction-clear.js +2 -2
  116. package/dist/m365/spo/commands/customaction/customaction-get.js +3 -3
  117. package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -3
  118. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +2 -2
  119. package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +3 -3
  120. package/dist/m365/spo/commands/field/field-remove.js +2 -2
  121. package/dist/m365/spo/commands/file/file-checkout-undo.js +2 -2
  122. package/dist/m365/spo/commands/file/file-remove.js +2 -2
  123. package/dist/m365/spo/commands/file/file-rename.js +2 -2
  124. package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +2 -2
  125. package/dist/m365/spo/commands/file/file-roleassignment-add.js +5 -5
  126. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +5 -5
  127. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +3 -3
  128. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +3 -3
  129. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +2 -2
  130. package/dist/m365/spo/commands/file/file-sharinglink-clear.js +3 -3
  131. package/dist/m365/spo/commands/file/file-sharinglink-list.js +2 -2
  132. package/dist/m365/spo/commands/file/file-sharinglink-remove.js +2 -2
  133. package/dist/m365/spo/commands/file/file-version-clear.js +2 -2
  134. package/dist/m365/spo/commands/file/file-version-remove.js +2 -2
  135. package/dist/m365/spo/commands/file/file-version-restore.js +2 -2
  136. package/dist/m365/spo/commands/folder/folder-remove.js +2 -2
  137. package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +2 -2
  138. package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +4 -4
  139. package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +4 -4
  140. package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +2 -2
  141. package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +2 -2
  142. package/dist/m365/spo/commands/group/group-list.js +2 -2
  143. package/dist/m365/spo/commands/group/group-member-remove.js +9 -9
  144. package/dist/m365/spo/commands/group/group-remove.js +2 -2
  145. package/dist/m365/spo/commands/group/group-set.js +2 -2
  146. package/dist/m365/spo/commands/homesite/homesite-remove.js +2 -2
  147. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +2 -2
  148. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +3 -3
  149. package/dist/m365/spo/commands/hubsite/hubsite-get.js +4 -4
  150. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +2 -2
  151. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +2 -2
  152. package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +2 -2
  153. package/dist/m365/spo/commands/list/list-contenttype-remove.js +2 -2
  154. package/dist/m365/spo/commands/list/list-remove.js +2 -2
  155. package/dist/m365/spo/commands/list/list-retentionlabel-remove.js +2 -2
  156. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +4 -4
  157. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +2 -2
  158. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +2 -2
  159. package/dist/m365/spo/commands/list/list-view-field-remove.js +2 -2
  160. package/dist/m365/spo/commands/list/list-view-remove.js +2 -2
  161. package/dist/m365/spo/commands/list/list-webhook-remove.js +2 -2
  162. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +2 -2
  163. package/dist/m365/spo/commands/listitem/listitem-list.js +2 -2
  164. package/dist/m365/spo/commands/listitem/listitem-remove.js +2 -2
  165. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +2 -2
  166. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +4 -4
  167. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +4 -4
  168. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +2 -2
  169. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +2 -2
  170. package/dist/m365/spo/commands/navigation/navigation-node-remove.js +2 -2
  171. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +2 -2
  172. package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +2 -2
  173. package/dist/m365/spo/commands/page/page-add.js +4 -4
  174. package/dist/m365/spo/commands/page/page-column-get.js +2 -2
  175. package/dist/m365/spo/commands/page/page-column-list.js +2 -2
  176. package/dist/m365/spo/commands/page/page-remove.js +2 -2
  177. package/dist/m365/spo/commands/page/page-section-get.js +2 -2
  178. package/dist/m365/spo/commands/page/page-section-list.js +2 -2
  179. package/dist/m365/spo/commands/page/page-set.js +5 -5
  180. package/dist/m365/spo/commands/propertybag/propertybag-remove.js +2 -2
  181. package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +2 -2
  182. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +2 -2
  183. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +2 -2
  184. package/dist/m365/spo/commands/site/site-apppermission-remove.js +2 -2
  185. package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +2 -2
  186. package/dist/m365/spo/commands/site/site-recyclebinitem-clear.js +2 -2
  187. package/dist/m365/spo/commands/site/site-recyclebinitem-move.js +2 -2
  188. package/dist/m365/spo/commands/site/site-recyclebinitem-remove.js +2 -2
  189. package/dist/m365/spo/commands/site/site-remove.js +2 -2
  190. package/dist/m365/spo/commands/site/site-set.js +3 -3
  191. package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +2 -2
  192. package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +2 -2
  193. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +2 -2
  194. package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +2 -2
  195. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +2 -2
  196. package/dist/m365/spo/commands/spo-search.js +2 -2
  197. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +2 -2
  198. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +5 -5
  199. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +5 -5
  200. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +2 -2
  201. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +3 -3
  202. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +4 -4
  203. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +5 -5
  204. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +2 -2
  205. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -3
  206. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +2 -2
  207. package/dist/m365/spo/commands/term/term-get.js +2 -2
  208. package/dist/m365/spo/commands/term/term-list.js +2 -2
  209. package/dist/m365/spo/commands/theme/theme-remove.js +2 -2
  210. package/dist/m365/spo/commands/user/user-remove.js +2 -2
  211. package/dist/m365/spo/commands/userprofile/userprofile-get.js +2 -2
  212. package/dist/m365/spo/commands/web/web-remove.js +2 -2
  213. package/dist/m365/spo/commands/web/web-roleassignment-add.js +4 -4
  214. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +4 -4
  215. package/dist/m365/spo/commands/web/web-roleinheritance-break.js +2 -2
  216. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +2 -2
  217. package/dist/m365/teams/commands/app/app-install.js +32 -5
  218. package/dist/m365/teams/commands/app/app-remove.js +3 -3
  219. package/dist/m365/teams/commands/app/app-uninstall.js +2 -2
  220. package/dist/m365/teams/commands/app/app-update.js +2 -2
  221. package/dist/m365/teams/commands/cache/cache-remove.js +2 -2
  222. package/dist/m365/teams/commands/channel/channel-add.js +2 -2
  223. package/dist/m365/teams/commands/channel/channel-member-add.js +2 -2
  224. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -3
  225. package/dist/m365/teams/commands/channel/channel-member-set.js +2 -2
  226. package/dist/m365/teams/commands/channel/channel-remove.js +2 -2
  227. package/dist/m365/teams/commands/chat/chat-get.js +3 -3
  228. package/dist/m365/teams/commands/chat/chat-member-remove.js +2 -2
  229. package/dist/m365/teams/commands/chat/chat-message-send.js +3 -3
  230. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +2 -2
  231. package/dist/m365/teams/commands/tab/tab-remove.js +2 -2
  232. package/dist/m365/teams/commands/team/team-app-list.js +3 -3
  233. package/dist/m365/teams/commands/team/team-remove.js +2 -2
  234. package/dist/m365/teams/commands/user/user-app-list.js +2 -2
  235. package/dist/m365/teams/commands/user/user-app-remove.js +3 -3
  236. package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +2 -2
  237. package/dist/m365/todo/commands/list/list-remove.js +2 -2
  238. package/dist/m365/todo/commands/task/task-get.js +2 -2
  239. package/dist/m365/todo/commands/task/task-list.js +2 -2
  240. package/dist/m365/todo/commands/task/task-remove.js +2 -2
  241. package/dist/m365/viva/commands/connections/connections-app-create.js +2 -2
  242. package/dist/m365/yammer/commands/group/group-user-remove.js +2 -2
  243. package/dist/m365/yammer/commands/message/message-like-set.js +2 -2
  244. package/dist/m365/yammer/commands/message/message-remove.js +2 -2
  245. package/dist/m365/yammer/commands/yammer-search.js +2 -2
  246. package/dist/telemetry.js +2 -2
  247. package/dist/utils/aadAdministrativeUnit.js +2 -2
  248. package/dist/utils/aadGroup.js +3 -3
  249. package/dist/utils/prompt.js +4 -7
  250. package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-list.mdx +312 -0
  251. package/docs/docs/cmd/teams/app/app-install.mdx +11 -2
  252. package/package.json +1 -1
  253. package/dist/cli/Cli.js +0 -858
package/dist/Auth.js CHANGED
@@ -2,7 +2,7 @@ import { AzureCloudInstance } from '@azure/msal-common';
2
2
  import { CommandError } from './Command.js';
3
3
  import { FileTokenStorage } from './auth/FileTokenStorage.js';
4
4
  import { msalCachePlugin } from './auth/msalCachePlugin.js';
5
- import { Cli } from './cli/Cli.js';
5
+ import { cli } from './cli/cli.js';
6
6
  import config from './config.js';
7
7
  import request from './request.js';
8
8
  import { settingsNames } from './settingsNames.js';
@@ -338,7 +338,6 @@ export class Auth {
338
338
  await logger.logToStderr(response);
339
339
  await logger.logToStderr('');
340
340
  }
341
- const cli = Cli.getInstance();
342
341
  cli.spinner.text = response.message;
343
342
  cli.spinner.spinner = {
344
343
  frames: ['🌶️ ']
@@ -348,10 +347,10 @@ export class Auth {
348
347
  if (!cli.spinner.isSpinning && typeof global.it === 'undefined') {
349
348
  cli.spinner.start();
350
349
  }
351
- if (Cli.getInstance().getSettingWithDefaultValue(settingsNames.autoOpenLinksInBrowser, false)) {
350
+ if (cli.getSettingWithDefaultValue(settingsNames.autoOpenLinksInBrowser, false)) {
352
351
  browserUtil.open(response.verificationUri);
353
352
  }
354
- if (Cli.getInstance().getSettingWithDefaultValue(settingsNames.copyDeviceCodeToClipboard, false)) {
353
+ if (cli.getSettingWithDefaultValue(settingsNames.copyDeviceCodeToClipboard, false)) {
355
354
  // _clipboardy is never set before hitting this line, but this check
356
355
  // is implemented so that we can support lazy loading
357
356
  // but also stub it for testing
package/dist/Command.js CHANGED
@@ -6,7 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
6
6
  var _Command_instances, _Command_initTelemetry, _Command_initOptions, _Command_initValidators;
7
7
  import os from 'os';
8
8
  import auth from './Auth.js';
9
- import { Cli } from './cli/Cli.js';
9
+ import { cli } from './cli/cli.js';
10
10
  import request from './request.js';
11
11
  import { settingsNames } from './settingsNames.js';
12
12
  import { telemetry } from './telemetry.js';
@@ -75,7 +75,7 @@ class Command {
75
75
  return true;
76
76
  }
77
77
  async validateRequiredOptions(args, command) {
78
- const shouldPrompt = Cli.getInstance().getSettingWithDefaultValue(settingsNames.prompt, true);
78
+ const shouldPrompt = cli.getSettingWithDefaultValue(settingsNames.prompt, true);
79
79
  let prompted = false;
80
80
  for (let i = 0; i < command.options.length; i++) {
81
81
  const optionInfo = command.options[i];
@@ -88,7 +88,7 @@ class Command {
88
88
  }
89
89
  if (!prompted) {
90
90
  prompted = true;
91
- Cli.error('🌶️ Provide values for the following parameters:');
91
+ cli.error('🌶️ Provide values for the following parameters:');
92
92
  }
93
93
  const answer = optionInfo.autocomplete !== undefined
94
94
  ? await prompt.forSelection({ message: `${optionInfo.name}: `, choices: optionInfo.autocomplete.map((choice) => { return { name: choice, value: choice }; }) })
@@ -96,7 +96,7 @@ class Command {
96
96
  args.options[optionInfo.name] = answer;
97
97
  }
98
98
  if (prompted) {
99
- Cli.error('');
99
+ cli.error('');
100
100
  }
101
101
  this.processOptions(args.options);
102
102
  return true;
@@ -106,7 +106,7 @@ class Command {
106
106
  if (!optionsSets || optionsSets.length === 0) {
107
107
  return true;
108
108
  }
109
- const shouldPrompt = Cli.getInstance().getSettingWithDefaultValue(settingsNames.prompt, true);
109
+ const shouldPrompt = cli.getSettingWithDefaultValue(settingsNames.prompt, true);
110
110
  const argsOptions = Object.keys(args.options);
111
111
  for (const optionSet of optionsSets.sort(opt => opt.runsWhen ? 0 : 1)) {
112
112
  if (optionSet.runsWhen && !optionSet.runsWhen(args)) {
@@ -129,17 +129,17 @@ class Command {
129
129
  return true;
130
130
  }
131
131
  async promptForOptionSetNameAndValue(args, optionSet) {
132
- Cli.error(`🌶️ Please specify one of the following options:`);
132
+ cli.error(`🌶️ Please specify one of the following options:`);
133
133
  const selectedOptionName = await prompt.forSelection({ message: `Option to use:`, choices: optionSet.options.map((choice) => { return { name: choice, value: choice }; }) });
134
134
  const optionValue = await prompt.forInput({ message: `${selectedOptionName}:` });
135
135
  args.options[selectedOptionName] = optionValue;
136
- Cli.error('');
136
+ cli.error('');
137
137
  }
138
138
  async promptForSpecificOption(args, commonOptions) {
139
- Cli.error(`🌶️ Multiple options for an option set specified. Please specify the correct option that you wish to use.`);
139
+ cli.error(`🌶️ Multiple options for an option set specified. Please specify the correct option that you wish to use.`);
140
140
  const selectedOptionName = await prompt.forSelection({ message: `Option to use:`, choices: commonOptions.map((choice) => { return { name: choice, value: choice }; }) });
141
141
  commonOptions.filter(y => y !== selectedOptionName).map(optionName => args.options[optionName] = undefined);
142
- Cli.error('');
142
+ cli.error('');
143
143
  }
144
144
  async validateOutput(args) {
145
145
  if (args.options.output &&
@@ -376,7 +376,6 @@ class Command {
376
376
  });
377
377
  }
378
378
  async showDeprecationWarning(logger, deprecated, recommended) {
379
- const cli = Cli.getInstance();
380
379
  if (cli.currentCommandName &&
381
380
  cli.currentCommandName.indexOf(deprecated) === 0) {
382
381
  const chalk = (await import('chalk')).default;
@@ -388,7 +387,6 @@ class Command {
388
387
  await logger.logToStderr(chalk.yellow(warning));
389
388
  }
390
389
  getUsedCommandName() {
391
- const cli = Cli.getInstance();
392
390
  const commandName = this.getCommandName();
393
391
  if (!cli.currentCommandName) {
394
392
  return commandName;
@@ -456,7 +454,6 @@ class Command {
456
454
  }
457
455
  async getCsvOutput(logStatement, options) {
458
456
  const { stringify } = await import('csv-stringify/sync');
459
- const cli = Cli.getInstance();
460
457
  if (logStatement && logStatement.length > 0 && !options.query) {
461
458
  logStatement.map(l => {
462
459
  for (const x of Object.keys(l)) {
@@ -474,7 +471,7 @@ class Command {
474
471
  return stringify(logStatement, {
475
472
  header: cli.getSettingWithDefaultValue(settingsNames.csvHeader, true),
476
473
  escape: cli.getSettingWithDefaultValue(settingsNames.csvEscape, '"'),
477
- quote: cli.config.get(settingsNames.csvQuote),
474
+ quote: cli.getConfig().get(settingsNames.csvQuote),
478
475
  quoted: cli.getSettingWithDefaultValue(settingsNames.csvQuoted, false),
479
476
  // eslint-disable-next-line camelcase
480
477
  quoted_empty: cli.getSettingWithDefaultValue(settingsNames.csvQuotedEmpty, false)
package/dist/api.js CHANGED
@@ -1,11 +1,10 @@
1
- import { Cli } from "./cli/Cli.js";
1
+ import { cli } from "./cli/cli.js";
2
2
  export async function executeCommand(commandName, options, listener) {
3
- const cli = Cli.getInstance();
4
3
  cli.loadAllCommandsInfo();
5
4
  await cli.loadCommandFromArgs(commandName.split(' '));
6
5
  if (!cli.commandToExecute) {
7
6
  return Promise.reject(`Command not found: ${commandName}`);
8
7
  }
9
- return Cli.executeCommandWithOutput(cli.commandToExecute.command, { options: options ?? {} }, listener);
8
+ return cli.executeCommandWithOutput(cli.commandToExecute.command, { options: options ?? {} }, listener);
10
9
  }
11
10
  //# sourceMappingURL=api.js.map
@@ -4,7 +4,7 @@ import omelette from 'omelette';
4
4
  import os from 'os';
5
5
  import path from 'path';
6
6
  import url from 'url';
7
- import { Cli } from './cli/Cli.js';
7
+ import { cli } from './cli/cli.js';
8
8
  const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
9
9
  class Autocomplete {
10
10
  constructor() {
@@ -71,16 +71,14 @@ class Autocomplete {
71
71
  data.reply(replies);
72
72
  }
73
73
  generateShCompletion() {
74
- const cli = Cli.getInstance();
75
- const commandsInfo = this.getCommandsInfo(cli);
74
+ const commandsInfo = this.getCommandsInfo();
76
75
  fs.writeFileSync(Autocomplete.autocompleteFilePath, JSON.stringify(commandsInfo));
77
76
  }
78
77
  setupShCompletion() {
79
78
  this.omelette.setupShellInitFile();
80
79
  }
81
80
  getClinkCompletion() {
82
- const cli = Cli.getInstance();
83
- const cmd = this.getCommandsInfo(cli);
81
+ const cmd = this.getCommandsInfo();
84
82
  const lua = ['local parser = clink.arg.new_parser'];
85
83
  const functions = {};
86
84
  this.buildClinkForBranch(cmd, functions, 'm365');
@@ -136,7 +134,7 @@ class Autocomplete {
136
134
  getLuaFunctionName(functionName) {
137
135
  return functionName.replace(/-/g, '_');
138
136
  }
139
- getCommandsInfo(cli) {
137
+ getCommandsInfo() {
140
138
  const commandsInfo = {};
141
139
  const commands = cli.commands;
142
140
  commands.forEach(c => {
@@ -2,7 +2,7 @@ import fs from 'fs';
2
2
  import ora from 'ora';
3
3
  import path from 'path';
4
4
  import url from 'url';
5
- import { Cli } from '../cli/Cli.js';
5
+ import { cli } from '../cli/cli.js';
6
6
  import request from '../request.js';
7
7
  import { settingsNames } from '../settingsNames.js';
8
8
  import { md } from '../utils/md.js';
@@ -15,7 +15,6 @@ let promptForRating = true;
15
15
  let conversationId = 0;
16
16
  let initialPrompt = '';
17
17
  let history = [];
18
- const cli = Cli.getInstance();
19
18
  const showSpinner = cli.getSettingWithDefaultValue(settingsNames.showSpinner, true) && typeof global.it === 'undefined';
20
19
  request.logger = {
21
20
  /* c8 ignore next 3 */