From 9bedf1684512af887a83392bd70d57ce64221850 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 13 Sep 2024 13:52:19 -0400 Subject: [PATCH 01/43] fix: use a local comparison Signed-off-by: Vincent Biret --- vscode/microsoft-kiota/src/openApiTreeProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vscode/microsoft-kiota/src/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/openApiTreeProvider.ts index bf25c636d0..4fc8483009 100644 --- a/vscode/microsoft-kiota/src/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/openApiTreeProvider.ts @@ -292,7 +292,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider x !== '').map(x => x.trim().toLowerCase()).sort(); + this.tokenizedFilter = filterText.length === 0 ? [] : filterText.split(' ').filter(x => x !== '').map(x => x.trim().toLowerCase()).sort((a, b) => a.localeCompare(b)); this.refreshView(); } public get filter(): string { From e63566f650afa124067f54b945a59ae595fdf7f4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 13 Sep 2024 13:52:36 -0400 Subject: [PATCH 02/43] fix: removes ineffective try catch blocks Signed-off-by: Vincent Biret --- vscode/microsoft-kiota/src/generateClient.ts | 58 +++++++++---------- vscode/microsoft-kiota/src/generatePlugin.ts | 44 +++++++------- vscode/microsoft-kiota/src/getKiotaVersion.ts | 30 +++++----- .../src/getLanguageInformation.ts | 44 ++++++-------- .../src/migrateFromLockFile.ts | 24 ++++---- .../microsoft-kiota/src/searchDescription.ts | 32 +++++----- vscode/microsoft-kiota/src/updateClients.ts | 28 ++++----- 7 files changed, 114 insertions(+), 146 deletions(-) diff --git a/vscode/microsoft-kiota/src/generateClient.ts b/vscode/microsoft-kiota/src/generateClient.ts index ea0be0813b..5638d3b8b9 100644 --- a/vscode/microsoft-kiota/src/generateClient.ts +++ b/vscode/microsoft-kiota/src/generateClient.ts @@ -24,35 +24,31 @@ export function generateClient(context: vscode.ExtensionContext, operation: ConsumerOperation, workingDirectory: string = getWorkspaceJsonDirectory() ): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType1( - "Generate" - ); - return await connection.sendRequest( - request, - { - cleanOutput: cleanOutput, - clearCache: clearCache, - clientClassName: clientClassName, - clientNamespaceName: clientNamespaceName, - deserializers: deserializers, - disabledValidationRules: disableValidationRules, - excludeBackwardCompatible: excludeBackwardCompatible, - excludePatterns: excludeFilters, - includeAdditionalData: includeAdditionalData, - includePatterns: includeFilters, - language: language, - openAPIFilePath: descriptionPath, - outputPath: output, - serializers: serializers, - structuredMimeTypes: structuredMimeTypes, - usesBackingStore: usesBackingStore, - operation: operation - } as GenerationConfiguration, - ); - }, workingDirectory); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType1( + "Generate" + ); + return await connection.sendRequest( + request, + { + cleanOutput: cleanOutput, + clearCache: clearCache, + clientClassName: clientClassName, + clientNamespaceName: clientNamespaceName, + deserializers: deserializers, + disabledValidationRules: disableValidationRules, + excludeBackwardCompatible: excludeBackwardCompatible, + excludePatterns: excludeFilters, + includeAdditionalData: includeAdditionalData, + includePatterns: includeFilters, + language: language, + openAPIFilePath: descriptionPath, + outputPath: output, + serializers: serializers, + structuredMimeTypes: structuredMimeTypes, + usesBackingStore: usesBackingStore, + operation: operation + } as GenerationConfiguration, + ); + }, workingDirectory); }; diff --git a/vscode/microsoft-kiota/src/generatePlugin.ts b/vscode/microsoft-kiota/src/generatePlugin.ts index 134515ae55..caa57d2bce 100644 --- a/vscode/microsoft-kiota/src/generatePlugin.ts +++ b/vscode/microsoft-kiota/src/generatePlugin.ts @@ -16,28 +16,24 @@ export function generatePlugin(context: vscode.ExtensionContext, disableValidationRules: string[], operation: ConsumerOperation, workingDirectory: string = getWorkspaceJsonDirectory()): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType1( - "GeneratePlugin" - ); - return await connection.sendRequest( - request, - { - pluginTypes: pluginTypes, - cleanOutput: cleanOutput, - clearCache: clearCache, - clientClassName: clientClassName, - disabledValidationRules: disableValidationRules, - excludePatterns: excludeFilters, - includePatterns: includeFilters, - openAPIFilePath: descriptionPath, - outputPath: output, - operation: operation - } as GenerationConfiguration, - ); - }, workingDirectory); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType1( + "GeneratePlugin" + ); + return await connection.sendRequest( + request, + { + pluginTypes: pluginTypes, + cleanOutput: cleanOutput, + clearCache: clearCache, + clientClassName: clientClassName, + disabledValidationRules: disableValidationRules, + excludePatterns: excludeFilters, + includePatterns: includeFilters, + openAPIFilePath: descriptionPath, + outputPath: output, + operation: operation + } as GenerationConfiguration, + ); + }, workingDirectory); }; diff --git a/vscode/microsoft-kiota/src/getKiotaVersion.ts b/vscode/microsoft-kiota/src/getKiotaVersion.ts index 7e6f3c3852..2a09e6bc98 100644 --- a/vscode/microsoft-kiota/src/getKiotaVersion.ts +++ b/vscode/microsoft-kiota/src/getKiotaVersion.ts @@ -3,22 +3,18 @@ import * as rpc from "vscode-jsonrpc/node"; import * as vscode from "vscode"; export function getKiotaVersion(context: vscode.ExtensionContext, kiotaOutputChannel: vscode.LogOutputChannel): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType0("GetVersion"); - const result = await connection.sendRequest(request); - if (result) { - const version = result.split("+")[0]; - if (version) { - kiotaOutputChannel.info(`kiota: ${version}`); - return version; - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType0("GetVersion"); + const result = await connection.sendRequest(request); + if (result) { + const version = result.split("+")[0]; + if (version) { + kiotaOutputChannel.info(`kiota: ${version}`); + return version; } - kiotaOutputChannel.error(`kiota: ${vscode.l10n.t('not found')}`); - kiotaOutputChannel.show(); - return undefined; - }); - } catch (error) { - return Promise.resolve(undefined); - } + } + kiotaOutputChannel.error(`kiota: ${vscode.l10n.t('not found')}`); + kiotaOutputChannel.show(); + return undefined; + }); }; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/getLanguageInformation.ts b/vscode/microsoft-kiota/src/getLanguageInformation.ts index 9717f16f5e..eec21808f6 100644 --- a/vscode/microsoft-kiota/src/getLanguageInformation.ts +++ b/vscode/microsoft-kiota/src/getLanguageInformation.ts @@ -15,33 +15,25 @@ export async function getLanguageInformation(context: vscode.ExtensionContext): }; function getLanguageInformationInternal(context: vscode.ExtensionContext): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType0( - "Info" - ); - return await connection.sendRequest( - request, - ); - }); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType0( + "Info" + ); + return await connection.sendRequest( + request, + ); + }); }; export function getLanguageInformationForDescription(context: vscode.ExtensionContext, descriptionUrl: string, clearCache: boolean): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType2( - "InfoForDescription" - ); - return await connection.sendRequest( - request, - descriptionUrl, - clearCache - ); - }); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType2( + "InfoForDescription" + ); + return await connection.sendRequest( + request, + descriptionUrl, + clearCache + ); + }); }; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/migrateFromLockFile.ts b/vscode/microsoft-kiota/src/migrateFromLockFile.ts index c1c1d3acdf..893412f557 100644 --- a/vscode/microsoft-kiota/src/migrateFromLockFile.ts +++ b/vscode/microsoft-kiota/src/migrateFromLockFile.ts @@ -5,20 +5,16 @@ import { KIOTA_LOCK_FILE } from "./constants"; import { getWorkspaceJsonPath, handleMigration } from "./util"; export function migrateFromLockFile(context: vscode.ExtensionContext, lockFileDirectory: string): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType1( - "MigrateFromLockFile" - ); - const result = await connection.sendRequest( - request, - lockFileDirectory - ); - return result; - }); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType1( + "MigrateFromLockFile" + ); + const result = await connection.sendRequest( + request, + lockFileDirectory + ); + return result; + }); }; export async function checkForLockFileAndPrompt(context: vscode.ExtensionContext) { diff --git a/vscode/microsoft-kiota/src/searchDescription.ts b/vscode/microsoft-kiota/src/searchDescription.ts index 6fe76032ba..e69d9afc6a 100644 --- a/vscode/microsoft-kiota/src/searchDescription.ts +++ b/vscode/microsoft-kiota/src/searchDescription.ts @@ -3,22 +3,18 @@ import * as rpc from "vscode-jsonrpc/node"; import * as vscode from "vscode"; export function searchDescription(context: vscode.ExtensionContext, searchTerm: string, clearCache: boolean): Promise | undefined> { - try { - return connectToKiota>(context, async (connection) => { - const request = new rpc.RequestType2( - "Search" - ); - const result = await connection.sendRequest( - request, - searchTerm, - clearCache, - ); - if (result) { - return result.results; - } - return undefined; - }); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota>(context, async (connection) => { + const request = new rpc.RequestType2( + "Search" + ); + const result = await connection.sendRequest( + request, + searchTerm, + clearCache, + ); + if (result) { + return result.results; + } + return undefined; + }); }; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/updateClients.ts b/vscode/microsoft-kiota/src/updateClients.ts index d47f158f1f..6d34476f1b 100644 --- a/vscode/microsoft-kiota/src/updateClients.ts +++ b/vscode/microsoft-kiota/src/updateClients.ts @@ -3,20 +3,16 @@ import * as rpc from "vscode-jsonrpc/node"; import * as vscode from "vscode"; export function updateClients(context: vscode.ExtensionContext, cleanOutput: boolean, clearCache: boolean): Promise { - try { - return connectToKiota(context, async (connection) => { - const request = new rpc.RequestType3( - "Update" - ); - const result = await connection.sendRequest( - request, - vscode.workspace.workspaceFolders![0].uri.fsPath, - cleanOutput, - clearCache, - ); - return result; - }); - } catch (error) { - return Promise.resolve(undefined); - } + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType3( + "Update" + ); + const result = await connection.sendRequest( + request, + vscode.workspace.workspaceFolders![0].uri.fsPath, + cleanOutput, + clearCache, + ); + return result; + }); }; \ No newline at end of file From c5be8ed01505295df78d71c6cb9980fb293264fa Mon Sep 17 00:00:00 2001 From: samwelkanda Date: Wed, 25 Sep 2024 05:58:26 +0300 Subject: [PATCH 03/43] Use updated schema link in manifest --- src/Kiota.Builder/Plugins/PluginsGenerationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index e91a2b87ae..ce6e0dcaec 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -264,7 +264,7 @@ private PluginManifestDocument GetManifestDocument(string openApiDocumentPath) var manifestInfo = ExtractInfoFromDocument(OAIDocument.Info); var pluginManifestDocument = new PluginManifestDocument { - Schema = "https://aka.ms/json-schemas/copilot-extensions/v2.1/plugin.schema.json", + Schema = "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.1/schema.json", SchemaVersion = "v2.1", NameForHuman = OAIDocument.Info?.Title.CleanupXMLString(), DescriptionForHuman = descriptionForHuman, From 1ea8a2425e4c14a45e39f61bc90d148657b1c7d0 Mon Sep 17 00:00:00 2001 From: samwelkanda Date: Wed, 25 Sep 2024 06:05:54 +0300 Subject: [PATCH 04/43] Add changelog entry --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9e44af4f6..f183569be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,13 +19,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where a path segment named "item" after a single parameter path segment would derail generation. [#4814](https://github.com/microsoft/kiota/issues/4814) - Fixed a bug where collection/array of primitive types members for union/intersection types would be ignored. [#5283](https://github.com/microsoft/kiota/issues/5283) - Updated dependencies command and view to reflect the availability of bundles. [#5317](https://github.com/microsoft/kiota/issues/5317) -- Fixed a when generating a plugin when only an operation is selected in the root node in the extension. [#5300](https://github.com/microsoft/kiota/issues/5300) +- Fixed a bug when generating a plugin when only an operation is selected in the root node in the extension. [#5300](https://github.com/microsoft/kiota/issues/5300) - Fixed a bug where function descriptions in plugin manifest defaults to path summary instead of description. [#5301](https://github.com/microsoft/kiota/issues/5301) - Fixed a bug where TypeScript would not properly build URIs with uppercase first characters query parameter names.[#5382](https://github.com/microsoft/kiota/issues/5382) -- Fixed a bug where the description special characters are encoded. [5286](https://github.com/microsoft/kiota/issues/5286) +- Fixed a bug where the description special characters are encoded. [#5286](https://github.com/microsoft/kiota/issues/5286) - Fixed a bug where python constructor parameters are being cast to strings leading to bugs as the types is unknown on graph call. [microsoftgraph/msgraph-sdk-python#165](https://github.com/microsoftgraph/msgraph-sdk-python/issues/165) - Fixed a bug where child path segment from single parameter path segment would be incorrectly escaped. [#5433](https://github.com/microsoft/kiota/issues/5433) -- Fixed inconsistent typing information generated for `ParsableFactory` and stream return types in python [kiota-abstractions-python#533](https://github.com/microsoft/kiota-abstractions-python/issues/333) +- Fixed inconsistent typing information generated for `ParsableFactory` and stream return types in python [kiota-abstractions-python#533](https://github.com/microsoft/kiota-abstractions-python/issues/333) +- Updated schema link in plugin manifest to the correct url. [#5441](https://github.com/microsoft/kiota/issues/5441) ## [1.18.0] - 2024-09-05 From 6cd2a47b7a25a09d6c67c27a8067b3136e268b2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:18:05 +0000 Subject: [PATCH 05/43] chore(deps-dev): bump webpack in /vscode/microsoft-kiota Bumps [webpack](https://github.com/webpack/webpack) from 5.94.0 to 5.95.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.94.0...v5.95.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 8 ++++---- vscode/microsoft-kiota/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 45aee533a2..d3da31f4d9 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -30,7 +30,7 @@ "mocha": "^10.7.3", "ts-loader": "^9.5.1", "typescript": "^5.6.2", - "webpack": "^5.94.0", + "webpack": "^5.95.0", "webpack-cli": "^5.1.4" }, "engines": { @@ -4295,9 +4295,9 @@ } }, "node_modules/webpack": { - "version": "5.94.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", - "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, "dependencies": { "@types/estree": "^1.0.5", diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index ee815cc95c..f5204c7caf 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -479,7 +479,7 @@ "mocha": "^10.7.3", "ts-loader": "^9.5.1", "typescript": "^5.6.2", - "webpack": "^5.94.0", + "webpack": "^5.95.0", "webpack-cli": "^5.1.4" }, "dependencies": { From 2371385b7d6020970f102a5b3ed346347ce40175 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:18:15 +0000 Subject: [PATCH 06/43] chore(deps-dev): bump @types/node in /vscode/microsoft-kiota Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.0 to 22.7.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 45aee533a2..83882bc40d 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -531,9 +531,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.0.tgz", - "integrity": "sha512-MOdOibwBs6KW1vfqz2uKMlxq5xAfAZ98SZjO8e3XnAbFnTJtAspqhWk7hrdSAs9/Y14ZWMiy7/MxMUzAOadYEw==", + "version": "22.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.2.tgz", + "integrity": "sha512-866lXSrpGpgyHBZUa2m9YNWqHDjjM0aBTJlNtYaGEw4rqY/dcD7deRVTbBBAJelfA7oaGDbNftXF/TL/A6RgoA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" From 772d01f25d908d92fd9ee70ada75b1acc0c0378f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:21:35 +0000 Subject: [PATCH 07/43] chore(deps-dev): bump @types/node in /it/typescript Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.0 to 22.7.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 8 ++++---- it/typescript/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 57aea33734..2aabcf7355 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.0", + "@types/node": "^22.7.2", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", @@ -948,9 +948,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.0.tgz", - "integrity": "sha512-MOdOibwBs6KW1vfqz2uKMlxq5xAfAZ98SZjO8e3XnAbFnTJtAspqhWk7hrdSAs9/Y14ZWMiy7/MxMUzAOadYEw==", + "version": "22.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.2.tgz", + "integrity": "sha512-866lXSrpGpgyHBZUa2m9YNWqHDjjM0aBTJlNtYaGEw4rqY/dcD7deRVTbBBAJelfA7oaGDbNftXF/TL/A6RgoA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" diff --git a/it/typescript/package.json b/it/typescript/package.json index b8e09534e7..1b7662f1cf 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.0", + "@types/node": "^22.7.2", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", From b5842817fd2b44989ed57058caf8deee5079f2b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:50:41 +0000 Subject: [PATCH 08/43] chore(deps): bump the kiota-dependencies group with 6 updates Bumps the kiota-dependencies group with 6 updates: | Package | From | To | | --- | --- | --- | | [Microsoft.Kiota.Abstractions](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Http.HttpClientLibrary](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Form](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Json](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.kiota.Serialization.Multipart](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Text](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Http.HttpClientLibrary` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Form` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Json` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.kiota.Serialization.Multipart` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Text` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) --- updated-dependencies: - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Http.HttpClientLibrary dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Form dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.kiota.Serialization.Multipart dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- src/Kiota.Builder/Kiota.Builder.csproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index dd14cbd848..b442724b87 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -38,12 +38,12 @@ - - - - - - + + + + + + From ad818f3be922fbff0baf718ec85107eb6b5d90ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:06:06 +0000 Subject: [PATCH 09/43] chore(deps): bump the kiota-dependencies group Bumps the kiota-dependencies group in /it/csharp with 7 updates: | Package | From | To | | --- | --- | --- | | [Microsoft.Kiota.Abstractions](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Authentication.Azure](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Http.HttpClientLibrary](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Form](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Json](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.kiota.Serialization.Multipart](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | | [Microsoft.Kiota.Serialization.Text](https://github.com/microsoft/kiota-dotnet) | `1.12.4` | `1.13.0` | Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Authentication.Azure` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Http.HttpClientLibrary` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Form` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Json` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.kiota.Serialization.Multipart` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Serialization.Text` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) Updates `Microsoft.Kiota.Abstractions` from 1.12.4 to 1.13.0 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.12.4...v1.13.0) --- updated-dependencies: - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Authentication.Azure dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Http.HttpClientLibrary dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Form dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.kiota.Serialization.Multipart dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- it/csharp/dotnet.csproj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/it/csharp/dotnet.csproj b/it/csharp/dotnet.csproj index fa78b6c773..ee29e94816 100644 --- a/it/csharp/dotnet.csproj +++ b/it/csharp/dotnet.csproj @@ -10,13 +10,13 @@ - - - - - - - + + + + + + + From 5b64b53ef8e8ab509801b4a0e171138094ac247e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 26 Sep 2024 09:12:27 -0400 Subject: [PATCH 10/43] fix: untype node erasable in typescript Signed-off-by: Vincent Biret --- CHANGELOG.md | 2 ++ src/Kiota.Builder/Refiners/TypeScriptRefiner.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f183569be3..742fa0e582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added + - Control generated type access modifier for C# via `--type-access-modifier` flag. [#4788](https://github.com/microsoft/kiota/issues/4788) ### Changed @@ -26,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where python constructor parameters are being cast to strings leading to bugs as the types is unknown on graph call. [microsoftgraph/msgraph-sdk-python#165](https://github.com/microsoftgraph/msgraph-sdk-python/issues/165) - Fixed a bug where child path segment from single parameter path segment would be incorrectly escaped. [#5433](https://github.com/microsoft/kiota/issues/5433) - Fixed inconsistent typing information generated for `ParsableFactory` and stream return types in python [kiota-abstractions-python#533](https://github.com/microsoft/kiota-abstractions-python/issues/333) +- Fixed a bug where untyped not imports in TypeScripts would not be erasable. [microsoft/kiota-typescript#1381](https://github.com/microsoft/kiota-typescript/issues/1381) - Updated schema link in plugin manifest to the correct url. [#5441](https://github.com/microsoft/kiota/issues/5441) ## [1.18.0] - 2024-09-05 diff --git a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs index e4e49305a1..825c94a1c3 100644 --- a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs +++ b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs @@ -728,7 +728,10 @@ private static bool HasMultipartBody(CodeMethod m) => AbstractionsPackageName, MultipartBodyClassName, $"serialize{MultipartBodyClassName}"), new (static x => (x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase)) || (x is CodeMethod method && (method.Parameters.Any(param => param.Kind is CodeParameterKind.RequestBody && param.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase)) || method.ReturnType.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase))), - AbstractionsPackageName, KiotaBuilder.UntypedNodeName, "createUntypedNodeFromDiscriminatorValue"), + AbstractionsPackageName, "createUntypedNodeFromDiscriminatorValue"), + new (static x => (x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Custom) && prop.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase)) + || (x is CodeMethod method && (method.Parameters.Any(param => param.Kind is CodeParameterKind.RequestBody && param.Type.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase)) || method.ReturnType.Name.Equals(KiotaBuilder.UntypedNodeName, StringComparison.OrdinalIgnoreCase))), + AbstractionsPackageName, true, KiotaBuilder.UntypedNodeName), }; private const string MultipartBodyClassName = "MultipartBody"; private static void CorrectImplements(ProprietableBlockDeclaration block) From 82069333ebdc50381ea03b183b072aadefac7c99 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Thu, 26 Sep 2024 17:25:24 +0300 Subject: [PATCH 11/43] Removed registration of default serialization and deserialization classes --- src/kiota/Handlers/Client/GenerateHandler.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/kiota/Handlers/Client/GenerateHandler.cs b/src/kiota/Handlers/Client/GenerateHandler.cs index 9911911515..7c9ce9d01a 100644 --- a/src/kiota/Handlers/Client/GenerateHandler.cs +++ b/src/kiota/Handlers/Client/GenerateHandler.cs @@ -53,7 +53,6 @@ public override async Task InvokeAsync(InvocationContext context) var generationConfiguration = new GenerationConfiguration(); var requests = !refresh && manifest is not null && manifest.ApiDependencies.TryGetValue(clientEntry.Key, out var value) ? value.Requests : []; clientEntry.Value.UpdateGenerationConfigurationFromApiClientConfiguration(generationConfiguration, clientEntry.Key, requests); - DefaultSerializersAndDeserializers(generationConfiguration); generationConfiguration.ClearCache = refresh; generationConfiguration.CleanOutput = refresh; generationConfiguration.Operation = ConsumerOperation.Generate; From 45445c9878528c5b44bafe1bbf925548b7c8795c Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Thu, 26 Sep 2024 22:56:05 +0300 Subject: [PATCH 12/43] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f183569be3..9406ae9ed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where child path segment from single parameter path segment would be incorrectly escaped. [#5433](https://github.com/microsoft/kiota/issues/5433) - Fixed inconsistent typing information generated for `ParsableFactory` and stream return types in python [kiota-abstractions-python#533](https://github.com/microsoft/kiota-abstractions-python/issues/333) - Updated schema link in plugin manifest to the correct url. [#5441](https://github.com/microsoft/kiota/issues/5441) +- Removed registration of default serialization and deserialization classes in client constructor. [#5478](https://github.com/microsoft/kiota/pull/5478) ## [1.18.0] - 2024-09-05 From 529ae7e2346d3ff9ddf28a62a77a0492a6c7e174 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:12:01 +0000 Subject: [PATCH 13/43] chore(deps): bump Azure.Identity from 1.12.0 to 1.12.1 in /it/csharp Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.12.0 to 1.12.1. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.12.0...Azure.Identity_1.12.1) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/csharp/dotnet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/csharp/dotnet.csproj b/it/csharp/dotnet.csproj index ee29e94816..1c81728fc9 100644 --- a/it/csharp/dotnet.csproj +++ b/it/csharp/dotnet.csproj @@ -9,7 +9,7 @@ - + From d6519a767804483dd11d0aef799dbd7763757855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:17:50 +0000 Subject: [PATCH 14/43] chore(deps-dev): bump yarl from 1.12.1 to 1.13.0 in /it/python Bumps [yarl](https://github.com/aio-libs/yarl) from 1.12.1 to 1.13.0. - [Release notes](https://github.com/aio-libs/yarl/releases) - [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/yarl/compare/v1.12.1...v1.13.0) --- updated-dependencies: - dependency-name: yarl dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 4ce633c527..f46fb0d638 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -136,5 +136,5 @@ sniffio==1.3.1 ; python_version >= '3.7' uritemplate==4.1.1 ; python_version >= '3.6' -yarl==1.12.1 ; python_version >= '3.7' +yarl==1.13.0 ; python_version >= '3.7' From a07328d11e573264ec510eeb03035dd8ea7c9acf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:45:19 +0000 Subject: [PATCH 15/43] chore(deps-dev): bump @types/node in /it/typescript Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.2 to 22.7.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 8 ++++---- it/typescript/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 2aabcf7355..b9de495d80 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.2", + "@types/node": "^22.7.3", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", @@ -948,9 +948,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.2.tgz", - "integrity": "sha512-866lXSrpGpgyHBZUa2m9YNWqHDjjM0aBTJlNtYaGEw4rqY/dcD7deRVTbBBAJelfA7oaGDbNftXF/TL/A6RgoA==", + "version": "22.7.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", + "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" diff --git a/it/typescript/package.json b/it/typescript/package.json index 1b7662f1cf..5f1acaa57b 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.2", + "@types/node": "^22.7.3", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", From 5a28df818b951fe67b3d789233db5275437a5a0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:51:13 +0000 Subject: [PATCH 16/43] chore(deps-dev): bump @types/node in /vscode/microsoft-kiota Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.2 to 22.7.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 368c466fa8..2518e1a39b 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -531,9 +531,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.2.tgz", - "integrity": "sha512-866lXSrpGpgyHBZUa2m9YNWqHDjjM0aBTJlNtYaGEw4rqY/dcD7deRVTbBBAJelfA7oaGDbNftXF/TL/A6RgoA==", + "version": "22.7.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", + "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" From af0e7ca74782b854d1c48f5169ff36dcafc8e6cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:53:08 +0000 Subject: [PATCH 17/43] chore(deps): bump YamlDotNet from 16.1.2 to 16.1.3 Bumps [YamlDotNet](https://github.com/aaubry/YamlDotNet) from 16.1.2 to 16.1.3. - [Release notes](https://github.com/aaubry/YamlDotNet/releases) - [Commits](https://github.com/aaubry/YamlDotNet/compare/v16.1.2...v16.1.3) --- updated-dependencies: - dependency-name: YamlDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Kiota.Builder/Kiota.Builder.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index b442724b87..356e0d7d83 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -53,7 +53,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + From f506e2de15db0d271cb461bf00f805c6be4ca2a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:54:07 +0000 Subject: [PATCH 18/43] chore(deps): bump xunit from 2.9.1 to 2.9.2 Bumps [xunit](https://github.com/xunit/xunit) from 2.9.1 to 2.9.2. - [Commits](https://github.com/xunit/xunit/compare/2.9.1...2.9.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Kiota.Builder.IntegrationTests.csproj | 2 +- tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj | 2 +- tests/Kiota.Tests/Kiota.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj b/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj index 6f0f2b2342..e0797c6855 100644 --- a/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj +++ b/tests/Kiota.Builder.IntegrationTests/Kiota.Builder.IntegrationTests.csproj @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj b/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj index ba86766df8..5f6c96fe13 100644 --- a/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj +++ b/tests/Kiota.Builder.Tests/Kiota.Builder.Tests.csproj @@ -19,7 +19,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Kiota.Tests/Kiota.Tests.csproj b/tests/Kiota.Tests/Kiota.Tests.csproj index 9977c1f6ad..2ab181470b 100644 --- a/tests/Kiota.Tests/Kiota.Tests.csproj +++ b/tests/Kiota.Tests/Kiota.Tests.csproj @@ -12,7 +12,7 @@ all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From f8c2191e8f6843d8092014f14c4add711675feb7 Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 30 Sep 2024 10:01:53 +0300 Subject: [PATCH 19/43] show user the error message --- vscode/microsoft-kiota/src/kiotaInterop.ts | 46 +++++++-------- .../src/openApiTreeProvider.ts | 58 +++++++++---------- 2 files changed, 50 insertions(+), 54 deletions(-) diff --git a/vscode/microsoft-kiota/src/kiotaInterop.ts b/vscode/microsoft-kiota/src/kiotaInterop.ts index 2bb530d143..433b720c00 100644 --- a/vscode/microsoft-kiota/src/kiotaInterop.ts +++ b/vscode/microsoft-kiota/src/kiotaInterop.ts @@ -25,7 +25,7 @@ export async function connectToKiota(context: vscode.ExtensionContext, callba } catch (error) { const errorMessage = (error as { data?: { message: string } })?.data?.message || 'An unknown error occurred'; - throw new Error(errorMessage); + vscode.window.showErrorMessage(errorMessage); } finally { connection.dispose(); childProcess.kill(); @@ -197,30 +197,30 @@ export function maturityLevelToString(level: MaturityLevel): string { } } export enum DependencyType { - abstractions, - serialization, - authentication, - http, - bundle, - additional, + abstractions, + serialization, + authentication, + http, + bundle, + additional, } export function dependencyTypeToString(type: DependencyType): string { - switch (type) { - case DependencyType.abstractions: - return "abstractions"; - case DependencyType.serialization: - return "serialization"; - case DependencyType.authentication: - return "authentication"; - case DependencyType.http: - return "http"; - case DependencyType.bundle: - return "bundle"; - case DependencyType.additional: - return "additional"; - default: - throw new Error("unknown type"); - } + switch (type) { + case DependencyType.abstractions: + return "abstractions"; + case DependencyType.serialization: + return "serialization"; + case DependencyType.authentication: + return "authentication"; + case DependencyType.http: + return "http"; + case DependencyType.bundle: + return "bundle"; + case DependencyType.additional: + return "additional"; + default: + throw new Error("unknown type"); + } } export interface ConfigurationFile { version: string; diff --git a/vscode/microsoft-kiota/src/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/openApiTreeProvider.ts index 4fc8483009..d8cb256d63 100644 --- a/vscode/microsoft-kiota/src/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/openApiTreeProvider.ts @@ -320,40 +320,36 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider { - const request = new rpc.RequestType('Show'); - return await connection.sendRequest(request, { - includeFilters: this.includeFilters, - excludeFilters: this.excludeFilters, - descriptionPath: this.descriptionUrl, - clearCache - }); + const result = await connectToKiota(this.context, async (connection) => { + const request = new rpc.RequestType('Show'); + return await connection.sendRequest(request, { + includeFilters: this.includeFilters, + excludeFilters: this.excludeFilters, + descriptionPath: this.descriptionUrl, + clearCache }); - if (result) { - this.apiTitle = result.apiTitle; - if (result.rootNode) { - if (this.includeFilters.length === 0) { - this.setAllSelected(result.rootNode, false); - } - this.rawRootNode = result.rootNode; - if (clientNameOrPluginName) { - this.rawRootNode = createKiotaOpenApiNode( - clientNameOrPluginName, - '/', - [this.rawRootNode], - false, - false, - undefined, - clientNameOrPluginName - ); - } - await updateTreeViewIcons(treeViewId, true, false); + }); + if (result) { + this.apiTitle = result.apiTitle; + if (result.rootNode) { + if (this.includeFilters.length === 0) { + this.setAllSelected(result.rootNode, false); + } + this.rawRootNode = result.rootNode; + if (clientNameOrPluginName) { + this.rawRootNode = createKiotaOpenApiNode( + clientNameOrPluginName, + '/', + [this.rawRootNode], + false, + false, + undefined, + clientNameOrPluginName + ); } - void vscode.window.showInformationMessage(vscode.l10n.t('You can now select the required endpoints from {0}', this.apiTitle!)); + await updateTreeViewIcons(treeViewId, true, false); } - } catch (err) { - vscode.window.showErrorMessage((err as Error)?.message || 'An unknown error occurred'); + void vscode.window.showInformationMessage(vscode.l10n.t('You can now select the required endpoints from {0}', this.apiTitle!)); } } getCollapsedState(node: KiotaOpenApiNode): vscode.TreeItemCollapsibleState { From 9246eda4e7df4645cae4888fc9d1798aa155e3d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:39:38 +0000 Subject: [PATCH 20/43] chore(deps-dev): bump yarl from 1.13.0 to 1.13.1 in /it/python Bumps [yarl](https://github.com/aio-libs/yarl) from 1.13.0 to 1.13.1. - [Release notes](https://github.com/aio-libs/yarl/releases) - [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/yarl/compare/v1.13.0...v1.13.1) --- updated-dependencies: - dependency-name: yarl dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index f46fb0d638..85976960ce 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -136,5 +136,5 @@ sniffio==1.3.1 ; python_version >= '3.7' uritemplate==4.1.1 ; python_version >= '3.6' -yarl==1.13.0 ; python_version >= '3.7' +yarl==1.13.1 ; python_version >= '3.7' From 71f3974c2f6d5f62e72f6f12a6d2d85341531cf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:39:52 +0000 Subject: [PATCH 21/43] chore(deps-dev): bump aiohttp from 3.10.6 to 3.10.8 in /it/python Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.10.6 to 3.10.8. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.10.6...v3.10.8) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index f46fb0d638..d7dfcb29f5 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -66,7 +66,7 @@ yapf==0.40.2 zipp==3.20.2 ; python_version >= '3.7' -aiohttp==3.10.6 ; python_version >= '3.6' +aiohttp==3.10.8 ; python_version >= '3.6' aiosignal==1.3.1 ; python_version >= '3.7' From 090a274ba9b8db29afc270e89cd0b1a615a3671b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:58:09 +0000 Subject: [PATCH 22/43] chore(deps-dev): bump @types/node in /vscode/microsoft-kiota Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.3 to 22.7.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 2518e1a39b..1651d63e98 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -531,9 +531,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", - "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", "dev": true, "dependencies": { "undici-types": "~6.19.2" From aac802218240f3e2c043eef4aa69b96f9ebdfe0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:59:51 +0000 Subject: [PATCH 23/43] chore(deps): bump docker/build-push-action from 6.7.0 to 6.8.0 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.7.0 to 6.8.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6.7.0...v6.8.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6eff961bac..d37c59a418 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build image - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: false platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 @@ -94,7 +94,7 @@ jobs: run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - name: Push to GitHub Packages - Nightly if: contains(github.ref, env.PREVIEW_BRANCH) - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 @@ -104,7 +104,7 @@ jobs: # we can't get the sequence number from ADO so we default it back to github run number - name: Push to GitHub Packages - Release if: contains(github.ref, 'refs/tags/v') - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.8.0 with: push: true platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 From 2a9468a7f6fa0debfe8dd6b9daaaaa0602ba7796 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:02:05 +0000 Subject: [PATCH 24/43] chore(deps-dev): bump @types/node in /it/typescript Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.3 to 22.7.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 8 ++++---- it/typescript/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index b9de495d80..43c7237b26 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.3", + "@types/node": "^22.7.4", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", @@ -948,9 +948,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.7.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", - "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", "dev": true, "dependencies": { "undici-types": "~6.19.2" diff --git a/it/typescript/package.json b/it/typescript/package.json index 5f1acaa57b..238d3192f2 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", - "@types/node": "^22.7.3", + "@types/node": "^22.7.4", "@typescript-eslint/eslint-plugin": "^8.7.0", "@typescript-eslint/parser": "^8.7.0", "esbuild": "^0.24.0", From 16d2c45edeb11eb320cdac6e2b5c868bed531009 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 30 Sep 2024 12:56:14 +0300 Subject: [PATCH 25/43] fixes broad searching --- CHANGELOG.md | 1 + .../Writers/TypeScript/TypeScriptConventionService.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef79d80849..64a36d356c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where untyped not imports in TypeScripts would not be erasable. [microsoft/kiota-typescript#1381](https://github.com/microsoft/kiota-typescript/issues/1381) - Updated schema link in plugin manifest to the correct url. [#5441](https://github.com/microsoft/kiota/issues/5441) - Removed registration of default serialization and deserialization classes in client constructor. [#5478](https://github.com/microsoft/kiota/pull/5478) +- Fixed incorrect type name generation in aliased scenario in TS due to broad searching of types in root namespaces. [#5404](https://github.com/microsoft/kiota/issues/5404) ## [1.18.0] - 2024-09-05 diff --git a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs index 1b3b2b22e8..15fa173a48 100644 --- a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs +++ b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -297,7 +297,7 @@ public static string GetFactoryMethodName(CodeTypeBase targetClassType, CodeElem private static CodeFunction? GetFactoryMethod(CodeInterface definitionClass, string factoryMethodName) { - return definitionClass.GetImmediateParentOfType(definitionClass)?.FindChildByName(factoryMethodName); + return definitionClass.GetImmediateParentOfType(definitionClass)?.FindChildByName(factoryMethodName); } public string GetDeserializationMethodName(CodeTypeBase codeType, CodeMethod method, bool? IsCollection = null) From 4b640c41b42255cbe461011152ced5433c3d9f04 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Mon, 30 Sep 2024 15:04:46 +0300 Subject: [PATCH 26/43] validated with tests --- .../TypeScript/TypeScriptConventionService.cs | 4 +- .../TypeScriptLanguageRefinerTests.cs | 76 +++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs index 15fa173a48..ebb98ab309 100644 --- a/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs +++ b/src/Kiota.Builder/Writers/TypeScript/TypeScriptConventionService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -295,7 +295,7 @@ public static string GetFactoryMethodName(CodeTypeBase targetClassType, CodeElem throw new InvalidOperationException($"Unable to find factory method for {targetClassType}"); } - private static CodeFunction? GetFactoryMethod(CodeInterface definitionClass, string factoryMethodName) + internal static CodeFunction? GetFactoryMethod(CodeInterface definitionClass, string factoryMethodName) { return definitionClass.GetImmediateParentOfType(definitionClass)?.FindChildByName(factoryMethodName); } diff --git a/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs b/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs index f26cbb41e8..540f49f10d 100644 --- a/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs +++ b/tests/Kiota.Builder.Tests/Refiners/TypeScriptLanguageRefinerTests.cs @@ -594,6 +594,82 @@ public async Task AliasesDuplicateUsingSymbolsAsync() Assert.DoesNotContain(modelInterface.Usings, x => x.Declaration?.TypeDefinition == source2Interface); Assert.DoesNotContain(modelInterface.Usings, x => x.Declaration?.TypeDefinition == source1Interface); } + + [Fact] + public async Task AliasesDuplicateUsingSymbolsAsyncWithAliasedReferencesToParentNamespaceAsync() + { + var generationConfiguration = new GenerationConfiguration { Language = GenerationLanguage.TypeScript }; + var source1 = TestHelper.CreateModelClassInModelsNamespace(generationConfiguration, root, "source"); + var modelsNS = root.FindNamespaceByName(generationConfiguration.ModelsNamespaceName); + Assert.NotNull(modelsNS); + var submodelsNS = modelsNS.AddNamespace($"{generationConfiguration.ModelsNamespaceName}.submodels"); + var source2 = TestHelper.CreateModelClass(submodelsNS, "source"); + var model = TestHelper.CreateModelClass(submodelsNS, "model"); + + var source1Factory = new CodeMethod + { + Name = "factory", + Kind = CodeMethodKind.Factory, + IsAsync = false, + IsStatic = true, + ReturnType = new CodeType { Name = "source", TypeDefinition = source2, }, + }; + source1.AddMethod(source1Factory); + + var using1 = new CodeUsing + { + Name = modelsNS.Name, + Declaration = new CodeType + { + Name = source1.Name, + TypeDefinition = source1, + IsExternal = false, + } + }; + + var source2Factory = new CodeMethod + { + Name = "factory", + Kind = CodeMethodKind.Factory, + IsAsync = false, + IsStatic = true, + ReturnType = new CodeType { Name = "source", TypeDefinition = source2 }, + }; + + source2.AddMethod(source2Factory); + var using2 = new CodeUsing + { + Name = submodelsNS.Name, + Declaration = new CodeType + { + Name = source2.Name, + TypeDefinition = source2, + IsExternal = false, + } + }; + model.AddUsing(using1); + var property1 = new CodeProperty { Name = "source1", Type = new CodeType { TypeDefinition = source1, } }; + model.AddProperty(property1); + var property2 = new CodeProperty { Name = "source2", Type = new CodeType { TypeDefinition = source2, } }; + model.AddProperty(property2); + model.AddUsing(using2); + await ILanguageRefiner.RefineAsync(new GenerationConfiguration { Language = GenerationLanguage.TypeScript }, root); + + var sourceCodeFile = modelsNS.FindChildByName(IndexFileName, false); + Assert.NotNull(sourceCodeFile); + var source1Interface = sourceCodeFile.Interfaces.First(x => x.Name == source1.Name.ToFirstCharacterUpperCase()); + + var modelCodeFile = submodelsNS.FindChildByName(IndexFileName, false); + Assert.NotNull(modelCodeFile); + var source2Interface = modelCodeFile.Interfaces.First(x => x.Name == source1.Name.ToFirstCharacterUpperCase()); + + var result1 = Kiota.Builder.Writers.TypeScript.TypeScriptConventionService.GetFactoryMethod(source1Interface, "createSourceFromDiscriminatorValue"); + Assert.NotNull(result1); + var result2 = Kiota.Builder.Writers.TypeScript.TypeScriptConventionService.GetFactoryMethod(source2Interface, "createSourceFromDiscriminatorValue"); + Assert.NotNull(result2); + Assert.NotEqual(result1, result2);// they should be different discriminators despite having the same name + } + [Fact] public async Task DoesNotKeepCancellationParametersInRequestExecutorsAsync() { From 31c95685010d6a70a6f3a8c587e72c671d725578 Mon Sep 17 00:00:00 2001 From: Faith Kangai Date: Mon, 30 Sep 2024 16:31:50 +0300 Subject: [PATCH 27/43] Fix kiota vscode settings dependency for task build (#5471) --- .vscode/tasks.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b125148fae..29f5089976 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -22,17 +22,7 @@ "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], - "problemMatcher": "$msCompile", - "dependsOn": ["checkout:sample:locks"] - }, - { - "label": "checkout:sample:locks", - "type": "process", - "command": "git", - "args": ["checkout", "**/kiota-lock.json"], - "options": { - "cwd": "${workspaceFolder}/samples" - } + "problemMatcher": "$msCompile" }, { "label": "test", From c52ca2ea8f09bd5ffb88543b2a6b0490a4344133 Mon Sep 17 00:00:00 2001 From: Faith Kangai Date: Mon, 30 Sep 2024 16:49:51 +0300 Subject: [PATCH 28/43] Fix odata.type key already exists error for MSgraph OAD (#5470) * Fix odata.type key already exists error for MSgraph OAD * Add test for repeated property to not throw key already exist --- .../Plugins/PluginsGenerationService.cs | 5 ++--- .../Plugins/PluginsGenerationServiceTests.cs | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index ce6e0dcaec..4ec587549b 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -9,7 +9,6 @@ using Kiota.Builder.Configuration; using Kiota.Builder.Extensions; using Kiota.Builder.OpenApiExtensions; -using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.OpenApi.ApiManifest; using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Services; @@ -82,7 +81,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de case PluginType.APIManifest: var apiManifest = new ApiManifestDocument("application"); //TODO add application name // pass empty config hash so that its not included in this manifest. - apiManifest.ApiDependencies.AddOrReplace(Configuration.ClientClassName, Configuration.ToApiDependency(string.Empty, TreeNode?.GetRequestInfo().ToDictionary(static x => x.Key, static x => x.Value) ?? [], WorkingDirectory)); + apiManifest.ApiDependencies[Configuration.ClientClassName] = Configuration.ToApiDependency(string.Empty, TreeNode?.GetRequestInfo().ToDictionary(static x => x.Key, static x => x.Value) ?? [], WorkingDirectory); var publisherName = string.IsNullOrEmpty(OAIDocument.Info?.Contact?.Name) ? DefaultContactName : OAIDocument.Info.Contact.Name; @@ -183,7 +182,7 @@ private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDoc { foreach (var property in apiSchema.Properties) { - newSchema.Properties.Add(property.Key, property.Value); + newSchema.Properties.TryAdd(property.Key, property.Value); } } if (apiSchema.MaxProperties is not null) newSchema.MaxProperties = apiSchema.MaxProperties; diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index 44a4697314..c55fdb3ade 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -604,6 +604,26 @@ public static TheoryData> Assert.Equal(3, schema.Properties.Count); } }, + // objects with repeated properties + { + """ + content: + application/json: + schema: + allOf: [ + {type: object, properties: {a: {type: string}, b: {type: number}}}, + {type: object, properties: {b: {type: number}}} + ] + """, (slicedDocument, _) => + { + Assert.NotNull(slicedDocument); + Assert.NotEmpty(slicedDocument.Paths); + var schema = slicedDocument.Paths["/test"].Operations[OperationType.Post].RequestBody + .Content["application/json"].Schema; + Assert.Equal("object", schema.Type); + Assert.Equal(2, schema.Properties.Count); + } + }, // AnyOf { """ From 8b857a6e8173c82b37fac03cd34d987b69ac0e68 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Mon, 30 Sep 2024 17:59:34 +0300 Subject: [PATCH 29/43] Task: Show override message when regenerating (#5493) --- vscode/microsoft-kiota/src/extension.ts | 13 ++++++++++++- .../microsoft-kiota/src/utilities/regeneration.ts | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 vscode/microsoft-kiota/src/utilities/regeneration.ts diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index fe14699388..46d703cd62 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -34,6 +34,7 @@ import { parseGenerationType, parsePluginType, updateTreeViewIcons } from "./util"; import { IntegrationParams, isDeeplinkEnabled, transformToGenerationConfig, validateDeepLinkQueryParams } from './utilities/deep-linking'; +import { confirmOverride } from './utilities/regeneration'; import { loadTreeView } from "./workspaceTreeProvider"; let kiotaStatusBarItem: vscode.StatusBarItem; @@ -314,6 +315,11 @@ export async function activate( await updateTreeViewIcons(treeViewId, false, true); }), registerCommandWithTelemetry(reporter, `${treeViewId}.regenerateButton`, async () => { + const regenerate = await confirmOverride(); + if (!regenerate) { + return; + } + if (!clientOrPluginKey || clientOrPluginKey === '') { clientOrPluginKey = config.clientClassName || config.pluginName || ''; } @@ -339,6 +345,11 @@ export async function activate( } }), registerCommandWithTelemetry(reporter, `${extensionId}.regenerate`, async (clientKey: string, clientObject: ClientOrPluginProperties, generationType: string) => { + const regenerate = await confirmOverride(); + if (!regenerate) { + return; + } + const settings = getExtensionSettings(extensionId); const workspaceJson = vscode.workspace.textDocuments.find(doc => doc.fileName.endsWith(KIOTA_WORKSPACE_FILE)); if (workspaceJson && workspaceJson.isDirty) { @@ -449,7 +460,7 @@ export async function activate( if (!isSuccess) { await exportLogsAndShowErrors(result); } - const isttkIntegration = deepLinkParams.source && deepLinkParams.source.toLowerCase() === 'ttk'? true : false; + const isttkIntegration = deepLinkParams.source && deepLinkParams.source.toLowerCase() === 'ttk'; if (!isttkIntegration) { void vscode.window.showInformationMessage(vscode.l10n.t('Plugin generated successfully.')); } diff --git a/vscode/microsoft-kiota/src/utilities/regeneration.ts b/vscode/microsoft-kiota/src/utilities/regeneration.ts new file mode 100644 index 0000000000..5a8f8a775d --- /dev/null +++ b/vscode/microsoft-kiota/src/utilities/regeneration.ts @@ -0,0 +1,12 @@ +import * as vscode from "vscode"; + +export async function confirmOverride(): Promise { + const yesAnswer = vscode.l10n.t("Yes, override it"); + const confirmation = await vscode.window + .showWarningMessage( + vscode.l10n.t("When regenerating, all changes made manually to the generated files will be overridden."), + yesAnswer, + vscode.l10n.t("Cancel") + ); + return confirmation === yesAnswer; +} \ No newline at end of file From 122ab45b05823e5325e690fcaadf436936dd4833 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:10:12 +0000 Subject: [PATCH 30/43] chore(deps): bump Microsoft.OpenApi from 1.6.21 to 1.6.22 Bumps [Microsoft.OpenApi](https://github.com/Microsoft/OpenAPI.NET) from 1.6.21 to 1.6.22. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](https://github.com/Microsoft/OpenAPI.NET/compare/1.6.21...1.6.22) --- updated-dependencies: - dependency-name: Microsoft.OpenApi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Kiota.Builder/Kiota.Builder.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index 356e0d7d83..9fa1d1f331 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -44,7 +44,7 @@ - + From 3e21b96676fbe745f5ef005128ae73c2d34c76e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:12:31 +0000 Subject: [PATCH 31/43] chore(deps-dev): bump the eslint group Bumps the eslint group in /vscode/microsoft-kiota with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.7.0 to 8.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.7.0 to 8.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 88 ++++++++++++------------ vscode/microsoft-kiota/package.json | 4 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 1651d63e98..6332e8af7c 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -22,8 +22,8 @@ "@types/mocha": "^10.0.8", "@types/node": "22.x", "@types/vscode": "^1.93.0", - "@typescript-eslint/eslint-plugin": "^8.7.0", - "@typescript-eslint/parser": "^8.7.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "@vscode/test-electron": "^2.4.1", "eslint": "^9.11.1", "glob": "^11.0.0", @@ -546,16 +546,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.7.0.tgz", - "integrity": "sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", + "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/type-utils": "8.7.0", - "@typescript-eslint/utils": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/type-utils": "8.8.0", + "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -579,15 +579,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.7.0.tgz", - "integrity": "sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", + "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/typescript-estree": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4" }, "engines": { @@ -607,13 +607,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.7.0.tgz", - "integrity": "sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", + "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0" + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -624,13 +624,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.7.0.tgz", - "integrity": "sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", + "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.7.0", - "@typescript-eslint/utils": "8.7.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/utils": "8.8.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -648,9 +648,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.7.0.tgz", - "integrity": "sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", + "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -661,13 +661,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.7.0.tgz", - "integrity": "sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", + "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -713,15 +713,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.7.0.tgz", - "integrity": "sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", + "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/typescript-estree": "8.7.0" + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -735,12 +735,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.7.0.tgz", - "integrity": "sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", + "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/types": "8.8.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index f5204c7caf..9c6283c730 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -471,8 +471,8 @@ "@types/mocha": "^10.0.8", "@types/node": "22.x", "@types/vscode": "^1.93.0", - "@typescript-eslint/eslint-plugin": "^8.7.0", - "@typescript-eslint/parser": "^8.7.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "@vscode/test-electron": "^2.4.1", "eslint": "^9.11.1", "glob": "^11.0.0", From 3d2b48ee732f906811afa59d9c4b564a6a18329f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:27:18 +0000 Subject: [PATCH 32/43] chore(deps-dev): bump the eslint group in /it/typescript with 2 updates Bumps the eslint group in /it/typescript with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.7.0 to 8.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.7.0 to 8.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.8.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 88 ++++++++++++++++----------------- it/typescript/package.json | 4 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 43c7237b26..f9dd728763 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -24,8 +24,8 @@ "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", "@types/node": "^22.7.4", - "@typescript-eslint/eslint-plugin": "^8.7.0", - "@typescript-eslint/parser": "^8.7.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "esbuild": "^0.24.0", "eslint": "^9.11.1", "eslint-config-prettier": "^9.1.0", @@ -957,16 +957,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.7.0.tgz", - "integrity": "sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.0.tgz", + "integrity": "sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/type-utils": "8.7.0", - "@typescript-eslint/utils": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/type-utils": "8.8.0", + "@typescript-eslint/utils": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -990,15 +990,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.7.0.tgz", - "integrity": "sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.0.tgz", + "integrity": "sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/typescript-estree": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4" }, "engines": { @@ -1018,13 +1018,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.7.0.tgz", - "integrity": "sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz", + "integrity": "sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0" + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1035,13 +1035,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.7.0.tgz", - "integrity": "sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.0.tgz", + "integrity": "sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.7.0", - "@typescript-eslint/utils": "8.7.0", + "@typescript-eslint/typescript-estree": "8.8.0", + "@typescript-eslint/utils": "8.8.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1059,9 +1059,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.7.0.tgz", - "integrity": "sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz", + "integrity": "sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1072,13 +1072,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.7.0.tgz", - "integrity": "sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz", + "integrity": "sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/visitor-keys": "8.7.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/visitor-keys": "8.8.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1124,15 +1124,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.7.0.tgz", - "integrity": "sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz", + "integrity": "sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.7.0", - "@typescript-eslint/types": "8.7.0", - "@typescript-eslint/typescript-estree": "8.7.0" + "@typescript-eslint/scope-manager": "8.8.0", + "@typescript-eslint/types": "8.8.0", + "@typescript-eslint/typescript-estree": "8.8.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1146,12 +1146,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.7.0.tgz", - "integrity": "sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz", + "integrity": "sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.7.0", + "@typescript-eslint/types": "8.8.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { diff --git a/it/typescript/package.json b/it/typescript/package.json index 238d3192f2..d27d9f41b8 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -21,8 +21,8 @@ "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.8.0", "@types/node": "^22.7.4", - "@typescript-eslint/eslint-plugin": "^8.7.0", - "@typescript-eslint/parser": "^8.7.0", + "@typescript-eslint/eslint-plugin": "^8.8.0", + "@typescript-eslint/parser": "^8.8.0", "esbuild": "^0.24.0", "eslint": "^9.11.1", "eslint-config-prettier": "^9.1.0", From ba81bb6d575480891e43b29ec2af1cd11a61c926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:30:31 +0000 Subject: [PATCH 33/43] chore(deps): bump Microsoft.OpenApi.Readers from 1.6.21 to 1.6.22 Bumps [Microsoft.OpenApi.Readers](https://github.com/Microsoft/OpenAPI.NET) from 1.6.21 to 1.6.22. - [Release notes](https://github.com/Microsoft/OpenAPI.NET/releases) - [Commits](https://github.com/Microsoft/OpenAPI.NET/compare/1.6.21...1.6.22) --- updated-dependencies: - dependency-name: Microsoft.OpenApi.Readers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Kiota.Builder/Kiota.Builder.csproj | 2 +- src/kiota/kiota.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index 9fa1d1f331..96912deaca 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -46,7 +46,7 @@ - + diff --git a/src/kiota/kiota.csproj b/src/kiota/kiota.csproj index cf3a01e8bb..1bc679f1a4 100644 --- a/src/kiota/kiota.csproj +++ b/src/kiota/kiota.csproj @@ -47,7 +47,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 6f1ebe69c7e55472efe4dc72c23e6528d28dd2ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:44:36 +0000 Subject: [PATCH 34/43] chore(deps): bump docker/build-push-action from 6.8.0 to 6.9.0 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.8.0 to 6.9.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6.8.0...v6.9.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d37c59a418..d3ea8d16c9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build image - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: false platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 @@ -94,7 +94,7 @@ jobs: run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - name: Push to GitHub Packages - Nightly if: contains(github.ref, env.PREVIEW_BRANCH) - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 @@ -104,7 +104,7 @@ jobs: # we can't get the sequence number from ADO so we default it back to github run number - name: Push to GitHub Packages - Release if: contains(github.ref, 'refs/tags/v') - uses: docker/build-push-action@v6.8.0 + uses: docker/build-push-action@v6.9.0 with: push: true platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 From abb9c91eb999aa7f88debf1ae561f141bb457d38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 08:54:08 +0000 Subject: [PATCH 35/43] chore(deps): bump the kiota-dependencies group Bumps the kiota-dependencies group in /it/java with 5 updates: | Package | From | To | | --- | --- | --- | | [com.microsoft.kiota:microsoft-kiota-abstractions](https://github.com/microsoft/kiota-java) | `1.4.0` | `1.5.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-json](https://github.com/microsoft/kiota-java) | `1.4.0` | `1.5.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-text](https://github.com/microsoft/kiota-java) | `1.4.0` | `1.5.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-form](https://github.com/microsoft/kiota-java) | `1.4.0` | `1.5.0` | | [com.microsoft.kiota:microsoft-kiota-serialization-multipart](https://github.com/microsoft/kiota-java) | `1.4.0` | `1.5.0` | Updates `com.microsoft.kiota:microsoft-kiota-abstractions` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-json` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-text` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-form` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-multipart` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-json` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-text` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-form` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) Updates `com.microsoft.kiota:microsoft-kiota-serialization-multipart` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/microsoft/kiota-java/releases) - [Changelog](https://github.com/microsoft/kiota-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-java/compare/v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: com.microsoft.kiota:microsoft-kiota-abstractions dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-form dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-multipart dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-json dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-text dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-form dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies - dependency-name: com.microsoft.kiota:microsoft-kiota-serialization-multipart dependency-type: direct:production update-type: version-update:semver-minor dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- it/java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/java/pom.xml b/it/java/pom.xml index f96904cfd1..b0a9bf1f90 100644 --- a/it/java/pom.xml +++ b/it/java/pom.xml @@ -15,7 +15,7 @@ UTF-8 UTF-8 - 1.4.0 + 1.5.0 From 9f628e75e1690f14ed2939feebcf7457a8e846a8 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Tue, 1 Oct 2024 12:33:49 +0300 Subject: [PATCH 36/43] Task: create base command class (#5501) --- vscode/microsoft-kiota/src/commands/Command.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 vscode/microsoft-kiota/src/commands/Command.ts diff --git a/vscode/microsoft-kiota/src/commands/Command.ts b/vscode/microsoft-kiota/src/commands/Command.ts new file mode 100644 index 0000000000..dae90f270d --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/Command.ts @@ -0,0 +1,5 @@ +export abstract class Command { + public abstract getName(): string; + + abstract execute(args: unknown): Promise | void; +} \ No newline at end of file From 329c3e8b118af7f3bc48b604f0a952f1435a43d5 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 1 Oct 2024 15:52:57 +0300 Subject: [PATCH 37/43] Fixes incorrect type mapping --- CHANGELOG.md | 1 + src/Kiota.Builder/KiotaBuilder.cs | 5 +- .../Kiota.Builder.Tests/KiotaBuilderTests.cs | 68 +++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64a36d356c..b18d01bcdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated schema link in plugin manifest to the correct url. [#5441](https://github.com/microsoft/kiota/issues/5441) - Removed registration of default serialization and deserialization classes in client constructor. [#5478](https://github.com/microsoft/kiota/pull/5478) - Fixed incorrect type name generation in aliased scenario in TS due to broad searching of types in root namespaces. [#5404](https://github.com/microsoft/kiota/issues/5404) +- Fixed incorrect type mapping in request builders with subsequent paths with the same name. [#5462](https://github.com/microsoft/kiota/issues/5462) ## [1.18.0] - 2024-09-05 diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index 4978a47ec5..66176e81c8 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -955,8 +955,11 @@ x.Parent is CodeIndexer || Parallel.ForEach(unmappedRequestBuilderTypes, parallelOptions, x => { + var parentClass = x.Parent?.Parent as CodeClass; var parentNS = x.Parent?.Parent?.Parent as CodeNamespace; - x.TypeDefinition = parentNS?.FindChildrenByName(x.Name).MinBy(shortestNamespaceOrder); + x.TypeDefinition = parentNS?.FindChildrenByName(x.Name) + .Except([parentClass]).OfType() // the property method should not reference itself as a return type. + .MinBy(shortestNamespaceOrder); // searching down first because most request builder properties on a request builder are just sub paths on the API if (x.TypeDefinition == null) { diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index a38146b19a..6b17ad738e 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -231,6 +231,74 @@ await File.WriteAllTextAsync(tempFilePath, @$"openapi: 3.0.1 Assert.NotNull(specializedNS.FindChildByName("StorageAccount", false)); } [Fact] + public async Task HandlesPathWithRepeatedSegment() + { + var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); + await File.WriteAllTextAsync(tempFilePath, @$"openapi: 3.0.1 +info: + title: OData Service for namespace microsoft.graph + description: This OData service is located at https://graph.microsoft.com/v1.0 + version: 1.0.1 +servers: + - url: https://api.funtranslations.com +paths: + /media/response/response/{{id}}: + get: + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MediaResponseModel' +components: + schemas: + MediaResponseModel: + type: object + properties: + name: + type: string + id: + type: string + format: uuid + mediaType: + type: string + url: + type: string"); + var mockLogger = new Mock>(); + var builder = new KiotaBuilder(mockLogger.Object, new GenerationConfiguration + { + ClientClassName = "Graph", + OpenAPIFilePath = "https://api.apis.guru/v2/specs/funtranslations.com/starwars/2.3/swagger.json" + }, _httpClient); + await using var fs = new FileStream(tempFilePath, FileMode.Open); + var document = await builder.CreateOpenApiDocumentAsync(fs); + var node = builder.CreateUriSpace(document); + builder.SetApiRootUrl(); + var codeModel = builder.CreateSourceModel(node); + var rootNS = codeModel.FindNamespaceByName("ApiSdk"); + Assert.NotNull(rootNS); + var responseBuilderNs = codeModel.FindNamespaceByName("ApiSdk.media.response"); + Assert.NotNull(responseBuilderNs); + var responseRequestBuilder = responseBuilderNs.FindChildByName("ResponseRequestBuilder", false); + Assert.NotNull(responseRequestBuilder); + var navigationProperty = responseRequestBuilder.Properties.FirstOrDefault(prop => + prop.IsOfKind(CodePropertyKind.RequestBuilder) && + prop.Name.Equals("Response", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(navigationProperty); + var navigationPropertyType = navigationProperty.Type as CodeType; + Assert.NotNull(navigationPropertyType); + Assert.NotEqual(responseRequestBuilder, navigationPropertyType.TypeDefinition);// the request builder should not be the same as the class it is in. + var nestedResponseBuilderNs = codeModel.FindNamespaceByName("ApiSdk.media.response.response"); + var nestedResponseRequestBuilder = nestedResponseBuilderNs.FindChildByName("ResponseRequestBuilder", false); + Assert.Equal(nestedResponseRequestBuilder, navigationPropertyType.TypeDefinition);// the request builder should not be the same as the class it is in. + } + [Fact] public async Task HandlesPathWithItemInNameSegment() { var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); From 8580374a50720a3056004b69e5052ccddab7917e Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 1 Oct 2024 16:46:28 +0300 Subject: [PATCH 38/43] adds nullable checks. --- src/Kiota.Builder/KiotaBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index 66176e81c8..d575562412 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -955,10 +955,10 @@ x.Parent is CodeIndexer || Parallel.ForEach(unmappedRequestBuilderTypes, parallelOptions, x => { - var parentClass = x.Parent?.Parent as CodeClass; var parentNS = x.Parent?.Parent?.Parent as CodeNamespace; + CodeClass[] exceptions = x.Parent?.Parent is CodeClass parentClass ? [parentClass] : []; x.TypeDefinition = parentNS?.FindChildrenByName(x.Name) - .Except([parentClass]).OfType() // the property method should not reference itself as a return type. + .Except(exceptions)// the property method should not reference itself as a return type. .MinBy(shortestNamespaceOrder); // searching down first because most request builder properties on a request builder are just sub paths on the API if (x.TypeDefinition == null) From b0b9b05372feca7a898f645f3681d0512e920e65 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Tue, 1 Oct 2024 17:55:45 +0300 Subject: [PATCH 39/43] Task: create migrate from lock file command (#5510) --- .../microsoft-kiota/src/commands/Command.ts | 2 +- .../commands/migrateFromLockFileCommand.ts | 30 +++++++++++++++++++ vscode/microsoft-kiota/src/extension.ts | 14 ++------- 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 vscode/microsoft-kiota/src/commands/migrateFromLockFileCommand.ts diff --git a/vscode/microsoft-kiota/src/commands/Command.ts b/vscode/microsoft-kiota/src/commands/Command.ts index dae90f270d..eee2b170bd 100644 --- a/vscode/microsoft-kiota/src/commands/Command.ts +++ b/vscode/microsoft-kiota/src/commands/Command.ts @@ -1,5 +1,5 @@ export abstract class Command { public abstract getName(): string; - abstract execute(args: unknown): Promise | void; + public abstract execute(args: unknown): Promise; } \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/commands/migrateFromLockFileCommand.ts b/vscode/microsoft-kiota/src/commands/migrateFromLockFileCommand.ts new file mode 100644 index 0000000000..a534f460fc --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/migrateFromLockFileCommand.ts @@ -0,0 +1,30 @@ +import * as vscode from "vscode"; +import { ExtensionContext, Uri, workspace } from "vscode"; + +import { extensionId } from "../constants"; +import { Command } from "./Command"; +import { handleMigration } from "../util"; + +export class MigrateFromLockFileCommand extends Command { + private _context: ExtensionContext; + + constructor(context: ExtensionContext) { + super(); + this._context = context; + } + + public getName(): string { + return `${extensionId}.migrateFromLockFile`; + } + + public async execute(uri: Uri): Promise { + const workspaceFolder = workspace.getWorkspaceFolder(uri); + + if (!workspaceFolder) { + vscode.window.showErrorMessage(vscode.l10n.t("Could not determine the workspace folder.")); + return; + } + + await handleMigration(this._context, workspaceFolder); + } +} \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index 46d703cd62..52b2437245 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -6,6 +6,7 @@ import * as path from 'path'; import * as vscode from "vscode"; import { CodeLensProvider } from "./codelensProvider"; +import { MigrateFromLockFileCommand } from './commands/migrateFromLockFileCommand'; import { KIOTA_WORKSPACE_FILE, dependenciesInfo, extensionId, statusBarCommandId, treeViewFocusCommand, treeViewId } from "./constants"; import { DependenciesViewProvider } from "./dependenciesViewProvider"; import { GenerationType, KiotaGenerationLanguage, KiotaPluginType } from "./enums"; @@ -29,7 +30,6 @@ import { GenerateState, filterSteps, generateSteps, searchSteps } from "./steps" import { updateClients } from "./updateClients"; import { getSanitizedString, getWorkspaceJsonDirectory, getWorkspaceJsonPath, - handleMigration, isClientType, isPluginType, parseGenerationLanguage, parseGenerationType, parsePluginType, updateTreeViewIcons } from "./util"; @@ -61,6 +61,7 @@ export async function activate( context.extensionUri ); const reporter = new TelemetryReporter(context.extension.packageJSON.telemetryInstrumentationKey); + const migrateFromLockFileCommand = new MigrateFromLockFileCommand(context); await loadTreeView(context); await checkForLockFileAndPrompt(context); let codeLensProvider = new CodeLensProvider(); @@ -366,16 +367,7 @@ export async function activate( await regeneratePlugin(clientKey, clientObject, settings); } }), - registerCommandWithTelemetry(reporter, `${extensionId}.migrateFromLockFile`, async (uri: vscode.Uri) => { - const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri); - - if (!workspaceFolder) { - vscode.window.showErrorMessage(vscode.l10n.t("Could not determine the workspace folder.")); - return; - } - - await handleMigration(context, workspaceFolder); - }) + registerCommandWithTelemetry(reporter, migrateFromLockFileCommand.getName(), async (uri: vscode.Uri) => await migrateFromLockFileCommand.execute(uri)), ); async function generateManifestAndRefreshUI(config: Partial, settings: ExtensionSettings, outputPath: string, selectedPaths: string[]): Promise { From da0c9c79681a808d15b1b416e36d4ae8c289da28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:00:28 +0000 Subject: [PATCH 40/43] chore(deps-dev): bump httpcore from 1.0.5 to 1.0.6 in /it/python Bumps [httpcore](https://github.com/encode/httpcore) from 1.0.5 to 1.0.6. - [Release notes](https://github.com/encode/httpcore/releases) - [Changelog](https://github.com/encode/httpcore/blob/master/CHANGELOG.md) - [Commits](https://github.com/encode/httpcore/compare/1.0.5...1.0.6) --- updated-dependencies: - dependency-name: httpcore dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 5049e4f08a..95548b7ce0 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -92,7 +92,7 @@ h2==4.1.0 hpack==4.0.0 ; python_full_version >= '3.6.1' -httpcore==1.0.5 ; python_version >= '3.7' +httpcore==1.0.6 ; python_version >= '3.7' httpx[http2]==0.27.2 From ad38f2680792ea2166ad2c384204abdc0bb2c60b Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 2 Oct 2024 15:14:28 +0300 Subject: [PATCH 41/43] Task: create tree view endpoint selection commands (#5512) --- .../addAllToSelectedEndpointsCommand.ts | 20 ++++++++++++ .../addToSelectedEndpointsCommand.ts | 20 ++++++++++++ .../removeAllFromSelectedEndpointsCommand.ts | 20 ++++++++++++ .../removeFromSelectedEndpointsCommand.ts | 20 ++++++++++++ vscode/microsoft-kiota/src/extension.ts | 31 +++++++++---------- 5 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/addAllToSelectedEndpointsCommand.ts create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/addToSelectedEndpointsCommand.ts create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand.ts create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/removeFromSelectedEndpointsCommand.ts diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/addAllToSelectedEndpointsCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/addAllToSelectedEndpointsCommand.ts new file mode 100644 index 0000000000..1f1bdb869b --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/addAllToSelectedEndpointsCommand.ts @@ -0,0 +1,20 @@ +import { treeViewId } from "../../constants"; +import { OpenApiTreeNode, OpenApiTreeProvider } from "../../openApiTreeProvider"; +import { Command } from "../Command"; + +export class AddAllToSelectedEndpointsCommand extends Command { + private _openApiTreeProvider: OpenApiTreeProvider; + + constructor(openApiTreeProvider: OpenApiTreeProvider) { + super(); + this._openApiTreeProvider = openApiTreeProvider; + } + + public getName(): string { + return `${treeViewId}.addAllToSelectedEndpoints`; + } + + public async execute(openApiTreeNode: OpenApiTreeNode): Promise { + this._openApiTreeProvider.select(openApiTreeNode, true, true); + } +} diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/addToSelectedEndpointsCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/addToSelectedEndpointsCommand.ts new file mode 100644 index 0000000000..fcfad7f51f --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/addToSelectedEndpointsCommand.ts @@ -0,0 +1,20 @@ +import { treeViewId } from "../../constants"; +import { OpenApiTreeNode, OpenApiTreeProvider } from "../../openApiTreeProvider"; +import { Command } from "../Command"; + +export class AddToSelectedEndpointsCommand extends Command { + private _openApiTreeProvider: OpenApiTreeProvider; + + constructor(openApiTreeProvider: OpenApiTreeProvider) { + super(); + this._openApiTreeProvider = openApiTreeProvider; + } + + public getName(): string { + return `${treeViewId}.addToSelectedEndpoints`; + } + + public async execute(openApiTreeNode: OpenApiTreeNode): Promise { + this._openApiTreeProvider.select(openApiTreeNode, true, false); + } +} diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand.ts new file mode 100644 index 0000000000..5eb11da830 --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand.ts @@ -0,0 +1,20 @@ +import { treeViewId } from "../../constants"; +import { OpenApiTreeNode, OpenApiTreeProvider } from "../../openApiTreeProvider"; +import { Command } from "../Command"; + +export class RemoveAllFromSelectedEndpointsCommand extends Command { + private _openApiTreeProvider: OpenApiTreeProvider; + + constructor(openApiTreeProvider: OpenApiTreeProvider) { + super(); + this._openApiTreeProvider = openApiTreeProvider; + } + + public getName(): string { + return `${treeViewId}.removeAllFromSelectedEndpoints`; + } + + public async execute(openApiTreeNode: OpenApiTreeNode): Promise { + this._openApiTreeProvider.select(openApiTreeNode, false, true); + } +} diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeFromSelectedEndpointsCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeFromSelectedEndpointsCommand.ts new file mode 100644 index 0000000000..868d6d6e34 --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/removeFromSelectedEndpointsCommand.ts @@ -0,0 +1,20 @@ +import { treeViewId } from "../../constants"; +import { OpenApiTreeNode, OpenApiTreeProvider } from "../../openApiTreeProvider"; +import { Command } from "../Command"; + +export class RemoveFromSelectedEndpointsCommand extends Command { + private _openApiTreeProvider: OpenApiTreeProvider; + + constructor(openApiTreeProvider: OpenApiTreeProvider) { + super(); + this._openApiTreeProvider = openApiTreeProvider; + } + + public getName(): string { + return `${treeViewId}.removeFromSelectedEndpoints`; + } + + public async execute(openApiTreeNode: OpenApiTreeNode): Promise { + this._openApiTreeProvider.select(openApiTreeNode, false, false); + } +} diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index 52b2437245..fe73196422 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -7,6 +7,10 @@ import * as vscode from "vscode"; import { CodeLensProvider } from "./codelensProvider"; import { MigrateFromLockFileCommand } from './commands/migrateFromLockFileCommand'; +import { AddAllToSelectedEndpointsCommand } from './commands/open-api-tree-view/addAllToSelectedEndpointsCommand'; +import { AddToSelectedEndpointsCommand } from './commands/open-api-tree-view/addToSelectedEndpointsCommand'; +import { RemoveAllFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand'; +import { RemoveFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeFromSelectedEndpointsCommand'; import { KIOTA_WORKSPACE_FILE, dependenciesInfo, extensionId, statusBarCommandId, treeViewFocusCommand, treeViewId } from "./constants"; import { DependenciesViewProvider } from "./dependenciesViewProvider"; import { GenerationType, KiotaGenerationLanguage, KiotaPluginType } from "./enums"; @@ -62,6 +66,12 @@ export async function activate( ); const reporter = new TelemetryReporter(context.extension.packageJSON.telemetryInstrumentationKey); const migrateFromLockFileCommand = new MigrateFromLockFileCommand(context); + + const addAllToSelectedEndpointsCommand = new AddAllToSelectedEndpointsCommand(openApiTreeProvider); + const addToSelectedEndpointsCommand = new AddToSelectedEndpointsCommand(openApiTreeProvider); + const removeAllFromSelectedEndpointsCommand = new RemoveAllFromSelectedEndpointsCommand(openApiTreeProvider); + const removeFromSelectedEndpointsCommand = new RemoveFromSelectedEndpointsCommand(openApiTreeProvider); + await loadTreeView(context); await checkForLockFileAndPrompt(context); let codeLensProvider = new CodeLensProvider(); @@ -118,22 +128,11 @@ export async function activate( `${treeViewId}.openDocumentationPage`, (x: OpenApiTreeNode) => x.documentationUrl && vscode.env.openExternal(vscode.Uri.parse(x.documentationUrl)) ), - registerCommandWithTelemetry(reporter, - `${treeViewId}.addToSelectedEndpoints`, - (x: OpenApiTreeNode) => openApiTreeProvider.select(x, true, false) - ), - registerCommandWithTelemetry(reporter, - `${treeViewId}.addAllToSelectedEndpoints`, - (x: OpenApiTreeNode) => openApiTreeProvider.select(x, true, true) - ), - registerCommandWithTelemetry(reporter, - `${treeViewId}.removeFromSelectedEndpoints`, - (x: OpenApiTreeNode) => openApiTreeProvider.select(x, false, false) - ), - registerCommandWithTelemetry(reporter, - `${treeViewId}.removeAllFromSelectedEndpoints`, - (x: OpenApiTreeNode) => openApiTreeProvider.select(x, false, true) - ), + registerCommandWithTelemetry(reporter, addToSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await addToSelectedEndpointsCommand.execute(openApiTreeNode)), + registerCommandWithTelemetry(reporter, addAllToSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await addAllToSelectedEndpointsCommand.execute(openApiTreeNode)), + registerCommandWithTelemetry(reporter, removeFromSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await removeFromSelectedEndpointsCommand.execute(openApiTreeNode)), + registerCommandWithTelemetry(reporter, removeAllFromSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await removeAllFromSelectedEndpointsCommand.execute(openApiTreeNode)), + registerCommandWithTelemetry(reporter, `${treeViewId}.generateClient`, async () => { From f0d2c1a8fb15b9e715ceafe237ea6e53a26fade1 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 2 Oct 2024 15:28:26 +0300 Subject: [PATCH 42/43] Task: create filter description command (#5511) --- .../filterDescriptionCommand.ts | 24 +++++++++++++++++++ vscode/microsoft-kiota/src/extension.ts | 13 +++++----- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/filterDescriptionCommand.ts diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/filterDescriptionCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/filterDescriptionCommand.ts new file mode 100644 index 0000000000..73a80115ac --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/filterDescriptionCommand.ts @@ -0,0 +1,24 @@ +import { treeViewId } from "../../constants"; +import { OpenApiTreeProvider } from "../../openApiTreeProvider"; +import { filterSteps } from "../../steps"; +import { Command } from "../Command"; + +export class FilterDescriptionCommand extends Command { + + private _openApiTreeProvider: OpenApiTreeProvider; + + constructor(openApiTreeProvider: OpenApiTreeProvider) { + super(); + this._openApiTreeProvider = openApiTreeProvider; + } + + public getName(): string { + return `${treeViewId}.filterDescription`; + } + + public async execute(): Promise { + await filterSteps(this._openApiTreeProvider.filter, + x => this._openApiTreeProvider.filter = x); + } + +} diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index fe73196422..815cd1ddcb 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -9,6 +9,7 @@ import { CodeLensProvider } from "./codelensProvider"; import { MigrateFromLockFileCommand } from './commands/migrateFromLockFileCommand'; import { AddAllToSelectedEndpointsCommand } from './commands/open-api-tree-view/addAllToSelectedEndpointsCommand'; import { AddToSelectedEndpointsCommand } from './commands/open-api-tree-view/addToSelectedEndpointsCommand'; +import { FilterDescriptionCommand } from './commands/open-api-tree-view/filterDescriptionCommand'; import { RemoveAllFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand'; import { RemoveFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeFromSelectedEndpointsCommand'; import { KIOTA_WORKSPACE_FILE, dependenciesInfo, extensionId, statusBarCommandId, treeViewFocusCommand, treeViewId } from "./constants"; @@ -30,7 +31,7 @@ import { import { checkForLockFileAndPrompt } from "./migrateFromLockFile"; import { OpenApiTreeNode, OpenApiTreeProvider } from "./openApiTreeProvider"; import { searchDescription } from "./searchDescription"; -import { GenerateState, filterSteps, generateSteps, searchSteps } from "./steps"; +import { GenerateState, generateSteps, searchSteps } from "./steps"; import { updateClients } from "./updateClients"; import { getSanitizedString, getWorkspaceJsonDirectory, getWorkspaceJsonPath, @@ -65,12 +66,13 @@ export async function activate( context.extensionUri ); const reporter = new TelemetryReporter(context.extension.packageJSON.telemetryInstrumentationKey); - const migrateFromLockFileCommand = new MigrateFromLockFileCommand(context); + const migrateFromLockFileCommand = new MigrateFromLockFileCommand(context); const addAllToSelectedEndpointsCommand = new AddAllToSelectedEndpointsCommand(openApiTreeProvider); const addToSelectedEndpointsCommand = new AddToSelectedEndpointsCommand(openApiTreeProvider); const removeAllFromSelectedEndpointsCommand = new RemoveAllFromSelectedEndpointsCommand(openApiTreeProvider); const removeFromSelectedEndpointsCommand = new RemoveFromSelectedEndpointsCommand(openApiTreeProvider); + const filterDescriptionCommand = new FilterDescriptionCommand(openApiTreeProvider); await loadTreeView(context); await checkForLockFileAndPrompt(context); @@ -301,11 +303,8 @@ export async function activate( } } ), - registerCommandWithTelemetry(reporter, `${treeViewId}.filterDescription`, - async () => { - await filterSteps(openApiTreeProvider.filter, x => openApiTreeProvider.filter = x); - } - ), + registerCommandWithTelemetry(reporter, filterDescriptionCommand.getName(), async () => await filterDescriptionCommand.execute()), + registerCommandWithTelemetry(reporter, `${extensionId}.editPaths`, async (clientKey: string, clientObject: ClientOrPluginProperties, generationType: string) => { clientOrPluginKey = clientKey; clientOrPluginObject = clientObject; From f837b76cb0d20ed1658db262680312b2f5e9fbb4 Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 2 Oct 2024 16:05:01 +0300 Subject: [PATCH 43/43] Task: create open documentation page command (#5515) --- .../openDocumentationPageCommand.ts | 17 +++++++++++++++++ vscode/microsoft-kiota/src/extension.ts | 7 +++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 vscode/microsoft-kiota/src/commands/open-api-tree-view/openDocumentationPageCommand.ts diff --git a/vscode/microsoft-kiota/src/commands/open-api-tree-view/openDocumentationPageCommand.ts b/vscode/microsoft-kiota/src/commands/open-api-tree-view/openDocumentationPageCommand.ts new file mode 100644 index 0000000000..b303d853fc --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/open-api-tree-view/openDocumentationPageCommand.ts @@ -0,0 +1,17 @@ +import * as vscode from "vscode"; + +import { treeViewId } from "../../constants"; +import { OpenApiTreeNode } from "../../openApiTreeProvider"; +import { Command } from "../Command"; + +export class OpenDocumentationPageCommand extends Command { + + public getName(): string { + return `${treeViewId}.openDocumentationPage`; + } + + public async execute(node: OpenApiTreeNode): Promise { + node.documentationUrl && vscode.env.openExternal(vscode.Uri.parse(node.documentationUrl)); + } + +} \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index 815cd1ddcb..0ea6a62168 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -10,6 +10,7 @@ import { MigrateFromLockFileCommand } from './commands/migrateFromLockFileComman import { AddAllToSelectedEndpointsCommand } from './commands/open-api-tree-view/addAllToSelectedEndpointsCommand'; import { AddToSelectedEndpointsCommand } from './commands/open-api-tree-view/addToSelectedEndpointsCommand'; import { FilterDescriptionCommand } from './commands/open-api-tree-view/filterDescriptionCommand'; +import { OpenDocumentationPageCommand } from './commands/open-api-tree-view/openDocumentationPageCommand'; import { RemoveAllFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeAllFromSelectedEndpointsCommand'; import { RemoveFromSelectedEndpointsCommand } from './commands/open-api-tree-view/removeFromSelectedEndpointsCommand'; import { KIOTA_WORKSPACE_FILE, dependenciesInfo, extensionId, statusBarCommandId, treeViewFocusCommand, treeViewId } from "./constants"; @@ -73,6 +74,7 @@ export async function activate( const removeAllFromSelectedEndpointsCommand = new RemoveAllFromSelectedEndpointsCommand(openApiTreeProvider); const removeFromSelectedEndpointsCommand = new RemoveFromSelectedEndpointsCommand(openApiTreeProvider); const filterDescriptionCommand = new FilterDescriptionCommand(openApiTreeProvider); + const openDocumentationPageCommand = new OpenDocumentationPageCommand(); await loadTreeView(context); await checkForLockFileAndPrompt(context); @@ -126,10 +128,7 @@ export async function activate( dependenciesInfoProvider ), vscode.window.registerTreeDataProvider(treeViewId, openApiTreeProvider), - registerCommandWithTelemetry(reporter, - `${treeViewId}.openDocumentationPage`, - (x: OpenApiTreeNode) => x.documentationUrl && vscode.env.openExternal(vscode.Uri.parse(x.documentationUrl)) - ), + registerCommandWithTelemetry(reporter, openDocumentationPageCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await openDocumentationPageCommand.execute(openApiTreeNode)), registerCommandWithTelemetry(reporter, addToSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await addToSelectedEndpointsCommand.execute(openApiTreeNode)), registerCommandWithTelemetry(reporter, addAllToSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await addAllToSelectedEndpointsCommand.execute(openApiTreeNode)), registerCommandWithTelemetry(reporter, removeFromSelectedEndpointsCommand.getName(), async (openApiTreeNode: OpenApiTreeNode) => await removeFromSelectedEndpointsCommand.execute(openApiTreeNode)),