@stack-spot/portal-network 0.206.3 → 0.208.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.
@@ -0,0 +1,24 @@
1
+ import { HttpError } from '@oazapfts/runtime'
2
+ import { getApiAddresses } from '../api-addresses'
3
+ import { defaults, executeCodeWorkflow } from '../api/edpBfa'
4
+ import { DefaultAPIError } from '../error/DefaultAPIError'
5
+ import { baseDictionary } from '../error/dictionary/base'
6
+ import { StackspotAPIError } from '../error/StackspotAPIError'
7
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
8
+
9
+ class EdpBfaClient extends ReactQueryNetworkClient {
10
+ constructor() {
11
+ super(getApiAddresses().edpBfa.url, defaults)
12
+ }
13
+
14
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
15
+ return new DefaultAPIError(error.data, error.status, baseDictionary, error.headers)
16
+ }
17
+
18
+ /**
19
+ * Triggers an workflow to generate code.
20
+ */
21
+ generateCode = this.mutation(executeCodeWorkflow)
22
+ }
23
+
24
+ export const edpBfaClient = new EdpBfaClient()
@@ -1,5 +1,5 @@
1
1
  import { HttpError } from '@oazapfts/runtime'
2
- import { commit, committedNotifications, defaults, findAll } from '../api/notification'
2
+ import { commit, committedNotifications, defaults, findAll, uncommit } from '../api/notification'
3
3
  import { DefaultAPIError } from '../error/DefaultAPIError'
4
4
  import { baseDictionary } from '../error/dictionary/base'
5
5
  import { StackspotAPIError } from '../error/StackspotAPIError'
@@ -27,6 +27,11 @@ class NotificationClient extends ReactQueryNetworkClient {
27
27
  * Mark a notification as committed (mark as read)
28
28
  */
29
29
  commit = this.mutation(commit)
30
+ /**
31
+ * Mark a notification as uncommitted (mark as unread)
32
+ */
33
+ uncommit = this.mutation(uncommit)
34
+
30
35
  }
31
36
 
32
37
  export const notificationClient = new NotificationClient()
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export { contentClient } from './client/content'
15
15
  export { dataIntegrationClient } from './client/data-integration'
16
16
  export * from './client/discover'
17
17
  export { discoverClient } from './client/discover'
18
+ export { edpBfaClient } from './client/edp-bfa'
18
19
  export { eventBusClient } from './client/event-bus'
19
20
  export { genAiInferenceClient } from './client/gen-ai-inference'
20
21
  export { insightsClient } from './client/insights'
@@ -41,3 +42,4 @@ export { StreamedArray } from './utils/StreamedArray'
41
42
  export { StreamedJson } from './utils/StreamedJson'
42
43
  export { useExtendedList } from './utils/use-extended-list'
43
44
  export { useStreamedArray } from './utils/use-streamed-array'
45
+