@pnp/cli-microsoft365 12.0.0-beta.10c5833 → 12.0.0-beta.47b768f

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 (149) 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/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  7. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0-rc.0.js +19 -0
  8. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  9. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  10. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  11. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  12. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0-rc.0.js +77 -0
  13. package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
  14. package/dist/m365/spo/commands/app/app-add.js +35 -56
  15. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  16. package/dist/m365/spo/commands/app/app-get.js +40 -56
  17. package/dist/m365/spo/commands/app/app-install.js +20 -41
  18. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  19. package/dist/m365/spo/commands/app/app-list.js +26 -44
  20. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  21. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  22. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  23. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  24. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  25. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  26. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  27. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  28. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  29. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  30. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  31. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  32. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  33. package/dist/m365/spo/commands/field/field-add.js +33 -62
  34. package/dist/m365/spo/commands/field/field-get.js +30 -57
  35. package/dist/m365/spo/commands/field/field-list.js +21 -46
  36. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  37. package/dist/m365/spo/commands/field/field-set.js +34 -66
  38. package/dist/m365/spo/commands/file/file-get.js +4 -3
  39. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -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/listitem/listitem-get.js +1 -12
  51. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  52. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  53. package/dist/m365/spo/commands/navigation/navigation-node-list.js +6 -4
  54. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  55. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  56. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  57. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  58. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  59. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  60. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  61. package/dist/m365/spo/commands.js +3 -1
  62. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  63. package/dist/m365/spp/commands/model/model-get.js +25 -45
  64. package/dist/m365/spp/commands/model/model-list.js +12 -23
  65. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  66. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  67. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  68. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  69. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  70. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  71. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  72. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  73. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  74. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  75. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  76. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  77. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  78. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  79. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  80. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  81. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  82. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  83. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  84. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  85. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  86. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  87. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  88. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  89. package/dist/telemetry.js +7 -11
  90. package/dist/utils/spo.js +40 -3
  91. package/dist/utils/urlUtil.js +2 -2
  92. package/docs/docs/cmd/login.mdx +15 -2
  93. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  94. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  95. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  96. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  97. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  98. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  99. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  100. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  101. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  102. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  103. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  104. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  105. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  106. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
  107. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
  108. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
  109. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
  110. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
  111. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
  112. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  113. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  114. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  115. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  116. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  117. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  118. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  119. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  120. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  121. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  122. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  123. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  124. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
  125. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  126. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  127. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
  128. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
  129. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  130. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  131. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  132. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  133. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  134. package/docs/docs/cmd/spo/navigation/navigation-node-list.mdx +37 -27
  135. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  136. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  137. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  138. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  139. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  140. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  141. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  142. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  143. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  144. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  145. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  146. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  147. package/npm-shrinkwrap.json +702 -3230
  148. package/package.json +21 -38
  149. package/dist/appInsights.js +0 -43
@@ -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 _TeamsMeetingListCommand_instances, _TeamsMeetingListCommand_initTelemetry, _TeamsMeetingListCommand_initOptions, _TeamsMeetingListCommand_initValidators;
7
1
  import auth from '../../../../Auth.js';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { z } from 'zod';
8
4
  import { entraUser } from '../../../../utils/entraUser.js';
9
5
  import { accessToken } from '../../../../utils/accessToken.js';
10
6
  import { odata } from '../../../../utils/odata.js';
@@ -13,6 +9,30 @@ import GraphCommand from "../../../base/GraphCommand.js";
13
9
  import commands from '../../commands.js';
14
10
  import request from '../../../../request.js';
15
11
  import { formatting } from '../../../../utils/formatting.js';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ userId: z.string()
15
+ .refine(value => validation.isValidGuid(value), {
16
+ message: 'The userId value must be a valid GUID.'
17
+ }).optional().alias('u'),
18
+ userName: z.string()
19
+ .refine(value => validation.isValidUserPrincipalName(value), {
20
+ message: 'The userName value must be a valid user principal name (UPN).'
21
+ }).optional().alias('n'),
22
+ email: z.string()
23
+ .refine(value => validation.isValidUserPrincipalName(value), {
24
+ message: 'The email value must be a valid email.'
25
+ }).optional(),
26
+ startDateTime: z.string()
27
+ .refine(value => validation.isValidISODateTime(value), {
28
+ error: issue => `'${issue.input}' is not a valid ISO date string for startDateTime.`
29
+ }),
30
+ endDateTime: z.string()
31
+ .refine(value => validation.isValidISODateTime(value), {
32
+ error: issue => `'${issue.input}' is not a valid ISO date string for endDateTime.`
33
+ }).optional(),
34
+ isOrganizer: z.boolean().optional()
35
+ });
16
36
  class TeamsMeetingListCommand extends GraphCommand {
17
37
  get name() {
18
38
  return commands.MEETING_LIST;
@@ -23,12 +43,14 @@ class TeamsMeetingListCommand extends GraphCommand {
23
43
  defaultProperties() {
24
44
  return ['subject', 'startDateTime', 'endDateTime'];
25
45
  }
26
- constructor() {
27
- super();
28
- _TeamsMeetingListCommand_instances.add(this);
29
- __classPrivateFieldGet(this, _TeamsMeetingListCommand_instances, "m", _TeamsMeetingListCommand_initTelemetry).call(this);
30
- __classPrivateFieldGet(this, _TeamsMeetingListCommand_instances, "m", _TeamsMeetingListCommand_initOptions).call(this);
31
- __classPrivateFieldGet(this, _TeamsMeetingListCommand_instances, "m", _TeamsMeetingListCommand_initValidators).call(this);
46
+ get schema() {
47
+ return options;
48
+ }
49
+ getRefinedSchema(schema) {
50
+ return schema.refine(options => !options.endDateTime || options.startDateTime <= options.endDateTime, {
51
+ message: 'startDateTime value must be before endDateTime.',
52
+ path: ['startDateTime']
53
+ });
32
54
  }
33
55
  async commandAction(logger, args) {
34
56
  try {
@@ -127,52 +149,5 @@ class TeamsMeetingListCommand extends GraphCommand {
127
149
  return result;
128
150
  }
129
151
  }
130
- _TeamsMeetingListCommand_instances = new WeakSet(), _TeamsMeetingListCommand_initTelemetry = function _TeamsMeetingListCommand_initTelemetry() {
131
- this.telemetry.push((args) => {
132
- Object.assign(this.telemetryProperties, {
133
- userId: typeof args.options.userId !== 'undefined',
134
- userName: typeof args.options.userName !== 'undefined',
135
- email: typeof args.options.email !== 'undefined',
136
- endDateTime: typeof args.options.endDateTime !== 'undefined',
137
- isOrganizer: !!args.options.isOrganizer
138
- });
139
- });
140
- }, _TeamsMeetingListCommand_initOptions = function _TeamsMeetingListCommand_initOptions() {
141
- this.options.unshift({
142
- option: '-u, --userId [userId]'
143
- }, {
144
- option: '-n, --userName [userName]'
145
- }, {
146
- option: '--email [email]'
147
- }, {
148
- option: '--startDateTime <startDateTime>'
149
- }, {
150
- option: '--endDateTime [endDateTime]'
151
- }, {
152
- option: '--isOrganizer'
153
- });
154
- }, _TeamsMeetingListCommand_initValidators = function _TeamsMeetingListCommand_initValidators() {
155
- this.validators.push(async (args) => {
156
- if (!validation.isValidISODateTime(args.options.startDateTime)) {
157
- return `'${args.options.startDateTime}' is not a valid ISO date string for startDateTime.`;
158
- }
159
- if (args.options.endDateTime && !validation.isValidISODateTime(args.options.endDateTime)) {
160
- return `'${args.options.startDateTime}' is not a valid ISO date string for endDateTime.`;
161
- }
162
- if (args.options.startDateTime && args.options.endDateTime && args.options.startDateTime > args.options.endDateTime) {
163
- return 'startDateTime value must be before endDateTime.';
164
- }
165
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
166
- return `${args.options.userId} is not a valid GUID for userId.`;
167
- }
168
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
169
- return `'${args.options.userName}' is not a valid UPN for userName.`;
170
- }
171
- if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
172
- return `'${args.options.email}' is not a valid UPN for email.`;
173
- }
174
- return true;
175
- });
176
- };
177
152
  export default new TeamsMeetingListCommand();
178
153
  //# sourceMappingURL=meeting-list.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 _TeamsMeetingTranscriptGetCommand_instances, _TeamsMeetingTranscriptGetCommand_initTelemetry, _TeamsMeetingTranscriptGetCommand_initOptions, _TeamsMeetingTranscriptGetCommand_initValidators, _TeamsMeetingTranscriptGetCommand_initOptionSets;
7
1
  import auth from '../../../../Auth.js';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { z } from 'zod';
8
4
  import request from '../../../../request.js';
9
5
  import { entraUser } from '../../../../utils/entraUser.js';
10
6
  import { accessToken } from '../../../../utils/accessToken.js';
@@ -13,6 +9,27 @@ import GraphCommand from '../../../base/GraphCommand.js';
13
9
  import commands from '../../commands.js';
14
10
  import fs from 'fs';
15
11
  import path from 'path';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ userId: z.string()
15
+ .refine(value => validation.isValidGuid(value), {
16
+ message: 'The userId value must be a valid GUID.'
17
+ }).optional().alias('u'),
18
+ userName: z.string()
19
+ .refine(value => validation.isValidUserPrincipalName(value), {
20
+ message: 'The userName value must be a valid user principal name (UPN).'
21
+ }).optional().alias('n'),
22
+ email: z.string()
23
+ .refine(value => validation.isValidUserPrincipalName(value), {
24
+ message: 'The email value must be a valid email.'
25
+ }).optional(),
26
+ meetingId: z.string().alias('m'),
27
+ id: z.string().alias('i'),
28
+ outputFile: z.string()
29
+ .refine(value => fs.existsSync(path.dirname(value)), {
30
+ message: 'Specified path where to save the file does not exist.'
31
+ }).optional().alias('f')
32
+ });
16
33
  class TeamsMeetingTranscriptGetCommand extends GraphCommand {
17
34
  get name() {
18
35
  return commands.MEETING_TRANSCRIPT_GET;
@@ -20,13 +37,17 @@ class TeamsMeetingTranscriptGetCommand extends GraphCommand {
20
37
  get description() {
21
38
  return 'Downloads a transcript for a given meeting';
22
39
  }
23
- constructor() {
24
- super();
25
- _TeamsMeetingTranscriptGetCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptGetCommand_instances, "m", _TeamsMeetingTranscriptGetCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptGetCommand_instances, "m", _TeamsMeetingTranscriptGetCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptGetCommand_instances, "m", _TeamsMeetingTranscriptGetCommand_initValidators).call(this);
29
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptGetCommand_instances, "m", _TeamsMeetingTranscriptGetCommand_initOptionSets).call(this);
40
+ get schema() {
41
+ return options;
42
+ }
43
+ getRefinedSchema(schema) {
44
+ return schema.refine(options => [options.userId, options.userName, options.email].filter(value => value !== undefined).length <= 1, {
45
+ message: 'Specify either userId, userName or email, but not multiple.',
46
+ params: {
47
+ customCode: 'optionSet',
48
+ options: ['userId', 'userName', 'email']
49
+ }
50
+ });
30
51
  }
31
52
  async commandAction(logger, args) {
32
53
  try {
@@ -103,50 +124,5 @@ class TeamsMeetingTranscriptGetCommand extends GraphCommand {
103
124
  }
104
125
  }
105
126
  }
106
- _TeamsMeetingTranscriptGetCommand_instances = new WeakSet(), _TeamsMeetingTranscriptGetCommand_initTelemetry = function _TeamsMeetingTranscriptGetCommand_initTelemetry() {
107
- this.telemetry.push((args) => {
108
- Object.assign(this.telemetryProperties, {
109
- userId: typeof args.options.userId !== 'undefined',
110
- userName: typeof args.options.userName !== 'undefined',
111
- email: typeof args.options.email !== 'undefined',
112
- outputFile: typeof args.options.outputFile !== 'undefined'
113
- });
114
- });
115
- }, _TeamsMeetingTranscriptGetCommand_initOptions = function _TeamsMeetingTranscriptGetCommand_initOptions() {
116
- this.options.unshift({
117
- option: '-u, --userId [userId]'
118
- }, {
119
- option: '-n, --userName [userName]'
120
- }, {
121
- option: '--email [email]'
122
- }, {
123
- option: '-m, --meetingId <meetingId>'
124
- }, {
125
- option: '-i, --id <id>'
126
- }, {
127
- option: '-f, --outputFile [outputFile]'
128
- });
129
- }, _TeamsMeetingTranscriptGetCommand_initValidators = function _TeamsMeetingTranscriptGetCommand_initValidators() {
130
- this.validators.push(async (args) => {
131
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
132
- return `${args.options.userId} is not a valid Guid`;
133
- }
134
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
135
- return `${args.options.userName} is not a valid user principal name (UPN)`;
136
- }
137
- if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
138
- return `${args.options.email} is not a valid email`;
139
- }
140
- if (args.options.outputFile && !fs.existsSync(path.dirname(args.options.outputFile))) {
141
- return 'Specified path where to save the file does not exits';
142
- }
143
- return true;
144
- });
145
- }, _TeamsMeetingTranscriptGetCommand_initOptionSets = function _TeamsMeetingTranscriptGetCommand_initOptionSets() {
146
- this.optionSets.push({
147
- options: ['userId', 'userName', 'email'],
148
- runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
149
- });
150
- };
151
127
  export default new TeamsMeetingTranscriptGetCommand();
152
128
  //# sourceMappingURL=meeting-transcript-get.js.map
@@ -1,16 +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 _TeamsMeetingTranscriptListCommand_instances, _TeamsMeetingTranscriptListCommand_initTelemetry, _TeamsMeetingTranscriptListCommand_initOptions, _TeamsMeetingTranscriptListCommand_initValidators, _TeamsMeetingTranscriptListCommand_initOptionSets;
7
1
  import auth from '../../../../Auth.js';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { z } from 'zod';
8
4
  import { entraUser } from '../../../../utils/entraUser.js';
9
5
  import { accessToken } from '../../../../utils/accessToken.js';
10
6
  import { odata } from '../../../../utils/odata.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import GraphCommand from '../../../base/GraphCommand.js';
13
9
  import commands from '../../commands.js';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ userId: z.string()
13
+ .refine(value => validation.isValidGuid(value), {
14
+ message: 'The userId value must be a valid GUID.'
15
+ }).optional().alias('u'),
16
+ userName: z.string()
17
+ .refine(value => validation.isValidUserPrincipalName(value), {
18
+ message: 'The userName value must be a valid user principal name (UPN).'
19
+ }).optional().alias('n'),
20
+ email: z.string()
21
+ .refine(value => validation.isValidUserPrincipalName(value), {
22
+ message: 'The email value must be a valid email.'
23
+ }).optional(),
24
+ meetingId: z.string().alias('m')
25
+ });
14
26
  class TeamsMeetingTranscriptListCommand extends GraphCommand {
15
27
  get name() {
16
28
  return commands.MEETING_TRANSCRIPT_LIST;
@@ -21,13 +33,17 @@ class TeamsMeetingTranscriptListCommand extends GraphCommand {
21
33
  defaultProperties() {
22
34
  return ['id', 'createdDateTime'];
23
35
  }
24
- constructor() {
25
- super();
26
- _TeamsMeetingTranscriptListCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initValidators).call(this);
30
- __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptionSets).call(this);
36
+ get schema() {
37
+ return options;
38
+ }
39
+ getRefinedSchema(schema) {
40
+ return schema.refine(options => [options.userId, options.userName, options.email].filter(value => value !== undefined).length <= 1, {
41
+ message: 'Specify either userId, userName or email, but not multiple.',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['userId', 'userName', 'email']
45
+ }
46
+ });
31
47
  }
32
48
  async commandAction(logger, args) {
33
49
  try {
@@ -70,42 +86,5 @@ class TeamsMeetingTranscriptListCommand extends GraphCommand {
70
86
  }
71
87
  }
72
88
  }
73
- _TeamsMeetingTranscriptListCommand_instances = new WeakSet(), _TeamsMeetingTranscriptListCommand_initTelemetry = function _TeamsMeetingTranscriptListCommand_initTelemetry() {
74
- this.telemetry.push((args) => {
75
- Object.assign(this.telemetryProperties, {
76
- userId: typeof args.options.userId !== 'undefined',
77
- userName: typeof args.options.userName !== 'undefined',
78
- email: typeof args.options.email !== 'undefined'
79
- });
80
- });
81
- }, _TeamsMeetingTranscriptListCommand_initOptions = function _TeamsMeetingTranscriptListCommand_initOptions() {
82
- this.options.unshift({
83
- option: '-u, --userId [userId]'
84
- }, {
85
- option: '-n, --userName [userName]'
86
- }, {
87
- option: '--email [email]'
88
- }, {
89
- option: '-m, --meetingId <meetingId>'
90
- });
91
- }, _TeamsMeetingTranscriptListCommand_initValidators = function _TeamsMeetingTranscriptListCommand_initValidators() {
92
- this.validators.push(async (args) => {
93
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
94
- return `${args.options.userId} is not a valid Guid`;
95
- }
96
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
97
- return `${args.options.userName} is not a valid user principal name (UPN)`;
98
- }
99
- if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
100
- return `${args.options.email} is not a valid email`;
101
- }
102
- return true;
103
- });
104
- }, _TeamsMeetingTranscriptListCommand_initOptionSets = function _TeamsMeetingTranscriptListCommand_initOptionSets() {
105
- this.optionSets.push({
106
- options: ['userId', 'userName', 'email'],
107
- runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
108
- });
109
- };
110
89
  export default new TeamsMeetingTranscriptListCommand();
111
90
  //# sourceMappingURL=meeting-transcript-list.js.map
@@ -1,13 +1,14 @@
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 _UtilAccessTokenGetCommand_instances, _UtilAccessTokenGetCommand_initTelemetry, _UtilAccessTokenGetCommand_initOptions;
1
+ import { z } from 'zod';
7
2
  import auth, { Auth } from '../../../../Auth.js';
8
- import Command from '../../../../Command.js';
3
+ import Command, { globalOptionsZod } from '../../../../Command.js';
9
4
  import commands from '../../commands.js';
10
5
  import { accessToken } from '../../../../utils/accessToken.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ resource: z.string().alias('r'),
9
+ new: z.boolean().optional(),
10
+ decoded: z.boolean().optional()
11
+ });
11
12
  class UtilAccessTokenGetCommand extends Command {
12
13
  get name() {
13
14
  return commands.ACCESSTOKEN_GET;
@@ -15,11 +16,8 @@ class UtilAccessTokenGetCommand extends Command {
15
16
  get description() {
16
17
  return 'Gets access token for the specified resource';
17
18
  }
18
- constructor() {
19
- super();
20
- _UtilAccessTokenGetCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _UtilAccessTokenGetCommand_instances, "m", _UtilAccessTokenGetCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _UtilAccessTokenGetCommand_instances, "m", _UtilAccessTokenGetCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
23
21
  }
24
22
  async commandAction(logger, args) {
25
23
  let resource = args.options.resource;
@@ -49,21 +47,5 @@ class UtilAccessTokenGetCommand extends Command {
49
47
  }
50
48
  }
51
49
  }
52
- _UtilAccessTokenGetCommand_instances = new WeakSet(), _UtilAccessTokenGetCommand_initTelemetry = function _UtilAccessTokenGetCommand_initTelemetry() {
53
- this.telemetry.push((args) => {
54
- Object.assign(this.telemetryProperties, {
55
- new: args.options.new,
56
- decoded: args.options.decoded
57
- });
58
- });
59
- }, _UtilAccessTokenGetCommand_initOptions = function _UtilAccessTokenGetCommand_initOptions() {
60
- this.options.unshift({
61
- option: '-r, --resource <resource>'
62
- }, {
63
- option: '--new'
64
- }, {
65
- option: '--decoded'
66
- });
67
- };
68
50
  export default new UtilAccessTokenGetCommand();
69
51
  //# sourceMappingURL=accesstoken-get.js.map
package/dist/telemetry.js CHANGED
@@ -1,25 +1,21 @@
1
- import appInsights from './appInsights.js';
2
1
  import { cli } from './cli/cli.js';
2
+ import { googleAnalytics } from './googleAnalytics.js';
3
3
  import { settingsNames } from './settingsNames.js';
4
4
  import { pid } from './utils/pid.js';
5
5
  import { session } from './utils/session.js';
6
6
  async function trackTelemetry(object) {
7
7
  try {
8
8
  const { commandName, properties, exception } = object;
9
- appInsights.commonProperties.shell = pid.getProcessName(process.ppid) || '';
10
- appInsights.context.tags[appInsights.context.keys.sessionId] = session.getId(process.ppid);
9
+ const context = {
10
+ shell: pid.getProcessName(process.ppid) || '',
11
+ sessionId: session.getId(process.ppid)
12
+ };
11
13
  if (exception) {
12
- appInsights.trackException({
13
- exception
14
- });
14
+ await googleAnalytics.trackException(exception, context);
15
15
  }
16
16
  else {
17
- appInsights.trackEvent({
18
- name: commandName,
19
- properties
20
- });
17
+ await googleAnalytics.trackEvent(commandName, properties, context);
21
18
  }
22
- await appInsights.flush();
23
19
  }
24
20
  catch {
25
21
  // Do nothing
package/dist/utils/spo.js CHANGED
@@ -576,6 +576,45 @@ export const spo = {
576
576
  return request.post(requestOptions);
577
577
  },
578
578
  /**
579
+ * Retrieves the navigation node with the specified key.
580
+ * Returns the node along with the menu state that contains it.
581
+ * @param webUrl Web url
582
+ * @param key Key (ID) of the navigation node
583
+ * @param location Navigation to search. When not specified, searches the quick launch first and then the top navigation
584
+ */
585
+ async getMenuStateNodeByKey(webUrl, key, location) {
586
+ const locations = location ? [location] : ['QuickLaunch', 'TopNavigationBar'];
587
+ for (const navigationLocation of locations) {
588
+ const menuState = navigationLocation === 'TopNavigationBar'
589
+ ? await this.getTopNavigationMenuState(webUrl)
590
+ : await this.getQuickLaunchMenuState(webUrl);
591
+ const node = this.findMenuStateNode(menuState.Nodes, key);
592
+ if (node) {
593
+ return { menuState, node };
594
+ }
595
+ }
596
+ throw location
597
+ ? `Navigation node with id '${key}' not found in ${location}.`
598
+ : `Navigation node with id '${key}' not found.`;
599
+ },
600
+ /**
601
+ * Recursively searches the specified menu state nodes for the node with the specified key.
602
+ * @param nodes Menu state nodes to search
603
+ * @param key Key (ID) of the navigation node
604
+ */
605
+ findMenuStateNode(nodes, key) {
606
+ for (const node of nodes) {
607
+ if (node.Key === key) {
608
+ return node;
609
+ }
610
+ const childNode = this.findMenuStateNode(node.Nodes, key);
611
+ if (childNode) {
612
+ return childNode;
613
+ }
614
+ }
615
+ return undefined;
616
+ },
617
+ /**
579
618
  * Retrieves the spo group by name.
580
619
  * Returns a group object
581
620
  * @param webUrl Web url
@@ -1250,9 +1289,7 @@ export const spo = {
1250
1289
  // Neither properties nor contentTypeName provided, no need to proceed
1251
1290
  throw 'Either properties or contentTypeName must be provided for systemUpdateListItem.';
1252
1291
  }
1253
- const parsedUrl = new URL(absoluteListUrl);
1254
- const serverRelativeSiteMatch = absoluteListUrl.match(new RegExp('/sites/[^/]+'));
1255
- const webUrl = `${parsedUrl.protocol}//${parsedUrl.host}${serverRelativeSiteMatch ?? ''}`;
1292
+ const webUrl = absoluteListUrl.substring(0, absoluteListUrl.indexOf('/_api/'));
1256
1293
  if (verbose && logger) {
1257
1294
  await logger.logToStderr(`Getting list id...`);
1258
1295
  }
@@ -165,8 +165,8 @@ export const urlUtil = {
165
165
  */
166
166
  getTargetSiteAbsoluteUrl(webUrl, url) {
167
167
  const fullUrl = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
168
- // Pattern to match SharePoint URLs
169
- const urlPattern = /https:\/\/[\w-]+\.sharepoint\.com\/(teams|sites|personal)\/([\w-]+)/;
168
+ // Pattern to match SharePoint site collection URLs on any of the supported managed paths
169
+ const urlPattern = /^https:\/\/[\w-]+\.sharepoint\.com\/(teams|sites|personal)\/[^/?#]+/i;
170
170
  const match = fullUrl.match(urlPattern);
171
171
  if (match) {
172
172
  // If a match is found, return the matched URL
@@ -78,7 +78,20 @@ When logging in to Microsoft 365 using the user name and password, next to the a
78
78
 
79
79
  When logging in to Microsoft 365 using a certificate, the CLI for Microsoft 365 will store the contents of the certificate so that it can automatically re-authenticate if necessary. The contents of the certificate are removed by re-authenticating using the device code or by calling the [logout](logout.mdx) command.
80
80
 
81
- Federated Identity is currently supported in GitHub Actions. To use this you need to set `authType` to `federatedIdentity` and specify `appId` and `tenant` to the values of the app registration you've configured a federated credential on.
81
+ Federated Identity is currently supported in GitHub Actions, Azure DevOps and GitLab CI/CD. To use this you need to set `authType` to `federatedIdentity` and specify `appId` and `tenant` to the values of the app registration you've configured a federated credential on.
82
+
83
+ To use Federated Identity in GitLab CI/CD, the job must request an ID token named `GITLAB_OIDC_TOKEN` with audience `api://AzureADTokenExchange`, for example:
84
+
85
+ ```yaml
86
+ job:
87
+ id_tokens:
88
+ GITLAB_OIDC_TOKEN:
89
+ aud: "api://AzureADTokenExchange"
90
+ script:
91
+ - m365 login --authType federatedIdentity --appId eb96cfd0-abfa-4477-8d1d-c6dfde3efb19 --tenant 9a1a1bbd-e158-4cf5-967d-a53b8e85c628
92
+ ```
93
+
94
+ The corresponding federated credential on the Microsoft Entra app registration must have issuer `https://gitlab.com` (or your self-managed GitLab instance URL) and a subject matching the GitLab OIDC claim for the job, for example `project_path:<group>/<project>:ref_type:branch:ref:<branch>`.
82
95
 
83
96
  To log in to Microsoft 365 using a certificate or secret, you will typically [create a custom Microsoft Entra application](../user-guide/using-own-identity.mdx). To use this application with the CLI for Microsoft 365, you will set the `CLIMICROSOFT365_ENTRAAPPID` environment variable to the application's ID and the `CLIMICROSOFT365_TENANT` environment variable to the ID of the Microsoft Entra tenant, where you created the Microsoft Entra application. Also, please make sure to read about [the caveats when using the certificate login option](../user-guide/cli-certificate-caveats.mdx).
84
97
 
@@ -202,7 +215,7 @@ Log in to Microsoft 365 using a user-assigned managed identity with `clientId` s
202
215
  m365 login --authType identity --userName ac9fbed5-804c-4362-a369-21a4ec51109e
203
216
  ```
204
217
 
205
- Log in to Microsoft 365 using a federated identity. Can currently only be used in GitHub Actions.
218
+ Log in to Microsoft 365 using a federated identity. Can currently only be used in GitHub Actions, Azure DevOps and GitLab CI/CD.
206
219
 
207
220
  ```sh
208
221
  m365 login --authType federatedIdentity --appId eb96cfd0-abfa-4477-8d1d-c6dfde3efb19 --tenant 9a1a1bbd-e158-4cf5-967d-a53b8e85c628
@@ -22,7 +22,7 @@ m365 spo file archive [options]
22
22
  : The server- or site-relative decoded URL of the file to archive. Specify either `url` or `id`, but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the file to archive. Specify either `url` or `id`, but not both.
25
+ : The unique ID (GUID) of the file to archive. Specify either `url` or `id`, but not both.
26
26
 
27
27
  `-f, --force`
28
28
  : Don't prompt for confirmation.
@@ -22,7 +22,7 @@ m365 spo file checkin [options]
22
22
  : The server- or site-relative decoded URL of the file to retrieve. Specify either `url` or `id` but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the file to retrieve. Specify either `url` or `id` but not both.
25
+ : The unique ID (GUID) of the file to retrieve. Specify either `url` or `id` but not both.
26
26
 
27
27
  `-t, --type [type]`
28
28
  : Type of the check in. Allowed values: `Minor`, `Major`, `Overwrite`. Defaults to `Major`.
@@ -54,7 +54,7 @@ m365 spo file checkin [options]
54
54
 
55
55
  ## Examples
56
56
 
57
- Checks in file with the specified UniqueId located in the specified site.
57
+ Checks in file with the specified unique ID located in the specified site.
58
58
 
59
59
  ```sh
60
60
  m365 spo file checkin --webUrl https://contoso.sharepoint.com/sites/project-x --id 'b2307a39-e878-458b-bc90-03bc578531d6'
@@ -22,7 +22,7 @@ m365 spo file checkout undo [options]
22
22
  : The server- or site-relative decoded URL of the file to retrieve. Specify either `fileUrl` or `fileId` but not both.
23
23
 
24
24
  `-i, --fileId [fileId]`
25
- : The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both.
25
+ : The unique ID (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both.
26
26
 
27
27
  `-f, --force`
28
28
  : Don't prompt for confirmation.
@@ -22,7 +22,7 @@ m365 spo file checkout [options]
22
22
  : The server- or site-relative decoded URL of the file to retrieve. Specify either `url` or `id` but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the file to retrieve. Specify either `url` or `id` but not both.
25
+ : The unique ID (GUID) of the file to retrieve. Specify either `url` or `id` but not both.
26
26
  ```
27
27
 
28
28
  <Global />
@@ -48,7 +48,7 @@ m365 spo file checkout [options]
48
48
 
49
49
  ## Examples
50
50
 
51
- Checks out file with the specified UniqueId located in the specified site.
51
+ Checks out file with the specified unique ID located in the specified site.
52
52
 
53
53
  ```sh
54
54
  m365 spo file checkout --webUrl https://contoso.sharepoint.com/sites/project-x --id 'b2307a39-e878-458b-bc90-03bc578531d6'
@@ -85,13 +85,13 @@ Copy a file by site-relative URL to a document library in another site collectio
85
85
  m365 spo file copy --webUrl https://contoso.sharepoint.com/sites/project --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --ignoreVersionHistory
86
86
  ```
87
87
 
88
- Copy file by sourceId (UniqueId) to a document library in another site collection and rename the file (without specifying the file extension).
88
+ Copy file by sourceId (unique ID) to a document library in another site collection and rename the file (without specifying the file extension).
89
89
 
90
90
  ```sh
91
91
  m365 spo file copy --webUrl https://contoso.sharepoint.com/sites/project --sourceId "b2307a39-e878-458b-bc90-03bc578531d6" --targetUrl "/sites/IT/Shared Documents" --newName "Report.pdf"
92
92
  ```
93
93
 
94
- Copy file by sourceId (UniqueId) to a document library in another site collection with a new name, rename the file if it already exists.
94
+ Copy file by sourceId (unique ID) to a document library in another site collection with a new name, rename the file if it already exists.
95
95
 
96
96
  ```sh
97
97
  m365 spo file copy --webUrl https://contoso.sharepoint.com/sites/project --sourceId "b2307a39-e878-458b-bc90-03bc578531d6" --targetUrl "/sites/IT/Shared Documents" --newName "Report.pdf" --nameConflictBehavior rename