@stack-spot/portal-network 0.61.1 → 0.63.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.61.1",
3
+ "version": "0.63.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -746,13 +746,22 @@ export type StackVersionListResponse = {
746
746
  copyFromStackVersionId?: string;
747
747
  documentation?: StackVersionListDocumentationResponse;
748
748
  };
749
- export type PageGetStackWorkflowResponse = {
749
+ export type ListStackWorkflowResponse = {
750
+ id: string;
751
+ slug: string;
752
+ "type": "create" | "deploy" | "destroy" | "reusable" | "rollback" | "starter";
753
+ target: "app" | "infra";
754
+ studio: GetStackWorkflowStudioResponse;
755
+ range?: string;
756
+ latestVersion?: GetStackWorkflowLatestVersionResponse;
757
+ };
758
+ export type PageListStackWorkflowResponse = {
750
759
  totalElements?: number;
751
760
  totalPages?: number;
752
761
  first?: boolean;
753
762
  last?: boolean;
754
763
  size?: number;
755
- content?: GetStackWorkflowResponse[];
764
+ content?: ListStackWorkflowResponse[];
756
765
  "number"?: number;
757
766
  sort?: SortObject[];
758
767
  numberOfElements?: number;
@@ -1360,6 +1369,7 @@ export type WorkflowInputResponse = {
1360
1369
  connectionInterfaceType?: string;
1361
1370
  outputs?: WorkflowOutputResponse[];
1362
1371
  input?: WorkflowInputResponse;
1372
+ scope: string;
1363
1373
  };
1364
1374
  export type WorkflowComputedInputResponse = {
1365
1375
  name: string;
@@ -3617,16 +3627,17 @@ export function removeStackWorkspace({ stackVersionId, workspaceId }: {
3617
3627
  /**
3618
3628
  * List all workflows versions from a stack version
3619
3629
  */
3620
- export function listWorkflows({ stackVersionId, xWorkspaceId, displayName, $type, pageable }: {
3630
+ export function listWorkflows({ stackVersionId, xWorkspaceId, displayName, $type, target, pageable }: {
3621
3631
  stackVersionId: string;
3622
3632
  xWorkspaceId?: string;
3623
3633
  displayName?: string;
3624
- $type?: "create" | "deploy" | "destroy" | "reusable" | "rollback" | "starter";
3634
+ $type?: string;
3635
+ target?: "app" | "infra";
3625
3636
  pageable: Pageable;
3626
3637
  }, opts?: Oazapfts.RequestOpts) {
3627
3638
  return oazapfts.ok(oazapfts.fetchJson<{
3628
3639
  status: 200;
3629
- data: PageGetStackWorkflowResponse;
3640
+ data: PageListStackWorkflowResponse;
3630
3641
  } | {
3631
3642
  status: 422;
3632
3643
  data: {
@@ -3646,6 +3657,7 @@ export function listWorkflows({ stackVersionId, xWorkspaceId, displayName, $type
3646
3657
  }>(`/v1/stacks/versions/${encodeURIComponent(stackVersionId)}/workflows${QS.query(QS.explode({
3647
3658
  displayName,
3648
3659
  "type": $type,
3660
+ target,
3649
3661
  pageable
3650
3662
  }))}`, {
3651
3663
  ...opts,
@@ -4,8 +4,8 @@
4
4
  * DO NOT MODIFY - This file has been generated using oazapfts.
5
5
  * See https://www.npmjs.com/package/oazapfts
6
6
  */
7
- import * as Oazapfts from "@oazapfts/runtime"
8
- import * as QS from "@oazapfts/runtime/query"
7
+ import * as Oazapfts from "@oazapfts/runtime";
8
+ import * as QS from "@oazapfts/runtime/query";
9
9
  export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
10
  headers: {},
11
11
  baseUrl: "https://workspace-workspace-manager.dev.stackspot.com",
@@ -96,7 +96,7 @@ export type ConnectionInterfaceAttributesByEnv = {
96
96
  /** List of attributes */
97
97
  attributes: ConnectionInterfaceAttribute[];
98
98
  };
99
- export type PluginInputValuesInConsolidatedContextResponseConsolidatedValueByEnv = {
99
+ export type ValueByEnvWorkspaceResponse = {
100
100
  envName: string;
101
101
  value: object;
102
102
  mandate: boolean;
@@ -114,7 +114,7 @@ export type PluginInputValuesInConsolidatedContextResponse = {
114
114
  items?: string[];
115
115
  itemsValues?: string[];
116
116
  externalItems?: ExternalItemsResponse;
117
- valuesByEnv: PluginInputValuesInConsolidatedContextResponseConsolidatedValueByEnv[];
117
+ valuesByEnv: ValueByEnvWorkspaceResponse[];
118
118
  condition?: InputConditionResponse;
119
119
  isGlobal?: boolean;
120
120
  connectionInterfaceType?: string;
@@ -136,16 +136,11 @@ export type UpsertActionInputContextRequest = {
136
136
  value: object;
137
137
  mandate?: boolean;
138
138
  };
139
- export type PluginInputValuesInAccountContextResponseAccValueByEnv = {
139
+ export type ValueByEnvAccountResponse = {
140
140
  envName: string;
141
141
  value: object;
142
142
  mandate: boolean;
143
143
  };
144
- export type PluginInputValuesInAccountContextResponseCondition = {
145
- variable: string;
146
- operator: string;
147
- value: object;
148
- };
149
144
  export type PluginInputValuesInAccountContextResponse = {
150
145
  name: string;
151
146
  label: string;
@@ -157,8 +152,8 @@ export type PluginInputValuesInAccountContextResponse = {
157
152
  help?: string;
158
153
  items?: string[];
159
154
  externalItems?: ExternalItemsResponse;
160
- valuesByEnv: PluginInputValuesInAccountContextResponseAccValueByEnv[];
161
- condition?: PluginInputValuesInAccountContextResponseCondition;
155
+ valuesByEnv: ValueByEnvAccountResponse[];
156
+ condition?: InputConditionResponse;
162
157
  isGlobal?: boolean;
163
158
  connectionInterfaceType?: string;
164
159
  addQuestion?: string;
@@ -311,7 +306,7 @@ export type CreateSharedRequest = {
311
306
  export type CreateShareInfraResponse = {
312
307
  sharedInfraId: string;
313
308
  workflowId: string;
314
- logs: string;
309
+ logs?: string;
315
310
  };
316
311
  export type App = {
317
312
  /** Application apiId that will be used in case of retry. */
@@ -360,7 +355,21 @@ export type CreateApplicationResponse = {
360
355
  applicationId: string;
361
356
  apiId?: string;
362
357
  workflowId: string;
363
- logs: string;
358
+ logs?: string;
359
+ };
360
+ export type ContentWorkflowSaveRequest = {
361
+ name: string;
362
+ description: string;
363
+ targetId?: string;
364
+ stackVersionId: string;
365
+ inputs: {
366
+ [key: string]: object;
367
+ };
368
+ frontData?: object;
369
+ };
370
+ export type ContentWorkflowSaveResponse = {
371
+ targetId: string;
372
+ executionId: string;
364
373
  };
365
374
  export type StackVersionLatestAvailableResponse = {
366
375
  stackVersionId: string;
@@ -667,6 +676,7 @@ export type InputValuesContextResponse = {
667
676
  inputs: object[];
668
677
  condition?: InputConditionResponse;
669
678
  isGlobal?: boolean;
679
+ scope?: string;
670
680
  };
671
681
  export type FullInputContextResponse = {
672
682
  inputs: InputValuesContextResponse[];
@@ -962,11 +972,24 @@ export type AccountSharedInfraPageResponse = {
962
972
  totalPages: number;
963
973
  items: AccountSharedInfraSimplesResponse[];
964
974
  };
965
- export type StackActionInputValuesByEnvInWorkspaceContextResponseValueByEnvWorkspaceResponse = {
966
- envName: string;
967
- value: object;
968
- mandate: boolean;
969
- source: string;
975
+ export type WorkflowVersionInfoResponse = {
976
+ id: string;
977
+ displayName: string;
978
+ label: string;
979
+ description: string;
980
+ semanticVersion: string;
981
+ targetApp: boolean;
982
+ targetInfra: boolean;
983
+ createdAt: string;
984
+ };
985
+ export type WorkflowForCreationResponse = {
986
+ id: string;
987
+ slug: string;
988
+ "type": string;
989
+ inputs: InputValuesContextResponse[];
990
+ computedInputs: ComputedInputResponse[];
991
+ globalComputedInputs: ComputedInputResponse[];
992
+ versionInfo?: WorkflowVersionInfoResponse;
970
993
  };
971
994
  export type StackActionInputValuesByEnvInWorkspaceContextResponse = {
972
995
  name: string;
@@ -979,17 +1002,12 @@ export type StackActionInputValuesByEnvInWorkspaceContextResponse = {
979
1002
  required?: boolean;
980
1003
  pattern?: string;
981
1004
  help?: string;
982
- valuesByEnv: StackActionInputValuesByEnvInWorkspaceContextResponseValueByEnvWorkspaceResponse[];
1005
+ valuesByEnv: ValueByEnvWorkspaceResponse[];
983
1006
  connectionInterfaceType?: string;
984
1007
  addQuestion?: string;
985
1008
  input?: object;
986
1009
  inputs: object[];
987
1010
  };
988
- export type StackActionInputValuesByEnvInAccountContextResponseValueByEnvAccountResponse = {
989
- envName: string;
990
- value: object;
991
- mandate: boolean;
992
- };
993
1011
  export type StackActionInputValuesByEnvInAccountContextResponse = {
994
1012
  name: string;
995
1013
  label: string;
@@ -1001,7 +1019,7 @@ export type StackActionInputValuesByEnvInAccountContextResponse = {
1001
1019
  required?: boolean;
1002
1020
  pattern?: string;
1003
1021
  help?: string;
1004
- valuesByEnv: StackActionInputValuesByEnvInAccountContextResponseValueByEnvAccountResponse[];
1022
+ valuesByEnv: ValueByEnvAccountResponse[];
1005
1023
  connectionInterfaceType?: string;
1006
1024
  addQuestion?: string;
1007
1025
  input?: object;
@@ -1298,6 +1316,34 @@ export function applicationControllerV2CreateApp({ workspaceId, createAppRequest
1298
1316
  body: createAppRequest
1299
1317
  })));
1300
1318
  }
1319
+ export function contentWorkflowControllercreateSharedInfraThroughWorkflow({ workspaceId, workflowVersionId, contentWorkflowSaveRequest }: {
1320
+ workspaceId: string;
1321
+ workflowVersionId: string;
1322
+ contentWorkflowSaveRequest: ContentWorkflowSaveRequest;
1323
+ }, opts?: Oazapfts.RequestOpts) {
1324
+ return oazapfts.ok(oazapfts.fetchJson<{
1325
+ status: 201;
1326
+ data: ContentWorkflowSaveResponse;
1327
+ }>(`/v1/workspaces/${encodeURIComponent(workspaceId)}/workflows/${encodeURIComponent(workflowVersionId)}/shared-infra`, oazapfts.json({
1328
+ ...opts,
1329
+ method: "POST",
1330
+ body: contentWorkflowSaveRequest
1331
+ })));
1332
+ }
1333
+ export function contentWorkflowControllercreateApplicationThroughWorkflow({ workspaceId, workflowVersionId, contentWorkflowSaveRequest }: {
1334
+ workspaceId: string;
1335
+ workflowVersionId: string;
1336
+ contentWorkflowSaveRequest: ContentWorkflowSaveRequest;
1337
+ }, opts?: Oazapfts.RequestOpts) {
1338
+ return oazapfts.ok(oazapfts.fetchJson<{
1339
+ status: 201;
1340
+ data: ContentWorkflowSaveResponse;
1341
+ }>(`/v1/workspaces/${encodeURIComponent(workspaceId)}/workflows/${encodeURIComponent(workflowVersionId)}/applications`, oazapfts.json({
1342
+ ...opts,
1343
+ method: "POST",
1344
+ body: contentWorkflowSaveRequest
1345
+ })));
1346
+ }
1301
1347
  export function workspaceStackControllerlistStacks({ workspaceId }: {
1302
1348
  workspaceId: string;
1303
1349
  }, opts?: Oazapfts.RequestOpts) {
@@ -1804,7 +1850,7 @@ export function accountSharedInfraControllergetAccountSharedInfraPage({ page, si
1804
1850
  ...opts
1805
1851
  }));
1806
1852
  }
1807
- export function accountSharedInfraControllergetAccountApplicationsFilters(opts?: Oazapfts.RequestOpts) {
1853
+ export function accountSharedInfraControllergetAccountSharedInfraFilters(opts?: Oazapfts.RequestOpts) {
1808
1854
  return oazapfts.ok(oazapfts.fetchJson<{
1809
1855
  status: 200;
1810
1856
  data: StackFilterResponse;
@@ -1812,6 +1858,33 @@ export function accountSharedInfraControllergetAccountApplicationsFilters(opts?:
1812
1858
  ...opts
1813
1859
  }));
1814
1860
  }
1861
+ export function contextWorkflowControllergetConsolidatedWorkflowInputs({ workspaceId, stackVersionId, workflowVersionId }: {
1862
+ workspaceId: string;
1863
+ stackVersionId: string;
1864
+ workflowVersionId: string;
1865
+ }, opts?: Oazapfts.RequestOpts) {
1866
+ return oazapfts.ok(oazapfts.fetchJson<{
1867
+ status: 200;
1868
+ data: WorkflowForCreationResponse;
1869
+ }>(`/v1/contexts/workspaces/${encodeURIComponent(workspaceId)}/stacks/${encodeURIComponent(stackVersionId)}/workflows/${encodeURIComponent(workflowVersionId)}`, {
1870
+ ...opts
1871
+ }));
1872
+ }
1873
+ export function contextWorkflowControllergetWorkspaceWorkflowInputs({ workspaceId, stackVersionId, workflowVersionId, envName }: {
1874
+ workspaceId: string;
1875
+ stackVersionId: string;
1876
+ workflowVersionId: string;
1877
+ envName?: string;
1878
+ }, opts?: Oazapfts.RequestOpts) {
1879
+ return oazapfts.ok(oazapfts.fetchJson<{
1880
+ status: 200;
1881
+ data: FullInputContextResponse;
1882
+ }>(`/v1/contexts/workspaces/${encodeURIComponent(workspaceId)}/stacks/${encodeURIComponent(stackVersionId)}/workflows/${encodeURIComponent(workflowVersionId)}/inputs${QS.query(QS.explode({
1883
+ envName
1884
+ }))}`, {
1885
+ ...opts
1886
+ }));
1887
+ }
1815
1888
  export function contextControllergetStackActionInputsInWorkspaceContext({ workspaceId, stackVersionId, actionsVersionId, envName }: {
1816
1889
  workspaceId: string;
1817
1890
  stackVersionId: string;
@@ -1827,6 +1900,20 @@ export function contextControllergetStackActionInputsInWorkspaceContext({ worksp
1827
1900
  ...opts
1828
1901
  }));
1829
1902
  }
1903
+ export function contextWorkflowControllergetAccountWorkflowInputs({ stackVersionId, workflowVersionId, envName }: {
1904
+ stackVersionId: string;
1905
+ workflowVersionId: string;
1906
+ envName?: string;
1907
+ }, opts?: Oazapfts.RequestOpts) {
1908
+ return oazapfts.ok(oazapfts.fetchJson<{
1909
+ status: 200;
1910
+ data: FullInputContextResponse;
1911
+ }>(`/v1/contexts/account/stacks/${encodeURIComponent(stackVersionId)}/workflows/${encodeURIComponent(workflowVersionId)}/inputs${QS.query(QS.explode({
1912
+ envName
1913
+ }))}`, {
1914
+ ...opts
1915
+ }));
1916
+ }
1830
1917
  export function contextControllergetStackActionInputsInAccountContext({ stackVersionId, actionsVersionId, envName }: {
1831
1918
  stackVersionId: string;
1832
1919
  actionsVersionId: string;
@@ -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 { ActivityResponse, FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PaginatedActivityResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse } from '../api/workspaceManager'
6
+ import { ActivityResponse, FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PaginatedActivityResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse, WorkflowForCreationResponse } from '../api/workspaceManager'
7
7
 
8
8
  interface BaseSMCStatus {
9
9
  /**
@@ -141,11 +141,15 @@ export interface FixedInputValuesContextResponse extends Omit<InputValuesContext
141
141
  default?: any,
142
142
  condition?: FixedInputConditionResponse,
143
143
  valuesByEnv: FixedValueByEnvResponse[],
144
+ scope?: 'default' | 'hidden' | 'env',
144
145
  }
145
146
 
146
147
  export interface FixedFullInputContextResponse extends Omit<FullInputContextResponse, 'inputs'> {
147
148
  inputs: FixedInputValuesContextResponse[],
148
149
  }
150
+ export interface FixedWorkflowForCreationResponse extends Omit<WorkflowForCreationResponse, 'inputs'> {
151
+ inputs: FixedPluginInputValuesInConsolidatedContextResponse[],
152
+ }
149
153
 
150
154
  export interface FixedPluginInputValuesInConsolidatedContextResponse extends
151
155
  Omit<PluginInputValuesInConsolidatedContextResponse, 'inputs' | 'input' | 'type' | 'default' | 'condition'> {
@@ -35,7 +35,10 @@ import {
35
35
  workspaceStackControllerlistStacks,
36
36
  workspaceStackControllerrefreshStacksInWorkspace,
37
37
  accountApplicationControllergetAccountApplicationsFilters,
38
- accountSharedInfraControllergetAccountApplicationsFilters,
38
+ accountSharedInfraControllergetAccountSharedInfraFilters,
39
+ contextWorkflowControllergetConsolidatedWorkflowInputs,
40
+ contentWorkflowControllercreateSharedInfraThroughWorkflow,
41
+ contentWorkflowControllercreateApplicationThroughWorkflow,
39
42
  } from '../api/workspaceManager'
40
43
  import apis from '../apis.json'
41
44
  import { DefaultAPIError } from '../error/DefaultAPIError'
@@ -43,7 +46,7 @@ import { workspaceDictionary } from '../error/dictionary/workspace'
43
46
  import { StackspotAPIError } from '../error/StackspotAPIError'
44
47
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
45
48
  import { contentClient } from './content'
46
- import { FixedFullInputContextResponse, FixedPaginatedActivityResponse, FixedPluginForAppCreationV2Response, ReplaceResult } from './types'
49
+ import { FixedFullInputContextResponse, FixedPaginatedActivityResponse, FixedPluginForAppCreationV2Response, FixedWorkflowForCreationResponse, ReplaceResult } from './types'
47
50
  import { workspaceClient } from './workspace'
48
51
 
49
52
  class WorkspaceManagerClient extends ReactQueryNetworkClient {
@@ -113,6 +116,11 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
113
116
  return canViewContext && canGetConnectionInterfaceTypes && canGetPluginVersions
114
117
  },
115
118
  })
119
+ /**
120
+ * Gets workflow in a workspace stack
121
+ */
122
+ workflowDataWithInputsInWorkspace = this.query(contextWorkflowControllergetConsolidatedWorkflowInputs as
123
+ unknown as ReplaceResult<typeof contextWorkflowControllergetConsolidatedWorkflowInputs, FixedWorkflowForCreationResponse>)
116
124
  /**
117
125
  * Gets inputs from a plugin in account context
118
126
  */
@@ -174,6 +182,14 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
174
182
  */
175
183
  workflowsByStackIdAndWorkflowType = this.query(workflowWorkspaceControllerlistWorkflowByStackIdAndWorkflowType)
176
184
 
185
+ /**
186
+ * Creates an infra using workflow
187
+ */
188
+ createInfraUsingWorkflow = this.mutation(contentWorkflowControllercreateSharedInfraThroughWorkflow)
189
+ /**
190
+ * Creates an application using workflow
191
+ */
192
+ createAppUsingWorkflow = this.mutation(contentWorkflowControllercreateApplicationThroughWorkflow)
177
193
  /**
178
194
  * Gets inputs from an action in a workspace
179
195
  */
@@ -314,7 +330,7 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
314
330
  getAccountApplicationsFilters = this.query(accountApplicationControllergetAccountApplicationsFilters)
315
331
 
316
332
  /** * Gets filters for shared infrastructures associated with an account. */
317
- getAccountSharedInfraFilters = this.query(accountSharedInfraControllergetAccountApplicationsFilters)
333
+ getAccountSharedInfraFilters = this.query(accountSharedInfraControllergetAccountSharedInfraFilters)
318
334
  }
319
335
 
320
336
  export const workspaceManagerClient = new WorkspaceManagerClient()