Skip to content

Commit

Permalink
chore: release data-link SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
slavkor authored and github-actions[bot] committed Aug 22, 2024
1 parent d3eebf9 commit 4031ede
Show file tree
Hide file tree
Showing 24 changed files with 964 additions and 628 deletions.
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

0 comments on commit 4031ede

Please sign in to comment.