@backstage/repo-tools 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f1dc48e: Updated the OpenAPI template to export the `TypedResponse` interface so that client code can leverage it
8
+ - Updated dependencies
9
+ - @backstage/backend-common@0.20.1
10
+
3
11
  ## 0.5.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -125,7 +125,7 @@ function lazy(getActionFunc) {
125
125
  };
126
126
  }
127
127
 
128
- var version = "0.5.0";
128
+ var version = "0.5.1";
129
129
 
130
130
  const main = (argv) => {
131
131
  commander.program.name("backstage-repo-tools").version(version);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/repo-tools",
3
3
  "description": "CLI for Backstage repo tooling ",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -9,7 +9,12 @@ import * as parser from 'uri-template';
9
9
  import { {{classname}} } from '{{filename}}.model{{importFileExtension}}';
10
10
  {{/imports}}
11
11
 
12
- type TypedResponse<T> = Omit<Response, 'json'> & {
12
+ /**
13
+ * Wraps the Response type to convey a type on the json call.
14
+ *
15
+ * @public
16
+ */
17
+ export type TypedResponse<T> = Omit<Response, 'json'> & {
13
18
  json: () => Promise<T>;
14
19
  };
15
20
 
@@ -84,9 +89,9 @@ export class {{classname}}Client {
84
89
  options?: RequestOptions
85
90
  ): Promise<TypedResponse<{{{returnType}}} {{^returnType}}void{{/returnType}}>> {
86
91
  const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
87
-
92
+
88
93
  const uriTemplate = `{{{path}}}{{#hasQueryParams}}{?{{#queryParams}}{{baseName}}{{#isArray}}{{#isExplode}}*{{/isExplode}}{{/isArray}}{{^-last}},{{/-last}}{{/queryParams}}}{{/hasQueryParams}}`;
89
-
94
+
90
95
  const uri = parser.parse(uriTemplate).expand({
91
96
  {{#pathParams}}
92
97
  {{baseName}}: request.path.{{paramName}},