UNPKG

@space-cow-media/spellbook-client

Version:

An Open Api generated client for the Commander Spellbook backend REST API.

165 lines (114 loc) 4.18 kB
# TemplatesApi All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**templatesList**](TemplatesApi.md#templateslist) | **GET** /templates/ | | | [**templatesRetrieve**](TemplatesApi.md#templatesretrieve) | **GET** /templates/{id}/ | | ## templatesList > PaginatedTemplateList templatesList(limit, offset, q) ### Example ```ts import { Configuration, TemplatesApi, } from ''; import type { TemplatesListRequest } 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 TemplatesApi(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 | A search query. (optional) q: q_example, } satisfies TemplatesListRequest; try { const data = await api.templatesList(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`] | | **q** | `string` | A search query. | [Optional] [Defaults to `undefined`] | ### Return type [**PaginatedTemplateList**](PaginatedTemplateList.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) ## templatesRetrieve > Template templatesRetrieve(id) ### Example ```ts import { Configuration, TemplatesApi, } from ''; import type { TemplatesRetrieveRequest } 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 TemplatesApi(config); const body = { // number | A unique integer value identifying this card template. id: 56, } satisfies TemplatesRetrieveRequest; try { const data = await api.templatesRetrieve(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 template. | [Defaults to `undefined`] | ### Return type [**Template**](Template.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)