@stack-spot/portal-network 0.113.7 → 0.114.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
@@ -31,6 +31,14 @@
31
31
  },
32
32
  "docs": "/openapi.json"
33
33
  },
34
+ "dataIntegration": {
35
+ "url": {
36
+ "dev": "https://genai-data-integration-api.dev.stackspot.com",
37
+ "stg": "https://genai-data-integration-api.stg.stackspot.com",
38
+ "prd": "https://genai-data-integration-api.stackspot.com"
39
+ },
40
+ "docs": "/openapi.json"
41
+ },
34
42
  "workspace": {
35
43
  "url": {
36
44
  "dev": "https://workspace-workspace-api.dev.stackspot.com",
@@ -12,7 +12,8 @@ import { defaults, createApplicationsBatchServiceV1ApplicationsBatchPost, create
12
12
  getReportV1ReportsReportIdGet,
13
13
  listApplicationReportV1ApplicationsApplicationIdReportsGet,
14
14
  downloadReportV1ReportsReportIdDownloadGet,
15
- checkRoleRouteV1RolesRoleGet,
15
+ checkRoleRouteV1RolesRoleGet,
16
+ createModuleServiceV1ModulesPost,
16
17
  } from '../api/codeShift'
17
18
  import { DefaultAPIError } from '../error/DefaultAPIError'
18
19
 
@@ -49,6 +50,10 @@ class CodeShift extends ReactQueryNetworkClient {
49
50
  * Gets modules.
50
51
  */
51
52
  modules = this.query(removeAuthorizationParam(listModulesServiceV1ModulesGet))
53
+ /**
54
+ * Creates a module.
55
+ */
56
+ createModule = this.mutation(removeAuthorizationParam(createModuleServiceV1ModulesPost))
52
57
  /**
53
58
  * Deletes a code shift application.
54
59
  */
@@ -0,0 +1,49 @@
1
+ import { HttpError } from '@oazapfts/runtime'
2
+ import
3
+ {
4
+ defaults,
5
+ getFileUploadStatusV1FileUploadFileUploadIdGet,
6
+ getUploadFormV2V2FileUploadFormPost,
7
+ saveChunkedFilesV1FileUploadFileUploadIdPost,
8
+ splitUploadedFilePreviewV1FileUploadFileUploadIdSplitPreviewSplitStrategyGet,
9
+ splitUploadedFileV1FileUploadFileUploadIdSplitPost,
10
+ } from '../api/dataIntegration'
11
+ import apis from '../apis.json'
12
+ import { DefaultAPIError } from '../error/DefaultAPIError'
13
+ import { StackspotAPIError } from '../error/StackspotAPIError'
14
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
15
+ import { removeAuthorizationParam } from '../utils/remove-authorization-param'
16
+ import { baseDictionary } from '../error/dictionary/base'
17
+
18
+ class DataIntegrationClient extends ReactQueryNetworkClient {
19
+ constructor() {
20
+ super(apis.dataIntegration.url, defaults)
21
+ }
22
+
23
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
24
+ return new DefaultAPIError(error.data, error.status, baseDictionary, error.headers)
25
+ }
26
+ /**
27
+ * Generates a url to upload the file
28
+ */
29
+ generateUrlToFileUpload = this.mutation(removeAuthorizationParam(getUploadFormV2V2FileUploadFormPost))
30
+ /**
31
+ * Get file processing status by id
32
+ */
33
+ getFileProcessingStatusById = this.query(removeAuthorizationParam(getFileUploadStatusV1FileUploadFileUploadIdGet))
34
+ /**
35
+ * Save the splitted knowledge objects
36
+ */
37
+ saveKnowledgeObjects = this.mutation(removeAuthorizationParam(saveChunkedFilesV1FileUploadFileUploadIdPost))
38
+ /**
39
+ * Splits the file with the passed settings
40
+ */
41
+ splitFile = this.mutation(removeAuthorizationParam(splitUploadedFileV1FileUploadFileUploadIdSplitPost))
42
+ /**
43
+ * Generate a preview with splitted objects
44
+ */
45
+ generateSplittedKnowledgeObjects = this.query(
46
+ removeAuthorizationParam(splitUploadedFilePreviewV1FileUploadFileUploadIdSplitPreviewSplitStrategyGet))
47
+ }
48
+
49
+ export const dataIntegrationClient = new DataIntegrationClient()
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ 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'
6
7
  export { aiClient } from './client/ai'
7
8
  export { cloudAccountClient } from './client/cloud-account'
8
9
  export { cloudPlatformClient } from './client/cloud-platform'
@@ -18,7 +18,7 @@ import { Env, FetchEventStream, HTTPMethod, SessionManager } from './types'
18
18
  */
19
19
  export abstract class NetworkClient {
20
20
  private baseURL: Record<Env, string>
21
- private static sessionManager?: SessionManager
21
+ static readonly sessionManager?: SessionManager
22
22
  private static env?: Env
23
23
 
24
24
  /**
@@ -34,6 +34,7 @@ export abstract class NetworkClient {
34
34
  * @param env The environment to send the requests to.
35
35
  */
36
36
  static setup(sessionManager: SessionManager, env: Env) {
37
+ //@ts-ignore This is the only place we would link session manager to be set.
37
38
  NetworkClient.sessionManager = sessionManager
38
39
  NetworkClient.env = env
39
40
  }