Skip to content

Commit

Permalink
fix default Api export to do both default and regular export (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo authored May 13, 2024
1 parent 1c7c155 commit eb887fc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions oxide-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion oxide-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oxide/api",
"version": "0.1.0-alpha.7",
"version": "0.1.0-alpha.8",
"description": "TypeScript client for the Oxide API",
"engines": {
"node": ">=18"
Expand Down
4 changes: 3 additions & 1 deletion oxide-api/src/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4175,7 +4175,7 @@ export type ApiListMethods = Pick<
>;

type EmptyObj = Record<string, never>;
export default class Api extends HttpClient {
export class Api extends HttpClient {
methods = {
/**
* Start an OAuth 2.0 Device Authorization Grant
Expand Down Expand Up @@ -6990,3 +6990,5 @@ export default class Api extends HttpClient {
},
};
}

export default Api;
4 changes: 2 additions & 2 deletions oxide-openapi-gen-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion oxide-openapi-gen-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oxide/openapi-gen-ts",
"version": "0.2.1",
"version": "0.2.2",
"description": "OpenAPI client generator used to generate Oxide TypeScript SDK",
"keywords": [
"oxide",
Expand Down
6 changes: 4 additions & 2 deletions oxide-openapi-gen-ts/src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export function generateApi(spec: OpenAPIV3.Document, destDir: string) {

w("type EmptyObj = Record<string, never>;");

w(`export default class Api extends HttpClient {
w(`export class Api extends HttpClient {
methods = {`);

for (const { conf, opId, method, path } of iterPathConfig(spec.paths)) {
Expand Down Expand Up @@ -331,6 +331,8 @@ export function generateApi(spec: OpenAPIV3.Document, destDir: string) {
}

w(` }
}`);
}
export default Api;`);
out.end();
}

0 comments on commit eb887fc

Please sign in to comment.