shoal-web-sdk 0.0.21 → 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 { CreateProjectData, CreateProjectErrors, CreateProjectResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses } from './types.gen';
|
|
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
|
|
@@ -26,10 +26,26 @@ export declare const requestAccountPasswordReset: <ThrowOnError extends boolean
|
|
|
26
26
|
*/
|
|
27
27
|
export declare const getUserProfile: <ThrowOnError extends boolean = false>(options?: Options<GetUserProfileData, ThrowOnError>) => import("./client").RequestResult<GetUserProfileResponses, GetUserProfileErrors, ThrowOnError, "fields">;
|
|
28
28
|
/**
|
|
29
|
-
* Create a
|
|
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.
|
|
30
38
|
*/
|
|
31
39
|
export declare const createProject: <ThrowOnError extends boolean = false>(options: Options<CreateProjectData, ThrowOnError>) => import("./client").RequestResult<CreateProjectResponses, CreateProjectErrors, ThrowOnError, "fields">;
|
|
32
40
|
/**
|
|
33
41
|
* Get the project overview.
|
|
34
42
|
*/
|
|
35
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
|
@@ -46,7 +46,41 @@ export const getUserProfile = (options) => {
|
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* Create a
|
|
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.
|
|
50
84
|
*/
|
|
51
85
|
export const createProject = (options) => {
|
|
52
86
|
return (options.client ?? client).post({
|
|
@@ -56,7 +90,7 @@ export const createProject = (options) => {
|
|
|
56
90
|
type: 'http'
|
|
57
91
|
}
|
|
58
92
|
],
|
|
59
|
-
url: '/auth/
|
|
93
|
+
url: '/auth/spaces/{spaceHandle}/projets/create',
|
|
60
94
|
...options,
|
|
61
95
|
headers: {
|
|
62
96
|
'Content-Type': 'application/json',
|
|
@@ -75,7 +109,41 @@ export const getProjectOverview = (options) => {
|
|
|
75
109
|
type: 'http'
|
|
76
110
|
}
|
|
77
111
|
],
|
|
78
|
-
url: '/auth/
|
|
112
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview',
|
|
113
|
+
...options
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Create an environment inside a project.
|
|
118
|
+
*/
|
|
119
|
+
export const createEnvironment = (options) => {
|
|
120
|
+
return (options.client ?? client).post({
|
|
121
|
+
security: [
|
|
122
|
+
{
|
|
123
|
+
scheme: 'bearer',
|
|
124
|
+
type: 'http'
|
|
125
|
+
}
|
|
126
|
+
],
|
|
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',
|
|
79
147
|
...options
|
|
80
148
|
});
|
|
81
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;
|
|
@@ -10,17 +10,38 @@ export type ErrorResponse = {
|
|
|
10
10
|
};
|
|
11
11
|
export type CreateProject = {
|
|
12
12
|
name: string;
|
|
13
|
+
handle: string;
|
|
13
14
|
description?: string;
|
|
14
15
|
};
|
|
15
16
|
export type ProjectOverview = {
|
|
16
17
|
id: string;
|
|
17
18
|
orgCode: string;
|
|
18
19
|
name: string;
|
|
20
|
+
handle: string;
|
|
19
21
|
description?: string;
|
|
20
22
|
createdAt: string;
|
|
21
23
|
updatedAt: string;
|
|
22
24
|
environments: Array<EnvironmentOverview>;
|
|
23
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 = {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
handle: string;
|
|
43
|
+
projects: Array<ProjectOverview>;
|
|
44
|
+
};
|
|
24
45
|
export type EnvironmentOverview = {
|
|
25
46
|
id: string;
|
|
26
47
|
name: string;
|
|
@@ -30,7 +51,6 @@ export type EnvironmentOverview = {
|
|
|
30
51
|
versions: unknown;
|
|
31
52
|
};
|
|
32
53
|
export type AccountProfile = {
|
|
33
|
-
kindeId: string;
|
|
34
54
|
preferredEmail: string;
|
|
35
55
|
phone: string;
|
|
36
56
|
username: string;
|
|
@@ -44,13 +64,17 @@ export type AccountProfile = {
|
|
|
44
64
|
createdOn: string;
|
|
45
65
|
};
|
|
46
66
|
/**
|
|
47
|
-
* A project
|
|
67
|
+
* A project name. This must be unique to a space.
|
|
48
68
|
*/
|
|
49
|
-
export type
|
|
69
|
+
export type ProjectHandle = string;
|
|
50
70
|
/**
|
|
51
|
-
*
|
|
71
|
+
* An environment name (e.g., dev, prod, foo-bar). This must be unique to a project.
|
|
52
72
|
*/
|
|
53
|
-
export type
|
|
73
|
+
export type EnvironmentHandle = string;
|
|
74
|
+
/**
|
|
75
|
+
* The space handle. This must be globally unique.
|
|
76
|
+
*/
|
|
77
|
+
export type SpaceHandle = string;
|
|
54
78
|
export type GetServiceHealthData = {
|
|
55
79
|
body?: never;
|
|
56
80
|
path?: never;
|
|
@@ -99,7 +123,7 @@ export type GetUserProfileErrors = {
|
|
|
99
123
|
*/
|
|
100
124
|
403: ErrorResponse;
|
|
101
125
|
/**
|
|
102
|
-
*
|
|
126
|
+
* Related content not found.
|
|
103
127
|
*/
|
|
104
128
|
404: ErrorResponse;
|
|
105
129
|
/**
|
|
@@ -115,16 +139,84 @@ export type GetUserProfileResponses = {
|
|
|
115
139
|
200: AccountProfile;
|
|
116
140
|
};
|
|
117
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
|
+
};
|
|
118
210
|
export type CreateProjectData = {
|
|
119
211
|
body?: CreateProject;
|
|
120
212
|
path: {
|
|
121
213
|
/**
|
|
122
|
-
*
|
|
214
|
+
* The space handle. This must be globally unique.
|
|
123
215
|
*/
|
|
124
|
-
|
|
216
|
+
spaceHandle: string;
|
|
125
217
|
};
|
|
126
218
|
query?: never;
|
|
127
|
-
url: '/auth/
|
|
219
|
+
url: '/auth/spaces/{spaceHandle}/projets/create';
|
|
128
220
|
};
|
|
129
221
|
export type CreateProjectErrors = {
|
|
130
222
|
/**
|
|
@@ -136,7 +228,7 @@ export type CreateProjectErrors = {
|
|
|
136
228
|
*/
|
|
137
229
|
403: ErrorResponse;
|
|
138
230
|
/**
|
|
139
|
-
*
|
|
231
|
+
* Related content not found.
|
|
140
232
|
*/
|
|
141
233
|
404: ErrorResponse;
|
|
142
234
|
/**
|
|
@@ -147,7 +239,7 @@ export type CreateProjectErrors = {
|
|
|
147
239
|
export type CreateProjectError = CreateProjectErrors[keyof CreateProjectErrors];
|
|
148
240
|
export type CreateProjectResponses = {
|
|
149
241
|
/**
|
|
150
|
-
* Successfully created project inside a
|
|
242
|
+
* Successfully created project inside a space.
|
|
151
243
|
*/
|
|
152
244
|
201: ProjectOverview;
|
|
153
245
|
};
|
|
@@ -156,16 +248,16 @@ export type GetProjectOverviewData = {
|
|
|
156
248
|
body?: never;
|
|
157
249
|
path: {
|
|
158
250
|
/**
|
|
159
|
-
*
|
|
251
|
+
* The space handle. This must be globally unique.
|
|
160
252
|
*/
|
|
161
|
-
|
|
253
|
+
spaceHandle: string;
|
|
162
254
|
/**
|
|
163
|
-
* A project
|
|
255
|
+
* A project name. This must be unique to a space.
|
|
164
256
|
*/
|
|
165
|
-
|
|
257
|
+
projectHandle: string;
|
|
166
258
|
};
|
|
167
259
|
query?: never;
|
|
168
|
-
url: '/auth/
|
|
260
|
+
url: '/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview';
|
|
169
261
|
};
|
|
170
262
|
export type GetProjectOverviewErrors = {
|
|
171
263
|
/**
|
|
@@ -177,7 +269,7 @@ export type GetProjectOverviewErrors = {
|
|
|
177
269
|
*/
|
|
178
270
|
403: ErrorResponse;
|
|
179
271
|
/**
|
|
180
|
-
*
|
|
272
|
+
* Related content not found.
|
|
181
273
|
*/
|
|
182
274
|
404: ErrorResponse;
|
|
183
275
|
/**
|
|
@@ -193,3 +285,89 @@ export type GetProjectOverviewResponses = {
|
|
|
193
285
|
200: ProjectOverview;
|
|
194
286
|
};
|
|
195
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,5 +1,5 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
|
-
import { GetServiceHealthData, RequestAccountPasswordResetData, GetUserProfileData, CreateProjectData, GetProjectOverviewData } from "../../sdk/types.gen";
|
|
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>;
|
|
@@ -11,6 +11,14 @@ export declare const useRequestAccountPasswordReset: (config?: {
|
|
|
11
11
|
export declare const useGetUserProfile: (options?: Omit<GetUserProfileData, "url"> & {
|
|
12
12
|
enabled?: boolean;
|
|
13
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>;
|
|
14
22
|
export declare const useCreateProject: (config?: {
|
|
15
23
|
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
16
24
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
@@ -19,3 +27,11 @@ export declare const useCreateProject: (config?: {
|
|
|
19
27
|
export declare const useGetProjectOverview: (options: Omit<GetProjectOverviewData, "url"> & {
|
|
20
28
|
enabled?: boolean;
|
|
21
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, requestAccountPasswordReset, getUserProfile, createProject, getProjectOverview } from "../../sdk/sdk.gen";
|
|
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 };
|
|
@@ -62,10 +62,49 @@ export const useGetUserProfile = (options) => {
|
|
|
62
62
|
retry: false
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
+
export const useCreateSpace = (config) => {
|
|
66
|
+
const token = useToken();
|
|
67
|
+
const queryClient = useQueryClient();
|
|
68
|
+
const opts = { throwOnError: true, url: "/auth/spaces/create" };
|
|
69
|
+
const funcer = async (options) => {
|
|
70
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
71
|
+
const res = await createSpace({ ...opts, ...options, auth });
|
|
72
|
+
return res?.data;
|
|
73
|
+
};
|
|
74
|
+
return useMutation({
|
|
75
|
+
mutationFn: funcer,
|
|
76
|
+
onSuccess: (res, options, c, ctx) => {
|
|
77
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", "create"] });
|
|
78
|
+
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
79
|
+
},
|
|
80
|
+
onError: config?.onError,
|
|
81
|
+
retry: config?.retry
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export const useGetSpaceOverview = (options) => {
|
|
85
|
+
const token = useToken();
|
|
86
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
87
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/overview" };
|
|
88
|
+
const funcer = async () => {
|
|
89
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
90
|
+
if (isPromise(token) && !token)
|
|
91
|
+
return;
|
|
92
|
+
const res = await getSpaceOverview({ ...opts, ...rest, auth });
|
|
93
|
+
return res.data;
|
|
94
|
+
};
|
|
95
|
+
if (!token)
|
|
96
|
+
enabled = false;
|
|
97
|
+
return useQuery({
|
|
98
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "overview", options.query ?? {}],
|
|
99
|
+
queryFn: funcer,
|
|
100
|
+
enabled,
|
|
101
|
+
retry: false
|
|
102
|
+
});
|
|
103
|
+
};
|
|
65
104
|
export const useCreateProject = (config) => {
|
|
66
105
|
const token = useToken();
|
|
67
106
|
const queryClient = useQueryClient();
|
|
68
|
-
const opts = { throwOnError: true, url: "/auth/
|
|
107
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/create" };
|
|
69
108
|
const funcer = async (options) => {
|
|
70
109
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
71
110
|
const res = await createProject({ ...opts, ...options, auth });
|
|
@@ -74,7 +113,7 @@ export const useCreateProject = (config) => {
|
|
|
74
113
|
return useMutation({
|
|
75
114
|
mutationFn: funcer,
|
|
76
115
|
onSuccess: (res, options, c, ctx) => {
|
|
77
|
-
queryClient.invalidateQueries({ queryKey: ["
|
|
116
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "projets", "create"] });
|
|
78
117
|
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
79
118
|
},
|
|
80
119
|
onError: config?.onError,
|
|
@@ -84,7 +123,7 @@ export const useCreateProject = (config) => {
|
|
|
84
123
|
export const useGetProjectOverview = (options) => {
|
|
85
124
|
const token = useToken();
|
|
86
125
|
let { enabled, ...rest } = options || { enabled: true };
|
|
87
|
-
const opts = { throwOnError: true, url: "/auth/
|
|
126
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projets/{projectHandle}/overview" };
|
|
88
127
|
const funcer = async () => {
|
|
89
128
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
90
129
|
if (isPromise(token) && !token)
|
|
@@ -95,7 +134,46 @@ export const useGetProjectOverview = (options) => {
|
|
|
95
134
|
if (!token)
|
|
96
135
|
enabled = false;
|
|
97
136
|
return useQuery({
|
|
98
|
-
queryKey: ["
|
|
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 ?? {}],
|
|
99
177
|
queryFn: funcer,
|
|
100
178
|
enabled,
|
|
101
179
|
retry: false
|