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

[SDK release] Generated SDK code based on data-link 0.4.3 API changes #24

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
43 changes: 1 addition & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## databox@2.1.1

This generator creates TypeScript/JavaScript client that utilizes [RxJS](https://rxjs-dev.firebaseapp.com/). The generated Node module can be used in the following environments:
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

Environment
* Node.js
Expand Down Expand Up @@ -44,44 +44,3 @@ _unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
```

### How to apply middleware

First, add a singleton class that extends the generated `Configuration` class.

```
export class AuthInterceptor extends Configuration {
private static config: AuthInterceptor;

private constructor() {
const middleware: Middleware[] = [
{
pre(request: RequestArgs): RequestArgs {
const token = getAuthToken();

return {
...request,
headers: {
...request.headers,
Authorization: `Bearer ${token}`,
},
};
},
},
];

super({ middleware });
}

public static get Instance() {
return AuthInterceptor.config || (AuthInterceptor.config = new this());
}
}
```

Next, pass it to the generated api controller.

```
const api = new StoreApi(AuthInterceptor.Instance);

```
1 change: 1 addition & 0 deletions src/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
20 changes: 10 additions & 10 deletions src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.gitignore
.npmignore
README.md
apis/DefaultApi.ts
apis/index.ts
index.ts
models/ApiResponse.ts
models/PushData.ts
models/PushDataAttribute.ts
models/State.ts
models/index.ts
package.json
runtime.ts
servers.ts
src/apis/DefaultApi.ts
src/apis/index.ts
src/index.ts
src/models/ModelApiResponse.ts
src/models/PushData.ts
src/models/PushDataAttribute.ts
src/models/State.ts
src/models/index.ts
src/runtime.ts
tsconfig.json
43 changes: 1 addition & 42 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## databox@2.1.1

This generator creates TypeScript/JavaScript client that utilizes [RxJS](https://rxjs-dev.firebaseapp.com/). The generated Node module can be used in the following environments:
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

Environment
* Node.js
Expand Down Expand Up @@ -44,44 +44,3 @@ _unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
```

### How to apply middleware

First, add a singleton class that extends the generated `Configuration` class.

```
export class AuthInterceptor extends Configuration {
private static config: AuthInterceptor;

private constructor() {
const middleware: Middleware[] = [
{
pre(request: RequestArgs): RequestArgs {
const token = getAuthToken();

return {
...request,
headers: {
...request.headers,
Authorization: `Bearer ${token}`,
},
};
},
},
];

super({ middleware });
}

public static get Instance() {
return AuthInterceptor.config || (AuthInterceptor.config = new this());
}
}
```

Next, pass it to the generated api controller.

```
const api = new StoreApi(AuthInterceptor.Instance);

```
143 changes: 0 additions & 143 deletions src/apis/DefaultApi.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/apis/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/index.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/models/ApiResponse.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/models/PushData.ts

This file was deleted.

Loading