shoal-web-sdk 0.0.20 → 0.0.22
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/dist/sdk/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, Options as Options2, TDataShape } from './client';
|
|
2
|
-
import type { GetServiceHealthData, GetServiceHealthResponses,
|
|
2
|
+
import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -17,10 +17,6 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
17
17
|
* Get service health.
|
|
18
18
|
*/
|
|
19
19
|
export declare const getServiceHealth: <ThrowOnError extends boolean = false>(options?: Options<GetServiceHealthData, ThrowOnError>) => import("./client").RequestResult<GetServiceHealthResponses, unknown, ThrowOnError, "fields">;
|
|
20
|
-
/**
|
|
21
|
-
* Registers an account through kinde's webhook.
|
|
22
|
-
*/
|
|
23
|
-
export declare const registerAccount: <ThrowOnError extends boolean = false>(options: Options<RegisterAccountData, ThrowOnError>) => import("./client").RequestResult<RegisterAccountResponses, RegisterAccountErrors, ThrowOnError, "fields">;
|
|
24
20
|
/**
|
|
25
21
|
* This will submit a password reset request requiring the user to reset their password on next sign in.
|
|
26
22
|
*/
|
|
@@ -29,3 +25,27 @@ export declare const requestAccountPasswordReset: <ThrowOnError extends boolean
|
|
|
29
25
|
* Fetch the users profile.
|
|
30
26
|
*/
|
|
31
27
|
export declare const getUserProfile: <ThrowOnError extends boolean = false>(options?: Options<GetUserProfileData, ThrowOnError>) => import("./client").RequestResult<GetUserProfileResponses, GetUserProfileErrors, ThrowOnError, "fields">;
|
|
28
|
+
/**
|
|
29
|
+
* Create a space.
|
|
30
|
+
*/
|
|
31
|
+
export declare const createSpace: <ThrowOnError extends boolean = false>(options?: Options<CreateSpaceData, ThrowOnError>) => import("./client").RequestResult<CreateSpaceResponses, CreateSpaceErrors, ThrowOnError, "fields">;
|
|
32
|
+
/**
|
|
33
|
+
* The space overview.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getSpaceOverview: <ThrowOnError extends boolean = false>(options: Options<GetSpaceOverviewData, ThrowOnError>) => import("./client").RequestResult<GetSpaceOverviewResponses, GetSpaceOverviewErrors, ThrowOnError, "fields">;
|
|
36
|
+
/**
|
|
37
|
+
* Create a project inside a space.
|
|
38
|
+
*/
|
|
39
|
+
export declare const createProject: <ThrowOnError extends boolean = false>(options: Options<CreateProjectData, ThrowOnError>) => import("./client").RequestResult<CreateProjectResponses, CreateProjectErrors, ThrowOnError, "fields">;
|
|
40
|
+
/**
|
|
41
|
+
* Get the project overview.
|
|
42
|
+
*/
|
|
43
|
+
export declare const getProjectOverview: <ThrowOnError extends boolean = false>(options: Options<GetProjectOverviewData, ThrowOnError>) => import("./client").RequestResult<GetProjectOverviewResponses, GetProjectOverviewErrors, ThrowOnError, "fields">;
|
|
44
|
+
/**
|
|
45
|
+
* Create an environment inside a project.
|
|
46
|
+
*/
|
|
47
|
+
export declare const createEnvironment: <ThrowOnError extends boolean = false>(options: Options<CreateEnvironmentData, ThrowOnError>) => import("./client").RequestResult<CreateEnvironmentResponses, CreateEnvironmentErrors, ThrowOnError, "fields">;
|
|
48
|
+
/**
|
|
49
|
+
* Get the environment overview.
|
|
50
|
+
*/
|
|
51
|
+
export declare const getEnvironmentOverview: <ThrowOnError extends boolean = false>(options: Options<GetEnvironmentOverviewData, ThrowOnError>) => import("./client").RequestResult<GetEnvironmentOverviewResponses, GetEnvironmentOverviewErrors, ThrowOnError, "fields">;
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -16,52 +16,134 @@ export const getServiceHealth = (options) => {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* This will submit a password reset request requiring the user to reset their password on next sign in.
|
|
20
|
+
*/
|
|
21
|
+
export const requestAccountPasswordReset = (options) => {
|
|
22
|
+
return (options?.client ?? client).patch({
|
|
23
|
+
security: [
|
|
24
|
+
{
|
|
25
|
+
scheme: 'bearer',
|
|
26
|
+
type: 'http'
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
url: '/auth/account/request-password-reset',
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Fetch the users profile.
|
|
20
35
|
*/
|
|
21
|
-
export const
|
|
36
|
+
export const getUserProfile = (options) => {
|
|
37
|
+
return (options?.client ?? client).get({
|
|
38
|
+
security: [
|
|
39
|
+
{
|
|
40
|
+
scheme: 'bearer',
|
|
41
|
+
type: 'http'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
url: '/auth/account/profile',
|
|
45
|
+
...options
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Create a space.
|
|
50
|
+
*/
|
|
51
|
+
export const createSpace = (options) => {
|
|
52
|
+
return (options?.client ?? client).post({
|
|
53
|
+
security: [
|
|
54
|
+
{
|
|
55
|
+
scheme: 'bearer',
|
|
56
|
+
type: 'http'
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
url: '/auth/spaces/create',
|
|
60
|
+
...options,
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/json',
|
|
63
|
+
...options?.headers
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The space overview.
|
|
69
|
+
*/
|
|
70
|
+
export const getSpaceOverview = (options) => {
|
|
71
|
+
return (options.client ?? client).get({
|
|
72
|
+
security: [
|
|
73
|
+
{
|
|
74
|
+
scheme: 'bearer',
|
|
75
|
+
type: 'http'
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
url: '/auth/spaces/{spaceHandle}/overview',
|
|
79
|
+
...options
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Create a project inside a space.
|
|
84
|
+
*/
|
|
85
|
+
export const createProject = (options) => {
|
|
22
86
|
return (options.client ?? client).post({
|
|
23
|
-
bodySerializer: null,
|
|
24
87
|
security: [
|
|
25
88
|
{
|
|
26
89
|
scheme: 'bearer',
|
|
27
90
|
type: 'http'
|
|
28
91
|
}
|
|
29
92
|
],
|
|
30
|
-
url: '/
|
|
93
|
+
url: '/auth/spaces/{spaceHandle}/projets/create',
|
|
31
94
|
...options,
|
|
32
95
|
headers: {
|
|
33
|
-
'Content-Type': '
|
|
96
|
+
'Content-Type': 'application/json',
|
|
34
97
|
...options.headers
|
|
35
98
|
}
|
|
36
99
|
});
|
|
37
100
|
};
|
|
38
101
|
/**
|
|
39
|
-
*
|
|
102
|
+
* Get the project overview.
|
|
40
103
|
*/
|
|
41
|
-
export const
|
|
42
|
-
return (options
|
|
104
|
+
export const getProjectOverview = (options) => {
|
|
105
|
+
return (options.client ?? client).get({
|
|
43
106
|
security: [
|
|
44
107
|
{
|
|
45
108
|
scheme: 'bearer',
|
|
46
109
|
type: 'http'
|
|
47
110
|
}
|
|
48
111
|
],
|
|
49
|
-
url: '/auth/
|
|
112
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview',
|
|
50
113
|
...options
|
|
51
114
|
});
|
|
52
115
|
};
|
|
53
116
|
/**
|
|
54
|
-
*
|
|
117
|
+
* Create an environment inside a project.
|
|
55
118
|
*/
|
|
56
|
-
export const
|
|
57
|
-
return (options
|
|
119
|
+
export const createEnvironment = (options) => {
|
|
120
|
+
return (options.client ?? client).post({
|
|
58
121
|
security: [
|
|
59
122
|
{
|
|
60
123
|
scheme: 'bearer',
|
|
61
124
|
type: 'http'
|
|
62
125
|
}
|
|
63
126
|
],
|
|
64
|
-
url: '/auth/
|
|
127
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/create',
|
|
128
|
+
...options,
|
|
129
|
+
headers: {
|
|
130
|
+
'Content-Type': 'application/json',
|
|
131
|
+
...options.headers
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Get the environment overview.
|
|
137
|
+
*/
|
|
138
|
+
export const getEnvironmentOverview = (options) => {
|
|
139
|
+
return (options.client ?? client).get({
|
|
140
|
+
security: [
|
|
141
|
+
{
|
|
142
|
+
scheme: 'bearer',
|
|
143
|
+
type: 'http'
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/{environmentHandle}/overview',
|
|
65
147
|
...options
|
|
66
148
|
});
|
|
67
149
|
};
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type ClientOptions = {
|
|
2
|
-
baseUrl: 'http://localhost:8080/core-service' | (string & {});
|
|
2
|
+
baseUrl: 'http://localhost:8080/core-service' | 'https://shoal-dev.platform48.com/core-service' | (string & {});
|
|
3
3
|
};
|
|
4
4
|
export type HealthResponse = {
|
|
5
5
|
status: string;
|
|
@@ -8,21 +8,73 @@ export type ErrorResponse = {
|
|
|
8
8
|
message: string;
|
|
9
9
|
internalCode: unknown;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type CreateProject = {
|
|
12
|
+
name: string;
|
|
13
|
+
handle: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ProjectOverview = {
|
|
17
|
+
id: string;
|
|
18
|
+
orgCode: string;
|
|
19
|
+
name: string;
|
|
20
|
+
handle: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
environments: Array<EnvironmentOverview>;
|
|
25
|
+
};
|
|
26
|
+
export type CreateSpace = {
|
|
27
|
+
name: string;
|
|
28
|
+
handle: string;
|
|
29
|
+
senderName: string;
|
|
30
|
+
senderEmail: string;
|
|
31
|
+
billingEmail: string;
|
|
32
|
+
billingPlanCode: string;
|
|
33
|
+
};
|
|
34
|
+
export type CreateEnvironment = {
|
|
35
|
+
name: string;
|
|
36
|
+
handle: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
};
|
|
39
|
+
export type SpaceOverview = {
|
|
12
40
|
id: string;
|
|
13
|
-
|
|
41
|
+
name: string;
|
|
42
|
+
handle: string;
|
|
43
|
+
projects: Array<ProjectOverview>;
|
|
44
|
+
};
|
|
45
|
+
export type EnvironmentOverview = {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
versions: unknown;
|
|
52
|
+
};
|
|
53
|
+
export type AccountProfile = {
|
|
14
54
|
preferredEmail: string;
|
|
15
55
|
phone: string;
|
|
16
56
|
username: string;
|
|
17
57
|
firstName: string;
|
|
18
58
|
lastName: string;
|
|
19
|
-
isSuspended:
|
|
59
|
+
isSuspended: boolean;
|
|
20
60
|
picture: string;
|
|
21
61
|
totalSignIns: unknown;
|
|
22
62
|
failedSignIns: unknown;
|
|
23
63
|
lastSignedIn: string;
|
|
24
|
-
|
|
64
|
+
createdOn: string;
|
|
25
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* A project name. This must be unique to a space.
|
|
68
|
+
*/
|
|
69
|
+
export type ProjectHandle = string;
|
|
70
|
+
/**
|
|
71
|
+
* An environment name (e.g., dev, prod, foo-bar). This must be unique to a project.
|
|
72
|
+
*/
|
|
73
|
+
export type EnvironmentHandle = string;
|
|
74
|
+
/**
|
|
75
|
+
* The space handle. This must be globally unique.
|
|
76
|
+
*/
|
|
77
|
+
export type SpaceHandle = string;
|
|
26
78
|
export type GetServiceHealthData = {
|
|
27
79
|
body?: never;
|
|
28
80
|
path?: never;
|
|
@@ -36,32 +88,6 @@ export type GetServiceHealthResponses = {
|
|
|
36
88
|
200: HealthResponse;
|
|
37
89
|
};
|
|
38
90
|
export type GetServiceHealthResponse = GetServiceHealthResponses[keyof GetServiceHealthResponses];
|
|
39
|
-
export type RegisterAccountData = {
|
|
40
|
-
/**
|
|
41
|
-
* Kinde account creation callback.
|
|
42
|
-
*/
|
|
43
|
-
body: string;
|
|
44
|
-
path?: never;
|
|
45
|
-
query?: never;
|
|
46
|
-
url: '/register';
|
|
47
|
-
};
|
|
48
|
-
export type RegisterAccountErrors = {
|
|
49
|
-
/**
|
|
50
|
-
* Invalid credentials.
|
|
51
|
-
*/
|
|
52
|
-
403: ErrorResponse;
|
|
53
|
-
/**
|
|
54
|
-
* If parsing json fails, or an unknown error occurs.
|
|
55
|
-
*/
|
|
56
|
-
500: ErrorResponse;
|
|
57
|
-
};
|
|
58
|
-
export type RegisterAccountError = RegisterAccountErrors[keyof RegisterAccountErrors];
|
|
59
|
-
export type RegisterAccountResponses = {
|
|
60
|
-
/**
|
|
61
|
-
* An account is registered in our system.
|
|
62
|
-
*/
|
|
63
|
-
201: unknown;
|
|
64
|
-
};
|
|
65
91
|
export type RequestAccountPasswordResetData = {
|
|
66
92
|
body?: never;
|
|
67
93
|
path?: never;
|
|
@@ -97,7 +123,7 @@ export type GetUserProfileErrors = {
|
|
|
97
123
|
*/
|
|
98
124
|
403: ErrorResponse;
|
|
99
125
|
/**
|
|
100
|
-
*
|
|
126
|
+
* Related content not found.
|
|
101
127
|
*/
|
|
102
128
|
404: ErrorResponse;
|
|
103
129
|
/**
|
|
@@ -113,3 +139,235 @@ export type GetUserProfileResponses = {
|
|
|
113
139
|
200: AccountProfile;
|
|
114
140
|
};
|
|
115
141
|
export type GetUserProfileResponse = GetUserProfileResponses[keyof GetUserProfileResponses];
|
|
142
|
+
export type CreateSpaceData = {
|
|
143
|
+
body?: CreateSpace;
|
|
144
|
+
path?: never;
|
|
145
|
+
query?: never;
|
|
146
|
+
url: '/auth/spaces/create';
|
|
147
|
+
};
|
|
148
|
+
export type CreateSpaceErrors = {
|
|
149
|
+
/**
|
|
150
|
+
* Unauthorised user.
|
|
151
|
+
*/
|
|
152
|
+
401: ErrorResponse;
|
|
153
|
+
/**
|
|
154
|
+
* Invalid credentials.
|
|
155
|
+
*/
|
|
156
|
+
403: ErrorResponse;
|
|
157
|
+
/**
|
|
158
|
+
* Related content not found.
|
|
159
|
+
*/
|
|
160
|
+
404: ErrorResponse;
|
|
161
|
+
/**
|
|
162
|
+
* Unexpected error.
|
|
163
|
+
*/
|
|
164
|
+
500: ErrorResponse;
|
|
165
|
+
};
|
|
166
|
+
export type CreateSpaceError = CreateSpaceErrors[keyof CreateSpaceErrors];
|
|
167
|
+
export type CreateSpaceResponses = {
|
|
168
|
+
/**
|
|
169
|
+
* Successfully created a space.
|
|
170
|
+
*/
|
|
171
|
+
201: SpaceOverview;
|
|
172
|
+
};
|
|
173
|
+
export type CreateSpaceResponse = CreateSpaceResponses[keyof CreateSpaceResponses];
|
|
174
|
+
export type GetSpaceOverviewData = {
|
|
175
|
+
body?: never;
|
|
176
|
+
path: {
|
|
177
|
+
/**
|
|
178
|
+
* The space handle. This must be globally unique.
|
|
179
|
+
*/
|
|
180
|
+
spaceHandle: string;
|
|
181
|
+
};
|
|
182
|
+
query?: never;
|
|
183
|
+
url: '/auth/spaces/{spaceHandle}/overview';
|
|
184
|
+
};
|
|
185
|
+
export type GetSpaceOverviewErrors = {
|
|
186
|
+
/**
|
|
187
|
+
* Unauthorised user.
|
|
188
|
+
*/
|
|
189
|
+
401: ErrorResponse;
|
|
190
|
+
/**
|
|
191
|
+
* Invalid credentials.
|
|
192
|
+
*/
|
|
193
|
+
403: ErrorResponse;
|
|
194
|
+
/**
|
|
195
|
+
* Related content not found.
|
|
196
|
+
*/
|
|
197
|
+
404: ErrorResponse;
|
|
198
|
+
/**
|
|
199
|
+
* Unexpected error.
|
|
200
|
+
*/
|
|
201
|
+
500: ErrorResponse;
|
|
202
|
+
};
|
|
203
|
+
export type GetSpaceOverviewError = GetSpaceOverviewErrors[keyof GetSpaceOverviewErrors];
|
|
204
|
+
export type GetSpaceOverviewResponses = {
|
|
205
|
+
/**
|
|
206
|
+
* A summary of the users space they are in.
|
|
207
|
+
*/
|
|
208
|
+
200: unknown;
|
|
209
|
+
};
|
|
210
|
+
export type CreateProjectData = {
|
|
211
|
+
body?: CreateProject;
|
|
212
|
+
path: {
|
|
213
|
+
/**
|
|
214
|
+
* The space handle. This must be globally unique.
|
|
215
|
+
*/
|
|
216
|
+
spaceHandle: string;
|
|
217
|
+
};
|
|
218
|
+
query?: never;
|
|
219
|
+
url: '/auth/spaces/{spaceHandle}/projets/create';
|
|
220
|
+
};
|
|
221
|
+
export type CreateProjectErrors = {
|
|
222
|
+
/**
|
|
223
|
+
* Unauthorised user.
|
|
224
|
+
*/
|
|
225
|
+
401: ErrorResponse;
|
|
226
|
+
/**
|
|
227
|
+
* Invalid credentials.
|
|
228
|
+
*/
|
|
229
|
+
403: ErrorResponse;
|
|
230
|
+
/**
|
|
231
|
+
* Related content not found.
|
|
232
|
+
*/
|
|
233
|
+
404: ErrorResponse;
|
|
234
|
+
/**
|
|
235
|
+
* Unexpected error.
|
|
236
|
+
*/
|
|
237
|
+
500: ErrorResponse;
|
|
238
|
+
};
|
|
239
|
+
export type CreateProjectError = CreateProjectErrors[keyof CreateProjectErrors];
|
|
240
|
+
export type CreateProjectResponses = {
|
|
241
|
+
/**
|
|
242
|
+
* Successfully created project inside a space.
|
|
243
|
+
*/
|
|
244
|
+
201: ProjectOverview;
|
|
245
|
+
};
|
|
246
|
+
export type CreateProjectResponse = CreateProjectResponses[keyof CreateProjectResponses];
|
|
247
|
+
export type GetProjectOverviewData = {
|
|
248
|
+
body?: never;
|
|
249
|
+
path: {
|
|
250
|
+
/**
|
|
251
|
+
* The space handle. This must be globally unique.
|
|
252
|
+
*/
|
|
253
|
+
spaceHandle: string;
|
|
254
|
+
/**
|
|
255
|
+
* A project name. This must be unique to a space.
|
|
256
|
+
*/
|
|
257
|
+
projectHandle: string;
|
|
258
|
+
};
|
|
259
|
+
query?: never;
|
|
260
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview';
|
|
261
|
+
};
|
|
262
|
+
export type GetProjectOverviewErrors = {
|
|
263
|
+
/**
|
|
264
|
+
* Unauthorised user.
|
|
265
|
+
*/
|
|
266
|
+
401: ErrorResponse;
|
|
267
|
+
/**
|
|
268
|
+
* Invalid credentials.
|
|
269
|
+
*/
|
|
270
|
+
403: ErrorResponse;
|
|
271
|
+
/**
|
|
272
|
+
* Related content not found.
|
|
273
|
+
*/
|
|
274
|
+
404: ErrorResponse;
|
|
275
|
+
/**
|
|
276
|
+
* Unexpected error.
|
|
277
|
+
*/
|
|
278
|
+
500: ErrorResponse;
|
|
279
|
+
};
|
|
280
|
+
export type GetProjectOverviewError = GetProjectOverviewErrors[keyof GetProjectOverviewErrors];
|
|
281
|
+
export type GetProjectOverviewResponses = {
|
|
282
|
+
/**
|
|
283
|
+
* Project overview.
|
|
284
|
+
*/
|
|
285
|
+
200: ProjectOverview;
|
|
286
|
+
};
|
|
287
|
+
export type GetProjectOverviewResponse = GetProjectOverviewResponses[keyof GetProjectOverviewResponses];
|
|
288
|
+
export type CreateEnvironmentData = {
|
|
289
|
+
body?: CreateEnvironment;
|
|
290
|
+
path: {
|
|
291
|
+
/**
|
|
292
|
+
* The space handle. This must be globally unique.
|
|
293
|
+
*/
|
|
294
|
+
spaceHandle: string;
|
|
295
|
+
/**
|
|
296
|
+
* A project name. This must be unique to a space.
|
|
297
|
+
*/
|
|
298
|
+
projectHandle: string;
|
|
299
|
+
};
|
|
300
|
+
query?: never;
|
|
301
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/create';
|
|
302
|
+
};
|
|
303
|
+
export type CreateEnvironmentErrors = {
|
|
304
|
+
/**
|
|
305
|
+
* Unauthorised user.
|
|
306
|
+
*/
|
|
307
|
+
401: ErrorResponse;
|
|
308
|
+
/**
|
|
309
|
+
* Invalid credentials.
|
|
310
|
+
*/
|
|
311
|
+
403: ErrorResponse;
|
|
312
|
+
/**
|
|
313
|
+
* Related content not found.
|
|
314
|
+
*/
|
|
315
|
+
404: ErrorResponse;
|
|
316
|
+
/**
|
|
317
|
+
* Unexpected error.
|
|
318
|
+
*/
|
|
319
|
+
500: ErrorResponse;
|
|
320
|
+
};
|
|
321
|
+
export type CreateEnvironmentError = CreateEnvironmentErrors[keyof CreateEnvironmentErrors];
|
|
322
|
+
export type CreateEnvironmentResponses = {
|
|
323
|
+
/**
|
|
324
|
+
* Successfully created an environment inside a project.
|
|
325
|
+
*/
|
|
326
|
+
201: EnvironmentOverview;
|
|
327
|
+
};
|
|
328
|
+
export type CreateEnvironmentResponse = CreateEnvironmentResponses[keyof CreateEnvironmentResponses];
|
|
329
|
+
export type GetEnvironmentOverviewData = {
|
|
330
|
+
body?: never;
|
|
331
|
+
path: {
|
|
332
|
+
/**
|
|
333
|
+
* The space handle. This must be globally unique.
|
|
334
|
+
*/
|
|
335
|
+
spaceHandle: string;
|
|
336
|
+
/**
|
|
337
|
+
* A project name. This must be unique to a space.
|
|
338
|
+
*/
|
|
339
|
+
projectHandle: string;
|
|
340
|
+
/**
|
|
341
|
+
* An environment name (e.g., dev, prod, foo-bar). This must be unique to a project.
|
|
342
|
+
*/
|
|
343
|
+
environmentHandle: string;
|
|
344
|
+
};
|
|
345
|
+
query?: never;
|
|
346
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/{environmentHandle}/overview';
|
|
347
|
+
};
|
|
348
|
+
export type GetEnvironmentOverviewErrors = {
|
|
349
|
+
/**
|
|
350
|
+
* Unauthorised user.
|
|
351
|
+
*/
|
|
352
|
+
401: ErrorResponse;
|
|
353
|
+
/**
|
|
354
|
+
* Invalid credentials.
|
|
355
|
+
*/
|
|
356
|
+
403: ErrorResponse;
|
|
357
|
+
/**
|
|
358
|
+
* Related content not found.
|
|
359
|
+
*/
|
|
360
|
+
404: ErrorResponse;
|
|
361
|
+
/**
|
|
362
|
+
* Unexpected error.
|
|
363
|
+
*/
|
|
364
|
+
500: ErrorResponse;
|
|
365
|
+
};
|
|
366
|
+
export type GetEnvironmentOverviewError = GetEnvironmentOverviewErrors[keyof GetEnvironmentOverviewErrors];
|
|
367
|
+
export type GetEnvironmentOverviewResponses = {
|
|
368
|
+
/**
|
|
369
|
+
* Environment overview.
|
|
370
|
+
*/
|
|
371
|
+
200: EnvironmentOverview;
|
|
372
|
+
};
|
|
373
|
+
export type GetEnvironmentOverviewResponse = GetEnvironmentOverviewResponses[keyof GetEnvironmentOverviewResponses];
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
|
-
import { GetServiceHealthData,
|
|
2
|
+
import { GetServiceHealthData, RequestAccountPasswordResetData, GetUserProfileData, CreateSpaceData, GetSpaceOverviewData, CreateProjectData, GetProjectOverviewData, CreateEnvironmentData, GetEnvironmentOverviewData } from "../../sdk/types.gen";
|
|
3
3
|
export declare const useGetServiceHealth: (options?: Omit<GetServiceHealthData, "url"> & {
|
|
4
4
|
enabled?: boolean;
|
|
5
5
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").HealthResponse | undefined, Error>;
|
|
6
|
-
export declare const useRegisterAccount: (config?: {
|
|
7
|
-
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
8
|
-
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
9
|
-
retry?: boolean;
|
|
10
|
-
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<RegisterAccountData, "url">, unknown>;
|
|
11
6
|
export declare const useRequestAccountPasswordReset: (config?: {
|
|
12
7
|
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
13
8
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
@@ -16,3 +11,27 @@ export declare const useRequestAccountPasswordReset: (config?: {
|
|
|
16
11
|
export declare const useGetUserProfile: (options?: Omit<GetUserProfileData, "url"> & {
|
|
17
12
|
enabled?: boolean;
|
|
18
13
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").AccountProfile | undefined, Error>;
|
|
14
|
+
export declare const useCreateSpace: (config?: {
|
|
15
|
+
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
16
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
17
|
+
retry?: boolean;
|
|
18
|
+
}) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").SpaceOverview | undefined, unknown, Omit<CreateSpaceData, "url"> | undefined, unknown>;
|
|
19
|
+
export declare const useGetSpaceOverview: (options: Omit<GetSpaceOverviewData, "url"> & {
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
}) => import("@tanstack/react-query").UseQueryResult<unknown, Error>;
|
|
22
|
+
export declare const useCreateProject: (config?: {
|
|
23
|
+
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
24
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
25
|
+
retry?: boolean;
|
|
26
|
+
}) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").ProjectOverview | undefined, unknown, Omit<CreateProjectData, "url">, unknown>;
|
|
27
|
+
export declare const useGetProjectOverview: (options: Omit<GetProjectOverviewData, "url"> & {
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").ProjectOverview | undefined, Error>;
|
|
30
|
+
export declare const useCreateEnvironment: (config?: {
|
|
31
|
+
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
32
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
33
|
+
retry?: boolean;
|
|
34
|
+
}) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").EnvironmentOverview | undefined, unknown, Omit<CreateEnvironmentData, "url">, unknown>;
|
|
35
|
+
export declare const useGetEnvironmentOverview: (options: Omit<GetEnvironmentOverviewData, "url"> & {
|
|
36
|
+
enabled?: boolean;
|
|
37
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").EnvironmentOverview | undefined, Error>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
3
|
import { isPromise } from "../util";
|
|
4
4
|
import { useToken } from "../../provider/token-provider";
|
|
5
|
-
import { getServiceHealth,
|
|
5
|
+
import { getServiceHealth, requestAccountPasswordReset, getUserProfile, createSpace, getSpaceOverview, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -23,59 +23,157 @@ export const useGetServiceHealth = (options) => {
|
|
|
23
23
|
retry: false
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
export const
|
|
26
|
+
export const useRequestAccountPasswordReset = (config) => {
|
|
27
27
|
const token = useToken();
|
|
28
28
|
const queryClient = useQueryClient();
|
|
29
|
-
const opts = { throwOnError: true, url: "/
|
|
29
|
+
const opts = { throwOnError: true, url: "/auth/account/request-password-reset" };
|
|
30
30
|
const funcer = async (options) => {
|
|
31
31
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
32
|
-
const res = await
|
|
32
|
+
const res = await requestAccountPasswordReset({ ...opts, ...options, auth });
|
|
33
33
|
return res?.data;
|
|
34
34
|
};
|
|
35
35
|
return useMutation({
|
|
36
36
|
mutationFn: funcer,
|
|
37
37
|
onSuccess: (res, options, c, ctx) => {
|
|
38
|
-
queryClient.invalidateQueries({ queryKey: ["
|
|
38
|
+
queryClient.invalidateQueries({ queryKey: ["account", "request-password-reset"] });
|
|
39
39
|
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
40
40
|
},
|
|
41
41
|
onError: config?.onError,
|
|
42
42
|
retry: config?.retry
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
export const
|
|
45
|
+
export const useGetUserProfile = (options) => {
|
|
46
|
+
const token = useToken();
|
|
47
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
48
|
+
const opts = { throwOnError: true, url: "/auth/account/profile" };
|
|
49
|
+
const funcer = async () => {
|
|
50
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
51
|
+
if (isPromise(token) && !token)
|
|
52
|
+
return;
|
|
53
|
+
const res = await getUserProfile({ ...opts, ...rest, auth });
|
|
54
|
+
return res.data;
|
|
55
|
+
};
|
|
56
|
+
if (!token)
|
|
57
|
+
enabled = false;
|
|
58
|
+
return useQuery({
|
|
59
|
+
queryKey: ["account", "profile", options?.query ?? {}],
|
|
60
|
+
queryFn: funcer,
|
|
61
|
+
enabled,
|
|
62
|
+
retry: false
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export const useCreateSpace = (config) => {
|
|
46
66
|
const token = useToken();
|
|
47
67
|
const queryClient = useQueryClient();
|
|
48
|
-
const opts = { throwOnError: true, url: "/auth/
|
|
68
|
+
const opts = { throwOnError: true, url: "/auth/spaces/create" };
|
|
49
69
|
const funcer = async (options) => {
|
|
50
70
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
51
|
-
const res = await
|
|
71
|
+
const res = await createSpace({ ...opts, ...options, auth });
|
|
52
72
|
return res?.data;
|
|
53
73
|
};
|
|
54
74
|
return useMutation({
|
|
55
75
|
mutationFn: funcer,
|
|
56
76
|
onSuccess: (res, options, c, ctx) => {
|
|
57
|
-
queryClient.invalidateQueries({ queryKey: ["
|
|
77
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", "create"] });
|
|
58
78
|
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
59
79
|
},
|
|
60
80
|
onError: config?.onError,
|
|
61
81
|
retry: config?.retry
|
|
62
82
|
});
|
|
63
83
|
};
|
|
64
|
-
export const
|
|
84
|
+
export const useGetSpaceOverview = (options) => {
|
|
65
85
|
const token = useToken();
|
|
66
86
|
let { enabled, ...rest } = options || { enabled: true };
|
|
67
|
-
const opts = { throwOnError: true, url: "/auth/
|
|
87
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/overview" };
|
|
68
88
|
const funcer = async () => {
|
|
69
89
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
70
90
|
if (isPromise(token) && !token)
|
|
71
91
|
return;
|
|
72
|
-
const res = await
|
|
92
|
+
const res = await getSpaceOverview({ ...opts, ...rest, auth });
|
|
73
93
|
return res.data;
|
|
74
94
|
};
|
|
75
95
|
if (!token)
|
|
76
96
|
enabled = false;
|
|
77
97
|
return useQuery({
|
|
78
|
-
queryKey: ["
|
|
98
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "overview", options.query ?? {}],
|
|
99
|
+
queryFn: funcer,
|
|
100
|
+
enabled,
|
|
101
|
+
retry: false
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
export const useCreateProject = (config) => {
|
|
105
|
+
const token = useToken();
|
|
106
|
+
const queryClient = useQueryClient();
|
|
107
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/create" };
|
|
108
|
+
const funcer = async (options) => {
|
|
109
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
110
|
+
const res = await createProject({ ...opts, ...options, auth });
|
|
111
|
+
return res?.data;
|
|
112
|
+
};
|
|
113
|
+
return useMutation({
|
|
114
|
+
mutationFn: funcer,
|
|
115
|
+
onSuccess: (res, options, c, ctx) => {
|
|
116
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "projets", "create"] });
|
|
117
|
+
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
118
|
+
},
|
|
119
|
+
onError: config?.onError,
|
|
120
|
+
retry: config?.retry
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
export const useGetProjectOverview = (options) => {
|
|
124
|
+
const token = useToken();
|
|
125
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
126
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview" };
|
|
127
|
+
const funcer = async () => {
|
|
128
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
129
|
+
if (isPromise(token) && !token)
|
|
130
|
+
return;
|
|
131
|
+
const res = await getProjectOverview({ ...opts, ...rest, auth });
|
|
132
|
+
return res.data;
|
|
133
|
+
};
|
|
134
|
+
if (!token)
|
|
135
|
+
enabled = false;
|
|
136
|
+
return useQuery({
|
|
137
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "projets", options?.path?.projectHandle, "overview", options.query ?? {}],
|
|
138
|
+
queryFn: funcer,
|
|
139
|
+
enabled,
|
|
140
|
+
retry: false
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
export const useCreateEnvironment = (config) => {
|
|
144
|
+
const token = useToken();
|
|
145
|
+
const queryClient = useQueryClient();
|
|
146
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/create" };
|
|
147
|
+
const funcer = async (options) => {
|
|
148
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
149
|
+
const res = await createEnvironment({ ...opts, ...options, auth });
|
|
150
|
+
return res?.data;
|
|
151
|
+
};
|
|
152
|
+
return useMutation({
|
|
153
|
+
mutationFn: funcer,
|
|
154
|
+
onSuccess: (res, options, c, ctx) => {
|
|
155
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "projets", options?.path?.projectHandle, "environments", "create"] });
|
|
156
|
+
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
157
|
+
},
|
|
158
|
+
onError: config?.onError,
|
|
159
|
+
retry: config?.retry
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export const useGetEnvironmentOverview = (options) => {
|
|
163
|
+
const token = useToken();
|
|
164
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
165
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/{projectHandle}/environments/{environmentHandle}/overview" };
|
|
166
|
+
const funcer = async () => {
|
|
167
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
168
|
+
if (isPromise(token) && !token)
|
|
169
|
+
return;
|
|
170
|
+
const res = await getEnvironmentOverview({ ...opts, ...rest, auth });
|
|
171
|
+
return res.data;
|
|
172
|
+
};
|
|
173
|
+
if (!token)
|
|
174
|
+
enabled = false;
|
|
175
|
+
return useQuery({
|
|
176
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "projets", options?.path?.projectHandle, "environments", options?.path?.environmentHandle, "overview", options.query ?? {}],
|
|
79
177
|
queryFn: funcer,
|
|
80
178
|
enabled,
|
|
81
179
|
retry: false
|