5.2.0 • Published 10 months ago
@irohalab/mira-bangumi-provider-sdk v5.2.0
mira-bangumi-provider-sdk
A typescript sdk for mira-bangumi-provider API.
Install
Install from npm:
$ npm install @irohalab/mira-bangumi-provider-sdk --saveInstall dependencies:
$ npm install axios tslib typescript --save-devUsage
All API method are defined in a class DefaultApi, you can either create an instance using its constructor or using a factory method
Both way need a Configuration instance as parameter. You usually need to provide a basePath, apiKey or accessKey based on your server
Here are three examples:
Using constructor to create a new instance:
import { Configuration, DefaultApi } from '@irohalab/mira-bangumi-provider-sdk';
export class MyAppClient {
private _apiInstance: DefaultApi;
constructor() {
const config = new Configuration({basePath: 'http://localhost:8085'});
this._apiInstance = new DefaultApi(config);
}
public async getJobList(status: string): Promise<Job[]> {
try {
const resp = await this._apiInstance.listJobs(status, 0, 10);
return resp.data.data as Job[];
} catch (ex) {
return null;
}
}
}Using factory method
import { DefaultApiFactory, Configuration } from '@irohalab/mira-bangumi-provider-sdk';
async function getJobList(status: string): Promise<Job[]> {
try {
const resp = await DefaultApiFactory(new Configuration({basePath: 'http://localhost:8085'})).listJobs(status, 0, 10);
return resp.data.data as Job[];
} catch (ex) {
return null;
}
}5.2.0
10 months ago
5.1.1
10 months ago
5.1.0
10 months ago
5.0.0
1 year ago
4.0.1
1 year ago
3.4.3
1 year ago
3.4.2
1 year ago
3.5.0
1 year ago
4.0.0
1 year ago
3.4.0
1 year ago
3.3.0
2 years ago
3.2.0
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.1
2 years ago
1.2.2
2 years ago
2.0.0
2 years ago
1.2.1
2 years ago
1.2.0
3 years ago
1.0.2
3 years ago
1.1.0
3 years ago
1.0.3
3 years ago
1.0.1
3 years ago