@stack-spot/portal-network 0.158.1-beta.2 → 0.159.0-beta.2
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 +9 -11
- package/dist/api-addresses.d.ts +32 -0
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +53 -0
- package/dist/api-addresses.js.map +1 -1
- package/dist/client/account.d.ts +7 -0
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +12 -3
- package/dist/client/account.js.map +1 -1
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +2 -2
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/agent.d.ts +1 -0
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +3 -2
- package/dist/client/agent.js.map +1 -1
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +2 -2
- package/dist/client/ai.js.map +1 -1
- package/dist/client/api-management.d.ts.map +1 -1
- package/dist/client/api-management.js +2 -2
- package/dist/client/api-management.js.map +1 -1
- package/dist/client/cloud-account.d.ts.map +1 -1
- package/dist/client/cloud-account.js +2 -2
- package/dist/client/cloud-account.js.map +1 -1
- package/dist/client/cloud-platform-horizon.d.ts.map +1 -1
- package/dist/client/cloud-platform-horizon.js +2 -2
- package/dist/client/cloud-platform-horizon.js.map +1 -1
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +2 -2
- package/dist/client/cloud-platform.js.map +1 -1
- package/dist/client/cloud-runtimes.d.ts.map +1 -1
- package/dist/client/cloud-runtimes.js +2 -2
- package/dist/client/cloud-runtimes.js.map +1 -1
- package/dist/client/cloud-services.d.ts.map +1 -1
- package/dist/client/cloud-services.js +2 -2
- package/dist/client/cloud-services.js.map +1 -1
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +2 -2
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/content.d.ts.map +1 -1
- package/dist/client/content.js +2 -2
- package/dist/client/content.js.map +1 -1
- package/dist/client/data-integration.d.ts.map +1 -1
- package/dist/client/data-integration.js +2 -2
- package/dist/client/data-integration.js.map +1 -1
- package/dist/client/discovery.d.ts.map +1 -1
- package/dist/client/discovery.js +2 -2
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/event-bus.d.ts.map +1 -1
- package/dist/client/event-bus.js +2 -2
- package/dist/client/event-bus.js.map +1 -1
- package/dist/client/gen-ai-inference.js +2 -2
- package/dist/client/gen-ai-inference.js.map +1 -1
- package/dist/client/insights.d.ts.map +1 -1
- package/dist/client/insights.js +2 -2
- package/dist/client/insights.js.map +1 -1
- package/dist/client/notification.d.ts.map +1 -1
- package/dist/client/notification.js +2 -2
- package/dist/client/notification.js.map +1 -1
- package/dist/client/runtime-manager.d.ts.map +1 -1
- package/dist/client/runtime-manager.js +2 -2
- package/dist/client/runtime-manager.js.map +1 -1
- package/dist/client/secrets.d.ts.map +1 -1
- package/dist/client/secrets.js +2 -2
- package/dist/client/secrets.js.map +1 -1
- package/dist/client/workflow.d.ts.map +1 -1
- package/dist/client/workflow.js +2 -2
- package/dist/client/workflow.js.map +1 -1
- package/dist/client/workspace-ai.d.ts +1 -4
- package/dist/client/workspace-ai.d.ts.map +1 -1
- package/dist/client/workspace-ai.js +2 -2
- package/dist/client/workspace-ai.js.map +1 -1
- package/dist/client/workspace-manager.d.ts.map +1 -1
- package/dist/client/workspace-manager.js +2 -2
- package/dist/client/workspace-manager.js.map +1 -1
- package/dist/client/workspace-search.d.ts.map +1 -1
- package/dist/client/workspace-search.js +2 -2
- package/dist/client/workspace-search.js.map +1 -1
- package/dist/client/workspace.d.ts.map +1 -1
- package/dist/client/workspace.js +2 -2
- package/dist/client/workspace.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/network/NetworkClient.d.ts +6 -0
- package/dist/network/NetworkClient.d.ts.map +1 -1
- package/dist/network/NetworkClient.js +10 -1
- package/dist/network/NetworkClient.js.map +1 -1
- package/package.json +1 -1
- package/src/api-addresses.ts +71 -0
- package/src/client/account.ts +12 -3
- package/src/client/agent-tools.ts +2 -3
- package/src/client/agent.ts +4 -2
- package/src/client/ai.ts +2 -2
- package/src/client/api-management.ts +2 -2
- package/src/client/cloud-account.ts +2 -2
- package/src/client/cloud-platform-horizon.ts +2 -2
- package/src/client/cloud-platform.ts +2 -2
- package/src/client/cloud-runtimes.ts +2 -2
- package/src/client/cloud-services.ts +2 -2
- package/src/client/code-shift.ts +2 -2
- package/src/client/content.ts +2 -2
- package/src/client/data-integration.ts +2 -2
- package/src/client/discovery.ts +2 -2
- package/src/client/event-bus.ts +2 -2
- package/src/client/gen-ai-inference.ts +2 -2
- package/src/client/insights.ts +2 -2
- package/src/client/notification.ts +2 -2
- package/src/client/runtime-manager.ts +2 -2
- package/src/client/secrets.ts +2 -2
- package/src/client/workflow.ts +2 -2
- package/src/client/workspace-ai.ts +2 -2
- package/src/client/workspace-manager.ts +2 -2
- package/src/client/workspace-search.ts +2 -2
- package/src/client/workspace.ts +2 -2
- package/src/index.ts +1 -1
- package/src/network/NetworkClient.ts +11 -1
package/src/client/agent.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
+
import { getApiAddresses } from '../api-addresses'
|
|
2
3
|
import {
|
|
3
4
|
defaults, deleteV1AgentByAgentIdFavorite, getV1AgentByAgentId, getV1Agents, getV1PublicAgentByAgentId, getV1PublicAgents,
|
|
4
5
|
postV1AgentByAgentIdFavorite, putV1AgentByAgentId,
|
|
5
6
|
} from '../api/agent'
|
|
6
|
-
import apis from '../apis.json'
|
|
7
7
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
8
8
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
9
9
|
|
|
10
|
+
export const isAgentDefault = (agentSlug?: string) => agentSlug === 'stk_code_buddy'
|
|
11
|
+
|
|
10
12
|
interface AgentError {
|
|
11
13
|
code?: string,
|
|
12
14
|
details?: string,
|
|
@@ -15,7 +17,7 @@ interface AgentError {
|
|
|
15
17
|
|
|
16
18
|
class AgentClient extends ReactQueryNetworkClient {
|
|
17
19
|
constructor() {
|
|
18
|
-
super(
|
|
20
|
+
super(getApiAddresses().agent.url, defaults)
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/ai.ts
CHANGED
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
updateTitleV1ConversationsConversationIdPatch,
|
|
40
40
|
vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost,
|
|
41
41
|
} from '../api/ai'
|
|
42
|
-
import apis from '../apis.json'
|
|
43
42
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
44
43
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
45
44
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
@@ -56,10 +55,11 @@ import {
|
|
|
56
55
|
ReplaceResult,
|
|
57
56
|
StepChatStep,
|
|
58
57
|
} from './types'
|
|
58
|
+
import { getApiAddresses } from '../api-addresses'
|
|
59
59
|
|
|
60
60
|
class AIClient extends ReactQueryNetworkClient {
|
|
61
61
|
constructor() {
|
|
62
|
-
super(
|
|
62
|
+
super(getApiAddresses().ai.url, defaults)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { defaults, getEntries, getEntryById, getSubEntries } from '../api/apiManagement'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { actionDictionary } from '../error/dictionary/action'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class ApiManagementClient extends ReactQueryNetworkClient {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(
|
|
11
|
+
super(getApiAddresses().apiManagement.url, defaults)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { createCloudAccount, defaults, deleteCloudAccountFromEnvironment, deleteManagedAccountsFromWorkspace, getCloudAccountByWorkspace, getManagedCloudRegion, getManagedCloudTemplate, getProvisionWorkflowInWorkspace, listCloudAccounts, provisionManagedAccountsForWorkspace } from '../api/cloudAccount'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
5
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
6
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
7
|
import { FixedConnectAccountRequestV2, FixedManagedAccountProvisionRequest, FixVariables } from './types'
|
|
8
|
+
import { getApiAddresses } from '../api-addresses'
|
|
9
9
|
|
|
10
10
|
const listAccounts = removeAuthorizationParam(listCloudAccounts)
|
|
11
11
|
|
|
12
12
|
class CloudAccountClient extends ReactQueryNetworkClient {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(
|
|
14
|
+
super(getApiAddresses().cloudAccount.url, defaults)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
5
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
6
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
7
|
import { createAddon, createDeployTemplate, createOrganization, createRuntime1, createTenant1, defaults, deploy, findApplicationDeploymentById, getApplicationDeploymentHealth, getApplicationDeploymentLogs, getOrganizationById, getOrganizations, getRuntime1, getTenant1, listAddon, listApplicationDeployments, listDeployTemplate, listRuntimes, listRuntimes1, listTenants, listTenants1 } from '../api/cloudPlatformHorizon'
|
|
9
8
|
import { baseDictionary } from '../error/dictionary/base'
|
|
9
|
+
import { getApiAddresses } from '../api-addresses'
|
|
10
10
|
|
|
11
11
|
class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(
|
|
13
|
+
super(getApiAddresses().cloudPlatformHorizon.url, defaults)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -31,16 +31,16 @@ import
|
|
|
31
31
|
listVpns,
|
|
32
32
|
providers,
|
|
33
33
|
} from '../api/cloudPlatform'
|
|
34
|
-
import apis from '../apis.json'
|
|
35
34
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
36
35
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
37
36
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
38
37
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
39
38
|
import { scfDictionary } from '../error/dictionary/cloud-platform'
|
|
39
|
+
import { getApiAddresses } from '../api-addresses'
|
|
40
40
|
|
|
41
41
|
class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
42
42
|
constructor() {
|
|
43
|
-
super(
|
|
43
|
+
super(getApiAddresses().cloudPlatform.url, defaults)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -24,16 +24,16 @@ import
|
|
|
24
24
|
startApplication,
|
|
25
25
|
stopApplication,
|
|
26
26
|
} from '../api/cloudRuntimes'
|
|
27
|
-
import apis from '../apis.json'
|
|
28
27
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
29
28
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
30
29
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
31
30
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
32
31
|
import { baseDictionary } from '../error/dictionary/base'
|
|
32
|
+
import { getApiAddresses } from '../api-addresses'
|
|
33
33
|
|
|
34
34
|
class CloudRuntimesClient extends ReactQueryNetworkClient {
|
|
35
35
|
constructor() {
|
|
36
|
-
super(
|
|
36
|
+
super(getApiAddresses().cloudRuntimes.url, defaults)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
getCostOverview, getGuardrails, getInstanceDetails, listBillingAccounts, listInstances, listServices,
|
|
6
6
|
processAllocationCostRequest,
|
|
7
7
|
} from '../api/cloudServices'
|
|
8
|
-
import apis from '../apis.json'
|
|
9
8
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
10
9
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
11
10
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
12
11
|
import { CostAllocationResult, CostAllocationVariables, FixedManagedService, FixVariables, OazapftsFunction, ReplaceResult } from './types'
|
|
12
|
+
import { getApiAddresses } from '../api-addresses'
|
|
13
13
|
|
|
14
14
|
class CloudServicesClient extends ReactQueryNetworkClient {
|
|
15
15
|
constructor() {
|
|
16
|
-
super(
|
|
16
|
+
super(getApiAddresses().cloudServices.url, defaults)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/code-shift.ts
CHANGED
|
@@ -36,16 +36,16 @@ import {
|
|
|
36
36
|
updateRepositoryServiceV1ReposRepositoryIdPut,
|
|
37
37
|
validateScmUrlServiceV1ReposValidateScmUrlPost,
|
|
38
38
|
} from '../api/codeShift'
|
|
39
|
-
import apis from '../apis.json'
|
|
40
39
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
41
40
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
42
41
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
43
42
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
44
43
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
44
|
+
import { getApiAddresses } from '../api-addresses'
|
|
45
45
|
|
|
46
46
|
class CodeShift extends ReactQueryNetworkClient {
|
|
47
47
|
constructor() {
|
|
48
|
-
super(
|
|
48
|
+
super(getApiAddresses().codeShift.url, defaults)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/content.ts
CHANGED
|
@@ -96,19 +96,19 @@ import {
|
|
|
96
96
|
updateStudio,
|
|
97
97
|
updateStudioTabs,
|
|
98
98
|
} from '../api/content'
|
|
99
|
-
import apis from '../apis.json'
|
|
100
99
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
101
100
|
import { cntDictionary } from '../error/dictionary/cnt'
|
|
102
101
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
103
102
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
104
103
|
import { OperationObject } from '../network/types'
|
|
105
104
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
105
|
+
import { getApiAddresses } from '../api-addresses'
|
|
106
106
|
|
|
107
107
|
const getStudiosWithoutAuthorization = removeAuthorizationParam(getStudios)
|
|
108
108
|
|
|
109
109
|
class ContentClient extends ReactQueryNetworkClient {
|
|
110
110
|
constructor() {
|
|
111
|
-
super(
|
|
111
|
+
super(getApiAddresses().content.url, defaults)
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -25,17 +25,17 @@ import {
|
|
|
25
25
|
splitUploadedFileV1FileUploadFileUploadIdSplitPost,
|
|
26
26
|
updateKsV1KnowledgeSourcesSlugPatch,
|
|
27
27
|
} from '../api/dataIntegration'
|
|
28
|
-
import apis from '../apis.json'
|
|
29
28
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
30
29
|
import { baseDictionary } from '../error/dictionary/base'
|
|
31
30
|
import { FileUploadError } from '../error/FileUploadError'
|
|
32
31
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
33
32
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
34
33
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
34
|
+
import { getApiAddresses } from '../api-addresses'
|
|
35
35
|
|
|
36
36
|
class DataIntegrationClient extends ReactQueryNetworkClient {
|
|
37
37
|
constructor() {
|
|
38
|
-
super(
|
|
38
|
+
super(getApiAddresses().dataIntegration.url, defaults)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/discovery.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { attach, createHypothesis, defaults, deleteV1DocumentsByDocumentIdHypothesesAndHypothesisNumber, download, findHypothesisByNumber, getAll, getById, list1, list2, listAllDocumentsWithHypotheses, listHypothesis, listVersions, upload } from '../api/discovery'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { baseDictionary } from '../error/dictionary/base'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
8
7
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
|
+
import { getApiAddresses } from '../api-addresses'
|
|
9
9
|
|
|
10
10
|
class DiscoveryClient extends ReactQueryNetworkClient {
|
|
11
11
|
|
|
12
12
|
constructor() {
|
|
13
|
-
super(
|
|
13
|
+
super(getApiAddresses().discovery.url, defaults)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/event-bus.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { HttpError } from '@oazapfts/runtime'
|
|
|
2
2
|
import { CompletablePromise } from '@stack-spot/opa'
|
|
3
3
|
import { cloneDeep } from 'lodash'
|
|
4
4
|
import { defaults, EventProcessingResponse, Event as EventType, sendEvents } from '../api/eventBus'
|
|
5
|
-
import apis from '../apis.json'
|
|
6
5
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
7
6
|
import { baseDictionary } from '../error/dictionary/base'
|
|
8
7
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
9
8
|
import { NetworkClient } from '../network/NetworkClient'
|
|
9
|
+
import { getApiAddresses } from '../api-addresses'
|
|
10
10
|
|
|
11
11
|
export const EVENTS_STORAGE_IDENTIFIER = 'eventsError'
|
|
12
12
|
const DEFER_MS = 5000
|
|
@@ -17,7 +17,7 @@ class EventBusClient extends NetworkClient {
|
|
|
17
17
|
private lock = false
|
|
18
18
|
|
|
19
19
|
constructor() {
|
|
20
|
-
super(
|
|
20
|
+
super(getApiAddresses().eventBus.url)
|
|
21
21
|
defaults.baseUrl = ''
|
|
22
22
|
defaults.fetch = (...args) => this.fetch(...args)
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { HttpError } from '@oazapfts/runtime'
|
|
3
|
+
import { getApiAddresses } from '../api-addresses'
|
|
3
4
|
import { addSelfHostedModelV1LlmModelsPost, agentChatV1AgentAgentIdChatPost, defaults, deleteModelResourcesV1LlmResourcesResourceIdDelete, deleteV1LlmModelsModelIdDelete, getModelV1LlmModelsModelIdGet, listLlmProvidersV1LlmProvidersGet, listModelsV1LlmModelsGet, saveOrUpdateModelResourcesV1LlmModelsModelIdResourcesPut, toggleModelStatusV1LlmModelsModelIdPatch, updateV1LlmModelsModelIdPut } from '../api/genAiInference'
|
|
4
|
-
import apis from '../apis.json'
|
|
5
5
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
6
6
|
import { inferenceDictionary } from '../error/dictionary/ai-inference'
|
|
7
7
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
@@ -10,7 +10,7 @@ import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
|
10
10
|
|
|
11
11
|
class GenAiInference extends ReactQueryNetworkClient {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(
|
|
13
|
+
super(getApiAddresses().genAiInference.url, defaults)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/insights.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { defaults, downloadAccountData, getDashboardAccount } from '../api/insights'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { baseDictionary } from '../error/dictionary/base'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class InsightsClient extends ReactQueryNetworkClient {
|
|
10
10
|
|
|
11
11
|
constructor() {
|
|
12
|
-
super(
|
|
12
|
+
super(getApiAddresses().insights.url, defaults)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { commit, committedNotifications, defaults, findAll } from '../api/notification'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { baseDictionary } from '../error/dictionary/base'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class NotificationClient extends ReactQueryNetworkClient {
|
|
10
10
|
|
|
11
11
|
constructor() {
|
|
12
|
-
super(
|
|
12
|
+
super(getApiAddresses().notification.url, defaults)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { defaults, getAppInfo, getAppsInRealm, getPluginDeployments, getRunByUlid, getRunsOnAllEnvs, getRunsOnEnv, getRunsRunning, getRunTaskPlugins, getRunTasks, runRollbackApp1, runRollbackInfra1 } from '../api/apiRuntime'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { rteDictionary } from '../error/dictionary/rte'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class RuntimeManagerClient extends ReactQueryNetworkClient {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(
|
|
11
|
+
super(getApiAddresses().apiRuntime.url, defaults)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/secrets.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
|
|
3
3
|
import { createKey, defaults, deleteKey, deleteSecretValue, editKey, encrypt, getAll1, getAvailability, updateSecretValue } from '../api/secrets'
|
|
4
|
-
import apis from '../apis.json'
|
|
5
4
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
6
5
|
import { secretsDictionary } from '../error/dictionary/secrets'
|
|
7
6
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
8
7
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
8
|
+
import { getApiAddresses } from '../api-addresses'
|
|
9
9
|
|
|
10
10
|
class SecretClient extends ReactQueryNetworkClient {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(
|
|
12
|
+
super(getApiAddresses().secrets.url, defaults)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/workflow.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { createApiServiceWorkflowsCreateApiDispatchPost, defaults, getExecutionDispatchRequestServiceWorkflowsExecutionIdRequestGet, getExecutionStatusServiceWorkflowsExecutionStatusExecutionIdGet, healthCheckServiceWorkflowsHealthCheckDispatchPost, runActionServiceWorkflowsRunActionDispatchPost, v1AcceptWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdAcceptPost, v1GetWorkflowExecutionAttemptsV1ExecutionsExecutionIdAttemptsGet, v1GetWorkflowExecutionJobDetailServiceV1ExecutionsExecutionIdJobsJobIdGet, v1GetWorkflowExecutionJobGraphServiceV1ExecutionsExecutionIdGet, v1RefuseWorkflowExecutionJobSuspendedServiceV1ExecutionsExecutionIdJobsJobIdRefusePost, v1RetryWorkflowExecutionV1ExecutionsExecutionIdRetryPost } from '../api/workflows'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { actionDictionary } from '../error/dictionary/action'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
8
7
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
|
+
import { getApiAddresses } from '../api-addresses'
|
|
9
9
|
|
|
10
10
|
class WorkflowClient extends ReactQueryNetworkClient {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(
|
|
12
|
+
super(getApiAddresses().workflows.url, defaults)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -22,15 +22,15 @@ import {
|
|
|
22
22
|
updateWorkspaceV1WorkspacesWorkspaceIdPatch,
|
|
23
23
|
useShareableLinkV1ShareShareIdPatch,
|
|
24
24
|
} from '../api/workspace-ai'
|
|
25
|
-
import apis from '../apis.json'
|
|
26
25
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
27
26
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
28
27
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
29
28
|
import { FixedAddResourceToWorkspaceAi, FixedWorkspaceAiPermissions, ReplaceResult } from './types'
|
|
29
|
+
import { getApiAddresses } from '../api-addresses'
|
|
30
30
|
|
|
31
31
|
class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
32
32
|
constructor() {
|
|
33
|
-
super(
|
|
33
|
+
super(getApiAddresses()['workspace-ai'].url, defaults)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -72,7 +72,6 @@ import {
|
|
|
72
72
|
workspaceVariableControllerfindByName,
|
|
73
73
|
workspaceVariableControllerupsert,
|
|
74
74
|
} from '../api/workspaceManager'
|
|
75
|
-
import apis from '../apis.json'
|
|
76
75
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
77
76
|
import { workspaceDictionary } from '../error/dictionary/workspace'
|
|
78
77
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
@@ -80,10 +79,11 @@ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
|
80
79
|
import { contentClient } from './content'
|
|
81
80
|
import { FixedFullInputContextResponse, FixedPaginatedActivityResponse, FixedPluginForAppCreationV2Response, FixedWorkflowForCreationResponse, ReplaceResult } from './types'
|
|
82
81
|
import { workspaceClient } from './workspace'
|
|
82
|
+
import { getApiAddresses } from '../api-addresses'
|
|
83
83
|
|
|
84
84
|
class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
85
85
|
constructor() {
|
|
86
|
-
super(
|
|
86
|
+
super(getApiAddresses().workspaceManager.url, defaults)
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { clearUserHistory, defaults, deleteUserHistoryItem, getUserHistory, search } from '../api/workspaceSearchEngine'
|
|
3
|
-
import apis from '../apis.json'
|
|
4
3
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
4
|
import { baseDictionary } from '../error/dictionary/base'
|
|
6
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
7
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
|
+
import { getApiAddresses } from '../api-addresses'
|
|
8
8
|
|
|
9
9
|
class WorkspaceSearchClient extends ReactQueryNetworkClient {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(
|
|
11
|
+
super(getApiAddresses().workspaceSearchEngine.url, defaults)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/client/workspace.ts
CHANGED
|
@@ -82,16 +82,16 @@ import {
|
|
|
82
82
|
workspaceVariableV2Controllerupsert,
|
|
83
83
|
} from '../api/workspace'
|
|
84
84
|
|
|
85
|
-
import apis from '../apis.json'
|
|
86
85
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
87
86
|
import { workspaceDictionary } from '../error/dictionary/workspace'
|
|
88
87
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
89
88
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
90
89
|
import { OperationObject } from '../network/types'
|
|
90
|
+
import { getApiAddresses } from '../api-addresses'
|
|
91
91
|
|
|
92
92
|
class WorkspaceClient extends ReactQueryNetworkClient {
|
|
93
93
|
constructor() {
|
|
94
|
-
super(
|
|
94
|
+
super(getApiAddresses().workspace.url, defaults)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query'
|
|
2
|
-
export { apiAddresses } from './api-addresses'
|
|
2
|
+
export { apiAddresses, getApiAddresses, getBaseUrlWithOverride, setApisOverride } 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'
|
|
@@ -3,6 +3,7 @@ import { requestPermission } from '@stack-spot/opa'
|
|
|
3
3
|
import { events } from 'fetch-event-stream'
|
|
4
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
5
|
import { Env, FetchEventStream, HTTPMethod, SessionManager } from './types'
|
|
6
|
+
import { getBaseUrlWithOverride } from '../api-addresses'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* A set of methods for performing network requests to an API.
|
|
@@ -54,6 +55,15 @@ export abstract class NetworkClient {
|
|
|
54
55
|
private uninitializedError() {
|
|
55
56
|
return new Error('Please, call "NetworkClient.setup(sessionManager, env)" before attempting to make a request.')
|
|
56
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the final base URL for the current environment.
|
|
61
|
+
* If a local API override exists for the current environment and current resource (api name), it will be use instead.
|
|
62
|
+
* @returns the final baseURL for the current environment, considering overrides if available.
|
|
63
|
+
*/
|
|
64
|
+
protected getBaseURL(): string {
|
|
65
|
+
return getBaseUrlWithOverride(this.baseURL, NetworkClient.env);
|
|
66
|
+
}
|
|
57
67
|
|
|
58
68
|
/**
|
|
59
69
|
* Builds a URL with the `baseUrl` of this network client and the `path` passed as parameter.
|
|
@@ -65,7 +75,7 @@ export abstract class NetworkClient {
|
|
|
65
75
|
// paths must not start with "/", otherwise, the base url will not be fully appended to it.
|
|
66
76
|
const fixedPath = path.replace(/^\//, '')
|
|
67
77
|
// the baseUrl must end with "/", otherwise, the last of its part will get replaced by the path, instead of concatenated with.
|
|
68
|
-
const fixedBaseUrl = this.
|
|
78
|
+
const fixedBaseUrl = this.getBaseURL().replace(/([^/])$/, '$1/')
|
|
69
79
|
return new URL(fixedPath, fixedBaseUrl)
|
|
70
80
|
}
|
|
71
81
|
|