@stack-spot/portal-network 0.35.0 → 0.36.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/CHANGELOG.md +8 -0
- package/dist/api/content.d.ts +68 -12
- package/dist/api/content.d.ts.map +1 -1
- package/dist/api/content.js +25 -21
- package/dist/api/content.js.map +1 -1
- package/dist/api/workspaceManager.d.ts +74 -69
- package/dist/api/workspaceManager.d.ts.map +1 -1
- package/dist/api/workspaceManager.js +68 -68
- package/dist/api/workspaceManager.js.map +1 -1
- package/dist/client/content.d.ts +12 -0
- package/dist/client/content.d.ts.map +1 -1
- package/dist/client/content.js +15 -1
- package/dist/client/content.js.map +1 -1
- package/dist/client/workspace-manager.d.ts +7 -0
- package/dist/client/workspace-manager.d.ts.map +1 -1
- package/dist/client/workspace-manager.js +32 -23
- package/dist/client/workspace-manager.js.map +1 -1
- package/package.json +1 -1
- package/src/api/content.ts +103 -28
- package/src/api/workspaceManager.ts +82 -77
- package/src/client/content.ts +11 -1
- package/src/client/workspace-manager.ts +76 -71
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import { HttpError } from '@oazapfts/runtime'
|
|
3
3
|
import {
|
|
4
|
+
applicationControllerV2GetApplicationAppliedPlugins,
|
|
5
|
+
applicationControllergetApplicationDetails,
|
|
6
|
+
applicationControllergetApplicationLinks,
|
|
7
|
+
contextActionControllergetStackActionInputsInAccountContext,
|
|
8
|
+
contextActionControllergetStackActionInputsInWorkspaceContext,
|
|
9
|
+
contextControllerupsertAccountActionsInputContext,
|
|
10
|
+
contextControllerupsertPluginAccountContext,
|
|
11
|
+
contextControllerupsertPluginWorkspaceContext,
|
|
12
|
+
contextControllerupsertWorkspaceActionsInputContext,
|
|
13
|
+
contextgetAccountPluginInputs,
|
|
14
|
+
contextgetConsolidatedPluginInputs,
|
|
15
|
+
contextgetConsolidatedPluginInputsWithConnectionInterfaces,
|
|
4
16
|
defaults,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
getConsolidatedPluginInputsWithConnectionInterfaces,
|
|
17
|
-
listWorkflowByStackIdAndWorkflowType,
|
|
18
|
-
getApplicationLinks,
|
|
19
|
-
getApplicationLinks1,
|
|
20
|
-
addStacksInWorkspace,
|
|
21
|
-
deleteStacksInWorkspace,
|
|
22
|
-
deleteV1WorkspacesByWorkspaceId,
|
|
23
|
-
getApplicationDetails,
|
|
24
|
-
getSharedInfraAppliedPlugins1,
|
|
25
|
-
deleteApplication,
|
|
26
|
-
deleteSharedInfra,
|
|
17
|
+
managerRunControllerdeleteApplication,
|
|
18
|
+
managerRunControllerdeleteSharedInfra,
|
|
19
|
+
sharedInfraControllerV2GetSharedInfraAppliedPlugins,
|
|
20
|
+
sharedInfraControllergetApplicationLinks,
|
|
21
|
+
sharedInfraControllergetSharedInfraAppliedPlugins,
|
|
22
|
+
workflowWorkspaceControllerlistWorkflowByStackIdAndWorkflowType,
|
|
23
|
+
workspaceControllerdelete,
|
|
24
|
+
workspaceStackControlleraddStacksInWorkspace,
|
|
25
|
+
workspaceStackControllerdeleteStacksInWorkspace,
|
|
26
|
+
workspaceStackControllerlistStacks,
|
|
27
|
+
workspaceStackControllerrefreshStacksInWorkspace,
|
|
27
28
|
} from '../api/workspaceManager'
|
|
28
29
|
import apis from '../apis.json'
|
|
29
30
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
@@ -48,8 +49,8 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
48
49
|
*/
|
|
49
50
|
stacksInWorkspace = this.query({
|
|
50
51
|
name: 'stacksInWorkspace',
|
|
51
|
-
request: async (signal, variables: Parameters<typeof
|
|
52
|
-
permission: async (variables: Parameters<typeof
|
|
52
|
+
request: async (signal, variables: Parameters<typeof workspaceStackControllerlistStacks>[0]) => workspaceStackControllerlistStacks(variables, { signal }),
|
|
53
|
+
permission: async (variables: Parameters<typeof workspaceStackControllerlistStacks>[0]) => {
|
|
53
54
|
const contentStacksPermission = await contentClient.allStackVersionByIds.isAllowed()
|
|
54
55
|
const workspaceStacksPermission = await workspaceClient.stacks.isAllowed(variables)
|
|
55
56
|
return workspaceStacksPermission && contentStacksPermission
|
|
@@ -60,9 +61,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
60
61
|
*/
|
|
61
62
|
addStackToWorkspace = this.mutation({
|
|
62
63
|
name: 'addStackToWorkspace',
|
|
63
|
-
request: async (signal, variables: Parameters<typeof
|
|
64
|
-
|
|
65
|
-
permission: async ({ workspaceId }: Parameters<typeof
|
|
64
|
+
request: async (signal, variables: Parameters<typeof workspaceStackControlleraddStacksInWorkspace>[0]) =>
|
|
65
|
+
workspaceStackControlleraddStacksInWorkspace(variables, { signal }),
|
|
66
|
+
permission: async ({ workspaceId }: Parameters<typeof workspaceStackControlleraddStacksInWorkspace>[0]) =>
|
|
66
67
|
workspaceClient.addStackInWorkspace.isAllowed({ workspaceId }),
|
|
67
68
|
})
|
|
68
69
|
/**
|
|
@@ -70,9 +71,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
70
71
|
*/
|
|
71
72
|
removeStackFromWorkspace = this.mutation({
|
|
72
73
|
name: 'removeStackFromWorkspace',
|
|
73
|
-
request: async (signal, variables: Parameters<typeof
|
|
74
|
-
|
|
75
|
-
permission: async ({ workspaceId }: Parameters<typeof
|
|
74
|
+
request: async (signal, variables: Parameters<typeof workspaceStackControllerdeleteStacksInWorkspace>[0]) =>
|
|
75
|
+
workspaceStackControllerdeleteStacksInWorkspace(variables, { signal }),
|
|
76
|
+
permission: async ({ workspaceId }: Parameters<typeof workspaceStackControllerdeleteStacksInWorkspace>[0]) =>
|
|
76
77
|
workspaceClient.removeStackFromWorkspace.isAllowed({ workspaceId }),
|
|
77
78
|
})
|
|
78
79
|
/**
|
|
@@ -80,9 +81,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
80
81
|
*/
|
|
81
82
|
deleteWorkspace = this.mutation({
|
|
82
83
|
name: 'removeStackFromWorkspace',
|
|
83
|
-
request: async (signal, variables: Parameters<typeof
|
|
84
|
-
|
|
85
|
-
permission: async ({ workspaceId }: Parameters<typeof
|
|
84
|
+
request: async (signal, variables: Parameters<typeof workspaceControllerdelete>[0]) =>
|
|
85
|
+
workspaceControllerdelete(variables, { signal }),
|
|
86
|
+
permission: async ({ workspaceId }: Parameters<typeof workspaceControllerdelete>[0]) =>
|
|
86
87
|
workspaceClient.deleteWorkspace.isAllowed({ workspaceId }),
|
|
87
88
|
})
|
|
88
89
|
/**
|
|
@@ -90,11 +91,11 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
90
91
|
*/
|
|
91
92
|
pluginInputsInWorkspace = this.query({
|
|
92
93
|
name: 'pluginInputsInWorkspace',
|
|
93
|
-
request: async (signal, variables: Parameters<typeof
|
|
94
|
-
const data = await
|
|
94
|
+
request: async (signal, variables: Parameters<typeof contextgetConsolidatedPluginInputs>[0]) => {
|
|
95
|
+
const data = await contextgetConsolidatedPluginInputs(variables, { signal })
|
|
95
96
|
return data as FixedFullInputContextResponse
|
|
96
97
|
},
|
|
97
|
-
permission: async ({ workspaceId, stackVersionId }: Parameters<typeof
|
|
98
|
+
permission: async ({ workspaceId, stackVersionId }: Parameters<typeof contextgetConsolidatedPluginInputs>[0]) => {
|
|
98
99
|
const canViewContext = await workspaceClient.listConsolidatedWorkspaceContext.isAllowed({ $type: 'plugin', workspaceId, stackVersionId })
|
|
99
100
|
const canGetConnectionInterfaceTypes = await contentClient.connectionInterfaceTypes.isAllowed()
|
|
100
101
|
const canGetPluginVersions = await contentClient.pluginVersionsByIds.isAllowed({})
|
|
@@ -106,11 +107,11 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
106
107
|
*/
|
|
107
108
|
pluginInputsAccount = this.query({
|
|
108
109
|
name: 'pluginInputsAccount',
|
|
109
|
-
request: async (signal, variables: Parameters<typeof
|
|
110
|
-
const data = await
|
|
110
|
+
request: async (signal, variables: Parameters<typeof contextgetAccountPluginInputs>[0]) => {
|
|
111
|
+
const data = await contextgetAccountPluginInputs(variables, { signal })
|
|
111
112
|
return data as FixedFullInputContextResponse
|
|
112
113
|
},
|
|
113
|
-
permission: async ({ stackVersionId }: Parameters<typeof
|
|
114
|
+
permission: async ({ stackVersionId }: Parameters<typeof contextgetAccountPluginInputs>[0]) => {
|
|
114
115
|
const canViewContext = await workspaceClient.listConsolidatedContext.isAllowed({ $type: 'plugin', stackVersionId })
|
|
115
116
|
const canGetConnectionInterfaceTypes = await contentClient.connectionInterfaceTypes.isAllowed()
|
|
116
117
|
const canGetPluginVersions = await contentClient.pluginVersionsByIds.isAllowed({})
|
|
@@ -122,9 +123,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
122
123
|
*/
|
|
123
124
|
updateInputContextPluginWorkspace = this.mutation({
|
|
124
125
|
name: 'updateInputContextPluginWorkspace',
|
|
125
|
-
request: async (signal, variables: Parameters<typeof
|
|
126
|
-
|
|
127
|
-
permission: async ({ stackVersionId, workspaceId, pluginVersionId }: Parameters<typeof
|
|
126
|
+
request: async (signal, variables: Parameters<typeof contextControllerupsertPluginWorkspaceContext>[0]) =>
|
|
127
|
+
contextControllerupsertPluginWorkspaceContext(variables, { signal }),
|
|
128
|
+
permission: async ({ stackVersionId, workspaceId, pluginVersionId }: Parameters<typeof contextControllerupsertPluginWorkspaceContext>[0]) =>
|
|
128
129
|
workspaceClient.saveContextInWorkspace.isAllowed({ $type: 'plugin', workspaceId, stackVersionId, externalId: pluginVersionId }),
|
|
129
130
|
})
|
|
130
131
|
/**
|
|
@@ -132,46 +133,46 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
132
133
|
*/
|
|
133
134
|
updateInputContextPluginAccount = this.mutation({
|
|
134
135
|
name: 'updateInputContextPluginAccount',
|
|
135
|
-
request: async (signal, variables: Parameters<typeof
|
|
136
|
-
|
|
137
|
-
permission: async ({ stackVersionId, pluginVersionId }: Parameters<typeof
|
|
136
|
+
request: async (signal, variables: Parameters<typeof contextControllerupsertPluginAccountContext>[0]) =>
|
|
137
|
+
contextControllerupsertPluginAccountContext(variables, { signal }),
|
|
138
|
+
permission: async ({ stackVersionId, pluginVersionId }: Parameters<typeof contextControllerupsertPluginAccountContext>[0]) =>
|
|
138
139
|
workspaceClient.saveContextInAccount.isAllowed({ $type: 'plugin', stackVersionId, externalId: pluginVersionId }),
|
|
139
140
|
})
|
|
140
141
|
/**
|
|
141
142
|
* Gets links in a shared infra for a given env
|
|
142
143
|
*/
|
|
143
|
-
sharedInfraLinks = this.query(
|
|
144
|
+
sharedInfraLinks = this.query(sharedInfraControllergetApplicationLinks)
|
|
144
145
|
/**
|
|
145
146
|
* Gets links in an application for a given env
|
|
146
147
|
*/
|
|
147
|
-
applicationLinks = this.query(
|
|
148
|
+
applicationLinks = this.query(applicationControllergetApplicationLinks)
|
|
148
149
|
/**
|
|
149
150
|
* Gets applied plugins in shared infra
|
|
150
151
|
*/
|
|
151
|
-
appliedPluginsSharedInfra = this.query(
|
|
152
|
+
appliedPluginsSharedInfra = this.query(sharedInfraControllerV2GetSharedInfraAppliedPlugins)
|
|
152
153
|
/**
|
|
153
154
|
* Gets applied plugins in application
|
|
154
155
|
*/
|
|
155
|
-
appliedPluginsApplication = this.query(
|
|
156
|
+
appliedPluginsApplication = this.query(applicationControllerV2GetApplicationAppliedPlugins)
|
|
156
157
|
/**
|
|
157
158
|
* Gets plugin inputs and connection interface from a plugin in a stack version in workspace
|
|
158
159
|
*/
|
|
159
|
-
pluginInputsWithConnectionInterfaces = this.query(
|
|
160
|
+
pluginInputsWithConnectionInterfaces = this.query(contextgetConsolidatedPluginInputsWithConnectionInterfaces as unknown as ReplaceResult<typeof contextgetConsolidatedPluginInputsWithConnectionInterfaces, FixedPluginForAppCreationV2Response>)
|
|
160
161
|
/**
|
|
161
162
|
* Gets workflows from a given stack and workflow type
|
|
162
163
|
*/
|
|
163
|
-
workflowsByStackIdAndWorkflowType = this.query(
|
|
164
|
+
workflowsByStackIdAndWorkflowType = this.query(workflowWorkspaceControllerlistWorkflowByStackIdAndWorkflowType)
|
|
164
165
|
|
|
165
166
|
/**
|
|
166
167
|
* Gets inputs from an action in a workspace
|
|
167
168
|
*/
|
|
168
169
|
actionInputsInWorkspace = this.query({
|
|
169
170
|
name: 'actionInputsInWorkspace',
|
|
170
|
-
request: async (signal, variables: Parameters<typeof
|
|
171
|
-
const data = await
|
|
171
|
+
request: async (signal, variables: Parameters<typeof contextActionControllergetStackActionInputsInWorkspaceContext>[0]) => {
|
|
172
|
+
const data = await contextActionControllergetStackActionInputsInWorkspaceContext(variables, { signal })
|
|
172
173
|
return data as FixedFullInputContextResponse
|
|
173
174
|
},
|
|
174
|
-
permission: async ({ workspaceId, stackVersionId, actionsVersionId }: Parameters<typeof
|
|
175
|
+
permission: async ({ workspaceId, stackVersionId, actionsVersionId }: Parameters<typeof contextActionControllergetStackActionInputsInWorkspaceContext>[0]) => {
|
|
175
176
|
const canViewContext = await workspaceClient.listConsolidatedWorkspaceContext.isAllowed({ $type: 'action', workspaceId, stackVersionId })
|
|
176
177
|
const canGetActionInput = await contentClient.actionInputs.isAllowed({ actionVersionId: actionsVersionId })
|
|
177
178
|
return canViewContext && canGetActionInput
|
|
@@ -182,11 +183,11 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
182
183
|
*/
|
|
183
184
|
actionInputsAccount = this.query({
|
|
184
185
|
name: 'actionInputsFromStack',
|
|
185
|
-
request: async (signal, variables: Parameters<typeof
|
|
186
|
-
const data = await
|
|
186
|
+
request: async (signal, variables: Parameters<typeof contextActionControllergetStackActionInputsInAccountContext>[0]) => {
|
|
187
|
+
const data = await contextActionControllergetStackActionInputsInAccountContext(variables, { signal })
|
|
187
188
|
return data as FixedFullInputContextResponse
|
|
188
189
|
},
|
|
189
|
-
permission: async ({ stackVersionId, actionsVersionId }: Parameters<typeof
|
|
190
|
+
permission: async ({ stackVersionId, actionsVersionId }: Parameters<typeof contextActionControllergetStackActionInputsInAccountContext>[0]) => {
|
|
190
191
|
const canViewContext = await workspaceClient.listConsolidatedContext.isAllowed({ $type: 'action', stackVersionId })
|
|
191
192
|
const canGetActionInput = await contentClient.actionInputs.isAllowed({ actionVersionId: actionsVersionId })
|
|
192
193
|
return canViewContext && canGetActionInput
|
|
@@ -197,9 +198,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
197
198
|
*/
|
|
198
199
|
updateInputContextActionWorkspace = this.mutation({
|
|
199
200
|
name: 'updateInputContextActionWorkspace',
|
|
200
|
-
request: async (signal, variables: Parameters<typeof
|
|
201
|
-
|
|
202
|
-
permission: async ({ stackVersionId, workspaceId, actionVersionId }: Parameters<typeof
|
|
201
|
+
request: async (signal, variables: Parameters<typeof contextControllerupsertWorkspaceActionsInputContext>[0]) =>
|
|
202
|
+
contextControllerupsertWorkspaceActionsInputContext(variables, { signal }),
|
|
203
|
+
permission: async ({ stackVersionId, workspaceId, actionVersionId }: Parameters<typeof contextControllerupsertWorkspaceActionsInputContext>[0]) =>
|
|
203
204
|
workspaceClient.saveContextInWorkspace.isAllowed({ $type: 'action', workspaceId, stackVersionId, externalId: actionVersionId }),
|
|
204
205
|
})
|
|
205
206
|
/**
|
|
@@ -207,9 +208,9 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
207
208
|
*/
|
|
208
209
|
updateInputContextActionAccount = this.mutation({
|
|
209
210
|
name: 'updateInputContextActionAccount',
|
|
210
|
-
request: async (signal, variables: Parameters<typeof
|
|
211
|
-
|
|
212
|
-
permission: async ({ stackVersionId, actionVersionId }: Parameters<typeof
|
|
211
|
+
request: async (signal, variables: Parameters<typeof contextControllerupsertAccountActionsInputContext>[0]) =>
|
|
212
|
+
contextControllerupsertAccountActionsInputContext(variables, { signal }),
|
|
213
|
+
permission: async ({ stackVersionId, actionVersionId }: Parameters<typeof contextControllerupsertAccountActionsInputContext>[0]) =>
|
|
213
214
|
workspaceClient.saveContextInAccount.isAllowed({ $type: 'action', stackVersionId, externalId: actionVersionId }),
|
|
214
215
|
})
|
|
215
216
|
/**
|
|
@@ -217,8 +218,8 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
217
218
|
*/
|
|
218
219
|
applicationDetails = this.query({
|
|
219
220
|
name: 'applicationDetails',
|
|
220
|
-
request: async (signal, variables: Parameters<typeof
|
|
221
|
-
permission: async ({ applicationId, workspaceId }: Parameters<typeof
|
|
221
|
+
request: async (signal, variables: Parameters<typeof applicationControllergetApplicationDetails>[0]) => applicationControllergetApplicationDetails(variables, { signal }),
|
|
222
|
+
permission: async ({ applicationId, workspaceId }: Parameters<typeof applicationControllergetApplicationDetails>[0]) =>
|
|
222
223
|
workspaceClient.applicationDetail.isAllowed({ applicationId, workspaceId }),
|
|
223
224
|
})
|
|
224
225
|
/**
|
|
@@ -226,8 +227,8 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
226
227
|
*/
|
|
227
228
|
deleteApplication = this.mutation({
|
|
228
229
|
name: 'deleteApplication',
|
|
229
|
-
request: async (signal, variables: Parameters<typeof
|
|
230
|
-
permission: async (variables: Parameters<typeof
|
|
230
|
+
request: async (signal, variables: Parameters<typeof managerRunControllerdeleteApplication>[0]) => managerRunControllerdeleteApplication(variables, { signal }),
|
|
231
|
+
permission: async (variables: Parameters<typeof managerRunControllerdeleteApplication>[0]) =>
|
|
231
232
|
workspaceClient.deleteApplication.isAllowed(variables),
|
|
232
233
|
})
|
|
233
234
|
/**
|
|
@@ -235,8 +236,8 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
235
236
|
*/
|
|
236
237
|
sharedInfraDetails = this.query({
|
|
237
238
|
name: 'sharedInfraDetails',
|
|
238
|
-
request: async (signal, variables: Parameters<typeof
|
|
239
|
-
permission: async ({ sharedInfraId, workspaceId }: Parameters<typeof
|
|
239
|
+
request: async (signal, variables: Parameters<typeof sharedInfraControllergetSharedInfraAppliedPlugins>[0]) => sharedInfraControllergetSharedInfraAppliedPlugins(variables, { signal }),
|
|
240
|
+
permission: async ({ sharedInfraId, workspaceId }: Parameters<typeof sharedInfraControllergetSharedInfraAppliedPlugins>[0]) =>
|
|
240
241
|
workspaceClient.infraDetail.isAllowed({ sharedInfraId, workspaceId }),
|
|
241
242
|
})
|
|
242
243
|
/**
|
|
@@ -244,10 +245,14 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
|
|
|
244
245
|
*/
|
|
245
246
|
deleteInfra = this.mutation({
|
|
246
247
|
name: 'deleteInfra',
|
|
247
|
-
request: async (signal, variables: Parameters<typeof
|
|
248
|
-
permission: async (variables: Parameters<typeof
|
|
248
|
+
request: async (signal, variables: Parameters<typeof managerRunControllerdeleteSharedInfra>[0]) => managerRunControllerdeleteSharedInfra(variables, { signal }),
|
|
249
|
+
permission: async (variables: Parameters<typeof managerRunControllerdeleteSharedInfra>[0]) =>
|
|
249
250
|
workspaceClient.deleteInfra.isAllowed(variables),
|
|
250
251
|
})
|
|
252
|
+
/**
|
|
253
|
+
* Updates Stacks To Latest Version By Workspace
|
|
254
|
+
*/
|
|
255
|
+
updateStacksToLatestVersionByWorkspace = this.mutation(workspaceStackControllerrefreshStacksInWorkspace)
|
|
251
256
|
}
|
|
252
257
|
|
|
253
258
|
export const workspaceManagerClient = new WorkspaceManagerClient()
|