@stack-spot/portal-network 0.7.0 → 0.9.0-beta.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 +19 -0
- package/dist/api/secrets.d.ts +25 -0
- package/dist/api/secrets.d.ts.map +1 -1
- package/dist/api/secrets.js +22 -0
- package/dist/api/secrets.js.map +1 -1
- package/dist/client/account.d.ts +64 -0
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +168 -1
- package/dist/client/account.js.map +1 -1
- package/dist/client/secrets.d.ts +6 -0
- package/dist/client/secrets.d.ts.map +1 -1
- package/dist/client/secrets.js +10 -1
- package/dist/client/secrets.js.map +1 -1
- package/dist/client/types.d.ts +38 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/workspace.d.ts +138 -0
- package/dist/client/workspace.d.ts.map +1 -1
- package/dist/client/workspace.js +163 -1
- package/dist/client/workspace.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/secrets.ts +63 -0
- package/src/client/account.ts +108 -3
- package/src/client/secrets.ts +7 -3
- package/src/client/types.ts +44 -0
- package/src/client/workspace.ts +107 -1
- package/src/index.ts +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatusResponse } from '../api/account'
|
|
2
|
+
|
|
3
|
+
interface BaseSMCStatus {
|
|
4
|
+
/**
|
|
5
|
+
* Indicates the current status of the SCM credential.
|
|
6
|
+
* - 'valid': the SCM credential is valid.
|
|
7
|
+
* - 'missing-account': the SCM credential is not configured at the account level.
|
|
8
|
+
* - 'missing-user': the SCM credential is configured at the account level, but the SCM access is not configured for the user.
|
|
9
|
+
*/
|
|
10
|
+
status: 'missing-account' | 'missing-user' | 'valid',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ValidSCMStatus extends BaseSMCStatus, AccountScmStatusResponse {
|
|
14
|
+
status: 'valid',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface InvalidSCMStatus extends BaseSMCStatus {
|
|
18
|
+
status: 'missing-account' | 'missing-user',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type SCMStatus = InvalidSCMStatus | ValidSCMStatus
|
|
22
|
+
|
|
23
|
+
interface SCMAuthPATValue {
|
|
24
|
+
user: string,
|
|
25
|
+
pass: string,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SCMAuthGitValue {
|
|
29
|
+
appId: string,
|
|
30
|
+
installationId: string,
|
|
31
|
+
privateKey: string,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CreateSCMRequest {
|
|
35
|
+
accountScmInfoSaveRequest: AccountScmInfoSaveRequest & {
|
|
36
|
+
value: SCMAuthGitValue | SCMAuthPATValue,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface UpdateSCMRequest {
|
|
41
|
+
accountScmInfoUpdateRequest: AccountScmInfoUpdateRequest & {
|
|
42
|
+
value?: SCMAuthGitValue | SCMAuthPATValue,
|
|
43
|
+
},
|
|
44
|
+
}
|
package/src/client/workspace.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
save5 as createEmbeddedLink,
|
|
4
|
+
defaults,
|
|
5
|
+
delete6 as deleteApplicationEmbeddedLinks,
|
|
6
|
+
deleteConnectionInterfaceAttributesFromEnvironment, deleteConnectionInterfaceFromAllEnvironments,
|
|
7
|
+
delete4 as deleteEmbeddedLink,
|
|
8
|
+
getEmbeddedLinks1 as getAllApplicationEmbeddedLinks,
|
|
9
|
+
getEmbeddedLink1 as getApplicationEmbeddedLinks,
|
|
10
|
+
getConnectionInterface, getConnectionInterfaces,
|
|
11
|
+
getEmbeddedLink, getEmbeddedLinks, getEnvironment, getEnvironments,
|
|
12
|
+
save8 as saveApplicationEmbeddedLinks,
|
|
13
|
+
save9 as saveEnvironment,
|
|
14
|
+
upsertBatch2 as updateAllApplicationEmbeddedLinks,
|
|
15
|
+
upsertBatch1 as updateAllEmbeddedLink,
|
|
16
|
+
update8 as updateApplicationEmbeddedLinks,
|
|
17
|
+
updateConnectionInterfaceAttributes,
|
|
18
|
+
updateConnectionInterfaceVisibility,
|
|
19
|
+
update5 as updateEmbeddedLink,
|
|
4
20
|
update9 as updateEnvironment,
|
|
5
21
|
} from '../api/workspace'
|
|
6
22
|
import apis from '../apis.json'
|
|
@@ -17,6 +33,36 @@ class WorkspaceClient extends ReactQueryNetworkClient {
|
|
|
17
33
|
protected buildStackSpotError(error: HttpError): StackspotAPIError {
|
|
18
34
|
return new DefaultAPIError(error.data, error.status, workspaceDictionary, error.headers)
|
|
19
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets all connection interfaces from a workspace
|
|
39
|
+
*/
|
|
40
|
+
allConnectionInterfaces = this.query(getConnectionInterfaces)
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Gets a connection interface from a workspace
|
|
44
|
+
*/
|
|
45
|
+
connectionInterface = this.query(getConnectionInterface)
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Updates the visibility of a connection interface
|
|
49
|
+
*/
|
|
50
|
+
updateConnectionInterfaceVisibility = this.mutation(updateConnectionInterfaceVisibility)
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Removes a connection interface
|
|
54
|
+
*/
|
|
55
|
+
deleteConnectionInterface = this.mutation(deleteConnectionInterfaceFromAllEnvironments)
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Removes connection interface attributes by environment
|
|
59
|
+
*/
|
|
60
|
+
deleteConnectionInterfaceAttributesFromEnvironment = this.mutation(deleteConnectionInterfaceAttributesFromEnvironment)
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Updates the attributes of a connection interface
|
|
64
|
+
*/
|
|
65
|
+
updateConnectionInterfaceAttributes = this.mutation(updateConnectionInterfaceAttributes)
|
|
20
66
|
|
|
21
67
|
/**
|
|
22
68
|
* Gets all environments
|
|
@@ -38,6 +84,66 @@ class WorkspaceClient extends ReactQueryNetworkClient {
|
|
|
38
84
|
*/
|
|
39
85
|
updateEnvironment = this.mutation(updateEnvironment)
|
|
40
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Gets embedded link by id
|
|
89
|
+
*/
|
|
90
|
+
embeddedLinkInWorkspace = this.query(getEmbeddedLink)
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Gets all embedded links from a workspace
|
|
94
|
+
*/
|
|
95
|
+
allEmbeddedLinksInWorkspace = this.query(getEmbeddedLinks)
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Creates an embedded link in a workspace
|
|
99
|
+
*/
|
|
100
|
+
createEmbeddedLinkInWorkspace = this.mutation(createEmbeddedLink)
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Deletes an embedded link from a workspace
|
|
104
|
+
*/
|
|
105
|
+
deleteEmbeddedLinkFromWorkspace = this.mutation(deleteEmbeddedLink)
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Updates an embedded link from a workspace
|
|
109
|
+
*/
|
|
110
|
+
updateEmbeddedLinkInWorkspace = this.mutation(updateEmbeddedLink)
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Updates all embedded links from a workspace
|
|
114
|
+
*/
|
|
115
|
+
updateAllEmbeddedLinksInWorkspace = this.mutation(updateAllEmbeddedLink)
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets an embedded link from an application
|
|
119
|
+
*/
|
|
120
|
+
embeddedLinkInApplication = this.query(getApplicationEmbeddedLinks)
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Gets all embedded links from an application
|
|
124
|
+
*/
|
|
125
|
+
allEmbeddedLinksInApplication = this.query(getAllApplicationEmbeddedLinks)
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Creates an embedded link in an application
|
|
129
|
+
*/
|
|
130
|
+
createEmbeddedLinkInApplication = this.mutation(saveApplicationEmbeddedLinks)
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Deletes an embedded link from an application
|
|
134
|
+
*/
|
|
135
|
+
deleteEmbeddedLinkFromApplication = this.mutation(deleteApplicationEmbeddedLinks)
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Updates an embedded link in an application
|
|
139
|
+
*/
|
|
140
|
+
updateEmbeddedLinkInApplication = this.mutation(updateApplicationEmbeddedLinks)
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Updates all embedded links in an application
|
|
144
|
+
*/
|
|
145
|
+
updateAllEmbeddedLinksInApplication = this.mutation(updateAllApplicationEmbeddedLinks)
|
|
146
|
+
|
|
41
147
|
}
|
|
42
148
|
|
|
43
149
|
export const workspaceClient = new WorkspaceClient()
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { accountClient } from './client/account'
|
|
2
2
|
export { secretsClient } from './client/secrets'
|
|
3
|
+
export * from './client/types'
|
|
3
4
|
export { workspaceClient } from './client/workspace'
|
|
4
5
|
export { DefaultAPIError } from './error/DefaultAPIError'
|
|
5
6
|
export { StackspotAPIError } from './error/StackspotAPIError'
|