@pnp/cli-microsoft365 10.4.0-beta.5adfc5b → 10.4.0-beta.6f5b521

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.
package/dist/Auth.js CHANGED
@@ -91,25 +91,21 @@ export class Auth {
91
91
  static initialize() {
92
92
  this.cloudEndpoints[CloudType.USGov] = {
93
93
  'https://graph.microsoft.com': 'https://graph.microsoft.com',
94
- 'https://graph.windows.net': 'https://graph.windows.net',
95
94
  'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
96
95
  'https://login.microsoftonline.com': 'https://login.microsoftonline.com'
97
96
  };
98
97
  this.cloudEndpoints[CloudType.USGovHigh] = {
99
98
  'https://graph.microsoft.com': 'https://graph.microsoft.us',
100
- 'https://graph.windows.net': 'https://graph.windows.net',
101
99
  'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
102
100
  'https://login.microsoftonline.com': 'https://login.microsoftonline.us'
103
101
  };
104
102
  this.cloudEndpoints[CloudType.USGovDoD] = {
105
103
  'https://graph.microsoft.com': 'https://dod-graph.microsoft.us',
106
- 'https://graph.windows.net': 'https://graph.windows.net',
107
104
  'https://management.azure.com/': 'https://management.usgovcloudapi.net/',
108
105
  'https://login.microsoftonline.com': 'https://login.microsoftonline.us'
109
106
  };
110
107
  this.cloudEndpoints[CloudType.China] = {
111
108
  'https://graph.microsoft.com': 'https://microsoftgraph.chinacloudapi.cn',
112
- 'https://graph.windows.net': 'https://graph.chinacloudapi.cn',
113
109
  'https://management.azure.com/': 'https://management.chinacloudapi.cn',
114
110
  'https://login.microsoftonline.com': 'https://login.chinacloudapi.cn'
115
111
  };
package/dist/Command.js CHANGED
@@ -335,7 +335,7 @@ class Command {
335
335
  if (this.debug && auth.connection.identityName !== undefined) {
336
336
  await logger.logToStderr(`Executing command as '${auth.connection.identityName}', appId: ${auth.connection.appId}, tenantId: ${auth.connection.identityTenantId}`);
337
337
  }
338
- telemetry.trackEvent(this.getUsedCommandName(), this.getTelemetryProperties(args));
338
+ await telemetry.trackEvent(this.getUsedCommandName(), this.getTelemetryProperties(args));
339
339
  }
340
340
  getUnknownOptions(options) {
341
341
  const unknownOptions = JSON.parse(JSON.stringify(options));
@@ -3,6 +3,8 @@
3
3
  process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 'none';
4
4
  // prevents tests from hanging
5
5
  process.env.APPLICATION_INSIGHTS_NO_STATSBEAT = 'true';
6
+ // suppress all logging
7
+ process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = 'NONE';
6
8
  import * as appInsights from 'applicationinsights';
7
9
  import crypto from 'crypto';
8
10
  import fs from 'fs';
@@ -12,7 +14,7 @@ import url from 'url';
12
14
  import { app } from './utils/app.js';
13
15
  const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
14
16
  appInsights
15
- .setup('6b908c80-d09f-4cf6-8274-e54349a0149a')
17
+ .setup('InstrumentationKey=6b908c80-d09f-4cf6-8274-e54349a0149a;IngestionEndpoint=https://westeurope-3.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=d42020c6-da32-44f7-bbb7-666f0b3a664d')
16
18
  .setInternalLogging(false, false);
17
19
  // append -dev to the version number when ran locally
18
20
  // to distinguish production and dev version of the CLI
package/dist/cli/cli.js CHANGED
@@ -627,7 +627,7 @@ async function printHelp(helpMode, exitCode = 0) {
627
627
  properties.command = 'commandList';
628
628
  cli.printAvailableCommands();
629
629
  }
630
- telemetry.trackEvent('help', properties);
630
+ await telemetry.trackEvent('help', properties);
631
631
  process.exit(exitCode);
632
632
  }
633
633
  async function openHelpInBrowser() {
package/dist/config.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { app } from './utils/app.js';
2
2
  export default {
3
3
  allScopes: [
4
- 'https://graph.windows.net/Directory.AccessAsUser.All',
5
4
  'https://management.azure.com/user_impersonation',
6
5
  'https://admin.services.crm.dynamics.com/user_impersonation',
7
6
  'https://graph.microsoft.com/AppCatalog.ReadWrite.All',
@@ -49,8 +49,8 @@ export default [
49
49
  new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.20.0'),
50
50
  new FN002001_DEVDEP_microsoft_sp_build_web('1.20.2'),
51
51
  new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.20.2'),
52
- new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
53
52
  new FN002024_DEVDEP_eslint('8.57.0'),
53
+ new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
54
54
  new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.20.2'),
55
55
  new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.20.2'),
56
56
  new FN010001_YORC_version('1.20.0'),
@@ -2,17 +2,21 @@ import { odata } from '../../../../utils/odata.js';
2
2
  import { spo } from '../../../../utils/spo.js';
3
3
  import SpoCommand from '../../../base/SpoCommand.js';
4
4
  import commands from '../../commands.js';
5
- class SpoTenantHomeSiteListCommand extends SpoCommand {
5
+ class SpoHomeSiteListCommand extends SpoCommand {
6
6
  get name() {
7
- return commands.TENANT_HOMESITE_LIST;
7
+ return commands.HOMESITE_LIST;
8
8
  }
9
9
  get description() {
10
10
  return 'Lists all home sites';
11
11
  }
12
+ alias() {
13
+ return [commands.TENANT_HOMESITE_LIST];
14
+ }
12
15
  defaultProperties() {
13
16
  return ['Url', 'Title'];
14
17
  }
15
18
  async commandAction(logger) {
19
+ await this.showDeprecationWarning(logger, commands.TENANT_HOMESITE_LIST, commands.HOMESITE_LIST);
16
20
  try {
17
21
  const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.verbose);
18
22
  const requestOptions = {
@@ -33,5 +37,5 @@ class SpoTenantHomeSiteListCommand extends SpoCommand {
33
37
  }
34
38
  }
35
39
  }
36
- export default new SpoTenantHomeSiteListCommand();
37
- //# sourceMappingURL=tenant-homesite-list.js.map
40
+ export default new SpoHomeSiteListCommand();
41
+ //# sourceMappingURL=homesite-list.js.map
@@ -80,52 +80,10 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand {
80
80
  await logger.logToStderr(`Setting client-side web part layout and properties...`);
81
81
  }
82
82
  await this.setWebPartProperties(webPart, logger, args);
83
- // if no section exists (canvasContent array only has 1 default object), add a default section (1 col)
84
- if (canvasContent.length === 1) {
85
- const defaultSection = {
86
- position: {
87
- controlIndex: 1,
88
- sectionIndex: 1,
89
- zoneIndex: 1,
90
- sectionFactor: 12,
91
- layoutIndex: 1
92
- },
93
- emphasis: {},
94
- displayMode: 2
95
- };
96
- canvasContent.unshift(defaultSection);
97
- }
98
- // get unique zoneIndex values given each section can have 1 or more
99
- // columns each assigned to the zoneIndex of the corresponding section
100
- const zoneIndices = canvasContent
101
- .filter(c => c.position)
102
- .map(c => c.position.zoneIndex)
103
- .filter((value, index, array) => {
104
- return array.indexOf(value) === index;
105
- })
106
- .sort((a, b) => a - b);
107
- // get section number. if not specified, get the last section
108
- const section = args.options.section || zoneIndices.length;
109
- if (section > zoneIndices.length) {
110
- throw `Invalid section '${section}'`;
111
- }
112
- // zoneIndex that represents the section where the web part should be added
113
- const zoneIndex = zoneIndices[section - 1];
114
- const column = args.options.column || 1;
115
- // we need the index of the control in the array so that we know which
116
- // item to replace or where to add the web part
117
- const controlIndex = canvasContent
118
- .findIndex(c => c.position &&
119
- c.position.zoneIndex === zoneIndex &&
120
- c.position.sectionIndex === column);
121
- if (controlIndex === -1) {
122
- throw `Invalid column '${args.options.column}'`;
123
- }
124
- // get the first control that matches section and column
125
- // if it's a empty column, it should be replaced with the web part
126
- // if it's a web part, then we need to determine if there are other
127
- // web parts and where in the array the new web part should be put
128
- const control = canvasContent[controlIndex];
83
+ const control = this.getCorrectControl(canvasContent, args);
84
+ const controlIndex = canvasContent.indexOf(control);
85
+ const zoneIndex = control.position.zoneIndex;
86
+ const column = control.position.sectionIndex;
129
87
  const webPartControl = this.extend({
130
88
  controlType: 3,
131
89
  displayMode: 2,
@@ -294,6 +252,76 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand {
294
252
  webPart.id = webPart.webPartData.instanceId;
295
253
  }
296
254
  }
255
+ getCorrectControl(canvasContent, args) {
256
+ // get Vertical section
257
+ if (args.options.verticalSection) {
258
+ let verticalSection = canvasContent
259
+ .find(c => c.position?.layoutIndex === 2);
260
+ //if vertical section does not exist, create it
261
+ if (!verticalSection) {
262
+ verticalSection = {
263
+ position: {
264
+ controlIndex: 1,
265
+ sectionIndex: 1,
266
+ zoneIndex: 1,
267
+ sectionFactor: 12,
268
+ layoutIndex: 2
269
+ },
270
+ emphasis: {},
271
+ displayMode: 2
272
+ };
273
+ canvasContent.unshift(verticalSection);
274
+ }
275
+ return verticalSection;
276
+ }
277
+ // if no section exists (canvasContent array only has 1 default object), add a default section (1 col)
278
+ if (canvasContent.length === 1) {
279
+ const defaultSection = {
280
+ position: {
281
+ controlIndex: 1,
282
+ sectionIndex: 1,
283
+ zoneIndex: 1,
284
+ sectionFactor: 12,
285
+ layoutIndex: 1
286
+ },
287
+ emphasis: {},
288
+ displayMode: 2
289
+ };
290
+ canvasContent.unshift(defaultSection);
291
+ }
292
+ // get unique zoneIndex values given each section can have 1 or more
293
+ // columns each assigned to the zoneIndex of the corresponding section
294
+ const zoneIndices = canvasContent
295
+ // Exclude the vertical section
296
+ .filter(c => c.position)
297
+ .map(c => c.position.zoneIndex)
298
+ .filter((value, index, array) => {
299
+ return array.indexOf(value) === index;
300
+ })
301
+ .sort((a, b) => a - b);
302
+ // get section number. if not specified, get the last section
303
+ const section = args.options.section || zoneIndices.length;
304
+ if (section > zoneIndices.length) {
305
+ throw `Invalid section '${section}'`;
306
+ }
307
+ // zoneIndex that represents the section where the web part should be added
308
+ const zoneIndex = zoneIndices[section - 1];
309
+ const column = args.options.column || 1;
310
+ // we need the index of the control in the array so that we know which
311
+ // item to replace or where to add the web part
312
+ const controlIndex = canvasContent
313
+ .findIndex(c => c.position &&
314
+ c.position.zoneIndex === zoneIndex &&
315
+ c.position.sectionIndex === column);
316
+ if (controlIndex === -1) {
317
+ throw `Invalid column '${args.options.column}'`;
318
+ }
319
+ // get the first control that matches section and column
320
+ // if it's a empty column, it should be replaced with the web part
321
+ // if it's a web part, then we need to determine if there are other
322
+ // web parts and where in the array the new web part should be put
323
+ return canvasContent[controlIndex];
324
+ }
297
325
  /**
298
326
  * Provides functionality to extend the given object by doing a shallow copy
299
327
  *
@@ -318,7 +346,8 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
318
346
  webPartProperties: typeof args.options.webPartProperties !== 'undefined',
319
347
  section: typeof args.options.section !== 'undefined',
320
348
  column: typeof args.options.column !== 'undefined',
321
- order: typeof args.options.order !== 'undefined'
349
+ order: typeof args.options.order !== 'undefined',
350
+ verticalSection: !!args.options.verticalSection
322
351
  });
323
352
  });
324
353
  }, _SpoPageClientSideWebPartAddCommand_initOptions = function _SpoPageClientSideWebPartAddCommand_initOptions() {
@@ -340,6 +369,8 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
340
369
  option: '--column [column]'
341
370
  }, {
342
371
  option: '--order [order]'
372
+ }, {
373
+ option: '--verticalSection'
343
374
  });
344
375
  }, _SpoPageClientSideWebPartAddCommand_initValidators = function _SpoPageClientSideWebPartAddCommand_initValidators() {
345
376
  this.validators.push(async (args) => {
@@ -376,6 +407,12 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
376
407
  if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
377
408
  return 'The value of parameter column must be 1 or higher';
378
409
  }
410
+ if (args.options.section && args.options.verticalSection) {
411
+ return 'Specify section or verticalSection but not both';
412
+ }
413
+ if (args.options.column && args.options.verticalSection) {
414
+ return 'Use column in combination with section, not with verticalSection';
415
+ }
379
416
  return validation.isValidSharePointUrl(args.options.webUrl);
380
417
  });
381
418
  }, _SpoPageClientSideWebPartAddCommand_initOptionSets = function _SpoPageClientSideWebPartAddCommand_initOptionSets() {
@@ -117,6 +117,7 @@ export default {
117
117
  HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
118
118
  HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
119
119
  HOMESITE_GET: `${prefix} homesite get`,
120
+ HOMESITE_LIST: `${prefix} homesite list`,
120
121
  HOMESITE_REMOVE: `${prefix} homesite remove`,
121
122
  HOMESITE_SET: `${prefix} homesite set`,
122
123
  HUBSITE_CONNECT: `${prefix} hubsite connect`,
package/dist/telemetry.js CHANGED
@@ -1,33 +1,37 @@
1
- import child_process from 'child_process';
2
- import path from 'path';
3
- import url from 'url';
1
+ import appInsights from './appInsights.js';
4
2
  import { cli } from './cli/cli.js';
5
3
  import { settingsNames } from './settingsNames.js';
6
4
  import { pid } from './utils/pid.js';
7
5
  import { session } from './utils/session.js';
8
- const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
9
- function trackTelemetry(object) {
6
+ async function trackTelemetry(object) {
10
7
  try {
11
- const child = child_process.spawn('node', [path.join(__dirname, 'telemetryRunner.js')], {
12
- stdio: ['pipe', 'ignore', 'ignore'],
13
- detached: true
14
- });
15
- child.unref();
16
- object.shell = pid.getProcessName(process.ppid) || '';
17
- object.session = session.getId(process.ppid);
18
- child.stdin.write(JSON.stringify(object));
19
- child.stdin.end();
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);
11
+ if (exception) {
12
+ appInsights.trackException({
13
+ exception
14
+ });
15
+ }
16
+ else {
17
+ appInsights.trackEvent({
18
+ name: commandName,
19
+ properties
20
+ });
21
+ }
22
+ await appInsights.flush();
20
23
  }
21
24
  catch { }
22
25
  }
23
26
  export const telemetry = {
24
- trackEvent: (commandName, properties) => {
27
+ trackEvent: async (commandName, properties, exception) => {
25
28
  if (cli.getSettingWithDefaultValue(settingsNames.disableTelemetry, false)) {
26
29
  return;
27
30
  }
28
- trackTelemetry({
31
+ await trackTelemetry({
29
32
  commandName,
30
- properties
33
+ properties,
34
+ exception
31
35
  });
32
36
  }
33
37
  };
@@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx';
2
2
  import Tabs from '@theme/Tabs';
3
3
  import TabItem from '@theme/TabItem';
4
4
 
5
- # spo tenant homesite list
5
+ # spo homesite list
6
6
 
7
7
  Lists all home sites
8
8
 
9
9
  ## Usage
10
10
 
11
+ ```sh
12
+ m365 spo homesite list [options]
13
+ ```
14
+
15
+ ## Alias
16
+
11
17
  ```sh
12
18
  m365 spo tenant homesite list [options]
13
19
  ```
@@ -21,7 +27,7 @@ m365 spo tenant homesite list [options]
21
27
  List all home sites
22
28
 
23
29
  ```sh
24
- m365 spo tenant homesite list
30
+ m365 spo homesite list
25
31
  ```
26
32
 
27
33
  ## Response
@@ -72,7 +78,7 @@ m365 spo tenant homesite list
72
78
  <TabItem value="Markdown">
73
79
 
74
80
  ```md
75
- # spo tenant homesite list
81
+ # spo homesite list
76
82
 
77
83
  Date: 11/18/2024
78
84
 
@@ -32,13 +32,16 @@ m365 spo page clientsidewebpart add [options]
32
32
  : JSON string with web part data as retrieved from the web part maintenance mode. Specify either `webPartProperties` or `webPartData` but not both.
33
33
 
34
34
  `--section [section]`
35
- : Number of the section to which the web part should be added (1 or higher).
35
+ : Number of the section to which the web part should be added (1 or higher). Specify `section` or `verticalSection` but not both.
36
36
 
37
37
  `--column [column]`
38
- : Number of the column in which the web part should be added (1 or higher).
38
+ : Number of the column in which the web part should be added (1 or higher). Use `column` in combination with `section`, not with `verticalSection`.
39
39
 
40
40
  `--order [order]`
41
41
  : Order of the web part in the column.
42
+
43
+ `--verticalSection`
44
+ : Specifies that the web part should be added to the vertical section.
42
45
  ```
43
46
 
44
47
  <Global />
@@ -87,6 +90,12 @@ Add the standard Image web part with the preconfigured image
87
90
  m365 spo page clientsidewebpart add --webUrl https://contoso.sharepoint.com/sites/a-team --pageName page.aspx --standardWebPart Image --webPartData '{ "dataVersion": "1.8", "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{"captionText":""},"imageSources":{"imageSource":"/sites/team-a/SiteAssets/work-life-balance.png"},"links":{}}, "properties": {"imageSourceType":2,"altText":"a group of people on a beach","overlayText":"Work life balance","fileName":"48146-OFF12_Justice_01.png","siteId":"27664b85-067d-4be9-a7d7-89b2e804d09f","webId":"a7664b85-067d-4be9-a7d7-89b2e804d09f","listId":"37664b85-067d-4be9-a7d7-89b2e804d09f","uniqueId":"67664b85-067d-4be9-a7d7-89b2e804d09f","imgWidth":650,"imgHeight":433,"fixAspectRatio":false,"isOverlayTextEnabled":true}}'
88
91
  ```
89
92
 
93
+ Add the standard Bing Map web part to a modern page in the vertical section
94
+
95
+ ```sh
96
+ m365 spo page clientsidewebpart add --webUrl https://contoso.sharepoint.com/sites/a-team --pageName page.aspx --standardWebPart BingMap --verticalSection
97
+ ```
98
+
90
99
  ## Response
91
100
 
92
101
  The command won't return a response on success.
@@ -55,7 +55,7 @@
55
55
  "@types/json-schema": "^7.0.15",
56
56
  "@types/json-to-ast": "^2.1.4",
57
57
  "@types/mocha": "^10.0.10",
58
- "@types/node": "^20.17.16",
58
+ "@types/node": "^22.13.4",
59
59
  "@types/node-forge": "^1.3.11",
60
60
  "@types/omelette": "^0.4.4",
61
61
  "@types/semver": "^7.5.8",
@@ -1880,11 +1880,12 @@
1880
1880
  }
1881
1881
  },
1882
1882
  "node_modules/@types/node": {
1883
- "version": "20.17.16",
1884
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.16.tgz",
1885
- "integrity": "sha512-vOTpLduLkZXePLxHiHsBLp98mHGnl8RptV4YAO3HfKO5UHjDvySGbxKtpYfy8Sx5+WKcgc45qNreJJRVM3L6mw==",
1883
+ "version": "22.13.4",
1884
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.4.tgz",
1885
+ "integrity": "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg==",
1886
+ "license": "MIT",
1886
1887
  "dependencies": {
1887
- "undici-types": "~6.19.2"
1888
+ "undici-types": "~6.20.0"
1888
1889
  }
1889
1890
  },
1890
1891
  "node_modules/@types/node-forge": {
@@ -5959,9 +5960,10 @@
5959
5960
  }
5960
5961
  },
5961
5962
  "node_modules/undici-types": {
5962
- "version": "6.19.8",
5963
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
5964
- "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
5963
+ "version": "6.20.0",
5964
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
5965
+ "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
5966
+ "license": "MIT"
5965
5967
  },
5966
5968
  "node_modules/update-notifier": {
5967
5969
  "version": "7.3.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "10.4.0-beta.5adfc5b",
3
+ "version": "10.4.0-beta.6f5b521",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -293,7 +293,7 @@
293
293
  "@types/json-schema": "^7.0.15",
294
294
  "@types/json-to-ast": "^2.1.4",
295
295
  "@types/mocha": "^10.0.10",
296
- "@types/node": "^20.17.16",
296
+ "@types/node": "^22.13.4",
297
297
  "@types/node-forge": "^1.3.11",
298
298
  "@types/omelette": "^0.4.4",
299
299
  "@types/semver": "^7.5.8",
@@ -1,26 +0,0 @@
1
- import appInsights from './appInsights.js';
2
- import * as process from 'process';
3
- import * as fs from 'fs';
4
- process.stdin.setEncoding('utf8');
5
- try {
6
- // read from stdin
7
- const input = fs.readFileSync(0, 'utf-8');
8
- const data = JSON.parse(input);
9
- const { commandName, properties, exception, shell, session } = data;
10
- appInsights.commonProperties.shell = shell;
11
- appInsights.context.tags[appInsights.context.keys.sessionId] = session;
12
- if (exception) {
13
- appInsights.trackException({
14
- exception
15
- });
16
- }
17
- else {
18
- appInsights.trackEvent({
19
- name: commandName,
20
- properties
21
- });
22
- }
23
- await appInsights.flush();
24
- }
25
- catch { }
26
- //# sourceMappingURL=telemetryRunner.js.map