@microsoft/teamsfx 2.3.1-alpha.ec50e3de8.0 → 2.3.1-alpha.fccd8293a.0

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.
@@ -8,8 +8,8 @@ import { Dialog, ComponentDialog, WaterfallDialog, DialogSet, DialogTurnStatus }
8
8
  import { v4 } from 'uuid';
9
9
  import axios from 'axios';
10
10
  import { Agent } from 'https';
11
- import * as path from 'path';
12
- import * as fs from 'fs';
11
+ import { resolve } from 'path';
12
+ import { access, readFile, writeFile } from 'fs';
13
13
  import { AdaptiveCards } from '@microsoft/adaptivecards-tools';
14
14
 
15
15
  // Copyright (c) Microsoft Corporation.
@@ -1475,7 +1475,7 @@ function createApiClient(apiEndpoint, authProvider) {
1475
1475
  baseURL: apiEndpoint,
1476
1476
  });
1477
1477
  instance.interceptors.request.use(async function (config) {
1478
- return await authProvider.AddAuthenticationInfo(config);
1478
+ return (await authProvider.AddAuthenticationInfo(config));
1479
1479
  });
1480
1480
  return instance;
1481
1481
  }
@@ -2535,7 +2535,7 @@ class NotificationMiddleware {
2535
2535
  return ActivityType.Unknown;
2536
2536
  }
2537
2537
  async tryAddMessagedReference(context) {
2538
- var _a, _b, _c, _d;
2538
+ var _a, _b, _c, _d, _e, _f;
2539
2539
  const reference = TurnContext.getConversationReference(context.activity);
2540
2540
  const conversationType = (_a = reference === null || reference === void 0 ? void 0 : reference.conversation) === null || _a === void 0 ? void 0 : _a.conversationType;
2541
2541
  if (conversationType === "personal" || conversationType === "groupChat") {
@@ -2543,7 +2543,9 @@ class NotificationMiddleware {
2543
2543
  }
2544
2544
  else if (conversationType === "channel") {
2545
2545
  const teamId = (_d = (_c = (_b = context.activity) === null || _b === void 0 ? void 0 : _b.channelData) === null || _c === void 0 ? void 0 : _c.team) === null || _d === void 0 ? void 0 : _d.id;
2546
- if (teamId !== undefined) {
2546
+ const channelId = (_f = (_e = context.activity.channelData) === null || _e === void 0 ? void 0 : _e.channel) === null || _f === void 0 ? void 0 : _f.id;
2547
+ // `teamId === channelId` means General channel. Ignore messaging in non-General channel.
2548
+ if (teamId !== undefined && (channelId === undefined || teamId === channelId)) {
2547
2549
  const teamReference = cloneConversation(reference);
2548
2550
  teamReference.conversation.id = teamId;
2549
2551
  await this.conversationReferenceStore.add(getKey(teamReference), teamReference, {
@@ -2562,7 +2564,7 @@ class LocalFileStorage {
2562
2564
  constructor(fileDir) {
2563
2565
  var _a;
2564
2566
  this.localFileName = (_a = process.env.TEAMSFX_NOTIFICATION_STORE_FILENAME) !== null && _a !== void 0 ? _a : ".notification.localstore.json";
2565
- this.filePath = path.resolve(fileDir, this.localFileName);
2567
+ this.filePath = resolve(fileDir, this.localFileName);
2566
2568
  }
2567
2569
  async read(key) {
2568
2570
  if (!(await this.storeFileExists())) {
@@ -2598,7 +2600,7 @@ class LocalFileStorage {
2598
2600
  storeFileExists() {
2599
2601
  return new Promise((resolve) => {
2600
2602
  try {
2601
- fs.access(this.filePath, (err) => {
2603
+ access(this.filePath, (err) => {
2602
2604
  if (err) {
2603
2605
  resolve(false);
2604
2606
  }
@@ -2615,7 +2617,7 @@ class LocalFileStorage {
2615
2617
  readFromFile() {
2616
2618
  return new Promise((resolve, reject) => {
2617
2619
  try {
2618
- fs.readFile(this.filePath, { encoding: "utf-8" }, (err, rawData) => {
2620
+ readFile(this.filePath, { encoding: "utf-8" }, (err, rawData) => {
2619
2621
  if (err) {
2620
2622
  reject(err);
2621
2623
  }
@@ -2633,7 +2635,7 @@ class LocalFileStorage {
2633
2635
  return new Promise((resolve, reject) => {
2634
2636
  try {
2635
2637
  const rawData = JSON.stringify(data, undefined, 2);
2636
- fs.writeFile(this.filePath, rawData, { encoding: "utf-8" }, (err) => {
2638
+ writeFile(this.filePath, rawData, { encoding: "utf-8" }, (err) => {
2637
2639
  if (err) {
2638
2640
  reject(err);
2639
2641
  }
@@ -3064,7 +3066,7 @@ class NotificationBot$1 {
3064
3066
  */
3065
3067
  constructor(adapter, options) {
3066
3068
  var _a, _b;
3067
- const storage = (_a = options === null || options === void 0 ? void 0 : options.storage) !== null && _a !== void 0 ? _a : new LocalFileStorage(path.resolve(process.env.RUNNING_ON_AZURE === "1" ? (_b = process.env.TEMP) !== null && _b !== void 0 ? _b : "./" : "./"));
3069
+ const storage = (_a = options === null || options === void 0 ? void 0 : options.storage) !== null && _a !== void 0 ? _a : new LocalFileStorage(resolve(process.env.RUNNING_ON_AZURE === "1" ? (_b = process.env.TEMP) !== null && _b !== void 0 ? _b : "./" : "./"));
3068
3070
  this.conversationReferenceStore = new DefaultConversationReferenceStore(storage);
3069
3071
  this.adapter = adapter.use(new NotificationMiddleware({
3070
3072
  conversationReferenceStore: this.conversationReferenceStore,
@@ -3225,7 +3227,7 @@ var SearchScope$1;
3225
3227
  SearchScope[SearchScope["All"] = 7] = "All";
3226
3228
  })(SearchScope$1 || (SearchScope$1 = {}));
3227
3229
 
3228
- /******************************************************************************
3230
+ /*! *****************************************************************************
3229
3231
  Copyright (c) Microsoft Corporation.
3230
3232
 
3231
3233
  Permission to use, copy, modify, and/or distribute this software for any
@@ -3250,12 +3252,7 @@ function __rest(s, e) {
3250
3252
  t[p[i]] = s[p[i]];
3251
3253
  }
3252
3254
  return t;
3253
- }
3254
-
3255
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
3256
- var e = new Error(message);
3257
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3258
- };
3255
+ }
3259
3256
 
3260
3257
  // Copyright (c) Microsoft Corporation.
3261
3258
  let DIALOG_NAME = "BotSsoExecutionDialog";
@@ -4662,7 +4659,7 @@ class NotificationBot {
4662
4659
  this.conversationReferenceStore = options.store;
4663
4660
  }
4664
4661
  else {
4665
- const storage = (_a = options === null || options === void 0 ? void 0 : options.storage) !== null && _a !== void 0 ? _a : new LocalFileStorage(path.resolve(process.env.RUNNING_ON_AZURE === "1" ? (_b = process.env.TEMP) !== null && _b !== void 0 ? _b : "./" : "./"));
4662
+ const storage = (_a = options === null || options === void 0 ? void 0 : options.storage) !== null && _a !== void 0 ? _a : new LocalFileStorage(resolve(process.env.RUNNING_ON_AZURE === "1" ? (_b = process.env.TEMP) !== null && _b !== void 0 ? _b : "./" : "./"));
4666
4663
  this.conversationReferenceStore = new DefaultConversationReferenceStore(storage);
4667
4664
  }
4668
4665
  this.adapter = adapter.use(new NotificationMiddleware({