@stack-spot/portal-network 0.176.1 → 0.176.2-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 +227 -0
- package/dist/api/ai.d.ts +3 -0
- package/dist/api/ai.d.ts.map +1 -1
- package/dist/api/ai.js.map +1 -1
- package/dist/api/codeShift.d.ts +105 -10
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +84 -0
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api-addresses.d.ts +14 -5
- package/dist/api-addresses.d.ts.map +1 -1
- package/dist/api-addresses.js +27 -10
- package/dist/api-addresses.js.map +1 -1
- package/dist/apis-itau.json +225 -0
- package/dist/client/code-shift.d.ts +61 -4
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +46 -1
- package/dist/client/code-shift.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 +3 -0
- package/src/api/codeShift.ts +274 -10
- package/src/api/notification.ts +2 -0
- package/src/api-addresses.ts +30 -11
- package/src/apis-itau.json +225 -0
- package/src/client/ai.ts +1 -0
- package/src/client/code-shift.ts +29 -0
- package/src/index.ts +4 -3
- package/src/network/NetworkClient.ts +7 -4
- package/src/network/types.ts +2 -0
|
@@ -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
|
@@ -58,6 +58,11 @@ import {
|
|
|
58
58
|
getModuleV1ModulesModuleIdGet,
|
|
59
59
|
analyticsProgramGroupsTargetDetailsV1AnalyticsProgramGroupsTargetDetailsGet,
|
|
60
60
|
analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet,
|
|
61
|
+
analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet,
|
|
62
|
+
analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet,
|
|
63
|
+
searchReposScmServiceV2ReposSearchScmPost,
|
|
64
|
+
importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost,
|
|
65
|
+
searchReposScmV2V2ReposSearchScmSearchIdGet,
|
|
61
66
|
} from '../api/codeShift'
|
|
62
67
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
63
68
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
@@ -159,6 +164,18 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
159
164
|
* Downloads file with found repositories
|
|
160
165
|
*/
|
|
161
166
|
downloadSearchRepository = this.mutation(removeAuthorizationParam(downloadSearchReposScmServiceV1ReposSearchScmSearchRepoIdDownloadGet))
|
|
167
|
+
/**
|
|
168
|
+
* Searches for repositories (v2)
|
|
169
|
+
*/
|
|
170
|
+
searchRepositoryV2 = this.mutation(removeAuthorizationParam(searchReposScmServiceV2ReposSearchScmPost))
|
|
171
|
+
/**
|
|
172
|
+
* Imports repositories (v2)
|
|
173
|
+
*/
|
|
174
|
+
importRepositories = this.mutation(removeAuthorizationParam(importReposWithTagsScmServiceV2ReposSearchScmSearchIdPost))
|
|
175
|
+
/**
|
|
176
|
+
* Gets repositories search by id (v2)
|
|
177
|
+
*/
|
|
178
|
+
getRepositoriesBySearchId = this.query(removeAuthorizationParam(searchReposScmV2V2ReposSearchScmSearchIdGet))
|
|
162
179
|
/**
|
|
163
180
|
* Validate if the user has permission.
|
|
164
181
|
* We do not use opa in this api, so this is the fn needed to check permissions.
|
|
@@ -330,6 +347,18 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
330
347
|
analyticsProgramGroupsTargetDetailsDownload = this.query(
|
|
331
348
|
removeAuthorizationParam(analyticsProgramGroupsTargetDetailsDownloadV1AnalyticsProgramGroupsTargetDetailsDownloadGet),
|
|
332
349
|
)
|
|
350
|
+
/**
|
|
351
|
+
* Analytics Repository Target Details
|
|
352
|
+
*/
|
|
353
|
+
analyticsRepositoryTargetDetails = this.query(
|
|
354
|
+
removeAuthorizationParam(analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet),
|
|
355
|
+
)
|
|
356
|
+
/**
|
|
357
|
+
* Analytics Repository Target Details Download
|
|
358
|
+
*/
|
|
359
|
+
analyticsRepositoryTargetDetailsDownload = this.query(
|
|
360
|
+
removeAuthorizationParam(analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet),
|
|
361
|
+
)
|
|
333
362
|
}
|
|
334
363
|
|
|
335
364
|
export const codeShiftClient = new CodeShift()
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query'
|
|
2
|
-
export { apiAddresses, getApiAddresses,
|
|
2
|
+
export { apiAddresses, getApiAddresses, getApisByTenant, getBaseUrlByTenantWithOverride, 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 { getBaseUrlByTenantWithOverride } from '../api-addresses'
|
|
4
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
|
-
import { Env, FetchEventStream, HTTPMethod, SessionManager } from './types'
|
|
6
|
-
import { getBaseUrlWithOverride } from '../api-addresses'
|
|
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
|
|
68
|
+
return getBaseUrlByTenantWithOverride(this.baseURL, NetworkClient.env, NetworkClient.tenant);
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
/**
|
package/src/network/types.ts
CHANGED