@stack-spot/portal-network 0.124.1 → 0.125.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
@@ -152,9 +152,9 @@
152
152
  },
153
153
  "apiManagement": {
154
154
  "url": {
155
- "dev": "https://api-management-apigw.dev.stackspot.com/api-management",
156
- "stg": "https://api-management-apigw.stg.stackspot.com/api-management",
157
- "prd": "https://api-management-apigw.stackspot.com/api-management"
155
+ "dev": "https://api-management-apigw.dev.stackspot.com/catalog-assets",
156
+ "stg": "https://api-management-apigw.stg.stackspot.com/catalog-assets",
157
+ "prd": "https://api-management-apigw.stackspot.com/catalog-assets"
158
158
  },
159
159
  "docs": "/v3/api-docs"
160
160
  },
@@ -0,0 +1,36 @@
1
+ import { HttpError } from '@oazapfts/runtime'
2
+ import { defaults, getEntries, getEntryById, getSubEntries } from '../api/apiManagement'
3
+ import apis from '../apis.json'
4
+ import { DefaultAPIError } from '../error/DefaultAPIError'
5
+ import { actionDictionary } from '../error/dictionary/action'
6
+ import { StackspotAPIError } from '../error/StackspotAPIError'
7
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
8
+ import { removeAuthorizationParam } from '../utils/remove-authorization-param'
9
+
10
+ class ApiManagement extends ReactQueryNetworkClient {
11
+ constructor() {
12
+ super(apis.workflows.url, defaults)
13
+ }
14
+
15
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
16
+ return new DefaultAPIError(error.data, error.status, actionDictionary, error.headers)
17
+ }
18
+
19
+ /**
20
+ * Get list
21
+ */
22
+ getList = this.mutation(removeAuthorizationParam(getEntries))
23
+
24
+ /**
25
+ * Get api by id
26
+ */
27
+ getApiById = this.mutation(getEntryById)
28
+
29
+ /**
30
+ * Gets the version of one api
31
+ */
32
+ getApiVersions = this.query(removeAuthorizationParam(getSubEntries))
33
+
34
+ }
35
+
36
+ export const apiManagement = new ApiManagement()
package/src/index.ts CHANGED
@@ -3,8 +3,8 @@ export { apiAddresses } from './api-addresses'
3
3
  export { accountClient } from './client/account'
4
4
  export { agentClient } from './client/agent'
5
5
  export { agentToolsClient } from './client/agent-tools'
6
- export { dataIntegrationClient } from './client/data-integration'
7
6
  export { aiClient } from './client/ai'
7
+ export { apiManagement } from './client/api-management-client'
8
8
  export { cloudAccountClient } from './client/cloud-account'
9
9
  export { cloudPlatformClient } from './client/cloud-platform'
10
10
  export { cloudPlatformHorizonClient } from './client/cloud-platform-horizon'
@@ -12,6 +12,7 @@ export { cloudRuntimesClient } from './client/cloud-runtimes'
12
12
  export { cloudServicesClient } from './client/cloud-services'
13
13
  export { codeShiftClient } from './client/code-shift'
14
14
  export { contentClient } from './client/content'
15
+ export { dataIntegrationClient } from './client/data-integration'
15
16
  export { eventBusClient } from './client/event-bus'
16
17
  export { genAiInferenceClient } from './client/gen-ai-inference'
17
18
  export { insightsClient } from './client/insights'
@@ -34,3 +35,4 @@ export { queryClient } from './network/react-query-client'
34
35
  export { OperationResult, OperationVariables, UseQueryObjectOptions } from './network/types'
35
36
  export { StreamedJson } from './utils/StreamedJson'
36
37
  export { useExtendedList } from './utils/use-extended-list'
38
+