@stack-spot/portal-network 0.50.1 → 0.52.0

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.
@@ -546,7 +546,8 @@ export type ActivityResponse = {
546
546
  title: string;
547
547
  owner?: string;
548
548
  status: "SUCCESS" | "FAILED" | "RUNNING" | "PENDING" | "SKIPPED" | "CANCELLED" | "NONE" | "DRIFT" | "SUCCEEDED" | "RUNTIME_ERROR" | "USER_ERROR" | "INTERNAL_ERROR" | "ABORTED" | "ABORTING" | "EXTERNAL_ERROR" | "READY_TO_RUN" | "TIMEOUT";
549
- "type"?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
549
+ source: "STACK" | "RUNTIME" | "WORKFLOW" | "SCM";
550
+ "type": "DEPLOY" | "DESTROY" | "ROLLBACK" | "CREATE" | "ACTION" | "CUSTOMER_WORKFLOW";
550
551
  action?: "CREATE" | "UPDATE" | "DELETE" | "RUN";
551
552
  requestedBy?: string;
552
553
  time: number;
@@ -879,7 +880,7 @@ export type WorkspaceActivitiesResponse = {
879
880
  title: string;
880
881
  owner?: string;
881
882
  status: "SUCCESS" | "FAILED" | "RUNNING" | "PENDING" | "SKIPPED" | "CANCELLED" | "NONE" | "DRIFT" | "SUCCEEDED" | "RUNTIME_ERROR" | "USER_ERROR" | "INTERNAL_ERROR" | "ABORTED" | "ABORTING" | "EXTERNAL_ERROR" | "READY_TO_RUN" | "TIMEOUT";
882
- "type"?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
883
+ "type"?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
883
884
  action?: "CREATE" | "UPDATE" | "DELETE" | "RUN";
884
885
  requestedBy?: string;
885
886
  time: number;
@@ -888,11 +889,15 @@ export type WorkspaceActivitiesResponse = {
888
889
  [key: string]: object;
889
890
  };
890
891
  };
892
+ export type SimpleStackVersionResponse = {
893
+ semanticVersion: string;
894
+ stackVersionId: string;
895
+ };
891
896
  export type StackResponse = {
892
897
  stackId: string;
893
898
  displayName: string;
894
899
  imageUrl?: string;
895
- stackVersions: StackVersionResponse[];
900
+ stackVersions: SimpleStackVersionResponse[];
896
901
  };
897
902
  export type StackFilterResponse = {
898
903
  stacks: StackResponse[];
@@ -1521,7 +1526,7 @@ export function sharedInfraControllerV2GetSharedInfraActivities({ workspaceId, s
1521
1526
  workspaceId: string;
1522
1527
  sharedInfraId: string;
1523
1528
  envName: string;
1524
- $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1529
+ $type?: "DEPLOY" | "DESTROY" | "ROLLBACK" | "CREATE" | "ACTION" | "CUSTOMER_WORKFLOW";
1525
1530
  page: number;
1526
1531
  size: number;
1527
1532
  }, opts?: Oazapfts.RequestOpts) {
@@ -1557,7 +1562,7 @@ export function applicationControllerV2GetApplicationActivities({ workspaceId, a
1557
1562
  workspaceId: string;
1558
1563
  applicationId: string;
1559
1564
  envName: string;
1560
- $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1565
+ $type?: "DEPLOY" | "DESTROY" | "ROLLBACK" | "CREATE" | "ACTION" | "CUSTOMER_WORKFLOW";
1561
1566
  page: number;
1562
1567
  size: number;
1563
1568
  }, opts?: Oazapfts.RequestOpts) {
@@ -1797,7 +1802,7 @@ export function sharedInfraControllergetSharedInfraActivities({ workspaceId, sha
1797
1802
  workspaceId: string;
1798
1803
  sharedInfraId: string;
1799
1804
  envName: string;
1800
- $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1805
+ $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1801
1806
  }, opts?: Oazapfts.RequestOpts) {
1802
1807
  return oazapfts.ok(oazapfts.fetchJson<{
1803
1808
  status: 200;
@@ -1910,7 +1915,7 @@ export function applicationControllergetApplicationActivities({ workspaceId, app
1910
1915
  workspaceId: string;
1911
1916
  applicationId: string;
1912
1917
  envName: string;
1913
- $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DRIFT" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1918
+ $type?: "DEPLOY" | "CUSTOMER_WORKFLOW" | "ACTION" | "WORKFLOW" | "DESTROY" | "ROLLBACK" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
1914
1919
  }, opts?: Oazapfts.RequestOpts) {
1915
1920
  return oazapfts.ok(oazapfts.fetchJson<{
1916
1921
  status: 200;
@@ -3,7 +3,7 @@ import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatu
3
3
  import { ChatRequest2, ChatResponse3, ConversationHistoryResponse, ConversationResponse } from '../api/ai'
4
4
  import { ConnectAccountRequestV2, ManagedAccountProvisionRequest } from '../api/cloudAccount'
5
5
  import { AllocationCostRequest, AllocationCostResponse, ChargePeriod, getAllocationCostFilters, ManagedService, ServiceResource } from '../api/cloudServices'
6
- import { FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse } from '../api/workspaceManager'
6
+ import { ActivityResponse, FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PaginatedActivityResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse } from '../api/workspaceManager'
7
7
 
8
8
  interface BaseSMCStatus {
9
9
  /**
@@ -156,6 +156,14 @@ Omit<PluginInputValuesInConsolidatedContextResponse, 'inputs' | 'input' | 'type'
156
156
  condition?: FixedInputConditionResponse,
157
157
  }
158
158
 
159
+ export interface FixedActivityResponse extends Omit<ActivityResponse, 'detail'> {
160
+ detail: any,
161
+ }
162
+
163
+ export interface FixedPaginatedActivityResponse extends Omit<PaginatedActivityResponse, 'items'> {
164
+ items: FixedActivityResponse[],
165
+ }
166
+
159
167
  export interface FixedChatRequest extends ChatRequest2 {
160
168
  context?: {
161
169
  workspace?: string,
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable max-len */
2
2
  import { HttpError } from '@oazapfts/runtime'
3
3
  import {
4
+ applicationControllerV2GetApplicationActivities,
4
5
  applicationControllerV2GetApplicationAppliedPlugins,
5
6
  applicationControllergetApplicationDetails,
6
7
  applicationControllergetApplicationFilters,
@@ -18,6 +19,7 @@ import {
18
19
  defaults,
19
20
  managerRunControllerdeleteApplication,
20
21
  managerRunControllerdeleteSharedInfra,
22
+ sharedInfraControllerV2GetSharedInfraActivities,
21
23
  sharedInfraControllerV2GetSharedInfraAppliedPlugins,
22
24
  sharedInfraControllergetApplicationLinks,
23
25
  sharedInfraControllergetSharedInfra,
@@ -37,7 +39,7 @@ import { workspaceDictionary } from '../error/dictionary/workspace'
37
39
  import { StackspotAPIError } from '../error/StackspotAPIError'
38
40
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
39
41
  import { contentClient } from './content'
40
- import { FixedFullInputContextResponse, FixedPluginForAppCreationV2Response, ReplaceResult } from './types'
42
+ import { FixedFullInputContextResponse, FixedPaginatedActivityResponse, FixedPluginForAppCreationV2Response, ReplaceResult } from './types'
41
43
  import { workspaceClient } from './workspace'
42
44
 
43
45
  class WorkspaceManagerClient extends ReactQueryNetworkClient {
@@ -254,6 +256,16 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
254
256
  permission: async (variables: Parameters<typeof managerRunControllerdeleteSharedInfra>[0]) =>
255
257
  workspaceClient.deleteInfra.isAllowed(variables),
256
258
  })
259
+ /**
260
+ * Gets activities of a shared infra
261
+ */
262
+ activitiesSharedInfra = this.infiniteQuery(sharedInfraControllerV2GetSharedInfraActivities as unknown as ReplaceResult<typeof sharedInfraControllerV2GetSharedInfraActivities, FixedPaginatedActivityResponse>,
263
+ { accumulator: 'items', initialPageParam: 0 })
264
+ /**
265
+ * Gets activities of an application
266
+ */
267
+ activitiesApplication = this.infiniteQuery(applicationControllerV2GetApplicationActivities as unknown as ReplaceResult<typeof applicationControllerV2GetApplicationActivities, FixedPaginatedActivityResponse>,
268
+ { accumulator: 'items', initialPageParam: 0 })
257
269
  /**
258
270
  * Updates Stacks To Latest Version By Workspace
259
271
  */
@@ -277,7 +289,7 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
277
289
  /**
278
290
  * Get all stacks used to create infra in a workspace
279
291
  */
280
- filterStacksFromInfraInWorkspace = this.query(sharedInfraControllergetSharedInfraFilters)
292
+ filterStacksFromInfraInWorkspace = this.query(sharedInfraControllergetSharedInfraFilters)
281
293
  }
282
294
 
283
295
  export const workspaceManagerClient = new WorkspaceManagerClient()
@@ -32,10 +32,10 @@ import {
32
32
  connectionInterfaceControllergetConnectionInterfaces,
33
33
  connectionInterfaceControllerupdateConnectionInterfaceAttributes,
34
34
  connectionInterfaceControllerupdateConnectionInterfaceVisibility,
35
- contextControlleraddTypedContextInAccount,
36
- contextControlleraddTypedContextInWorkspace,
37
35
  contextControllerlistAccountContext,
38
36
  contextControllerlistConsolidatedContext,
37
+ contextV2ControlleraddTypedContextInAccount,
38
+ contextV2ControlleraddTypedContextInWorkspace,
39
39
  defaults,
40
40
  environmentControllergetEnvironment,
41
41
  environmentControllergetEnvironments,
@@ -406,11 +406,11 @@ class WorkspaceClient extends ReactQueryNetworkClient {
406
406
  /**
407
407
  * Save workspace context inputs for a plugin or action in a stack. This fn is only used for permission purposes.
408
408
  */
409
- saveContextInWorkspace = this.query(contextControlleraddTypedContextInWorkspace) as OperationObject<Parameters<typeof contextControlleraddTypedContextInWorkspace>[0]>
409
+ saveContextInWorkspace = this.query(contextV2ControlleraddTypedContextInWorkspace) as OperationObject<Parameters<typeof contextV2ControlleraddTypedContextInWorkspace>[0]>
410
410
  /**
411
411
  * Save workspace context inputs for a plugin or action in the account. This fn is only used for permission purposes.
412
412
  */
413
- saveContextInAccount = this.query(contextControlleraddTypedContextInAccount) as OperationObject<Parameters<typeof contextControlleraddTypedContextInAccount>[0]>
413
+ saveContextInAccount = this.query(contextV2ControlleraddTypedContextInAccount) as OperationObject<Parameters<typeof contextV2ControlleraddTypedContextInAccount>[0]>
414
414
  /**
415
415
  * Add stack to workspace. This fn is only used for permission purposes.
416
416
  */