From 1ebf913c0e293070df687c3a8b62910827ecae79 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 4 Jun 2024 19:48:38 +0300 Subject: [PATCH 1/2] Renames plugin to API plugin --- .vscode/launch.json | 2 +- CHANGELOG.md | 1 + src/Kiota.Builder/PluginType.cs | 2 +- src/Kiota.Builder/Plugins/PluginsGenerationService.cs | 5 +++-- .../Plugins/PluginsGenerationServiceTests.cs | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index df1e40d5f1..f4bcd561b3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -352,7 +352,7 @@ "--type", "ApiManifest", "--type", - "microsoft", + "ApiPlugin", "--type", "OpenAI" ], diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ce954783..bd385a7682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix scalar member composed type serialization in PHP [#2827](https://github.com/microsoft/kiota/issues/2827) - Trims unused components from output openApi document when generating plugins [#4672](https://github.com/microsoft/kiota/issues/4672) - Fixes missing imports for UntypedNode when backingstore is enabled in Java. +- Renames `name_to_be_defined` plugin type to `apiplugin` [#4713](https://github.com/microsoft/kiota/issues/4713) ## [1.14.0] - 2024-05-02 diff --git a/src/Kiota.Builder/PluginType.cs b/src/Kiota.Builder/PluginType.cs index b985a129b0..c96bfa47b7 100644 --- a/src/Kiota.Builder/PluginType.cs +++ b/src/Kiota.Builder/PluginType.cs @@ -4,5 +4,5 @@ public enum PluginType { OpenAI, APIManifest, - Microsoft + APIPlugin } diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 7b5daca469..2acad9f0de 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -67,7 +67,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de switch (pluginType) { - case PluginType.Microsoft: + case PluginType.APIPlugin: var pluginDocument = GetManifestDocument(descriptionRelativePath); pluginDocument.Write(writer); break; @@ -173,7 +173,8 @@ private PluginManifestDocument GetManifestDocument(string openApiDocumentPath) var manifestInfo = ExtractInfoFromDocument(OAIDocument.Info); return new PluginManifestDocument { - SchemaVersion = "v2", + Schema = "https://aka.ms/json-schemas/copilot-extensions/v2.1/plugin.schema.json", + SchemaVersion = "v2.1", NameForHuman = OAIDocument.Info?.Title.CleanupXMLString(), // TODO name for model ??? DescriptionForHuman = descriptionForHuman, diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index d3b4e3cfbb..e67253a8c4 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -74,7 +74,7 @@ public async Task GeneratesManifest() { OutputPath = outputDirectory, OpenAPIFilePath = "openapiPath", - PluginTypes = [PluginType.Microsoft, PluginType.APIManifest, PluginType.OpenAI], + PluginTypes = [PluginType.APIPlugin, PluginType.APIManifest, PluginType.OpenAI], ClientClassName = "client", ApiRootUrl = "http://localhost/", //Kiota builder would set this for us }; @@ -108,7 +108,7 @@ public async Task GeneratesManifest() Assert.Equal(OpenApiFileName, v1Manifest.Document.Api.URL); Assert.Empty(v1Manifest.Problems); } - private const string ManifestFileName = "client-microsoft.json"; + private const string ManifestFileName = "client-apiplugin.json"; private const string OpenAIPluginFileName = "openai-plugins.json"; private const string OpenApiFileName = "client-openapi.yml"; @@ -171,7 +171,7 @@ public async Task GeneratesManifestAndCleansUpInputDescription() { OutputPath = outputDirectory, OpenAPIFilePath = "openapiPath", - PluginTypes = [PluginType.Microsoft], + PluginTypes = [PluginType.APIPlugin], ClientClassName = "client", ApiRootUrl = "http://localhost/", //Kiota builder would set this for us }; From a7cf9851189ed96af6b7ee419a9f3f50043c7b71 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 08:50:43 +0000 Subject: [PATCH 2/2] Bump prettier from 3.3.0 to 3.3.1 in /it/typescript Bumps [prettier](https://github.com/prettier/prettier) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.0...3.3.1) --- updated-dependencies: - dependency-name: prettier 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 c17de79fa5..456c572adb 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -29,7 +29,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", - "prettier": "^3.3.0", + "prettier": "^3.3.1", "typescript": "^4.9.5" } }, @@ -2878,9 +2878,9 @@ } }, "node_modules/prettier": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", - "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/it/typescript/package.json b/it/typescript/package.json index 2828a39198..dd111630d1 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -26,7 +26,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", - "prettier": "^3.3.0", + "prettier": "^3.3.1", "typescript": "^4.9.5" }, "dependencies": {