bandcamp-fetch/docs/api/classes/DiscoveryAPI.md

213 lines
4.8 KiB
Markdown
Raw Permalink Normal View History

2023-06-10 16:52:27 +02:00
[bandcamp-fetch](../README.md) / DiscoveryAPI
# Class: DiscoveryAPI
## Hierarchy
- [`BaseAPIWithImageSupport`](BaseAPIWithImageSupport.md)
2023-06-10 16:52:27 +02:00
**`DiscoveryAPI`**
↳↳ [`LimiterDiscoveryAPI`](LimiterDiscoveryAPI.md)
2023-06-10 16:52:27 +02:00
## Table of contents
### Constructors
- [constructor](DiscoveryAPI.md#constructor)
### Accessors
- [cache](DiscoveryAPI.md#cache)
- [imageAPI](DiscoveryAPI.md#imageapi)
2023-06-10 16:52:27 +02:00
### Methods
- [discover](DiscoveryAPI.md#discover)
- [fetch](DiscoveryAPI.md#fetch)
2023-06-10 16:52:27 +02:00
- [getAvailableOptions](DiscoveryAPI.md#getavailableoptions)
- [sanitizeDiscoverParams](DiscoveryAPI.md#sanitizediscoverparams)
## Constructors
### constructor
**new DiscoveryAPI**(`params`)
#### Parameters
| Name | Type |
| :------ | :------ |
| `params` | [`BaseAPIWithImageSupportParams`](../interfaces/BaseAPIWithImageSupportParams.md) |
#### Inherited from
[BaseAPIWithImageSupport](BaseAPIWithImageSupport.md).[constructor](BaseAPIWithImageSupport.md#constructor)
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/common/BaseAPIWithImageSupport.ts:12](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPIWithImageSupport.ts#L12)
## Accessors
### cache
`Protected` `get` **cache**(): [`Cache`](Cache.md)
#### Returns
[`Cache`](Cache.md)
#### Inherited from
BaseAPIWithImageSupport.cache
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/common/BaseAPI.ts:27](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L27)
___
### imageAPI
`get` **imageAPI**(): [`ImageAPI`](ImageAPI.md)
#### Returns
[`ImageAPI`](ImageAPI.md)
#### Inherited from
BaseAPIWithImageSupport.imageAPI
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/common/BaseAPIWithImageSupport.ts:17](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPIWithImageSupport.ts#L17)
2023-06-10 16:52:27 +02:00
## Methods
### discover
**discover**(`params?`): `Promise`<[`DiscoverResult`](../interfaces/DiscoverResult.md)\>
2023-06-10 16:52:27 +02:00
#### Parameters
| Name | Type |
| :------ | :------ |
| `params?` | [`DiscoverParams`](../interfaces/DiscoverParams.md) |
#### Returns
`Promise`<[`DiscoverResult`](../interfaces/DiscoverResult.md)\>
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/discovery/DiscoveryAPI.ts:76](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/discovery/DiscoveryAPI.ts#L76)
___
### fetch
2023-10-29 18:25:17 +01:00
`Protected` **fetch**(`url`, `jsonResponse`, `method`, `payload?`): `Promise`<`Response`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `jsonResponse` | ``false`` |
| `method` | [`HEAD`](../enums/FetchMethod.md#head) |
| `payload?` | `undefined` |
#### Returns
`Promise`<`Response`\>
#### Inherited from
[BaseAPIWithImageSupport](BaseAPIWithImageSupport.md).[fetch](BaseAPIWithImageSupport.md#fetch)
#### Defined in
[lib/common/BaseAPI.ts:20](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L20)
`Protected` **fetch**(`url`, `jsonResponse`, `method?`, `payload?`): `Promise`<`any`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `jsonResponse` | ``true`` |
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
| `payload?` | `Record`<`string`, `any`\> |
#### Returns
`Promise`<`any`\>
#### Inherited from
[BaseAPIWithImageSupport](BaseAPIWithImageSupport.md).[fetch](BaseAPIWithImageSupport.md#fetch)
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/common/BaseAPI.ts:21](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L21)
`Protected` **fetch**(`url`, `jsonResponse?`, `method?`, `payload?`): `Promise`<`string`\>
#### Parameters
| Name | Type |
| :------ | :------ |
| `url` | `string` |
| `jsonResponse?` | `boolean` |
| `method?` | [`FetchMethod`](../enums/FetchMethod.md) |
| `payload?` | `Record`<`string`, `any`\> |
#### Returns
`Promise`<`string`\>
#### Inherited from
[BaseAPIWithImageSupport](BaseAPIWithImageSupport.md).[fetch](BaseAPIWithImageSupport.md#fetch)
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/common/BaseAPI.ts:22](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/common/BaseAPI.ts#L22)
2023-06-10 16:52:27 +02:00
___
### getAvailableOptions
**getAvailableOptions**(): `Promise`<[`DiscoverOptions`](../interfaces/DiscoverOptions.md)\>
2023-06-10 16:52:27 +02:00
#### Returns
`Promise`<[`DiscoverOptions`](../interfaces/DiscoverOptions.md)\>
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/discovery/DiscoveryAPI.ts:24](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/discovery/DiscoveryAPI.ts#L24)
2023-06-10 16:52:27 +02:00
___
### sanitizeDiscoverParams
**sanitizeDiscoverParams**(`params?`): `Promise`<[`DiscoverParams`](../interfaces/DiscoverParams.md)\>
2023-06-10 16:52:27 +02:00
#### Parameters
| Name | Type |
| :------ | :------ |
| `params?` | [`DiscoverParams`](../interfaces/DiscoverParams.md) |
#### Returns
`Promise`<[`DiscoverParams`](../interfaces/DiscoverParams.md)\>
#### Defined in
2023-10-29 18:25:17 +01:00
[lib/discovery/DiscoveryAPI.ts:31](https://github.com/patrickkfkan/bandcamp-fetch/blob/7bb1899/src/lib/discovery/DiscoveryAPI.ts#L31)