@stack-spot/portal-network 0.184.0 → 0.185.0-beta.1
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/CHANGELOG.md +2444 -2412
- package/dist/api/account.js +1 -1
- package/dist/api/agent-tools.js +1 -1
- package/dist/api/agent.js +1 -1
- package/dist/api/ai.js +1 -1
- package/dist/api/apiManagement.js +1 -1
- package/dist/api/apiRuntime.js +1 -1
- package/dist/api/cloudAccount.js +1 -1
- package/dist/api/cloudPlatform.js +1 -1
- package/dist/api/cloudPlatformHorizon.js +1 -1
- package/dist/api/cloudRuntimes.js +1 -1
- package/dist/api/cloudServices.js +1 -1
- package/dist/api/codeShift.d.ts +63 -4
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +14 -1
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api/content.js +1 -1
- package/dist/api/dataIntegration.js +1 -1
- package/dist/api/discover.js +1 -1
- package/dist/api/genAiInference.js +1 -1
- package/dist/api/insights.js +1 -1
- package/dist/api/notification.js +1 -1
- package/dist/api/secrets.js +1 -1
- package/dist/api/serviceCatalog.js +1 -1
- package/dist/api/workspace-ai.js +1 -1
- package/dist/api/workspace.js +1 -1
- package/dist/api/workspaceManager.js +1 -1
- package/dist/api/workspaceSearchEngine.js +1 -1
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +84 -14
- package/dist/client/ai.js.map +1 -1
- package/dist/client/code-shift.d.ts +30 -0
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +37 -1
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/types.d.ts +26 -6
- package/dist/client/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/readme.md +1 -1
- package/scripts/generate-apis.ts +134 -134
- package/src/api/account.ts +8368 -8367
- package/src/api/agent-tools.ts +2172 -2169
- package/src/api/agent.ts +1085 -1083
- package/src/api/ai.ts +3388 -3388
- package/src/api/apiManagement.ts +570 -570
- package/src/api/apiRuntime.ts +2103 -2103
- package/src/api/cloudAccount.ts +1239 -1239
- package/src/api/cloudPlatform.ts +927 -927
- package/src/api/cloudPlatformHorizon.ts +2655 -2655
- package/src/api/cloudRuntimes.ts +2043 -2043
- package/src/api/cloudServices.ts +1445 -1445
- package/src/api/codeShift.ts +3567 -3481
- package/src/api/content.ts +9785 -9785
- package/src/api/dataIntegration.ts +1657 -1657
- package/src/api/discover.ts +435 -435
- package/src/api/eventBus.ts +171 -171
- package/src/api/genAiInference.ts +603 -603
- package/src/api/insights.ts +310 -310
- package/src/api/notification.ts +336 -334
- package/src/api/secrets.ts +342 -342
- package/src/api/serviceCatalog.ts +2908 -2908
- package/src/api/workflows.ts +1669 -1669
- package/src/api/workspace-ai.ts +677 -677
- package/src/api/workspace.ts +5889 -5889
- package/src/api/workspaceManager.ts +2951 -2951
- package/src/api/workspaceSearchEngine.ts +153 -153
- package/src/api-addresses.ts +120 -120
- package/src/apis-itau.json +225 -225
- package/src/apis.json +225 -225
- package/src/client/account.ts +902 -902
- package/src/client/agent-tools.ts +210 -210
- package/src/client/agent.ts +81 -81
- package/src/client/ai.ts +469 -395
- package/src/client/api-management.ts +40 -40
- package/src/client/cloud-account.ts +70 -70
- package/src/client/cloud-platform-horizon.ts +113 -113
- package/src/client/cloud-platform.ts +163 -163
- package/src/client/cloud-runtimes.ts +129 -129
- package/src/client/cloud-services.ts +94 -94
- package/src/client/code-shift.ts +371 -349
- package/src/client/content.ts +538 -538
- package/src/client/data-integration.ts +191 -191
- package/src/client/discover.ts +89 -89
- package/src/client/event-bus.ts +84 -84
- package/src/client/gen-ai-inference.ts +65 -65
- package/src/client/insights.ts +28 -28
- package/src/client/notification.ts +32 -32
- package/src/client/runtime-manager.ts +76 -76
- package/src/client/secrets.ts +60 -60
- package/src/client/types.ts +398 -377
- package/src/client/workflow.ts +83 -83
- package/src/client/workspace-ai.ts +191 -191
- package/src/client/workspace-manager.ts +564 -564
- package/src/client/workspace-search.ts +39 -39
- package/src/client/workspace.ts +480 -480
- package/src/error/DefaultAPIError.ts +151 -151
- package/src/error/FileUploadError.ts +18 -18
- package/src/error/IgnoredErrorCodes.ts +3 -3
- package/src/error/StackspotAPIError.ts +101 -101
- package/src/error/StreamCanceledError.ts +10 -10
- package/src/error/StreamError.ts +7 -7
- package/src/error/StreamJsonError.ts +10 -10
- package/src/error/dictionary/account.ts +58 -58
- package/src/error/dictionary/action-details.ts +20 -20
- package/src/error/dictionary/action.ts +211 -211
- package/src/error/dictionary/agent-tools.ts +75 -75
- package/src/error/dictionary/ai-inference.ts +28 -28
- package/src/error/dictionary/base.ts +22 -22
- package/src/error/dictionary/cloud-platform.ts +82 -82
- package/src/error/dictionary/cnt-fields.ts +14 -14
- package/src/error/dictionary/cnt.ts +103 -103
- package/src/error/dictionary/code-shift.ts +12 -12
- package/src/error/dictionary/rte.ts +24 -24
- package/src/error/dictionary/rtm.ts +10 -10
- package/src/error/dictionary/secrets.ts +14 -14
- package/src/error/dictionary/workspace-ai.ts +10 -10
- package/src/error/dictionary/workspace-details.ts +15 -15
- package/src/error/dictionary/workspace-fields.ts +10 -10
- package/src/error/dictionary/workspace.ts +209 -209
- package/src/error/types.ts +21 -21
- package/src/index.ts +43 -43
- package/src/network/AutoInfiniteQuery.ts +115 -115
- package/src/network/AutoMutation.ts +27 -27
- package/src/network/AutoOperation.ts +73 -73
- package/src/network/AutoQuery.ts +75 -75
- package/src/network/ManualInfiniteQuery.ts +95 -95
- package/src/network/ManualMutation.ts +40 -40
- package/src/network/ManualOperation.ts +52 -52
- package/src/network/ManualQuery.ts +82 -82
- package/src/network/NetworkClient.ts +167 -167
- package/src/network/ReactQueryNetworkClient.ts +312 -312
- package/src/network/react-query-client.ts +14 -14
- package/src/network/types.ts +294 -294
- package/src/types.ts +1 -1
- package/src/utils/StreamedArray.tsx +146 -146
- package/src/utils/StreamedJson.tsx +166 -166
- package/src/utils/remove-authorization-param.ts +6 -6
- package/src/utils/string.ts +19 -19
- package/src/utils/use-extended-list.ts +80 -80
- package/src/utils/use-streamed-array.ts +17 -17
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +10 -10
package/src/client/workflow.ts
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import { createApiServiceWorkflowsCreateApiDispatchPost, defaults, getExecutionDispatchRequestServiceWorkflowsExecutionIdRequestGet, getExecutionStatusServiceWorkflowsExecutionStatusExecutionIdGet, healthCheckServiceWorkflowsHealthCheckDispatchPost, runActionServiceWorkflowsRunActionDispatchPost, v1AcceptWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdAcceptPost, v1GetWorkflowExecutionAttemptsV1ExecutionsExecutionIdAttemptsGet, v1GetWorkflowExecutionJobDetailServiceV1ExecutionsExecutionIdJobsJobIdGet, v1GetWorkflowExecutionJobGraphServiceV1ExecutionsExecutionIdGet, v1RefuseWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdRefusePost, v1RetryWorkflowExecutionV1ExecutionsExecutionIdRetryPost } from '../api/workflows'
|
|
3
|
-
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
4
|
-
import { actionDictionary } from '../error/dictionary/action'
|
|
5
|
-
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
|
-
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
-
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
|
-
import { getApiAddresses } from '../api-addresses'
|
|
9
|
-
|
|
10
|
-
class WorkflowClient extends ReactQueryNetworkClient {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(getApiAddresses().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
|
-
* Runs an action
|
|
21
|
-
*/
|
|
22
|
-
runAction = this.mutation(removeAuthorizationParam(runActionServiceWorkflowsRunActionDispatchPost))
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Creates an api
|
|
26
|
-
*/
|
|
27
|
-
createApi = this.mutation(createApiServiceWorkflowsCreateApiDispatchPost)
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Gets the execution status of a workflow by id
|
|
31
|
-
*/
|
|
32
|
-
executionStatus = this.query(removeAuthorizationParam(getExecutionStatusServiceWorkflowsExecutionStatusExecutionIdGet))
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Gets the execution dispatch service
|
|
36
|
-
*/
|
|
37
|
-
executionDispatchInfo = this.query(removeAuthorizationParam(getExecutionDispatchRequestServiceWorkflowsExecutionIdRequestGet))
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Gets the health check of an execution id
|
|
41
|
-
*/
|
|
42
|
-
executionHealthCheck = this.mutation(removeAuthorizationParam(healthCheckServiceWorkflowsHealthCheckDispatchPost))
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get data about the workflow plus a graph representation of its jobs.
|
|
46
|
-
*/
|
|
47
|
-
graph = this.query(removeAuthorizationParam(v1GetWorkflowExecutionJobGraphServiceV1ExecutionsExecutionIdGet))
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Gets the steps of a workflow job.
|
|
51
|
-
*/
|
|
52
|
-
jobSteps = this.query(removeAuthorizationParam(v1GetWorkflowExecutionJobDetailServiceV1ExecutionsExecutionIdJobsJobIdGet))
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Approves a workflow step that is suspended so the execution can continue.
|
|
56
|
-
*/
|
|
57
|
-
acceptWorkflowStep = this.mutation(
|
|
58
|
-
removeAuthorizationParam(v1AcceptWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdAcceptPost),
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Refuses a workflow step that is suspended so the execution can be canceled.
|
|
63
|
-
*/
|
|
64
|
-
refuseWorkflowStep = this.mutation(
|
|
65
|
-
removeAuthorizationParam(v1RefuseWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdRefusePost),
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Retries a workflow execution.
|
|
70
|
-
*/
|
|
71
|
-
retry = this.mutation(
|
|
72
|
-
removeAuthorizationParam(v1RetryWorkflowExecutionV1ExecutionsExecutionIdRetryPost),
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Gets the attempts of a workflow execution.
|
|
77
|
-
*/
|
|
78
|
-
attempts = this.query(
|
|
79
|
-
removeAuthorizationParam(v1GetWorkflowExecutionAttemptsV1ExecutionsExecutionIdAttemptsGet),
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const workflowClient = new WorkflowClient()
|
|
1
|
+
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
+
import { createApiServiceWorkflowsCreateApiDispatchPost, defaults, getExecutionDispatchRequestServiceWorkflowsExecutionIdRequestGet, getExecutionStatusServiceWorkflowsExecutionStatusExecutionIdGet, healthCheckServiceWorkflowsHealthCheckDispatchPost, runActionServiceWorkflowsRunActionDispatchPost, v1AcceptWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdAcceptPost, v1GetWorkflowExecutionAttemptsV1ExecutionsExecutionIdAttemptsGet, v1GetWorkflowExecutionJobDetailServiceV1ExecutionsExecutionIdJobsJobIdGet, v1GetWorkflowExecutionJobGraphServiceV1ExecutionsExecutionIdGet, v1RefuseWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdRefusePost, v1RetryWorkflowExecutionV1ExecutionsExecutionIdRetryPost } from '../api/workflows'
|
|
3
|
+
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
4
|
+
import { actionDictionary } from '../error/dictionary/action'
|
|
5
|
+
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
|
+
import { getApiAddresses } from '../api-addresses'
|
|
9
|
+
|
|
10
|
+
class WorkflowClient extends ReactQueryNetworkClient {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(getApiAddresses().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
|
+
* Runs an action
|
|
21
|
+
*/
|
|
22
|
+
runAction = this.mutation(removeAuthorizationParam(runActionServiceWorkflowsRunActionDispatchPost))
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates an api
|
|
26
|
+
*/
|
|
27
|
+
createApi = this.mutation(createApiServiceWorkflowsCreateApiDispatchPost)
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Gets the execution status of a workflow by id
|
|
31
|
+
*/
|
|
32
|
+
executionStatus = this.query(removeAuthorizationParam(getExecutionStatusServiceWorkflowsExecutionStatusExecutionIdGet))
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Gets the execution dispatch service
|
|
36
|
+
*/
|
|
37
|
+
executionDispatchInfo = this.query(removeAuthorizationParam(getExecutionDispatchRequestServiceWorkflowsExecutionIdRequestGet))
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Gets the health check of an execution id
|
|
41
|
+
*/
|
|
42
|
+
executionHealthCheck = this.mutation(removeAuthorizationParam(healthCheckServiceWorkflowsHealthCheckDispatchPost))
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get data about the workflow plus a graph representation of its jobs.
|
|
46
|
+
*/
|
|
47
|
+
graph = this.query(removeAuthorizationParam(v1GetWorkflowExecutionJobGraphServiceV1ExecutionsExecutionIdGet))
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the steps of a workflow job.
|
|
51
|
+
*/
|
|
52
|
+
jobSteps = this.query(removeAuthorizationParam(v1GetWorkflowExecutionJobDetailServiceV1ExecutionsExecutionIdJobsJobIdGet))
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Approves a workflow step that is suspended so the execution can continue.
|
|
56
|
+
*/
|
|
57
|
+
acceptWorkflowStep = this.mutation(
|
|
58
|
+
removeAuthorizationParam(v1AcceptWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdAcceptPost),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Refuses a workflow step that is suspended so the execution can be canceled.
|
|
63
|
+
*/
|
|
64
|
+
refuseWorkflowStep = this.mutation(
|
|
65
|
+
removeAuthorizationParam(v1RefuseWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdRefusePost),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Retries a workflow execution.
|
|
70
|
+
*/
|
|
71
|
+
retry = this.mutation(
|
|
72
|
+
removeAuthorizationParam(v1RetryWorkflowExecutionV1ExecutionsExecutionIdRetryPost),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gets the attempts of a workflow execution.
|
|
77
|
+
*/
|
|
78
|
+
attempts = this.query(
|
|
79
|
+
removeAuthorizationParam(v1GetWorkflowExecutionAttemptsV1ExecutionsExecutionIdAttemptsGet),
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const workflowClient = new WorkflowClient()
|
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import { AgentResponse } from '../api/agent'
|
|
3
|
-
import { CustomToolkitResponse } from '../api/agent-tools'
|
|
4
|
-
import { GetAiStackResponse, KnowledgeSourceItemResponse, QuickCommandResponse } from '../api/ai'
|
|
5
|
-
import {
|
|
6
|
-
addContentV1WorkspacesWorkspaceIdContentTypePost,
|
|
7
|
-
addFavoriteV1WorkspacesWorkspaceIdFavoritePost,
|
|
8
|
-
addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch,
|
|
9
|
-
addPermissionV1WorkspacesWorkspaceIdPermissionsPatch,
|
|
10
|
-
createShareableLinkV1WorkspacesWorkspaceIdSharePost,
|
|
11
|
-
createWorkspaceV1WorkspacesPost,
|
|
12
|
-
defaults,
|
|
13
|
-
deleteFavoriteV1WorkspacesWorkspaceIdFavoriteDelete,
|
|
14
|
-
deleteWorkspaceV1WorkspacesWorkspaceIdDelete,
|
|
15
|
-
getWorkspaceByIdV1WorkspacesIdGet,
|
|
16
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet,
|
|
17
|
-
listAllContentsV1WorkspacesContentsContentTypeGet,
|
|
18
|
-
listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet,
|
|
19
|
-
listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet,
|
|
20
|
-
listWorkspacesV1WorkspacesGet,
|
|
21
|
-
removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete,
|
|
22
|
-
removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete,
|
|
23
|
-
removePermissionV1WorkspacesWorkspaceIdPermissionsDelete,
|
|
24
|
-
updateWorkspaceV1WorkspacesWorkspaceIdPatch,
|
|
25
|
-
useShareableLinkV1ShareShareIdPatch,
|
|
26
|
-
} from '../api/workspace-ai'
|
|
27
|
-
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
28
|
-
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
29
|
-
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
30
|
-
import { getApiAddresses } from '../api-addresses'
|
|
31
|
-
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
32
|
-
import { wksAiDictionary } from '../error/dictionary/workspace-ai'
|
|
33
|
-
import { FixedAddResourceToWorkspaceAi, FixedWorkspaceAiPermissions, ReplaceResult } from './types'
|
|
34
|
-
|
|
35
|
-
class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(getApiAddresses()['workspace-ai'].url, defaults)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
41
|
-
return new DefaultAPIError(error.data, error.status, wksAiDictionary, error.headers)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
createWorkspaceAi = this.mutation(removeAuthorizationParam(createWorkspaceV1WorkspacesPost))
|
|
45
|
-
workspacesAi = this.query(removeAuthorizationParam(listWorkspacesV1WorkspacesGet))
|
|
46
|
-
workspaceAi = this.query(removeAuthorizationParam(getWorkspaceByIdV1WorkspacesIdGet))
|
|
47
|
-
updateWorkspaceAi = this.mutation(removeAuthorizationParam(updateWorkspaceV1WorkspacesWorkspaceIdPatch))
|
|
48
|
-
deleteWorkspaceAi = this.mutation(removeAuthorizationParam(deleteWorkspaceV1WorkspacesWorkspaceIdDelete))
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Adds a resource to the Spot.
|
|
52
|
-
*/
|
|
53
|
-
addResourceTypeToWorkspaceAi = this.mutation({
|
|
54
|
-
name: 'addResourceTypeToWorkspaceAi',
|
|
55
|
-
request: (
|
|
56
|
-
signal,
|
|
57
|
-
variables: Omit<Parameters<typeof addContentV1WorkspacesWorkspaceIdContentTypePost>[0], 'authorization'>,
|
|
58
|
-
) =>
|
|
59
|
-
addContentV1WorkspacesWorkspaceIdContentTypePost({ ...variables, authorization: '' },
|
|
60
|
-
{ signal }) as unknown as Promise<FixedAddResourceToWorkspaceAi>,
|
|
61
|
-
permission: this.createPermissionFunctionFor(addContentV1WorkspacesWorkspaceIdContentTypePost),
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Lists all the knowledge sources in a Spot.
|
|
66
|
-
*/
|
|
67
|
-
getKSFromWorkspaceAi = this.query({
|
|
68
|
-
name: 'KsWorkspaceAi',
|
|
69
|
-
request: (
|
|
70
|
-
signal,
|
|
71
|
-
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
72
|
-
'authorization' | 'contentType'>,
|
|
73
|
-
) =>
|
|
74
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'knowledge_source', authorization: '' },
|
|
75
|
-
{ signal }) as unknown as Promise<KnowledgeSourceItemResponse[]>,
|
|
76
|
-
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Lists all the stacks in a Spot.
|
|
81
|
-
*/
|
|
82
|
-
getStackFromWorkspaceAi = this.query({
|
|
83
|
-
name: 'StackWorkspaceAi',
|
|
84
|
-
request: (
|
|
85
|
-
signal,
|
|
86
|
-
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
87
|
-
'authorization' | 'contentType'>,
|
|
88
|
-
) =>
|
|
89
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'stack', authorization: '' },
|
|
90
|
-
{ signal }) as unknown as Promise<GetAiStackResponse[]>,
|
|
91
|
-
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Lists all the quick commands in a Spot.
|
|
96
|
-
*/
|
|
97
|
-
getQCFromWorkspaceAi = this.query({
|
|
98
|
-
name: 'QcWorkspaceAi',
|
|
99
|
-
request: (
|
|
100
|
-
signal,
|
|
101
|
-
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
102
|
-
'authorization' | 'contentType'>,
|
|
103
|
-
) =>
|
|
104
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'quick_command', authorization: '' },
|
|
105
|
-
{ signal }) as unknown as Promise<QuickCommandResponse[]>,
|
|
106
|
-
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Lists all the agents in a Spot.
|
|
111
|
-
*/
|
|
112
|
-
getAgentFromWorkspaceAi = this.query({
|
|
113
|
-
name: 'AgentWorkspaceAi',
|
|
114
|
-
request: (
|
|
115
|
-
signal,
|
|
116
|
-
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
117
|
-
'authorization' | 'contentType'>,
|
|
118
|
-
) =>
|
|
119
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'agent', authorization: '' },
|
|
120
|
-
{ signal }) as unknown as Promise<AgentResponse[]>,
|
|
121
|
-
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Lists all the toolkits in a Spot.
|
|
126
|
-
*/
|
|
127
|
-
getToolkitsFromWorkspaceAi = this.query({
|
|
128
|
-
name: 'ToolkitWorkspaceAi',
|
|
129
|
-
request: (
|
|
130
|
-
signal,
|
|
131
|
-
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
132
|
-
'authorization' | 'contentType'>,
|
|
133
|
-
) =>
|
|
134
|
-
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'toolkit', authorization: '' },
|
|
135
|
-
{ signal }) as unknown as Promise<CustomToolkitResponse[]>,
|
|
136
|
-
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
deleteResourceTypeFromWorkspaceAi = this.mutation(removeAuthorizationParam(
|
|
140
|
-
removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete))
|
|
141
|
-
addPermissionToWorkspaceAi = this.mutation(removeAuthorizationParam(addPermissionV1WorkspacesWorkspaceIdPermissionsPatch))
|
|
142
|
-
removePermissionToWorkspaceAi = this.mutation(removeAuthorizationParam(removePermissionV1WorkspacesWorkspaceIdPermissionsDelete))
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Get group of permission on workspace AI
|
|
146
|
-
* @param search can be used to search by name
|
|
147
|
-
* @param filter_value is not necessary to use for filtering
|
|
148
|
-
* @param filter_by is not necessary to use for filtering
|
|
149
|
-
*/
|
|
150
|
-
// eslint-disable-next-line max-len
|
|
151
|
-
groupsOfWorkspaceAi = this.query(removeAuthorizationParam(listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet) as unknown as ReplaceResult<typeof listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet, FixedWorkspaceAiPermissions>)
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Adds the resource of type Workspace AI to the list of favorites.
|
|
155
|
-
*/
|
|
156
|
-
addFavoriteWorkspaceAi = this.mutation(removeAuthorizationParam(addFavoriteV1WorkspacesWorkspaceIdFavoritePost))
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Removes the resource of type Workspace AI from the list of favorites.
|
|
160
|
-
*/
|
|
161
|
-
removeFavoriteWorkspaceAi = this.mutation(removeAuthorizationParam(deleteFavoriteV1WorkspacesWorkspaceIdFavoriteDelete))
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Gets all content from all workspaces to which the user has permissions.
|
|
165
|
-
*/
|
|
166
|
-
workspacesContentsByType = this.query(removeAuthorizationParam(listAllContentsV1WorkspacesContentsContentTypeGet))
|
|
167
|
-
/**
|
|
168
|
-
* Get a generated link to share a spot
|
|
169
|
-
*/
|
|
170
|
-
generateShareSpotLink = this.mutation(removeAuthorizationParam(createShareableLinkV1WorkspacesWorkspaceIdSharePost))
|
|
171
|
-
/**
|
|
172
|
-
* Get a shareable link from a spot
|
|
173
|
-
*/
|
|
174
|
-
shareableLink = this.mutation(removeAuthorizationParam(useShareableLinkV1ShareShareIdPatch))
|
|
175
|
-
/**
|
|
176
|
-
* Add permission to resource
|
|
177
|
-
*/
|
|
178
|
-
addPermissionResource = this.mutation(removeAuthorizationParam(addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch))
|
|
179
|
-
/**
|
|
180
|
-
* Remove permission to resource
|
|
181
|
-
*/
|
|
182
|
-
removePermissionResource =
|
|
183
|
-
this.mutation(removeAuthorizationParam(removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete))
|
|
184
|
-
/**
|
|
185
|
-
* List members with permission to resource
|
|
186
|
-
*/
|
|
187
|
-
listMembersResource =
|
|
188
|
-
this.infiniteQuery(removeAuthorizationParam(listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet))
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export const workspaceAiClient = new WorkspaceAiClient()
|
|
1
|
+
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
+
import { AgentResponse } from '../api/agent'
|
|
3
|
+
import { CustomToolkitResponse } from '../api/agent-tools'
|
|
4
|
+
import { GetAiStackResponse, KnowledgeSourceItemResponse, QuickCommandResponse } from '../api/ai'
|
|
5
|
+
import {
|
|
6
|
+
addContentV1WorkspacesWorkspaceIdContentTypePost,
|
|
7
|
+
addFavoriteV1WorkspacesWorkspaceIdFavoritePost,
|
|
8
|
+
addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch,
|
|
9
|
+
addPermissionV1WorkspacesWorkspaceIdPermissionsPatch,
|
|
10
|
+
createShareableLinkV1WorkspacesWorkspaceIdSharePost,
|
|
11
|
+
createWorkspaceV1WorkspacesPost,
|
|
12
|
+
defaults,
|
|
13
|
+
deleteFavoriteV1WorkspacesWorkspaceIdFavoriteDelete,
|
|
14
|
+
deleteWorkspaceV1WorkspacesWorkspaceIdDelete,
|
|
15
|
+
getWorkspaceByIdV1WorkspacesIdGet,
|
|
16
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet,
|
|
17
|
+
listAllContentsV1WorkspacesContentsContentTypeGet,
|
|
18
|
+
listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet,
|
|
19
|
+
listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet,
|
|
20
|
+
listWorkspacesV1WorkspacesGet,
|
|
21
|
+
removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete,
|
|
22
|
+
removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete,
|
|
23
|
+
removePermissionV1WorkspacesWorkspaceIdPermissionsDelete,
|
|
24
|
+
updateWorkspaceV1WorkspacesWorkspaceIdPatch,
|
|
25
|
+
useShareableLinkV1ShareShareIdPatch,
|
|
26
|
+
} from '../api/workspace-ai'
|
|
27
|
+
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
28
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
29
|
+
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
30
|
+
import { getApiAddresses } from '../api-addresses'
|
|
31
|
+
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
32
|
+
import { wksAiDictionary } from '../error/dictionary/workspace-ai'
|
|
33
|
+
import { FixedAddResourceToWorkspaceAi, FixedWorkspaceAiPermissions, ReplaceResult } from './types'
|
|
34
|
+
|
|
35
|
+
class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(getApiAddresses()['workspace-ai'].url, defaults)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
41
|
+
return new DefaultAPIError(error.data, error.status, wksAiDictionary, error.headers)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
createWorkspaceAi = this.mutation(removeAuthorizationParam(createWorkspaceV1WorkspacesPost))
|
|
45
|
+
workspacesAi = this.query(removeAuthorizationParam(listWorkspacesV1WorkspacesGet))
|
|
46
|
+
workspaceAi = this.query(removeAuthorizationParam(getWorkspaceByIdV1WorkspacesIdGet))
|
|
47
|
+
updateWorkspaceAi = this.mutation(removeAuthorizationParam(updateWorkspaceV1WorkspacesWorkspaceIdPatch))
|
|
48
|
+
deleteWorkspaceAi = this.mutation(removeAuthorizationParam(deleteWorkspaceV1WorkspacesWorkspaceIdDelete))
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Adds a resource to the Spot.
|
|
52
|
+
*/
|
|
53
|
+
addResourceTypeToWorkspaceAi = this.mutation({
|
|
54
|
+
name: 'addResourceTypeToWorkspaceAi',
|
|
55
|
+
request: (
|
|
56
|
+
signal,
|
|
57
|
+
variables: Omit<Parameters<typeof addContentV1WorkspacesWorkspaceIdContentTypePost>[0], 'authorization'>,
|
|
58
|
+
) =>
|
|
59
|
+
addContentV1WorkspacesWorkspaceIdContentTypePost({ ...variables, authorization: '' },
|
|
60
|
+
{ signal }) as unknown as Promise<FixedAddResourceToWorkspaceAi>,
|
|
61
|
+
permission: this.createPermissionFunctionFor(addContentV1WorkspacesWorkspaceIdContentTypePost),
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Lists all the knowledge sources in a Spot.
|
|
66
|
+
*/
|
|
67
|
+
getKSFromWorkspaceAi = this.query({
|
|
68
|
+
name: 'KsWorkspaceAi',
|
|
69
|
+
request: (
|
|
70
|
+
signal,
|
|
71
|
+
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
72
|
+
'authorization' | 'contentType'>,
|
|
73
|
+
) =>
|
|
74
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'knowledge_source', authorization: '' },
|
|
75
|
+
{ signal }) as unknown as Promise<KnowledgeSourceItemResponse[]>,
|
|
76
|
+
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Lists all the stacks in a Spot.
|
|
81
|
+
*/
|
|
82
|
+
getStackFromWorkspaceAi = this.query({
|
|
83
|
+
name: 'StackWorkspaceAi',
|
|
84
|
+
request: (
|
|
85
|
+
signal,
|
|
86
|
+
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
87
|
+
'authorization' | 'contentType'>,
|
|
88
|
+
) =>
|
|
89
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'stack', authorization: '' },
|
|
90
|
+
{ signal }) as unknown as Promise<GetAiStackResponse[]>,
|
|
91
|
+
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Lists all the quick commands in a Spot.
|
|
96
|
+
*/
|
|
97
|
+
getQCFromWorkspaceAi = this.query({
|
|
98
|
+
name: 'QcWorkspaceAi',
|
|
99
|
+
request: (
|
|
100
|
+
signal,
|
|
101
|
+
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
102
|
+
'authorization' | 'contentType'>,
|
|
103
|
+
) =>
|
|
104
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'quick_command', authorization: '' },
|
|
105
|
+
{ signal }) as unknown as Promise<QuickCommandResponse[]>,
|
|
106
|
+
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Lists all the agents in a Spot.
|
|
111
|
+
*/
|
|
112
|
+
getAgentFromWorkspaceAi = this.query({
|
|
113
|
+
name: 'AgentWorkspaceAi',
|
|
114
|
+
request: (
|
|
115
|
+
signal,
|
|
116
|
+
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
117
|
+
'authorization' | 'contentType'>,
|
|
118
|
+
) =>
|
|
119
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'agent', authorization: '' },
|
|
120
|
+
{ signal }) as unknown as Promise<AgentResponse[]>,
|
|
121
|
+
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Lists all the toolkits in a Spot.
|
|
126
|
+
*/
|
|
127
|
+
getToolkitsFromWorkspaceAi = this.query({
|
|
128
|
+
name: 'ToolkitWorkspaceAi',
|
|
129
|
+
request: (
|
|
130
|
+
signal,
|
|
131
|
+
variables: Omit<Parameters<typeof listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet>[0],
|
|
132
|
+
'authorization' | 'contentType'>,
|
|
133
|
+
) =>
|
|
134
|
+
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'toolkit', authorization: '' },
|
|
135
|
+
{ signal }) as unknown as Promise<CustomToolkitResponse[]>,
|
|
136
|
+
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
deleteResourceTypeFromWorkspaceAi = this.mutation(removeAuthorizationParam(
|
|
140
|
+
removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete))
|
|
141
|
+
addPermissionToWorkspaceAi = this.mutation(removeAuthorizationParam(addPermissionV1WorkspacesWorkspaceIdPermissionsPatch))
|
|
142
|
+
removePermissionToWorkspaceAi = this.mutation(removeAuthorizationParam(removePermissionV1WorkspacesWorkspaceIdPermissionsDelete))
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Get group of permission on workspace AI
|
|
146
|
+
* @param search can be used to search by name
|
|
147
|
+
* @param filter_value is not necessary to use for filtering
|
|
148
|
+
* @param filter_by is not necessary to use for filtering
|
|
149
|
+
*/
|
|
150
|
+
// eslint-disable-next-line max-len
|
|
151
|
+
groupsOfWorkspaceAi = this.query(removeAuthorizationParam(listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet) as unknown as ReplaceResult<typeof listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet, FixedWorkspaceAiPermissions>)
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Adds the resource of type Workspace AI to the list of favorites.
|
|
155
|
+
*/
|
|
156
|
+
addFavoriteWorkspaceAi = this.mutation(removeAuthorizationParam(addFavoriteV1WorkspacesWorkspaceIdFavoritePost))
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Removes the resource of type Workspace AI from the list of favorites.
|
|
160
|
+
*/
|
|
161
|
+
removeFavoriteWorkspaceAi = this.mutation(removeAuthorizationParam(deleteFavoriteV1WorkspacesWorkspaceIdFavoriteDelete))
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Gets all content from all workspaces to which the user has permissions.
|
|
165
|
+
*/
|
|
166
|
+
workspacesContentsByType = this.query(removeAuthorizationParam(listAllContentsV1WorkspacesContentsContentTypeGet))
|
|
167
|
+
/**
|
|
168
|
+
* Get a generated link to share a spot
|
|
169
|
+
*/
|
|
170
|
+
generateShareSpotLink = this.mutation(removeAuthorizationParam(createShareableLinkV1WorkspacesWorkspaceIdSharePost))
|
|
171
|
+
/**
|
|
172
|
+
* Get a shareable link from a spot
|
|
173
|
+
*/
|
|
174
|
+
shareableLink = this.mutation(removeAuthorizationParam(useShareableLinkV1ShareShareIdPatch))
|
|
175
|
+
/**
|
|
176
|
+
* Add permission to resource
|
|
177
|
+
*/
|
|
178
|
+
addPermissionResource = this.mutation(removeAuthorizationParam(addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch))
|
|
179
|
+
/**
|
|
180
|
+
* Remove permission to resource
|
|
181
|
+
*/
|
|
182
|
+
removePermissionResource =
|
|
183
|
+
this.mutation(removeAuthorizationParam(removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete))
|
|
184
|
+
/**
|
|
185
|
+
* List members with permission to resource
|
|
186
|
+
*/
|
|
187
|
+
listMembersResource =
|
|
188
|
+
this.infiniteQuery(removeAuthorizationParam(listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet))
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const workspaceAiClient = new WorkspaceAiClient()
|