@space-cow-media/spellbook-client
Version:
An Open Api generated client for the Commander Spellbook backend REST API.
171 lines (120 loc) • 4.43 kB
Markdown
All URIs are relative to *http://localhost*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**cardsList**](CardsApi.md
| [**cardsRetrieve**](CardsApi.md
> PaginatedCardDetailList cardsList(limit, offset, ordering, q, replaces)
### Example
```ts
import {
Configuration,
CardsApi,
} from '';
import type { CardsListRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new CardsApi(config);
const body = {
// number | Number of results to return per page. (optional)
limit: 56,
// number | The initial index from which to return the results. (optional)
offset: 56,
// string | Which field to use when ordering the results. (optional)
ordering: ordering_example,
// string | A search query. (optional)
q: q_example,
// Array<number> (optional)
replaces: ...,
} satisfies CardsListRequest;
try {
const data = await api.cardsList(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **limit** | `number` | Number of results to return per page. | [Optional] [Defaults to `undefined`] |
| **offset** | `number` | The initial index from which to return the results. | [Optional] [Defaults to `undefined`] |
| **ordering** | `string` | Which field to use when ordering the results. | [Optional] [Defaults to `undefined`] |
| **q** | `string` | A search query. | [Optional] [Defaults to `undefined`] |
| **replaces** | `Array<number>` | | [Optional] |
[**PaginatedCardDetailList**](PaginatedCardDetailList.md)
[](../README.md
- **Content-Type**: Not defined
- **Accept**: `application/json`
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](
> CardDetail cardsRetrieve(id)
### Example
```ts
import {
Configuration,
CardsApi,
} from '';
import type { CardsRetrieveRequest } from '';
async function example() {
console.log("🚀 Testing SDK...");
const config = new Configuration({
// To configure HTTP basic authorization: basicAuth
username: "YOUR USERNAME",
password: "YOUR PASSWORD",
// To configure API key authorization: cookieAuth
apiKey: "YOUR API KEY",
// Configure HTTP bearer authorization: jwtAuth
accessToken: "YOUR BEARER TOKEN",
});
const api = new CardsApi(config);
const body = {
// number | A unique integer value identifying this card.
id: 56,
} satisfies CardsRetrieveRequest;
try {
const data = await api.cardsRetrieve(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `number` | A unique integer value identifying this card. | [Defaults to `undefined`] |
[**CardDetail**](CardDetail.md)
[](../README.md
- **Content-Type**: Not defined
- **Accept**: `application/json`
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | | - |
[[Back to top]](