@stack-spot/portal-network 0.98.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +0,0 @@
1
- import { HttpError } from '@oazapfts/runtime'
2
- import { addFavoriteV1FavoritesPost, defaults, deleteFavoriteV1FavoritesDelete, getFavoritesByTypeV1FavoritesGet } from '../api/codeBuddy'
3
- import apis from '../apis.json'
4
- import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
5
- import { removeAuthorizationParam } from '../utils/remove-authorization-param'
6
- import { StackspotAPIError } from '../error/StackspotAPIError'
7
- import { DefaultAPIError } from '../error/DefaultAPIError'
8
-
9
- class CodeBuddyClient extends ReactQueryNetworkClient {
10
- constructor(){
11
- super(apis.codeBuddy.url, defaults)
12
- }
13
-
14
- protected buildStackSpotError(error: HttpError): StackspotAPIError {
15
- return new DefaultAPIError(error.data, error.status, { pt: {}, en:{} }, error.headers)
16
- }
17
-
18
- /**
19
- * List of favorites by type
20
- */
21
- listFavoritesByType = this.query(removeAuthorizationParam(getFavoritesByTypeV1FavoritesGet))
22
- /**
23
- * Remove favorite from list
24
- */
25
- removeFavorite = this.mutation(removeAuthorizationParam(deleteFavoriteV1FavoritesDelete))
26
- /**
27
- * Add favorite to list
28
- */
29
- addFavorite = this.mutation(removeAuthorizationParam(addFavoriteV1FavoritesPost))
30
-
31
- }
32
-
33
- export const codeBuddyClient = new CodeBuddyClient()