Skip to content

Commit

Permalink
Merge branch 'main' into fix/4796
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwurzinger authored Jun 21, 2024
2 parents 45a28d1 + 94ef79b commit 5a6b21e
Show file tree
Hide file tree
Showing 9 changed files with 675 additions and 52 deletions.
118 changes: 86 additions & 32 deletions specs/cli/plugin-add.md

Large diffs are not rendered by default.

56 changes: 39 additions & 17 deletions specs/cli/plugin-edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Once the `workspace.json` file and the API Manifest are updated, the code genera
| `--openapi \| -d` | Yes | https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json | The location of the OpenAPI document in JSON or YAML format to use to generate the plugin. Accepts a URL or a local directory. | Yes, without its value |
| `--include-path \| -i` | No | /repos/{owner}/{repo} | A glob pattern to include paths from generation. Accepts multiple values. Defaults to no value which includes everything. | Yes, without its value |
| `--exclude-path \| -e` | No | /repos/{owner}/{repo}#DELETE | A glob pattern to exclude paths from generation. Accepts multiple values. Defaults to no value which excludes nothing. | Yes, without its value |
| `--type \| -t` | Yes | openai | The target type of plugin for the generated output files. Accepts multiple values. Possible values are `name_to_be_defined`, `openai` and `apimanifest`.| Yes |
| `--type \| -t` | Yes | openai | The target type of plugin for the generated output files. Accepts multiple values. Possible values are `apiplugin`, `openai` and `apimanifest`.| Yes |
| `--skip-generation \| --sg` | No | true | When specified, the generation would be skipped. Defaults to false. | Yes |
| `--output \| -o` | No | ./generated/plugins/github | The output directory or file path for the generated output files. This is relative to the current working directory. Defaults to `./output`. | Yes, without its value |

Expand Down Expand Up @@ -50,25 +50,46 @@ _The resulting `workspace.json` file will look like this:_
}
```

_The resulting OpenAI plugin named `openai-plugins.json` will look like this:_
_The resulting API Plugin named `github-apiplugin.json` will look like this:_

```jsonc
{
"schema_version": "v1",
"name_for_human": "GitHub Repository Plugin",
"name_for_model": "github",
"description_for_human": "Manage GitHub repositories.",
"description_for_model": "Help the user with managing a GitHub repositories. You can view and update repositories.",
"auth": {
"type": "none"
"$schema": "https://aka.ms/json-schemas/copilot-extensions/v2.1/plugin.schema.json",
"schema_version": "v2.1",
"name_for_human": "GitHub v3 REST API",
"description_for_human": "GitHub\u0026apos;s v3 REST API.",
"description_for_model": "GitHub\u0026apos;s v3 REST API.",
"logo_url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_github_profile_image.jpeg",
"contact_email": "[email protected]",
"namespace": "GitHubReposOwner",
"capabilities": {
"localization": {}
},
"functions": [
{
"name": "repos_get",
"description": "Get a repository"
},
"api": {
"type": "openapi",
"url": "./github-openapi.json"
},
"logo_url": "https://example.com/logo.png",
"contact_email": "[email protected]",
"legal_info_url": "http://www.example.com/view-plugin-information"
{
"name": "repos_update",
"description": "Update a repository"
}
],
"runtimes": [
{
"type": "OpenApi",
"auth": {
"type": "None"
},
"spec": {
"url": "githubreposowner-openapi.yml"
},
"run_for_functions": [
"repos_get",
"repos_update"
]
}
]
}
```

Expand Down Expand Up @@ -141,8 +162,9 @@ _The resulting API Manifest named `apimanifest.json` in the `./kiota` folder (co
└─generated
└─plugins
└─github
└─manifest.json # App manifest
└─github-apimanifest.json # Specific API Manifest
└─openai-plugins.json #OpenAI Plugin
└─github-apiplugin.json #API Plugin
└─github-openapi.json # Sliced and augmented OpenAPI document
```

Expand Down
4 changes: 2 additions & 2 deletions specs/cli/plugin-remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

`kiota plugin remove` allows a developer to remove an existing plugin from the `workspace.json` file. The command will remove the entry from the `plugins` section of `workspace.json` file. The command has a single required parameters; the name of the plugin.

The command also has one optional parameter, the ability to remove the all generated files. If provided, kiota will delete the folder and its content specified at the `outputPath` from the plugin configuration. It will also remove the local version of the OpenAPI document file (specified by the `x-ms-kiotaHash` property in the API plugins). The API plugins are also updated to remove the dependency from the list of dependencies.
The command also has one optional parameter, the ability to remove all generated files. If provided, kiota will delete the folder and its content specified at the `output` from the plugin configuration. It will also remove the local version of the OpenAPI document file (specified by the `x-ms-kiotaHash` property in the API plugins). The plugins are also updated to remove the dependency from the list of dependencies.

| Parameters | Required | Example | Description | Telemetry |
| -- | -- | -- | -- | -- |
Expand All @@ -16,7 +16,7 @@ The command also has one optional parameter, the ability to remove the all gener
```bash
kiota plugin remove --plugin-name "GitHub" --clean-output
```
_The resulting `github-apimanifest.json`, `openai-plugins.json` and `github-openapi.json` files will be deleted._
_The resulting `github-apimanifest.json`, `github-apiplugin.json` and `github-openapi.json` files will be deleted._

The resulting `workspace.json` file will look like this:

Expand Down
Loading

0 comments on commit 5a6b21e

Please sign in to comment.