@stack-spot/portal-network 0.97.2 → 0.98.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.
package/src/apis.json CHANGED
@@ -189,5 +189,13 @@
189
189
  "prd": "https://code-shift-code-shift-api.stackspot.com"
190
190
  },
191
191
  "docs": "/openapi.json"
192
+ },
193
+ "codeBuddy":{
194
+ "url":{
195
+ "dev": "https://genai-code-buddy-api.dev.stackspot.com",
196
+ "stg": "https://genai-code-buddy-api.stg.stackspot.com",
197
+ "prd": "https://genai-code-buddy-api.stackspot.com"
198
+ },
199
+ "docs": "/openapi.json"
192
200
  }
193
201
  }
@@ -0,0 +1,33 @@
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()
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ export { cloudPlatformHorizonClient } from './client/cloud-platform-horizon'
9
9
  export { cloudRuntimesClient } from './client/cloud-runtimes'
10
10
  export { cloudServicesClient } from './client/cloud-services'
11
11
  export { codeShiftClient } from './client/code-shift'
12
+ export { codeBuddyClient } from './client/code-buddy'
12
13
  export { contentClient } from './client/content'
13
14
  export { eventBusClient } from './client/event-bus'
14
15
  export { insightsClient } from './client/insights'