Skip to content

Commit

Permalink
Merge branch 'main' into southworks/add/support-node-22
Browse files Browse the repository at this point in the history
  • Loading branch information
ceciliaavila committed Dec 10, 2024
2 parents 5f37415 + 89ada0e commit da9796a
Show file tree
Hide file tree
Showing 33 changed files with 551 additions and 559 deletions.
2 changes: 1 addition & 1 deletion generators/generator-botbuilder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-botbuilder",
"version": "4.11.0",
"version": "4.1.6",
"description": "A yeoman generator for creating bots built with Bot Framework v4",
"homepage": "https://github.com/Microsoft/BotBuilder-JS/tree/main/generators/generator-botbuilder",
"author": {
Expand Down
10 changes: 0 additions & 10 deletions libraries/botbuilder-applicationinsights/eslint.config.cjs

This file was deleted.

5 changes: 2 additions & 3 deletions libraries/botbuilder-applicationinsights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
"dependencies": {
"applicationinsights": "^2.9.6",
"botbuilder-core": "4.1.6",
"cls-hooked": "^4.2.2",
"eslint-plugin-only-warn": "^1.1.0"
"cls-hooked": "^4.2.2"
},
"scripts": {
"build": "tsc -b",
"build-docs": "typedoc --theme markdown --entryPoint botbuilder-applicationinsights --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\botbuilder-applicationinsights .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Application Insights\" --readme none",
"build:rollup": "yarn clean && yarn build && api-extractor run --verbose --local",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "npm-run-all build test:mocha",
"test:compat": "api-extractor run --verbose",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* @module botbuilder-applicationinsights
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License

import { TelemetryLoggerMiddleware } from 'botbuilder-core';
import { Middleware } from 'botbuilder-core';
import { TurnContext } from 'botbuilder-core';
import { TelemetryLoggerMiddleware, Middleware, TurnContext } from 'botbuilder-core';
import { CorrelationContext } from 'applicationinsights/out/AutoCollection/CorrelationContextManager';
import * as appInsights from 'applicationinsights';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('TelemetryWaterfall', function () {
if (telemetry.name === 'WaterfallStep') {
assert(
telemetry.properties.StepName === 'Step' + (count + 1) + 'of' + dialog.steps.length,
'waterfallstep step name is wrong'
'waterfallstep step name is wrong',
);
count++;
}
Expand Down Expand Up @@ -252,23 +252,23 @@ describe('TelemetryWaterfall', function () {

assert(
component.findDialog('secondary').telemetryClient instanceof NullTelemetryClient,
'should be nulltelemetryclient by default'
'should be nulltelemetryclient by default',
);
assert(
component.telemetryClient instanceof NullTelemetryClient,
'child dialog should have same telemetry client'
'child dialog should have same telemetry client',
);

component.telemetryClient = new TestClient();

assert(
component.findDialog('secondary').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(component.telemetryClient instanceof TestClient, 'component should have a testclient as well');
assert(
component.telemetryClient === component.findDialog('secondary').telemetryClient,
'component should have same client as children'
'component should have same client as children',
);

component.addDialog(new WaterfallDialog('third'), [
Expand All @@ -279,29 +279,29 @@ describe('TelemetryWaterfall', function () {

assert(
component.findDialog('third').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(
component.findDialog('secondary').telemetryClient instanceof TestClient,
'child dialogs should now be TestClient'
'child dialogs should now be TestClient',
);
assert(
component.telemetryClient === component.findDialog('third').telemetryClient,
'component should have same client as new children'
'component should have same client as new children',
);
assert(
component.findDialog('third').telemetryClient === component.findDialog('secondary').telemetryClient,
'children should have identical clients'
'children should have identical clients',
);

component.telemetryClient = null;
assert(
component.findDialog('secondary').telemetryClient instanceof NullTelemetryClient,
'child dialog should be reset to nulltelemetryclient'
'child dialog should be reset to nulltelemetryclient',
);
assert(
component.telemetryClient instanceof NullTelemetryClient,
'component should be reset to nulltelemetryclient'
'component should be reset to nulltelemetryclient',
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('TelemetryInitializerMiddleware', function () {
(err) => {
assert.strictEqual(err.message, 'context is null');
return true;
}
},
);
});

Expand All @@ -175,7 +175,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand All @@ -200,7 +200,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('TelemetryInitializerMiddleware', function () {
() =>
new Promise((resolve) => {
resolve();
})
}),
);

const updatedContext = appInsights.getCorrelationContext();
Expand Down
10 changes: 0 additions & 10 deletions libraries/botbuilder-azure-blobs/eslint.config.cjs

This file was deleted.

3 changes: 1 addition & 2 deletions libraries/botbuilder-azure-blobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@azure/storage-blob": "^12.24.0",
"botbuilder-core": "4.1.6",
"botbuilder-stdlib": "4.1.6",
"eslint-plugin-only-warn": "^1.1.0",
"p-map": "^4.0.0",
"zod": "^3.23.8",
"@azure/core-http": "^3.0.4"
Expand All @@ -40,7 +39,7 @@
"build-docs": "typedoc --theme markdown --entryPoint botbuilder-azure-blobs --excludePrivate --includeDeclarations --ignoreCompilerErrors --module amd --out ..\\..\\doc\\botbuilder-azure-blobs .\\lib\\index.d.ts --hideGenerator --name \"Bot Builder SDK - Azure Blobs\" --readme none",
"clean": "rimraf _ts3.4 lib tsconfig.tsbuildinfo",
"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint .",
"lint": "eslint . --config ../../eslint.config.cjs",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",
"test": "yarn build && nyc mocha --check-leaks tests",
"test:compat": "api-extractor run --verbose"
Expand Down
10 changes: 5 additions & 5 deletions libraries/botbuilder-azure-blobs/src/blobsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class BlobsStorage implements Storage {
containerName: string,
options?: BlobsStorageOptions,
url = '',
credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,
) {
if (url != '' && credential != null) {
z.object({ url: z.string() }).parse({
Expand All @@ -80,7 +80,7 @@ export class BlobsStorage implements Storage {
this._containerClient = new ContainerClient(
connectionString,
containerName,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

// At most one promise at a time to be friendly to local emulator users
Expand Down Expand Up @@ -121,7 +121,7 @@ export class BlobsStorage implements Storage {

const blob = await ignoreError(
this._containerClient.getBlobClient(sanitizeBlobKey(key)).download(),
isStatusCodeError(404)
isStatusCodeError(404),
);

if (!blob) {
Expand All @@ -140,7 +140,7 @@ export class BlobsStorage implements Storage {
},
{
concurrency: this._concurrency,
}
},
)
).reduce((acc, { key, value }) => (value ? { ...acc, [key]: value } : acc), {});
}
Expand Down Expand Up @@ -196,7 +196,7 @@ export class BlobsStorage implements Storage {
(key) => ignoreError(this._containerClient.deleteBlob(sanitizeBlobKey(key)), isStatusCodeError(404)),
{
concurrency: this._concurrency,
}
},
);
}
}
14 changes: 7 additions & 7 deletions libraries/botbuilder-azure-blobs/src/blobsTranscriptStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getBlobKey(activity: Activity, options?: BlobsTranscriptStoreOptions):

return sanitizeBlobKey(
[activity.channelId, activity.conversation.id, `${formatTicks(timestamp)}-${activity.id}.json`].join('/'),
options
options,
);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
containerName: string,
options?: BlobsTranscriptStoreOptions,
blobServiceUri = '',
tokenCredential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
tokenCredential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,
) {
if (blobServiceUri != '' && tokenCredential != null) {
z.object({ blobServiceUri: z.string() }).parse({
Expand All @@ -116,7 +116,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
this._containerClient = new ContainerClient(
blobServiceUri,
tokenCredential,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

// At most one promise at a time to be friendly to local emulator users
Expand All @@ -132,7 +132,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
this._containerClient = new ContainerClient(
connectionString,
containerName,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

// At most one promise at a time to be friendly to local emulator users
Expand Down Expand Up @@ -170,7 +170,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
channelId: string,
conversationId: string,
continuationToken?: string,
startDate?: Date
startDate?: Date,
): Promise<PagedResult<Activity>> {
z.object({ channelId: z.string(), conversationId: z.string() }).parse({ channelId, conversationId });

Expand All @@ -195,7 +195,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
const fromIdx =
startDate != null
? blobItems.findIndex(
(blobItem) => blobItem?.properties?.createdOn && blobItem?.properties?.createdOn >= startDate
(blobItem) => blobItem?.properties?.createdOn && blobItem?.properties?.createdOn >= startDate,
)
: 0;

Expand All @@ -213,7 +213,7 @@ export class BlobsTranscriptStore implements TranscriptStore {
const activity = (await StreamConsumers.json(readableStreamBody)) as any;
return { ...activity, timestamp: new Date(activity.timestamp) } as Activity;
},
{ concurrency: this._concurrency }
{ concurrency: this._concurrency },
);

activities.forEach((activity) => {
Expand Down
5 changes: 3 additions & 2 deletions libraries/botbuilder-azure-blobs/tests/blobsStorage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('BlobsStorage', function () {
assert.throws(() => new BlobsStorage(null, null, null, [], {}), 'throws for missing url');
assert.throws(
() => new BlobsStorage(null, null, null, 'url', {}),
ReferenceError('Invalid credential type.')
ReferenceError('Invalid credential type.'),
);
});

Expand All @@ -40,7 +40,7 @@ describe('BlobsStorage', function () {
null,
null,
'https://test.blob.core.windows.net/blob',
new StorageSharedKeyCredential('accountName', 'accountKey')
new StorageSharedKeyCredential('accountName', 'accountKey'),
);
});
});
Expand Down Expand Up @@ -102,6 +102,7 @@ describe('BlobsStorage', function () {
}

let sandbox;

beforeEach(function () {
sandbox = sinon.createSandbox({});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('BlobsTranscriptStore', function () {
assert.throws(() => new BlobsTranscriptStore(null, null, null, [], {}), 'throws for missing url');
assert.throws(
() => new BlobsTranscriptStore(null, null, null, 'url', {}),
ReferenceError('Invalid credential type.')
ReferenceError('Invalid credential type.'),
);
});

Expand Down Expand Up @@ -110,7 +110,7 @@ describe('BlobsTranscriptStore', function () {
channelId,
conversationId,
undefined,
rest[0].timestamp
rest[0].timestamp,
);
assert.deepStrictEqual(result.items, rest);
});
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('BlobsTranscriptStore', function () {
channelId,
id,
created,
}))
})),
);
});
});
Expand Down
11 changes: 3 additions & 8 deletions libraries/botbuilder-lg/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
const onlyWarn = require("eslint-plugin-only-warn");
const sharedConfig = require("../../eslint.config.cjs")
const sharedConfig = require('../../eslint.config.cjs');

module.exports = [
...sharedConfig,
{
ignores: ["**/generated/*"],
ignores: ['**/generated/*'],
},
{
plugins: {
"only-warn": onlyWarn,
},
}];
];
1 change: 0 additions & 1 deletion libraries/botbuilder-lg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"dependencies": {
"adaptive-expressions": "4.1.6",
"antlr4ts": "0.5.0-alpha.4",
"eslint-plugin-only-warn": "^1.1.0",
"lodash": "^4.17.19",
"uuid": "^10.0.0"
},
Expand Down
Loading

0 comments on commit da9796a

Please sign in to comment.