@stack-spot/portal-network 0.174.0 → 0.175.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 +230 -0
- package/dist/api/ai.d.ts +2 -0
- package/dist/api/ai.d.ts.map +1 -1
- package/dist/api/ai.js.map +1 -1
- package/dist/api/codeShift.d.ts +575 -23
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +288 -0
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api-addresses.d.ts +11 -3
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +22 -2
- package/dist/api-addresses.js.map +1 -1
- package/dist/apis-itau.json +225 -0
- package/dist/client/code-shift.d.ts +218 -28
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +124 -7
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/data-integration.d.ts +9 -0
- package/dist/client/data-integration.d.ts.map +1 -1
- package/dist/client/data-integration.js +10 -1
- package/dist/client/data-integration.js.map +1 -1
- package/dist/client/workspace-manager.d.ts +9 -0
- package/dist/client/workspace-manager.d.ts.map +1 -1
- package/dist/client/workspace-manager.js +11 -2
- package/dist/client/workspace-manager.js.map +1 -1
- package/dist/error/dictionary/cloud-platform.d.ts +70 -8
- package/dist/error/dictionary/cloud-platform.d.ts.map +1 -1
- package/dist/error/dictionary/cloud-platform.js +74 -12
- package/dist/error/dictionary/cloud-platform.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/network/NetworkClient.d.ts +4 -2
- package/dist/network/NetworkClient.d.ts.map +1 -1
- package/dist/network/NetworkClient.js +5 -3
- package/dist/network/NetworkClient.js.map +1 -1
- package/dist/network/types.d.ts +1 -0
- package/dist/network/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/src/api/account.ts +1 -0
- package/src/api/agent-tools.ts +3 -0
- package/src/api/agent.ts +2 -0
- package/src/api/ai.ts +2 -0
- package/src/api/codeShift.ts +1103 -32
- package/src/api/notification.ts +2 -0
- package/src/api-addresses.ts +26 -3
- package/src/apis-itau.json +225 -0
- package/src/client/ai.ts +1 -0
- package/src/client/code-shift.ts +87 -7
- package/src/client/data-integration.ts +6 -0
- package/src/client/workspace-manager.ts +8 -1
- package/src/error/dictionary/cloud-platform.ts +74 -12
- package/src/index.ts +4 -3
- package/src/network/NetworkClient.ts +7 -4
- package/src/network/types.ts +2 -0
package/src/api/notification.ts
CHANGED
package/src/api-addresses.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import apisItauJson from './apis-itau.json' assert { type: 'json' }
|
|
1
2
|
import apisJson from './apis.json' assert { type: 'json' }
|
|
2
3
|
import { NetworkClient } from './network/NetworkClient'
|
|
3
|
-
import { Env } from './network/types'
|
|
4
|
+
import { Env, Tenant } from './network/types'
|
|
4
5
|
|
|
5
6
|
type ApisKeys = keyof typeof apisJson;
|
|
6
7
|
|
|
@@ -25,6 +26,21 @@ type ApiAddress = {
|
|
|
25
26
|
let defaultApis: Apis = apisJson;
|
|
26
27
|
let overrideApis: PartialApis = {};
|
|
27
28
|
|
|
29
|
+
const apis: Record<Tenant, Apis> = {
|
|
30
|
+
'stackspot': apisJson,
|
|
31
|
+
'itau': apisItauJson,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns the API catalog for the given tenant.
|
|
36
|
+
*
|
|
37
|
+
* @param tenant - Current tenant (e.g., 'stackspot', 'itau').
|
|
38
|
+
* @returns Typed catalog containing the URLs per environment.
|
|
39
|
+
*/
|
|
40
|
+
export function getApisByTenant(tenant: Tenant) {
|
|
41
|
+
return apis[tenant]
|
|
42
|
+
}
|
|
43
|
+
|
|
28
44
|
function transformApisToApiAddress(apis: Apis, env: Env): ApiAddress {
|
|
29
45
|
const apiAddress: ApiAddress = {}
|
|
30
46
|
|
|
@@ -57,9 +73,10 @@ function matchesBaseUrl(baseUrl: Record<Env, string>, candidate: Record<Env, str
|
|
|
57
73
|
* Checks if there is override for the given base URL and target environment.
|
|
58
74
|
* @param baseURL the default API base URL to check for overrides.
|
|
59
75
|
* @param targetEnv the target environment
|
|
60
|
-
* @
|
|
76
|
+
* @param tenant - Current tenant.
|
|
77
|
+
* @returns {string} the base URL for the given environment and tenant, applying any overrides if available.
|
|
61
78
|
*/
|
|
62
|
-
export const getBaseUrlWithOverride = (baseUrl: Record<Env, string>, targetEnv: Env = 'prd'): string => {
|
|
79
|
+
export const getBaseUrlWithOverride = (baseUrl: Record<Env, string>, targetEnv: Env = 'prd', tenant: Tenant): string => {
|
|
63
80
|
let matchesApiName: ApisKeys | null = null;
|
|
64
81
|
|
|
65
82
|
for (const [apiName, config] of Object.entries(defaultApis) as [ApisKeys, ApiConfig][]) {
|
|
@@ -70,6 +87,12 @@ export const getBaseUrlWithOverride = (baseUrl: Record<Env, string>, targetEnv:
|
|
|
70
87
|
}
|
|
71
88
|
|
|
72
89
|
if (matchesApiName) {
|
|
90
|
+
const apis = getApisByTenant(tenant)
|
|
91
|
+
const tenantUrl = apis?.[matchesApiName]?.url?.[targetEnv]
|
|
92
|
+
if(tenantUrl) {
|
|
93
|
+
return tenantUrl
|
|
94
|
+
}
|
|
95
|
+
|
|
73
96
|
const overrideUrl = overrideApis[matchesApiName]?.url?.[targetEnv];
|
|
74
97
|
|
|
75
98
|
if (overrideUrl) {
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ai": {
|
|
3
|
+
"url": {
|
|
4
|
+
"stg": "https://genai-code-buddy-api.stackspot.hom.aws.cloud.ihf",
|
|
5
|
+
"dev": "https://genai-code-buddy-api.stackspot.dev.aws.cloud.ihf",
|
|
6
|
+
"prd": "https://genai-code-buddy-api.stackspot.prod.aws.cloud.ihf"
|
|
7
|
+
},
|
|
8
|
+
"docs": "/openapi.json"
|
|
9
|
+
},
|
|
10
|
+
"workspace-ai": {
|
|
11
|
+
"url": {
|
|
12
|
+
"stg": "https://genai-workspace-ai-api.stackspot.hom.aws.cloud.ihf",
|
|
13
|
+
"dev": "https://genai-workspace-ai-api.stackspot.dev.aws.cloud.ihf",
|
|
14
|
+
"prd": "https://genai-workspace-ai-api.stackspot.prod.aws.cloud.ihf"
|
|
15
|
+
},
|
|
16
|
+
"docs": "/openapi.json"
|
|
17
|
+
},
|
|
18
|
+
"agent": {
|
|
19
|
+
"url": {
|
|
20
|
+
"stg": "",
|
|
21
|
+
"dev": "",
|
|
22
|
+
"prd": ""
|
|
23
|
+
},
|
|
24
|
+
"docs": "/q/openapi"
|
|
25
|
+
},
|
|
26
|
+
"agent-tools": {
|
|
27
|
+
"url": {
|
|
28
|
+
"stg": "https://genai-agent-tools-api.stackspot.hom.aws.cloud.ihf",
|
|
29
|
+
"dev": "https://genai-agent-tools-api.stackspot.dev.aws.cloud.ihf",
|
|
30
|
+
"prd": "https://genai-agent-tools-api.stackspot.prod.aws.cloud.ihf"
|
|
31
|
+
},
|
|
32
|
+
"docs": "/openapi.json"
|
|
33
|
+
},
|
|
34
|
+
"dataIntegration": {
|
|
35
|
+
"url": {
|
|
36
|
+
"stg": "https://genai-data-integration.stackspot.hom.aws.cloud.ihf",
|
|
37
|
+
"dev": "https://genai-data-integration.stackspot.dev.aws.cloud.ihf",
|
|
38
|
+
"prd": "https://genai-data-integration.stackspot.prod.aws.cloud.ihf"
|
|
39
|
+
},
|
|
40
|
+
"docs": "/openapi.json"
|
|
41
|
+
},
|
|
42
|
+
"workspace": {
|
|
43
|
+
"url": {
|
|
44
|
+
"stg": "",
|
|
45
|
+
"dev": "",
|
|
46
|
+
"prd": ""
|
|
47
|
+
},
|
|
48
|
+
"docs": "/v3/api-docs"
|
|
49
|
+
},
|
|
50
|
+
"account": {
|
|
51
|
+
"url": {
|
|
52
|
+
"stg": "https://account-account-api.stackspot.hom.aws.cloud.ihf",
|
|
53
|
+
"dev": "https://account-account-api.stackspot.dev.aws.cloud.ihf",
|
|
54
|
+
"prd": "https://account-account-api.stackspot.prod.aws.cloud.ihf"
|
|
55
|
+
},
|
|
56
|
+
"docs": "/v3/api-docs"
|
|
57
|
+
},
|
|
58
|
+
"content": {
|
|
59
|
+
"url": {
|
|
60
|
+
"stg": "",
|
|
61
|
+
"dev": "",
|
|
62
|
+
"prd": ""
|
|
63
|
+
},
|
|
64
|
+
"docs": "/v3/api-docs"
|
|
65
|
+
},
|
|
66
|
+
"eventBus": {
|
|
67
|
+
"url": {
|
|
68
|
+
"stg": "https://idp-event-bus-api.stackspot.hom.aws.cloud.ihf",
|
|
69
|
+
"dev": "https://idp-event-bus-api.stackspot.dev.aws.cloud.ihf",
|
|
70
|
+
"prd": "https://idp-event-bus-api.stackspot.prod.aws.cloud.ihf"
|
|
71
|
+
},
|
|
72
|
+
"docs": "/v3/api-docs"
|
|
73
|
+
},
|
|
74
|
+
"serviceCatalog": {
|
|
75
|
+
"url": {
|
|
76
|
+
"stg": "",
|
|
77
|
+
"dev": "",
|
|
78
|
+
"prd": ""
|
|
79
|
+
},
|
|
80
|
+
"docs": "/v3/api-docs"
|
|
81
|
+
},
|
|
82
|
+
"apiRuntime": {
|
|
83
|
+
"url": {
|
|
84
|
+
"stg": "",
|
|
85
|
+
"dev": "",
|
|
86
|
+
"prd": ""
|
|
87
|
+
},
|
|
88
|
+
"docs": "/v3/api-docs"
|
|
89
|
+
},
|
|
90
|
+
"cloudServices": {
|
|
91
|
+
"url": {
|
|
92
|
+
"stg": "",
|
|
93
|
+
"dev": "",
|
|
94
|
+
"prd": ""
|
|
95
|
+
},
|
|
96
|
+
"docs": "/v3/api-docs"
|
|
97
|
+
},
|
|
98
|
+
"cloudAccount": {
|
|
99
|
+
"url": {
|
|
100
|
+
"stg": "",
|
|
101
|
+
"dev": "",
|
|
102
|
+
"prd": ""
|
|
103
|
+
},
|
|
104
|
+
"docs": "/v3/api-docs"
|
|
105
|
+
},
|
|
106
|
+
"dataPlatform": {
|
|
107
|
+
"url": {
|
|
108
|
+
"stg": "",
|
|
109
|
+
"dev": "",
|
|
110
|
+
"prd": ""
|
|
111
|
+
},
|
|
112
|
+
"docs": "/v3/api-docs"
|
|
113
|
+
},
|
|
114
|
+
"insights": {
|
|
115
|
+
"url": {
|
|
116
|
+
"stg": "",
|
|
117
|
+
"dev": "",
|
|
118
|
+
"prd": ""
|
|
119
|
+
},
|
|
120
|
+
"docs": "/v3/api-docs"
|
|
121
|
+
},
|
|
122
|
+
"workflows": {
|
|
123
|
+
"url": {
|
|
124
|
+
"stg": "",
|
|
125
|
+
"dev": "",
|
|
126
|
+
"prd": ""
|
|
127
|
+
},
|
|
128
|
+
"docs": "/openapi.json"
|
|
129
|
+
},
|
|
130
|
+
"workspaceManager": {
|
|
131
|
+
"url": {
|
|
132
|
+
"stg": "",
|
|
133
|
+
"dev": "",
|
|
134
|
+
"prd": ""
|
|
135
|
+
},
|
|
136
|
+
"docs": "/v3/api-docs"
|
|
137
|
+
},
|
|
138
|
+
"workspaceSearchEngine": {
|
|
139
|
+
"url": {
|
|
140
|
+
"stg": "",
|
|
141
|
+
"dev": "",
|
|
142
|
+
"prd": ""
|
|
143
|
+
},
|
|
144
|
+
"docs": "/v3/api-docs"
|
|
145
|
+
},
|
|
146
|
+
"permissionValidation": {
|
|
147
|
+
"url": {
|
|
148
|
+
"stg": "https://portal-opa-server.stackspot.dev.aws.cloud.ihf/v1/validate",
|
|
149
|
+
"dev": "https://portal-opa-server.stackspot.hom.aws.cloud.ihf/v1/validate",
|
|
150
|
+
"prd": "https://portal-opa-server.stackspot.prod.aws.cloud.ihf/v1/validate"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"apiManagement": {
|
|
154
|
+
"url": {
|
|
155
|
+
"stg": "",
|
|
156
|
+
"dev": "",
|
|
157
|
+
"prd": ""
|
|
158
|
+
},
|
|
159
|
+
"docs": "/v3/api-docs"
|
|
160
|
+
},
|
|
161
|
+
"secrets": {
|
|
162
|
+
"url": {
|
|
163
|
+
"stg": "",
|
|
164
|
+
"dev": "",
|
|
165
|
+
"prd": ""
|
|
166
|
+
},
|
|
167
|
+
"docs": "/v3/api-docs"
|
|
168
|
+
},
|
|
169
|
+
"notification": {
|
|
170
|
+
"url": {
|
|
171
|
+
"stg": "https://account-notification-engine.stackspot.hom.aws.cloud.ihf",
|
|
172
|
+
"dev": "https://account-notification-engine.stackspot.dev.aws.cloud.ihf",
|
|
173
|
+
"prd": "https://account-notification-engine.stackspot.prod.aws.cloud.ihf"
|
|
174
|
+
},
|
|
175
|
+
"docs": "/v3/api-docs"
|
|
176
|
+
},
|
|
177
|
+
"cloudPlatform": {
|
|
178
|
+
"url": {
|
|
179
|
+
"stg": "",
|
|
180
|
+
"dev": "",
|
|
181
|
+
"prd": ""
|
|
182
|
+
},
|
|
183
|
+
"docs": "/v3/api-docs"
|
|
184
|
+
},
|
|
185
|
+
"cloudRuntimes": {
|
|
186
|
+
"url": {
|
|
187
|
+
"stg": "",
|
|
188
|
+
"dev": "",
|
|
189
|
+
"prd": ""
|
|
190
|
+
},
|
|
191
|
+
"docs": "/v3/api-docs"
|
|
192
|
+
},
|
|
193
|
+
"cloudPlatformHorizon": {
|
|
194
|
+
"url": {
|
|
195
|
+
"stg": "",
|
|
196
|
+
"dev": "",
|
|
197
|
+
"prd": ""
|
|
198
|
+
},
|
|
199
|
+
"docs": "/v3/api-docs"
|
|
200
|
+
},
|
|
201
|
+
"codeShift": {
|
|
202
|
+
"url": {
|
|
203
|
+
"stg": "",
|
|
204
|
+
"dev": "",
|
|
205
|
+
"prd": ""
|
|
206
|
+
},
|
|
207
|
+
"docs": "/openapi.json"
|
|
208
|
+
},
|
|
209
|
+
"genAiInference": {
|
|
210
|
+
"url": {
|
|
211
|
+
"stg": "https://genai-inference-app.stackspot.hom.aws.cloud.ihf",
|
|
212
|
+
"dev": "https://genai-inference-app.stackspot.dev.aws.cloud.ihf",
|
|
213
|
+
"prd": "https://genai-inference-app.stackpot.prod.aws.cloud.ihf"
|
|
214
|
+
},
|
|
215
|
+
"docs": "/openapi.json"
|
|
216
|
+
},
|
|
217
|
+
"discover": {
|
|
218
|
+
"url": {
|
|
219
|
+
"stg": "",
|
|
220
|
+
"dev": "",
|
|
221
|
+
"prd": ""
|
|
222
|
+
},
|
|
223
|
+
"docs": "/v3/api-docs"
|
|
224
|
+
}
|
|
225
|
+
}
|
package/src/client/ai.ts
CHANGED
package/src/client/code-shift.ts
CHANGED
|
@@ -48,6 +48,19 @@ import {
|
|
|
48
48
|
updateRepositoryServiceV1ReposRepositoryIdPut,
|
|
49
49
|
validateScmUrlServiceV1ReposValidateScmUrlPost,
|
|
50
50
|
listUserServiceV1UsersGet,
|
|
51
|
+
analyticsProgramGroupsDetailsV1AnalyticsProgramGroupsDetailsGet,
|
|
52
|
+
analyticsProgramGroupsDetailsDownloadV1AnalyticsProgramGroupsDetailsDownloadGet,
|
|
53
|
+
getModuleInputsV1ModulesModuleIdInputsGet,
|
|
54
|
+
analyticsRepositoryDetailedReportDownloadV1AnalyticsRepositoriesDetailsDownloadGet,
|
|
55
|
+
analyticsRepositoryDetailedReportV1AnalyticsRepositoriesDetailsGet,
|
|
56
|
+
listRepositoryDownloadServiceV1ReposDownloadGet,
|
|
57
|
+
listProgramGroupDownloadServiceV1ProgramGroupsDownloadGet,
|
|
58
|
+
getModuleV1ModulesModuleIdGet,
|
|
59
|
+
analyticsProgramGroupsTargetDetailsV1AnalyticsProgramGroupsTargetDetailsGet,
|
|
60
|
+
analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet,
|
|
61
|
+
analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet,
|
|
62
|
+
analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet,
|
|
63
|
+
searchReposScmServiceV2ReposSearchScmPost,
|
|
51
64
|
} from '../api/codeShift'
|
|
52
65
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
53
66
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
@@ -89,6 +102,10 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
89
102
|
* Updates a repository
|
|
90
103
|
*/
|
|
91
104
|
updateRepository = this.mutation(removeAuthorizationParam(updateRepositoryServiceV1ReposRepositoryIdPut))
|
|
105
|
+
/**
|
|
106
|
+
* List Repository Download Service
|
|
107
|
+
*/
|
|
108
|
+
repositoryDownload = this.query(removeAuthorizationParam(listRepositoryDownloadServiceV1ReposDownloadGet))
|
|
92
109
|
/**
|
|
93
110
|
* Get a report for a pull request by id.
|
|
94
111
|
*/
|
|
@@ -97,6 +114,14 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
97
114
|
* Gets modules.
|
|
98
115
|
*/
|
|
99
116
|
modules = this.query(removeAuthorizationParam(listModulesServiceV1ModulesGet))
|
|
117
|
+
/**
|
|
118
|
+
* Gets module by id.
|
|
119
|
+
*/
|
|
120
|
+
module = this.query(removeAuthorizationParam(getModuleV1ModulesModuleIdGet))
|
|
121
|
+
/**
|
|
122
|
+
* Gets module inputs.
|
|
123
|
+
*/
|
|
124
|
+
modulesInputs = this.query(removeAuthorizationParam(getModuleInputsV1ModulesModuleIdInputsGet))
|
|
100
125
|
/**
|
|
101
126
|
* Creates a module.
|
|
102
127
|
*/
|
|
@@ -137,6 +162,10 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
137
162
|
* Downloads file with found repositories
|
|
138
163
|
*/
|
|
139
164
|
downloadSearchRepository = this.mutation(removeAuthorizationParam(downloadSearchReposScmServiceV1ReposSearchScmSearchRepoIdDownloadGet))
|
|
165
|
+
/**
|
|
166
|
+
* Searches for repositories (v2)
|
|
167
|
+
*/
|
|
168
|
+
searchRepositoryV2 = this.mutation(removeAuthorizationParam(searchReposScmServiceV2ReposSearchScmPost))
|
|
140
169
|
/**
|
|
141
170
|
* Validate if the user has permission.
|
|
142
171
|
* We do not use opa in this api, so this is the fn needed to check permissions.
|
|
@@ -192,6 +221,10 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
192
221
|
* Deletes a program group.
|
|
193
222
|
*/
|
|
194
223
|
deleteProgramGroup = this.mutation(removeAuthorizationParam(deleteProgramGroupServiceV1ProgramGroupsProgramGroupIdDelete))
|
|
224
|
+
/**
|
|
225
|
+
* List Program Group Download Service
|
|
226
|
+
*/
|
|
227
|
+
programGroupDownload = this.query(removeAuthorizationParam(listProgramGroupDownloadServiceV1ProgramGroupsDownloadGet))
|
|
195
228
|
/**
|
|
196
229
|
* Gets list of tags.
|
|
197
230
|
*/
|
|
@@ -204,7 +237,6 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
204
237
|
* Get Branches for a Repository
|
|
205
238
|
*/
|
|
206
239
|
getBranches = this.query(removeAuthorizationParam(listBranchesServiceV1ReposBranchesGet))
|
|
207
|
-
|
|
208
240
|
/**
|
|
209
241
|
* General Report Success And Errors
|
|
210
242
|
*/
|
|
@@ -234,9 +266,11 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
234
266
|
removeAuthorizationParam(analyticsProgramGroupsLastReportStatusV1AnalyticsProgramGroupsLastReportStatusGet),
|
|
235
267
|
)
|
|
236
268
|
/**
|
|
237
|
-
* Analytics Program Groups
|
|
269
|
+
* Analytics Program Groups Last Report Status Download
|
|
238
270
|
*/
|
|
239
|
-
|
|
271
|
+
analyticsProgramGroupsLastReportStatusDownload = this.query(
|
|
272
|
+
removeAuthorizationParam(analyticsProgramGroupsLastReportStatusDownloadV1AnalyticsProgramGroupsLastReportStatusDownloadGet),
|
|
273
|
+
)
|
|
240
274
|
/**
|
|
241
275
|
* Analytics User Usage
|
|
242
276
|
*/
|
|
@@ -252,11 +286,9 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
252
286
|
removeAuthorizationParam(analyticsRepositoryUsageDownloadV1AnalyticsRepositoriesUsageDownloadGet),
|
|
253
287
|
)
|
|
254
288
|
/**
|
|
255
|
-
* Analytics Program Groups
|
|
289
|
+
* Analytics Program Groups Usage
|
|
256
290
|
*/
|
|
257
|
-
|
|
258
|
-
removeAuthorizationParam(analyticsProgramGroupsLastReportStatusDownloadV1AnalyticsProgramGroupsLastReportStatusDownloadGet),
|
|
259
|
-
)
|
|
291
|
+
analyticsProgramGroupsUsage = this.query(removeAuthorizationParam(analyticsProgramGroupsUsageV1AnalyticsProgramGroupsUsageGet))
|
|
260
292
|
/**
|
|
261
293
|
* Analytics Program Groups Usage Download
|
|
262
294
|
*/
|
|
@@ -269,6 +301,54 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
269
301
|
getUsersService = this.query(
|
|
270
302
|
removeAuthorizationParam(listUserServiceV1UsersGet),
|
|
271
303
|
)
|
|
304
|
+
/**
|
|
305
|
+
* Analytics Program Groups Details
|
|
306
|
+
*/
|
|
307
|
+
analyticsProgramGroupsDetails = this.query(
|
|
308
|
+
removeAuthorizationParam(analyticsProgramGroupsDetailsV1AnalyticsProgramGroupsDetailsGet),
|
|
309
|
+
)
|
|
310
|
+
/**
|
|
311
|
+
* Analytics Program Groups Details Download
|
|
312
|
+
*/
|
|
313
|
+
analyticsProgramGroupsDetailsDownload = this.query(
|
|
314
|
+
removeAuthorizationParam(analyticsProgramGroupsDetailsDownloadV1AnalyticsProgramGroupsDetailsDownloadGet),
|
|
315
|
+
)
|
|
316
|
+
/**
|
|
317
|
+
* Analytics Program Groups Details
|
|
318
|
+
*/
|
|
319
|
+
analyticsRepositoryDetails = this.query(
|
|
320
|
+
removeAuthorizationParam(analyticsRepositoryDetailedReportV1AnalyticsRepositoriesDetailsGet),
|
|
321
|
+
)
|
|
322
|
+
/**
|
|
323
|
+
* Analytics Program Groups Details Download
|
|
324
|
+
*/
|
|
325
|
+
analyticsRepositoryDetailsDownload = this.query(
|
|
326
|
+
removeAuthorizationParam(analyticsRepositoryDetailedReportDownloadV1AnalyticsRepositoriesDetailsDownloadGet),
|
|
327
|
+
)
|
|
328
|
+
/**
|
|
329
|
+
* Analytics Program Groups Target Details
|
|
330
|
+
*/
|
|
331
|
+
analyticsProgramGroupsTargetDetails = this.query(
|
|
332
|
+
removeAuthorizationParam(analyticsProgramGroupsTargetDetailsV1AnalyticsProgramGroupsTargetDetailsGet),
|
|
333
|
+
)
|
|
334
|
+
/**
|
|
335
|
+
* Analytics Program Groups Target Details Download
|
|
336
|
+
*/
|
|
337
|
+
analyticsProgramGroupsTargetDetailsDownload = this.query(
|
|
338
|
+
removeAuthorizationParam(analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet),
|
|
339
|
+
)
|
|
340
|
+
/**
|
|
341
|
+
* Analytics Repository Target Details
|
|
342
|
+
*/
|
|
343
|
+
analyticsRepositoryTargetDetails = this.query(
|
|
344
|
+
removeAuthorizationParam(analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet),
|
|
345
|
+
)
|
|
346
|
+
/**
|
|
347
|
+
* Analytics Repository Target Details Download
|
|
348
|
+
*/
|
|
349
|
+
analyticsRepositoryTargetDetailsDownload = this.query(
|
|
350
|
+
removeAuthorizationParam(analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet),
|
|
351
|
+
)
|
|
272
352
|
}
|
|
273
353
|
|
|
274
354
|
export const codeShiftClient = new CodeShift()
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
findKsV1KnowledgeSourcesSlugGet,
|
|
11
11
|
forkKsV1KnowledgeSourcesSlugForkPost,
|
|
12
12
|
getFileUploadStatusV1FileUploadFileUploadIdGet,
|
|
13
|
+
getIndexedFilesV1KnowledgeSourcesKsSlugFilesGet,
|
|
13
14
|
getUploadFormV1FileUploadFormPost,
|
|
14
15
|
getUploadFormV2V2FileUploadFormPost,
|
|
15
16
|
listKosV1KnowledgeSourcesKsSlugObjectsGet,
|
|
@@ -180,6 +181,11 @@ class DataIntegrationClient extends ReactQueryNetworkClient {
|
|
|
180
181
|
* Delete Knowledge Object from Knowledge Source
|
|
181
182
|
*/
|
|
182
183
|
deleteKnowledgeObjectFromKnowledgeSource = this.mutation(removeAuthorizationParam(deleteKoByIdV1KnowledgeSourcesKsSlugObjectsKoIdDelete))
|
|
184
|
+
/**
|
|
185
|
+
* Get Indexed Files
|
|
186
|
+
*/
|
|
187
|
+
listIndexedProjectFiles = this.query(removeAuthorizationParam(getIndexedFilesV1KnowledgeSourcesKsSlugFilesGet))
|
|
188
|
+
|
|
183
189
|
}
|
|
184
190
|
|
|
185
191
|
export const dataIntegrationClient = new DataIntegrationClient()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import { HttpError } from '@oazapfts/runtime'
|
|
3
|
+
import { getApiAddresses } from '../api-addresses'
|
|
3
4
|
import {
|
|
4
5
|
accountApplicationControllergetAccountApplicationPage,
|
|
5
6
|
accountApplicationControllergetAccountApplicationsFilters,
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
contextControllerupsertWorkspaceActionsInputContext,
|
|
39
40
|
contextWorkflowControllergetAccountWorkflowInputs,
|
|
40
41
|
contextWorkflowControllergetConsolidatedWorkflowInputs,
|
|
42
|
+
contextWorkflowControllergetWorkspaceWorkflowInputs,
|
|
41
43
|
contextgetAccountPluginInputs,
|
|
42
44
|
contextgetConsolidatedPluginInputs,
|
|
43
45
|
contextgetConsolidatedPluginInputsWithConnectionInterfaces,
|
|
@@ -79,7 +81,6 @@ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
|
79
81
|
import { contentClient } from './content'
|
|
80
82
|
import { FixedFullInputContextResponse, FixedPaginatedActivityResponse, FixedPluginForAppCreationV2Response, FixedWorkflowForCreationResponse, ReplaceResult } from './types'
|
|
81
83
|
import { workspaceClient } from './workspace'
|
|
82
|
-
import { getApiAddresses } from '../api-addresses'
|
|
83
84
|
|
|
84
85
|
class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
85
86
|
constructor() {
|
|
@@ -153,6 +154,12 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
153
154
|
*/
|
|
154
155
|
workflowDataWithInputsInWorkspace = this.query(contextWorkflowControllergetConsolidatedWorkflowInputs as
|
|
155
156
|
unknown as ReplaceResult<typeof contextWorkflowControllergetConsolidatedWorkflowInputs, FixedWorkflowForCreationResponse>)
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Gets workflow inputs in a workspace stack
|
|
160
|
+
*/
|
|
161
|
+
workflowInputsInWorkspace = this.query(contextWorkflowControllergetWorkspaceWorkflowInputs as unknown as ReplaceResult<typeof contextWorkflowControllergetWorkspaceWorkflowInputs, FixedWorkflowForCreationResponse>)
|
|
162
|
+
|
|
156
163
|
/**
|
|
157
164
|
* Gets workflow inputs in an account stack
|
|
158
165
|
*/
|
|
@@ -2,19 +2,81 @@ import { Dictionary } from '@stack-spot/portal-translate'
|
|
|
2
2
|
|
|
3
3
|
export const scfDictionary = {
|
|
4
4
|
en: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
SCF_CIDR_FOUNDATION_RESERVED: '
|
|
10
|
-
|
|
5
|
+
SCF_CERTIFICATE_ERROR: 'Certificate operation failed.',
|
|
6
|
+
SCF_CERTIFICATE_NOT_FOUND_ERROR: 'Certificate with ID {1} not found.',
|
|
7
|
+
SCF_CIDR_ERROR: 'CIDR operation failed.',
|
|
8
|
+
SCF_CIDR_RANGE_CONFLICT: 'CIDR range {1} conflicts with an existing range.',
|
|
9
|
+
SCF_CIDR_FOUNDATION_RESERVED: 'CIDR range {1} conflicts with the Foundation\'s reserved range.',
|
|
10
|
+
SCF_CIDR_NOT_FOUND_ERROR: 'CIDR with ID {1} not found.',
|
|
11
|
+
SCF_CONTROL_TOWER_BUSY_ERROR: 'Foundations Control Tower is currently busy. Please try again later.',
|
|
12
|
+
SCF_DNS_RECORD_ERROR: 'DNS Record operation failed.',
|
|
13
|
+
SCF_DNS_RECORD_NOT_FOUND_ERROR: 'DNS Record with ID {1} not found.',
|
|
14
|
+
SCF_DNS_ZONE_ERROR: 'DNS Zone operation failed.',
|
|
15
|
+
SCF_DNS_ZONE_NOT_FOUND_ERROR: 'DNS Zone with ID {1} not found.',
|
|
16
|
+
SCF_DNS_ZONE_NOT_READY_ERROR: 'DNS Zone with ID {1} not ready.',
|
|
17
|
+
SCF_FOLDER_ALREADY_EXISTS_ERROR: 'A folder named {1} already exists.',
|
|
18
|
+
SCF_FOLDER_ERROR: 'Folder operation failed.',
|
|
19
|
+
SCF_FOLDER_NOT_FOUND_ERROR: 'Folder with ID {1} not found.',
|
|
20
|
+
SCF_FOLDER_NOT_READY_ERROR: 'Folder with ID {1} not ready.',
|
|
21
|
+
SCF_FOUNDATION_ERROR: 'Foundation operation failed.',
|
|
22
|
+
SCF_FOUNDATION_NOT_FOUND_ERROR: 'Foundation with ID {1} not found.',
|
|
23
|
+
SCF_FOUNDATION_NOT_READY_ERROR: 'Foundation with ID {1} not ready.',
|
|
24
|
+
SCF_INBOUND_ERROR: 'Inbound operation failed.',
|
|
25
|
+
SCF_INVALID_REGEX_ERROR: 'The value {1} is invalid.',
|
|
26
|
+
SCF_MASTER_ACCOUNT_ERROR: 'Master Account operation failed.',
|
|
27
|
+
SCF_MASTER_ACCOUNT_NOT_FOUND_ERROR: 'No Master Account available for Foundation creation.',
|
|
28
|
+
SCF_NAMESPACE_CREATION_ERROR: 'An error occurred while creating the Kubernetes namespace.',
|
|
29
|
+
SCF_NETWORK_CONNECTION_ERROR: 'Network Connection operation failed.',
|
|
30
|
+
SCF_NETWORK_ERROR: 'Network operation failed.',
|
|
31
|
+
SCF_NETWORK_NOT_FOUND_ERROR: 'Network with ID {1} not found.',
|
|
32
|
+
SCF_NETWORK_NOT_READY_ERROR: 'Network with ID {1} not ready.',
|
|
33
|
+
SCF_PARENT_FOLDER_NOT_READY_ERROR: 'Parent Folder with ID {1} not ready.',
|
|
34
|
+
SCF_PROJECT_ERROR: 'Project operation failed.',
|
|
35
|
+
SCF_PROJECT_NOT_FOUND_ERROR: 'Project with ID {1} not found.',
|
|
36
|
+
SCF_PROJECT_NOT_READY_ERROR: 'Project with ID {1} not ready.',
|
|
37
|
+
SCF_UNKNOWN_ERROR: 'An unexpected error has occurred.',
|
|
38
|
+
SCF_VPN_CONFIGURATION_NOT_FOUND_ERROR: 'Configuration for VPN with ID {1} not found.',
|
|
39
|
+
SCF_VPN_ERROR: 'VPN operation failed.',
|
|
40
|
+
SCF_VPN_NOT_FOUND_ERROR: 'VPN with ID {1} not found.',
|
|
41
|
+
SCF_VPN_NOT_READY_ERROR: 'VPN with ID {1} not ready.',
|
|
11
42
|
},
|
|
12
43
|
pt: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
SCF_CIDR_FOUNDATION_RESERVED: 'O
|
|
18
|
-
|
|
44
|
+
SCF_CERTIFICATE_ERROR: 'Falha na operação de Certificado.',
|
|
45
|
+
SCF_CERTIFICATE_NOT_FOUND_ERROR: 'Certificado com ID {1} não encontrado.',
|
|
46
|
+
SCF_CIDR_ERROR: 'Falha na operação de CIDR.',
|
|
47
|
+
SCF_CIDR_RANGE_CONFLICT: 'O intervalo CIDR {1} conflita com um intervalo existente.',
|
|
48
|
+
SCF_CIDR_FOUNDATION_RESERVED: 'O intervalo CIDR {1} conflita com o intervalo reservado da Fundação.',
|
|
49
|
+
SCF_CIDR_NOT_FOUND_ERROR: 'CIDR com ID {1} não encontrado.',
|
|
50
|
+
SCF_CONTROL_TOWER_BUSY_ERROR: 'Control Tower da Fundação está ocupada no momento. Por favor, tente novamente mais tarde.',
|
|
51
|
+
SCF_DNS_RECORD_ERROR: 'Falha na operação de DNS Record.',
|
|
52
|
+
SCF_DNS_RECORD_NOT_FOUND_ERROR: 'DNS Record com ID {1} não encontrado.',
|
|
53
|
+
SCF_DNS_ZONE_ERROR: 'Falha na operação de DNS Zone.',
|
|
54
|
+
SCF_DNS_ZONE_NOT_FOUND_ERROR: 'DNS Zone com ID {1} não encontrada.',
|
|
55
|
+
SCF_DNS_ZONE_NOT_READY_ERROR: 'DNS Zone com ID {1} não está pronta.',
|
|
56
|
+
SCF_FOLDER_ALREADY_EXISTS_ERROR: 'Uma Pasta com o nome {1} já existe.',
|
|
57
|
+
SCF_FOLDER_ERROR: 'Falha na operação de Pasta.',
|
|
58
|
+
SCF_FOLDER_NOT_FOUND_ERROR: 'Pasta com ID {1} não encontrada.',
|
|
59
|
+
SCF_FOLDER_NOT_READY_ERROR: 'Pasta com ID {1} não está pronta.',
|
|
60
|
+
SCF_FOUNDATION_ERROR: 'Falha na operação da Fundação.',
|
|
61
|
+
SCF_FOUNDATION_NOT_FOUND_ERROR: 'Fundação com ID {1} não encontrada.',
|
|
62
|
+
SCF_FOUNDATION_NOT_READY_ERROR: 'Fundação com ID {1} não está pronta.',
|
|
63
|
+
SCF_INBOUND_ERROR: 'Falha na operação de Inbound.',
|
|
64
|
+
SCF_INVALID_REGEX_ERROR: 'O valor {1} é inválido.',
|
|
65
|
+
SCF_MASTER_ACCOUNT_ERROR: 'Falha na operação da Master Account.',
|
|
66
|
+
SCF_MASTER_ACCOUNT_NOT_FOUND_ERROR: 'Nenhuma Master Account disponível para criação da Fundação.',
|
|
67
|
+
SCF_NAMESPACE_CREATION_ERROR: 'Ocorreu um erro ao criar o namespace no Kubernetes.',
|
|
68
|
+
SCF_NETWORK_CONNECTION_ERROR: 'Falha na operação de Network Connection.',
|
|
69
|
+
SCF_NETWORK_ERROR: 'Falha na operação de Network.',
|
|
70
|
+
SCF_NETWORK_NOT_FOUND_ERROR: 'Network com ID {1} não encontrada.',
|
|
71
|
+
SCF_NETWORK_NOT_READY_ERROR: 'Network com ID {1} não está pronta.',
|
|
72
|
+
SCF_PARENT_FOLDER_NOT_READY_ERROR: 'Pasta pai com ID {1} não está pronta.',
|
|
73
|
+
SCF_PROJECT_ERROR: 'Falha na operação do Projeto.',
|
|
74
|
+
SCF_PROJECT_NOT_FOUND_ERROR: 'Projeto com ID {1} não encontrado.',
|
|
75
|
+
SCF_PROJECT_NOT_READY_ERROR: 'Projeto com ID {1} não está pronto.',
|
|
76
|
+
SCF_UNKNOWN_ERROR: 'Ocorreu um erro inesperado.',
|
|
77
|
+
SCF_VPN_CONFIGURATION_NOT_FOUND_ERROR: 'Configuração para VPN com ID {1} não encontrada.',
|
|
78
|
+
SCF_VPN_ERROR: 'Falha na operação de VPN.',
|
|
79
|
+
SCF_VPN_NOT_FOUND_ERROR: 'VPN com ID {1} não encontrada.',
|
|
80
|
+
SCF_VPN_NOT_READY_ERROR: 'VPN com ID {1} não está pronta.',
|
|
19
81
|
},
|
|
20
82
|
} satisfies Dictionary
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query'
|
|
2
|
-
export { apiAddresses, getApiAddresses, getBaseUrlWithOverride, setApisOverride } from './api-addresses'
|
|
2
|
+
export { apiAddresses, getApiAddresses, getApisByTenant, getBaseUrlWithOverride, setApisOverride } from './api-addresses'
|
|
3
3
|
export { accountClient } from './client/account'
|
|
4
|
-
export * from './client/discover'
|
|
5
4
|
export { agentClient } from './client/agent'
|
|
6
5
|
export { agentToolsClient } from './client/agent-tools'
|
|
7
6
|
export { aiClient } from './client/ai'
|
|
@@ -14,6 +13,7 @@ export { cloudServicesClient } from './client/cloud-services'
|
|
|
14
13
|
export { codeShiftClient } from './client/code-shift'
|
|
15
14
|
export { contentClient } from './client/content'
|
|
16
15
|
export { dataIntegrationClient } from './client/data-integration'
|
|
16
|
+
export * from './client/discover'
|
|
17
17
|
export { discoverClient } from './client/discover'
|
|
18
18
|
export { eventBusClient } from './client/event-bus'
|
|
19
19
|
export { genAiInferenceClient } from './client/gen-ai-inference'
|
|
@@ -35,9 +35,10 @@ export { StreamError } from './error/StreamError'
|
|
|
35
35
|
export { StreamJsonError } from './error/StreamJsonError'
|
|
36
36
|
export { NetworkClient } from './network/NetworkClient'
|
|
37
37
|
export { queryClient } from './network/react-query-client'
|
|
38
|
-
export { OperationResult, OperationVariables, UseQueryObjectOptions } from './network/types'
|
|
38
|
+
export { Env, OperationResult, OperationVariables, Tenant, UseQueryObjectOptions } from './network/types'
|
|
39
39
|
export { StreamingStatus } from './types'
|
|
40
40
|
export { StreamedArray } from './utils/StreamedArray'
|
|
41
41
|
export { StreamedJson } from './utils/StreamedJson'
|
|
42
42
|
export { useExtendedList } from './utils/use-extended-list'
|
|
43
43
|
export { useStreamedArray } from './utils/use-streamed-array'
|
|
44
|
+
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AuthenticationError, SessionExpiredError } from '@stack-spot/auth'
|
|
2
2
|
import { requestPermission } from '@stack-spot/opa'
|
|
3
3
|
import { events } from 'fetch-event-stream'
|
|
4
|
-
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
|
-
import { Env, FetchEventStream, HTTPMethod, SessionManager } from './types'
|
|
6
4
|
import { getBaseUrlWithOverride } from '../api-addresses'
|
|
5
|
+
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
|
+
import { Env, FetchEventStream, HTTPMethod, SessionManager, Tenant } from './types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A set of methods for performing network requests to an API.
|
|
@@ -21,6 +21,7 @@ export abstract class NetworkClient {
|
|
|
21
21
|
private baseURL: Record<Env, string>
|
|
22
22
|
static readonly sessionManager?: SessionManager
|
|
23
23
|
private static env?: Env
|
|
24
|
+
private static tenant?: Tenant
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* @param baseURL An object with the keys "dev", "stg" and "prd". The values must be the url for each of these environments.
|
|
@@ -33,11 +34,13 @@ export abstract class NetworkClient {
|
|
|
33
34
|
* Sets up all network clients. Must be called before attempting to make any request.
|
|
34
35
|
* @param sessionManager An object with functions capable of checking, retrieving and ending the current session.
|
|
35
36
|
* @param env The environment to send the requests to.
|
|
37
|
+
* @param tenant - {@link Tenant} tenant identifier used to scope requests.
|
|
36
38
|
*/
|
|
37
|
-
static setup(sessionManager: SessionManager, env: Env) {
|
|
39
|
+
static setup(sessionManager: SessionManager, env: Env, tenant: Tenant) {
|
|
38
40
|
//@ts-ignore This is the only place we would link session manager to be set.
|
|
39
41
|
NetworkClient.sessionManager = sessionManager
|
|
40
42
|
NetworkClient.env = env
|
|
43
|
+
NetworkClient.tenant = tenant
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
/**
|
|
@@ -62,7 +65,7 @@ export abstract class NetworkClient {
|
|
|
62
65
|
* @returns the final baseURL for the current environment, considering overrides if available.
|
|
63
66
|
*/
|
|
64
67
|
protected getBaseURL(): string {
|
|
65
|
-
return getBaseUrlWithOverride(this.baseURL, NetworkClient.env);
|
|
68
|
+
return getBaseUrlWithOverride(this.baseURL, NetworkClient.env, NetworkClient.tenant ?? 'stackspot');
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
/**
|