shoal-web-sdk 0.0.26 → 0.0.28
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/provider/token-provider.js +1 -1
- package/dist/sdk/sdk.gen.d.ts +1 -1
- package/dist/sdk/sdk.gen.js +7 -7
- package/dist/sdk/types.gen.d.ts +8 -8
- package/dist/tanstack-codegen/generated/generated.d.ts +1 -1
- package/dist/tanstack-codegen/generated/generated.js +10 -10
- package/package.json +1 -1
|
@@ -10,6 +10,6 @@ export const useToken = () => {
|
|
|
10
10
|
};
|
|
11
11
|
export const TokenProvider = ({ children }) => {
|
|
12
12
|
const c = useKindeBrowserClient();
|
|
13
|
-
return (_jsx(context.Provider, { value: c.
|
|
13
|
+
return (_jsx(context.Provider, { value: c.idTokenRaw ?? "", children: children }));
|
|
14
14
|
};
|
|
15
15
|
export default TokenProvider;
|
package/dist/sdk/sdk.gen.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const getUserProfile: <ThrowOnError extends boolean = false>(opti
|
|
|
28
28
|
/**
|
|
29
29
|
* Create a space.
|
|
30
30
|
*/
|
|
31
|
-
export declare const createSpace: <ThrowOnError extends boolean = false>(options
|
|
31
|
+
export declare const createSpace: <ThrowOnError extends boolean = false>(options: Options<CreateSpaceData, ThrowOnError>) => import("./client").RequestResult<CreateSpaceResponses, CreateSpaceErrors, ThrowOnError, "fields">;
|
|
32
32
|
/**
|
|
33
33
|
* The space overview.
|
|
34
34
|
*/
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -11,7 +11,7 @@ export const getServiceHealth = (options) => {
|
|
|
11
11
|
type: 'http'
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
url: '/
|
|
14
|
+
url: '/health',
|
|
15
15
|
...options
|
|
16
16
|
});
|
|
17
17
|
};
|
|
@@ -49,7 +49,7 @@ export const getUserProfile = (options) => {
|
|
|
49
49
|
* Create a space.
|
|
50
50
|
*/
|
|
51
51
|
export const createSpace = (options) => {
|
|
52
|
-
return (options
|
|
52
|
+
return (options.client ?? client).post({
|
|
53
53
|
security: [
|
|
54
54
|
{
|
|
55
55
|
scheme: 'bearer',
|
|
@@ -60,7 +60,7 @@ export const createSpace = (options) => {
|
|
|
60
60
|
...options,
|
|
61
61
|
headers: {
|
|
62
62
|
'Content-Type': 'application/json',
|
|
63
|
-
...options
|
|
63
|
+
...options.headers
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
};
|
|
@@ -90,7 +90,7 @@ export const createProject = (options) => {
|
|
|
90
90
|
type: 'http'
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
93
|
+
url: '/auth/spaces/{spaceHandle}/projects/create',
|
|
94
94
|
...options,
|
|
95
95
|
headers: {
|
|
96
96
|
'Content-Type': 'application/json',
|
|
@@ -109,7 +109,7 @@ export const getProjectOverview = (options) => {
|
|
|
109
109
|
type: 'http'
|
|
110
110
|
}
|
|
111
111
|
],
|
|
112
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
112
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/overview',
|
|
113
113
|
...options
|
|
114
114
|
});
|
|
115
115
|
};
|
|
@@ -124,7 +124,7 @@ export const createEnvironment = (options) => {
|
|
|
124
124
|
type: 'http'
|
|
125
125
|
}
|
|
126
126
|
],
|
|
127
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
127
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/create',
|
|
128
128
|
...options,
|
|
129
129
|
headers: {
|
|
130
130
|
'Content-Type': 'application/json',
|
|
@@ -143,7 +143,7 @@ export const getEnvironmentOverview = (options) => {
|
|
|
143
143
|
type: 'http'
|
|
144
144
|
}
|
|
145
145
|
],
|
|
146
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
146
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/{environmentHandle}/overview',
|
|
147
147
|
...options
|
|
148
148
|
});
|
|
149
149
|
};
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export type GetServiceHealthData = {
|
|
|
79
79
|
body?: never;
|
|
80
80
|
path?: never;
|
|
81
81
|
query?: never;
|
|
82
|
-
url: '/
|
|
82
|
+
url: '/health';
|
|
83
83
|
};
|
|
84
84
|
export type GetServiceHealthResponses = {
|
|
85
85
|
/**
|
|
@@ -140,7 +140,7 @@ export type GetUserProfileResponses = {
|
|
|
140
140
|
};
|
|
141
141
|
export type GetUserProfileResponse = GetUserProfileResponses[keyof GetUserProfileResponses];
|
|
142
142
|
export type CreateSpaceData = {
|
|
143
|
-
body
|
|
143
|
+
body: CreateSpace;
|
|
144
144
|
path?: never;
|
|
145
145
|
query?: never;
|
|
146
146
|
url: '/auth/spaces/create';
|
|
@@ -208,7 +208,7 @@ export type GetSpaceOverviewResponses = {
|
|
|
208
208
|
200: unknown;
|
|
209
209
|
};
|
|
210
210
|
export type CreateProjectData = {
|
|
211
|
-
body
|
|
211
|
+
body: CreateProject;
|
|
212
212
|
path: {
|
|
213
213
|
/**
|
|
214
214
|
* The space handle. This must be globally unique.
|
|
@@ -216,7 +216,7 @@ export type CreateProjectData = {
|
|
|
216
216
|
spaceHandle: string;
|
|
217
217
|
};
|
|
218
218
|
query?: never;
|
|
219
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
219
|
+
url: '/auth/spaces/{spaceHandle}/projects/create';
|
|
220
220
|
};
|
|
221
221
|
export type CreateProjectErrors = {
|
|
222
222
|
/**
|
|
@@ -257,7 +257,7 @@ export type GetProjectOverviewData = {
|
|
|
257
257
|
projectHandle: string;
|
|
258
258
|
};
|
|
259
259
|
query?: never;
|
|
260
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
260
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/overview';
|
|
261
261
|
};
|
|
262
262
|
export type GetProjectOverviewErrors = {
|
|
263
263
|
/**
|
|
@@ -286,7 +286,7 @@ export type GetProjectOverviewResponses = {
|
|
|
286
286
|
};
|
|
287
287
|
export type GetProjectOverviewResponse = GetProjectOverviewResponses[keyof GetProjectOverviewResponses];
|
|
288
288
|
export type CreateEnvironmentData = {
|
|
289
|
-
body
|
|
289
|
+
body: CreateEnvironment;
|
|
290
290
|
path: {
|
|
291
291
|
/**
|
|
292
292
|
* The space handle. This must be globally unique.
|
|
@@ -298,7 +298,7 @@ export type CreateEnvironmentData = {
|
|
|
298
298
|
projectHandle: string;
|
|
299
299
|
};
|
|
300
300
|
query?: never;
|
|
301
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
301
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/create';
|
|
302
302
|
};
|
|
303
303
|
export type CreateEnvironmentErrors = {
|
|
304
304
|
/**
|
|
@@ -343,7 +343,7 @@ export type GetEnvironmentOverviewData = {
|
|
|
343
343
|
environmentHandle: string;
|
|
344
344
|
};
|
|
345
345
|
query?: never;
|
|
346
|
-
url: '/auth/spaces/{spaceHandle}/
|
|
346
|
+
url: '/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/{environmentHandle}/overview';
|
|
347
347
|
};
|
|
348
348
|
export type GetEnvironmentOverviewErrors = {
|
|
349
349
|
/**
|
|
@@ -15,7 +15,7 @@ export declare const useCreateSpace: (config?: {
|
|
|
15
15
|
onSuccess?: Parameters<typeof useMutation>["0"]["onSuccess"];
|
|
16
16
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
17
17
|
retry?: boolean;
|
|
18
|
-
}) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").SpaceOverview | undefined, unknown, Omit<CreateSpaceData, "url"
|
|
18
|
+
}) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").SpaceOverview | undefined, unknown, Omit<CreateSpaceData, "url">, unknown>;
|
|
19
19
|
export declare const useGetSpaceOverview: (options: Omit<GetSpaceOverviewData, "url"> & {
|
|
20
20
|
enabled?: boolean;
|
|
21
21
|
}) => import("@tanstack/react-query").UseQueryResult<unknown, Error>;
|
|
@@ -6,7 +6,7 @@ import { getServiceHealth, requestAccountPasswordReset, getUserProfile, createSp
|
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
9
|
-
const opts = { throwOnError: true, url: "/
|
|
9
|
+
const opts = { throwOnError: true, url: "/health" };
|
|
10
10
|
const funcer = async () => {
|
|
11
11
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
12
12
|
if (isPromise(token) && !token)
|
|
@@ -17,7 +17,7 @@ export const useGetServiceHealth = (options) => {
|
|
|
17
17
|
if (!token)
|
|
18
18
|
enabled = false;
|
|
19
19
|
return useQuery({
|
|
20
|
-
queryKey: ["
|
|
20
|
+
queryKey: ["health", options?.query ?? {}],
|
|
21
21
|
queryFn: funcer,
|
|
22
22
|
enabled,
|
|
23
23
|
retry: false
|
|
@@ -104,7 +104,7 @@ export const useGetSpaceOverview = (options) => {
|
|
|
104
104
|
export const useCreateProject = (config) => {
|
|
105
105
|
const token = useToken();
|
|
106
106
|
const queryClient = useQueryClient();
|
|
107
|
-
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/
|
|
107
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projects/create" };
|
|
108
108
|
const funcer = async (options) => {
|
|
109
109
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
110
110
|
const res = await createProject({ ...opts, ...options, auth });
|
|
@@ -113,7 +113,7 @@ export const useCreateProject = (config) => {
|
|
|
113
113
|
return useMutation({
|
|
114
114
|
mutationFn: funcer,
|
|
115
115
|
onSuccess: (res, options, c, ctx) => {
|
|
116
|
-
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "
|
|
116
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "projects", "create"] });
|
|
117
117
|
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
118
118
|
},
|
|
119
119
|
onError: config?.onError,
|
|
@@ -123,7 +123,7 @@ export const useCreateProject = (config) => {
|
|
|
123
123
|
export const useGetProjectOverview = (options) => {
|
|
124
124
|
const token = useToken();
|
|
125
125
|
let { enabled, ...rest } = options || { enabled: true };
|
|
126
|
-
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/
|
|
126
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projects/{projectHandle}/overview" };
|
|
127
127
|
const funcer = async () => {
|
|
128
128
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
129
129
|
if (isPromise(token) && !token)
|
|
@@ -134,7 +134,7 @@ export const useGetProjectOverview = (options) => {
|
|
|
134
134
|
if (!token)
|
|
135
135
|
enabled = false;
|
|
136
136
|
return useQuery({
|
|
137
|
-
queryKey: ["spaces", options?.path?.spaceHandle, "
|
|
137
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "projects", options?.path?.projectHandle, "overview", options.query ?? {}],
|
|
138
138
|
queryFn: funcer,
|
|
139
139
|
enabled,
|
|
140
140
|
retry: false
|
|
@@ -143,7 +143,7 @@ export const useGetProjectOverview = (options) => {
|
|
|
143
143
|
export const useCreateEnvironment = (config) => {
|
|
144
144
|
const token = useToken();
|
|
145
145
|
const queryClient = useQueryClient();
|
|
146
|
-
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/
|
|
146
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/create" };
|
|
147
147
|
const funcer = async (options) => {
|
|
148
148
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
149
149
|
const res = await createEnvironment({ ...opts, ...options, auth });
|
|
@@ -152,7 +152,7 @@ export const useCreateEnvironment = (config) => {
|
|
|
152
152
|
return useMutation({
|
|
153
153
|
mutationFn: funcer,
|
|
154
154
|
onSuccess: (res, options, c, ctx) => {
|
|
155
|
-
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "
|
|
155
|
+
queryClient.invalidateQueries({ queryKey: ["spaces", options?.path?.spaceHandle, "projects", options?.path?.projectHandle, "environments", "create"] });
|
|
156
156
|
config?.onSuccess && config.onSuccess(res, options, c, ctx);
|
|
157
157
|
},
|
|
158
158
|
onError: config?.onError,
|
|
@@ -162,7 +162,7 @@ export const useCreateEnvironment = (config) => {
|
|
|
162
162
|
export const useGetEnvironmentOverview = (options) => {
|
|
163
163
|
const token = useToken();
|
|
164
164
|
let { enabled, ...rest } = options || { enabled: true };
|
|
165
|
-
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/
|
|
165
|
+
const opts = { throwOnError: true, url: "/auth/spaces/{spaceHandle}/projects/{projectHandle}/environments/{environmentHandle}/overview" };
|
|
166
166
|
const funcer = async () => {
|
|
167
167
|
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
168
168
|
if (isPromise(token) && !token)
|
|
@@ -173,7 +173,7 @@ export const useGetEnvironmentOverview = (options) => {
|
|
|
173
173
|
if (!token)
|
|
174
174
|
enabled = false;
|
|
175
175
|
return useQuery({
|
|
176
|
-
queryKey: ["spaces", options?.path?.spaceHandle, "
|
|
176
|
+
queryKey: ["spaces", options?.path?.spaceHandle, "projects", options?.path?.projectHandle, "environments", options?.path?.environmentHandle, "overview", options.query ?? {}],
|
|
177
177
|
queryFn: funcer,
|
|
178
178
|
enabled,
|
|
179
179
|
retry: false
|