Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): export SDK #856

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/api/src/codegen/languages/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export default class TSGenerator extends CodeGenerator {
this.sdk = sourceFile.addClass({
name: 'SDK',
properties: [{ name: 'core', type: 'APICore' }],
isExported: true,
});

this.sdk.addConstructor({
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/alby/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/alby.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/metrotransit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/metrotransit.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/operationid-quirks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/operationid-quirks.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/optional-payload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/optional-payload.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/petstore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@readme/oas-examples/3.0/json/petstore.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/readme/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@readme/oas-examples/3.0/json/readme.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse, HTTPMethodRange } from '@readme/api-
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/response-title-quirks.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/simple/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@api/test-utils/definitions/simple.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/star-trek/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ConfigOptions, FetchResponse } from '@readme/api-core/types';
import APICore from '@readme/api-core';
import definition from '@readme/oas-examples/3.0/json/star-trek.json';

class SDK {
export class SDK {
core: APICore;

constructor() {
Expand Down