shoal-web-sdk 0.0.65 → 0.0.67
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 { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses } from './types.gen';
|
|
2
|
+
import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses } 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
|
|
@@ -53,6 +53,10 @@ export declare const listInstallationBranches: <ThrowOnError extends boolean = f
|
|
|
53
53
|
* List GitHub App installations stored for the authenticated user.
|
|
54
54
|
*/
|
|
55
55
|
export declare const listUserInstallations: <ThrowOnError extends boolean = false>(options?: Options<ListUserInstallationsData, ThrowOnError>) => import("./client").RequestResult<ListUserInstallationsResponses, ListUserInstallationsErrors, ThrowOnError, "fields">;
|
|
56
|
+
/**
|
|
57
|
+
* List spaces for the authenticated user with organization details.
|
|
58
|
+
*/
|
|
59
|
+
export declare const listUserSpaces: <ThrowOnError extends boolean = false>(options?: Options<ListUserSpacesData, ThrowOnError>) => import("./client").RequestResult<ListUserSpacesResponses, ListUserSpacesErrors, ThrowOnError, "fields">;
|
|
56
60
|
/**
|
|
57
61
|
* Create a space.
|
|
58
62
|
*/
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -150,6 +150,21 @@ export const listUserInstallations = (options) => {
|
|
|
150
150
|
...options
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* List spaces for the authenticated user with organization details.
|
|
155
|
+
*/
|
|
156
|
+
export const listUserSpaces = (options) => {
|
|
157
|
+
return (options?.client ?? client).get({
|
|
158
|
+
security: [
|
|
159
|
+
{
|
|
160
|
+
scheme: 'bearer',
|
|
161
|
+
type: 'http'
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
url: '/auth/spaces/view',
|
|
165
|
+
...options
|
|
166
|
+
});
|
|
167
|
+
};
|
|
153
168
|
/**
|
|
154
169
|
* Create a space.
|
|
155
170
|
*/
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -166,6 +166,17 @@ export type AccountProfile = {
|
|
|
166
166
|
lastSignedIn: string;
|
|
167
167
|
createdOn: string;
|
|
168
168
|
};
|
|
169
|
+
export type UserSpace = {
|
|
170
|
+
code: string;
|
|
171
|
+
name: string;
|
|
172
|
+
handle: string;
|
|
173
|
+
created_on: string;
|
|
174
|
+
logo: string;
|
|
175
|
+
};
|
|
176
|
+
export type UserSpacesResponse = {
|
|
177
|
+
spaces: Array<UserSpace>;
|
|
178
|
+
next_page?: number;
|
|
179
|
+
};
|
|
169
180
|
export type KindeOrganisationBillingAgreement = {
|
|
170
181
|
/**
|
|
171
182
|
* The friendly id of an agreement
|
|
@@ -232,7 +243,7 @@ export type Node = {
|
|
|
232
243
|
} & DatabaseNodeProps) | ({
|
|
233
244
|
typ: 'function';
|
|
234
245
|
} & FunctionNodeProps) | ({
|
|
235
|
-
typ: '
|
|
246
|
+
typ: 'message_queue';
|
|
236
247
|
} & MessageQueueNodeProps) | ({
|
|
237
248
|
typ: 'proxy';
|
|
238
249
|
} & ProxyNodeProps) | ({
|
|
@@ -679,6 +690,51 @@ export type ListUserInstallationsResponses = {
|
|
|
679
690
|
200: UserGithubInstallationsResponse;
|
|
680
691
|
};
|
|
681
692
|
export type ListUserInstallationsResponse = ListUserInstallationsResponses[keyof ListUserInstallationsResponses];
|
|
693
|
+
export type ListUserSpacesData = {
|
|
694
|
+
body?: never;
|
|
695
|
+
path?: never;
|
|
696
|
+
query?: {
|
|
697
|
+
/**
|
|
698
|
+
* Page number (1-based).
|
|
699
|
+
*/
|
|
700
|
+
page?: number;
|
|
701
|
+
/**
|
|
702
|
+
* Page size (max 100).
|
|
703
|
+
*/
|
|
704
|
+
limit?: number;
|
|
705
|
+
};
|
|
706
|
+
url: '/auth/spaces/view';
|
|
707
|
+
};
|
|
708
|
+
export type ListUserSpacesErrors = {
|
|
709
|
+
/**
|
|
710
|
+
* Invalid request parameters.
|
|
711
|
+
*/
|
|
712
|
+
400: ErrorResponse;
|
|
713
|
+
/**
|
|
714
|
+
* Unauthorised user.
|
|
715
|
+
*/
|
|
716
|
+
401: ErrorResponse;
|
|
717
|
+
/**
|
|
718
|
+
* Invalid credentials.
|
|
719
|
+
*/
|
|
720
|
+
403: ErrorResponse;
|
|
721
|
+
/**
|
|
722
|
+
* Related content not found.
|
|
723
|
+
*/
|
|
724
|
+
404: ErrorResponse;
|
|
725
|
+
/**
|
|
726
|
+
* Unexpected error.
|
|
727
|
+
*/
|
|
728
|
+
500: ErrorResponse;
|
|
729
|
+
};
|
|
730
|
+
export type ListUserSpacesError = ListUserSpacesErrors[keyof ListUserSpacesErrors];
|
|
731
|
+
export type ListUserSpacesResponses = {
|
|
732
|
+
/**
|
|
733
|
+
* A list of spaces for the authenticated user.
|
|
734
|
+
*/
|
|
735
|
+
200: UserSpacesResponse;
|
|
736
|
+
};
|
|
737
|
+
export type ListUserSpacesResponse = ListUserSpacesResponses[keyof ListUserSpacesResponses];
|
|
682
738
|
export type CreateSpaceData = {
|
|
683
739
|
body: CreateSpace;
|
|
684
740
|
path?: never;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { GetSuccessResponse } from "../util";
|
|
3
|
-
import { GetServiceHealthData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses } from "../../sdk/types.gen";
|
|
3
|
+
import { GetServiceHealthData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses } from "../../sdk/types.gen";
|
|
4
4
|
export declare const useGetServiceHealth: (options?: Omit<GetServiceHealthData, "url"> & {
|
|
5
5
|
enabled?: boolean;
|
|
6
6
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").HealthResponse | undefined, Error>;
|
|
@@ -37,6 +37,9 @@ export declare const useListInstallationBranches: (options: Omit<ListInstallatio
|
|
|
37
37
|
export declare const useListUserInstallations: (options?: Omit<ListUserInstallationsData, "url"> & {
|
|
38
38
|
enabled?: boolean;
|
|
39
39
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").UserGithubInstallationsResponse | undefined, Error>;
|
|
40
|
+
export declare const useListUserSpaces: (options?: Omit<ListUserSpacesData, "url"> & {
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").UserSpacesResponse | undefined, Error>;
|
|
40
43
|
export declare const useCreateSpace: (config?: {
|
|
41
44
|
onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>) => void;
|
|
42
45
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
@@ -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, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, createSpace, getSpaceOverview, fetchKindeOrganisationBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState } from "../../sdk/sdk.gen";
|
|
5
|
+
import { getServiceHealth, requestAccountPasswordReset, getUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getSpaceOverview, fetchKindeOrganisationBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -207,6 +207,27 @@ export const useListUserInstallations = (options) => {
|
|
|
207
207
|
staleTime: 600000
|
|
208
208
|
});
|
|
209
209
|
};
|
|
210
|
+
export const useListUserSpaces = (options) => {
|
|
211
|
+
const token = useToken();
|
|
212
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
213
|
+
const opts = { throwOnError: true, url: "/auth/spaces/view" };
|
|
214
|
+
const funcer = async () => {
|
|
215
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
216
|
+
if (isPromise(token) && !token)
|
|
217
|
+
return;
|
|
218
|
+
const res = await listUserSpaces({ ...opts, ...rest, auth });
|
|
219
|
+
return res.data;
|
|
220
|
+
};
|
|
221
|
+
if (!token)
|
|
222
|
+
enabled = false;
|
|
223
|
+
return useQuery({
|
|
224
|
+
queryKey: ["spaces", "view", options?.query ?? {}],
|
|
225
|
+
queryFn: funcer,
|
|
226
|
+
enabled,
|
|
227
|
+
retry: false,
|
|
228
|
+
staleTime: 600000
|
|
229
|
+
});
|
|
230
|
+
};
|
|
210
231
|
export const useCreateSpace = (config) => {
|
|
211
232
|
const token = useToken();
|
|
212
233
|
const queryClient = useQueryClient();
|