@stack-spot/portal-network 0.164.0 → 0.165.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/dist/api/agent-tools.d.ts +71 -5
  3. package/dist/api/agent-tools.d.ts.map +1 -1
  4. package/dist/api/agent-tools.js +88 -6
  5. package/dist/api/agent-tools.js.map +1 -1
  6. package/dist/api/ai.d.ts +4 -0
  7. package/dist/api/ai.d.ts.map +1 -1
  8. package/dist/api/ai.js.map +1 -1
  9. package/dist/api/cloudPlatformHorizon.d.ts +448 -19
  10. package/dist/api/cloudPlatformHorizon.d.ts.map +1 -1
  11. package/dist/api/cloudPlatformHorizon.js +35 -0
  12. package/dist/api/cloudPlatformHorizon.js.map +1 -1
  13. package/dist/api/codeShift.d.ts +334 -12
  14. package/dist/api/codeShift.d.ts.map +1 -1
  15. package/dist/api/codeShift.js +222 -4
  16. package/dist/api/codeShift.js.map +1 -1
  17. package/dist/api/workspace-ai.d.ts +52 -1
  18. package/dist/api/workspace-ai.d.ts.map +1 -1
  19. package/dist/api/workspace-ai.js +48 -0
  20. package/dist/api/workspace-ai.js.map +1 -1
  21. package/dist/client/agent-tools.d.ts +14 -2
  22. package/dist/client/agent-tools.d.ts.map +1 -1
  23. package/dist/client/agent-tools.js +1 -1
  24. package/dist/client/agent-tools.js.map +1 -1
  25. package/dist/client/ai.d.ts.map +1 -1
  26. package/dist/client/ai.js +5 -3
  27. package/dist/client/ai.js.map +1 -1
  28. package/dist/client/cloud-platform-horizon.d.ts +26 -0
  29. package/dist/client/cloud-platform-horizon.d.ts.map +1 -1
  30. package/dist/client/cloud-platform-horizon.js +28 -1
  31. package/dist/client/cloud-platform-horizon.js.map +1 -1
  32. package/dist/client/code-shift.d.ts +150 -1
  33. package/dist/client/code-shift.d.ts.map +1 -1
  34. package/dist/client/code-shift.js +109 -1
  35. package/dist/client/code-shift.js.map +1 -1
  36. package/dist/client/workspace-ai.d.ts +36 -3
  37. package/dist/client/workspace-ai.d.ts.map +1 -1
  38. package/dist/client/workspace-ai.js +28 -1
  39. package/dist/client/workspace-ai.js.map +1 -1
  40. package/package.json +1 -1
  41. package/readme.md +1 -1
  42. package/src/api/account.ts +1 -0
  43. package/src/api/agent-tools.ts +173 -11
  44. package/src/api/agent.ts +2 -0
  45. package/src/api/ai.ts +4 -0
  46. package/src/api/cloudPlatformHorizon.ts +558 -19
  47. package/src/api/codeShift.ts +732 -14
  48. package/src/api/notification.ts +2 -0
  49. package/src/api/workspace-ai.ts +110 -1
  50. package/src/client/agent-tools.ts +1 -1
  51. package/src/client/ai.ts +6 -3
  52. package/src/client/cloud-platform-horizon.ts +13 -1
  53. package/src/client/code-shift.ts +77 -0
  54. package/src/client/workspace-ai.ts +17 -0
@@ -332,3 +332,5 @@ export function delete1({ notificationIntentId }: {
332
332
  method: "DELETE"
333
333
  }));
334
334
  }
335
+
336
+
@@ -50,7 +50,7 @@ export type ShareableLinkResponse = {
50
50
  "type": string;
51
51
  created_by: string;
52
52
  };
53
- export type Action = "view" | "edit" | "grant_access";
53
+ export type Action = "VIEW" | "EDIT" | "GRANT_ACESS";
54
54
  export type PermissionListRequest = {
55
55
  identifier: string;
56
56
  action: Action;
@@ -84,6 +84,21 @@ export type ListWksContentsResponse = {
84
84
  [key: string]: any;
85
85
  }[] | null;
86
86
  };
87
+ export type PermissionForSharedRequest = {
88
+ userId: string;
89
+ action: Action;
90
+ userName?: string | null;
91
+ };
92
+ export type PermissionListForSharedRequest = {
93
+ users: PermissionForSharedRequest[];
94
+ };
95
+ export type ResourceMembersResponse = {
96
+ id: string;
97
+ username: string;
98
+ email: string;
99
+ name: string;
100
+ actions: string[];
101
+ };
87
102
  /**
88
103
  * Create Workspace
89
104
  */
@@ -543,6 +558,100 @@ export function useShareableLinkV1ShareShareIdPatch({ shareId, authorization, xA
543
558
  })
544
559
  }));
545
560
  }
561
+ /**
562
+ * Add Permission
563
+ */
564
+ export function addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch({ resourceType, resourceIdentifier, authorization, xAccountId, permissionListForSharedRequest }: {
565
+ resourceType: ContentType;
566
+ resourceIdentifier: string;
567
+ authorization: string;
568
+ xAccountId?: string | null;
569
+ permissionListForSharedRequest: PermissionListForSharedRequest;
570
+ }, opts?: Oazapfts.RequestOpts) {
571
+ return oazapfts.ok(oazapfts.fetchJson<{
572
+ status: 204;
573
+ } | {
574
+ status: 404;
575
+ } | {
576
+ status: 422;
577
+ data: HttpValidationError;
578
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}`, oazapfts.json({
579
+ ...opts,
580
+ method: "PATCH",
581
+ body: permissionListForSharedRequest,
582
+ headers: oazapfts.mergeHeaders(opts?.headers, {
583
+ authorization,
584
+ "x-account-id": xAccountId
585
+ })
586
+ })));
587
+ }
588
+ /**
589
+ * Remove Permission
590
+ */
591
+ export function removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete({ resourceType, resourceIdentifier, authorization, xAccountId, permissionListForSharedRequest }: {
592
+ resourceType: ContentType;
593
+ resourceIdentifier: string;
594
+ authorization: string;
595
+ xAccountId?: string | null;
596
+ permissionListForSharedRequest: PermissionListForSharedRequest;
597
+ }, opts?: Oazapfts.RequestOpts) {
598
+ return oazapfts.ok(oazapfts.fetchJson<{
599
+ status: 204;
600
+ } | {
601
+ status: 404;
602
+ } | {
603
+ status: 422;
604
+ data: HttpValidationError;
605
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}`, oazapfts.json({
606
+ ...opts,
607
+ method: "DELETE",
608
+ body: permissionListForSharedRequest,
609
+ headers: oazapfts.mergeHeaders(opts?.headers, {
610
+ authorization,
611
+ "x-account-id": xAccountId
612
+ })
613
+ })));
614
+ }
615
+ /**
616
+ * List Members
617
+ */
618
+ export function listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet({ resourceType, resourceIdentifier, search, filterBy, filterValue, sortBy, page, size, order, authorization, xAccountId }: {
619
+ resourceType: ContentType;
620
+ resourceIdentifier: string;
621
+ search?: string | null;
622
+ filterBy?: string | null;
623
+ filterValue?: string | null;
624
+ sortBy?: SortBy | null;
625
+ page?: number;
626
+ size?: number;
627
+ order?: OrderEnum;
628
+ authorization: string;
629
+ xAccountId?: string | null;
630
+ }, opts?: Oazapfts.RequestOpts) {
631
+ return oazapfts.ok(oazapfts.fetchJson<{
632
+ status: 200;
633
+ data: ResourceMembersResponse[];
634
+ } | {
635
+ status: 404;
636
+ } | {
637
+ status: 422;
638
+ data: HttpValidationError;
639
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}/members${QS.query(QS.explode({
640
+ search,
641
+ filter_by: filterBy,
642
+ filter_value: filterValue,
643
+ sort_by: sortBy,
644
+ page,
645
+ size,
646
+ order
647
+ }))}`, {
648
+ ...opts,
649
+ headers: oazapfts.mergeHeaders(opts?.headers, {
650
+ authorization,
651
+ "x-account-id": xAccountId
652
+ })
653
+ }));
654
+ }
546
655
  /**
547
656
  * Healthz
548
657
  */
@@ -95,7 +95,7 @@ class AgentToolsClient extends ReactQueryNetworkClient {
95
95
  allAgents = this.query({
96
96
  name: 'allAgents',
97
97
  request: async (signal, variables: { visibilities: (AgentVisibilityLevel | 'all')[] }) => {
98
- const allVisibilities = ['account', 'built_in', 'favorite', 'personal', 'shared', 'workspace'] as const
98
+ const allVisibilities = ['account', 'built_in', 'recently_used', 'favorite', 'personal', 'shared', 'workspace'] as const
99
99
  const visibilities = variables.visibilities.includes('all')
100
100
  ? allVisibilities
101
101
  : variables.visibilities as Array<AgentVisibilityLevelEnum | VisibilityLevelEnum>
package/src/client/ai.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { HttpError } from '@oazapfts/runtime'
2
- import { findLast, last } from 'lodash'
2
+ import { findLast, isArray, last } from 'lodash'
3
+ import { getApiAddresses } from '../api-addresses'
3
4
  import {
4
5
  addFavoriteV1AiStacksStackIdFavoritePost,
5
6
  addFavoriteV1QuickCommandsSlugFavoritePost,
@@ -55,7 +56,6 @@ import {
55
56
  ReplaceResult,
56
57
  StepChatStep,
57
58
  } from './types'
58
- import { getApiAddresses } from '../api-addresses'
59
59
 
60
60
  class AIClient extends ReactQueryNetworkClient {
61
61
  constructor() {
@@ -63,11 +63,13 @@ class AIClient extends ReactQueryNetworkClient {
63
63
  }
64
64
 
65
65
  protected buildStackSpotError(error: HttpError): StackspotAPIError {
66
+ // @ts-ignore API documentation is wrong
67
+ const details = (error.data as HttpValidationError | undefined)?.details
66
68
  return new StackspotAPIError({
67
69
  status: error.status,
68
70
  headers: error.headers,
69
71
  stack: error.stack,
70
- message: (error.data as HttpValidationError | undefined)?.detail?.map(d => d.msg)?.join('\n'),
72
+ message: isArray(details) ? details?.map(d => d.msg)?.join('\n') : details,
71
73
  })
72
74
  }
73
75
 
@@ -381,3 +383,4 @@ class AIClient extends ReactQueryNetworkClient {
381
383
  }
382
384
 
383
385
  export const aiClient = new AIClient()
386
+
@@ -4,7 +4,7 @@ import { DefaultAPIError } from '../error/DefaultAPIError'
4
4
  import { StackspotAPIError } from '../error/StackspotAPIError'
5
5
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
6
6
  import { removeAuthorizationParam } from '../utils/remove-authorization-param'
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'
7
+ import { associateWithWorkspaceEnvironment, createAddon, createDeployTemplate, createOrganization, createRuntime1, createTenant1, defaults, deploy, findApplicationDeploymentById, getApplicationDeploymentHealth, getApplicationDeploymentLogs, getAssociationWorkspaceEnvironmentByRuntimeId, getOrganizationById, getOrganizations, getRuntime1, getTenant1, listAddon, listApplicationDeployments, listAssociations, listDeployTemplate, listRuntimes, listRuntimes1, listTenants, listTenants1 } from '../api/cloudPlatformHorizon'
8
8
  import { baseDictionary } from '../error/dictionary/base'
9
9
  import { getApiAddresses } from '../api-addresses'
10
10
 
@@ -96,6 +96,18 @@ class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
96
96
  * Create an deploy template
97
97
  */
98
98
  createDeployTemplate = this.mutation(removeAuthorizationParam(createDeployTemplate))
99
+ /**
100
+ * Associate an runtime with an workspace environment
101
+ */
102
+ associateRuntimeWithWorkspaceEnv = this.mutation(removeAuthorizationParam(associateWithWorkspaceEnvironment))
103
+ /**
104
+ * Retrieves associate runtime with a workspace's environment
105
+ */
106
+ getRuntimeAssociations = this.query(removeAuthorizationParam(getAssociationWorkspaceEnvironmentByRuntimeId))
107
+ /**
108
+ * List runtime associations to workspace's environment
109
+ */
110
+ listRuntimeAssociationsToEnv = this.query(removeAuthorizationParam(listAssociations))
99
111
  }
100
112
 
101
113
  export const cloudPlatformHorizonClient = new CloudPlatformHorizonClient()
@@ -1,6 +1,16 @@
1
1
 
2
2
  import { HttpError } from '@oazapfts/runtime'
3
3
  import {
4
+ analyticsRepositoryLastReportStatusDownloadV1AnalyticsRepositoriesLastReportStatusDownloadGet,
5
+ analyticsRepositoryLastReportStatusV1AnalyticsRepositoriesLastReportStatusGet,
6
+ analyticsRepositoryUsageDownloadV1AnalyticsRepositoriesUsageDownloadGet,
7
+ analyticsRepositoryUsageV1AnalyticsRepositoriesUsageGet,
8
+ analyticsProgramGroupsLastReportStatusDownloadV1AnalyticsProgramGroupsLastReportStatusDownloadGet,
9
+ analyticsProgramGroupsLastReportStatusV1AnalyticsProgramGroupsLastReportStatusGet,
10
+ analyticsProgramGroupsUsageDownloadV1AnalyticsProgramGroupsUsageDownloadGet,
11
+ analyticsProgramGroupsUsageV1AnalyticsProgramGroupsUsageGet,
12
+ analyticsUserUsageDownloadV1AnalyticsUsersUsageDownloadGet,
13
+ analyticsUserUsageV1AnalyticsUsersUsageGet,
4
14
  checkRoleRouteV1RolesRoleGet,
5
15
  createAccountSettingsV1SettingsPut,
6
16
  createIntegrationServiceV1IntegrationsPost,
@@ -15,6 +25,7 @@ import {
15
25
  dispatchModuleServiceV1ModulesDispatchesPost,
16
26
  downloadReportV1ReportsReportIdDownloadGet,
17
27
  downloadSearchReposScmServiceV1ReposSearchScmSearchRepoIdDownloadGet,
28
+ generalReportSuccessAndErrorsV1AnalyticsReportsGeneralSuccessAndErrorsGet,
18
29
  getAccountSettingsV1SettingsGet,
19
30
  getIntegrationByIdServiceV1IntegrationsIntegrationIdGet,
20
31
  getProgramGroupByIdServiceV1ProgramGroupsProgramGroupIdGet,
@@ -36,6 +47,7 @@ import {
36
47
  updateProgramGroupServiceV1ProgramGroupsProgramGroupIdPut,
37
48
  updateRepositoryServiceV1ReposRepositoryIdPut,
38
49
  validateScmUrlServiceV1ReposValidateScmUrlPost,
50
+ listUserServiceV1UsersGet,
39
51
  } from '../api/codeShift'
40
52
  import { DefaultAPIError } from '../error/DefaultAPIError'
41
53
  import { codeShiftDictionary } from '../error/dictionary/code-shift'
@@ -192,6 +204,71 @@ class CodeShift extends ReactQueryNetworkClient {
192
204
  * Get Branches for a Repository
193
205
  */
194
206
  getBranches = this.query(removeAuthorizationParam(listBranchesServiceV1ReposBranchesGet))
207
+
208
+ /**
209
+ * General Report Success And Errors
210
+ */
211
+ generalReportSuccessAndErrors = this.query(
212
+ removeAuthorizationParam(generalReportSuccessAndErrorsV1AnalyticsReportsGeneralSuccessAndErrorsGet),
213
+ )
214
+ /**
215
+ * Analytics Repository Last Report Status
216
+ */
217
+ analyticsRepositoryLastReportStatus = this.query(
218
+ removeAuthorizationParam(analyticsRepositoryLastReportStatusV1AnalyticsRepositoriesLastReportStatusGet),
219
+ )
220
+ /**
221
+ * Analytics Repository Last Report Status Download
222
+ */
223
+ analyticsRepositoryLastReportStatusDownload = this.query(
224
+ removeAuthorizationParam(analyticsRepositoryLastReportStatusDownloadV1AnalyticsRepositoriesLastReportStatusDownloadGet),
225
+ )
226
+ /**
227
+ * Analytics Repository Usage
228
+ */
229
+ analyticsRepositoryUsage = this.query(removeAuthorizationParam(analyticsRepositoryUsageV1AnalyticsRepositoriesUsageGet))
230
+ /**
231
+ * Analytics Program Groups Last Report Status
232
+ */
233
+ analyticsProgramGroupsLastReportStatus = this.query(
234
+ removeAuthorizationParam(analyticsProgramGroupsLastReportStatusV1AnalyticsProgramGroupsLastReportStatusGet),
235
+ )
236
+ /**
237
+ * Analytics Program Groups Usage
238
+ */
239
+ analyticsProgramGroupsUsage = this.query(removeAuthorizationParam(analyticsProgramGroupsUsageV1AnalyticsProgramGroupsUsageGet))
240
+ /**
241
+ * Analytics User Usage
242
+ */
243
+ analyticsUserUsage = this.query(removeAuthorizationParam(analyticsUserUsageV1AnalyticsUsersUsageGet))
244
+ /**
245
+ * Analytics User Usage Download
246
+ */
247
+ analyticsUserUsageDownload = this.query(removeAuthorizationParam(analyticsUserUsageDownloadV1AnalyticsUsersUsageDownloadGet))
248
+ /**
249
+ * Analytics Repository Usage Download
250
+ */
251
+ analyticsRepositoryUsageDownload = this.query(
252
+ removeAuthorizationParam(analyticsRepositoryUsageDownloadV1AnalyticsRepositoriesUsageDownloadGet),
253
+ )
254
+ /**
255
+ * Analytics Program Groups Last Report Status Download
256
+ */
257
+ analyticsProgramGroupsLastReportStatusDownload = this.query(
258
+ removeAuthorizationParam(analyticsProgramGroupsLastReportStatusDownloadV1AnalyticsProgramGroupsLastReportStatusDownloadGet),
259
+ )
260
+ /**
261
+ * Analytics Program Groups Usage Download
262
+ */
263
+ analyticsProgramGroupsUsageDownload = this.query(
264
+ removeAuthorizationParam(analyticsProgramGroupsUsageDownloadV1AnalyticsProgramGroupsUsageDownloadGet),
265
+ )
266
+ /**
267
+ * Gets users from the Code Shift service.
268
+ */
269
+ getUsersService = this.query(
270
+ removeAuthorizationParam(listUserServiceV1UsersGet),
271
+ )
195
272
  }
196
273
 
197
274
  export const codeShiftClient = new CodeShift()
@@ -5,6 +5,7 @@ import { GetAiStackResponse, KnowledgeSourceItemResponse, QuickCommandResponse }
5
5
  import {
6
6
  addContentV1WorkspacesWorkspaceIdContentTypePost,
7
7
  addFavoriteV1WorkspacesWorkspaceIdFavoritePost,
8
+ addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch,
8
9
  addPermissionV1WorkspacesWorkspaceIdPermissionsPatch,
9
10
  createShareableLinkV1WorkspacesWorkspaceIdSharePost,
10
11
  createWorkspaceV1WorkspacesPost,
@@ -16,8 +17,10 @@ import {
16
17
  listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet,
17
18
  listAllContentsV1WorkspacesContentsContentTypeGet,
18
19
  listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet,
20
+ listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet,
19
21
  listWorkspacesV1WorkspacesGet,
20
22
  removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete,
23
+ removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete,
21
24
  removePermissionV1WorkspacesWorkspaceIdPermissionsDelete,
22
25
  updateWorkspaceV1WorkspacesWorkspaceIdPatch,
23
26
  useShareableLinkV1ShareShareIdPatch,
@@ -173,6 +176,20 @@ class WorkspaceAiClient extends ReactQueryNetworkClient {
173
176
  * Get a shareable link from a spot
174
177
  */
175
178
  shareableLink = this.mutation(removeAuthorizationParam(useShareableLinkV1ShareShareIdPatch))
179
+ /**
180
+ * Add permission to resource
181
+ */
182
+ addPermissionResource = this.mutation(removeAuthorizationParam(addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch))
183
+ /**
184
+ * Remove permission to resource
185
+ */
186
+ removePermissionResource =
187
+ this.mutation(removeAuthorizationParam(removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete))
188
+ /**
189
+ * List members with permission to resource
190
+ */
191
+ listMembersResource =
192
+ this.infiniteQuery(removeAuthorizationParam(listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet))
176
193
  }
177
194
 
178
195
  export const workspaceAiClient = new WorkspaceAiClient()