UNPKG

@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
# CardsApi All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**cardsList**](CardsApi.md#cardslist) | **GET** /cards/ | | | [**cardsRetrieve**](CardsApi.md#cardsretrieve) | **GET** /cards/{id}/ | | ## cardsList > 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); ``` ### Parameters | 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] | ### Return type [**PaginatedCardDetailList**](PaginatedCardDetailList.md) ### Authorization [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) ## cardsRetrieve > 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); ``` ### Parameters | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **id** | `number` | A unique integer value identifying this card. | [Defaults to `undefined`] | ### Return type [**CardDetail**](CardDetail.md) ### Authorization [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [jwtAuth](../README.md#jwtAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: `application/json` ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | | - | [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)