shoal-web-sdk 0.0.47 → 0.0.48
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 { AddEdgesData, AddEdgesErrors, AddEdgesResponses, AddNodesData, AddNodesErrors, AddNodesResponses, CreateAccountIdentityData, CreateAccountIdentityErrors, CreateAccountIdentityResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, 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, RemoveEdgesData, RemoveEdgesErrors, RemoveEdgesResponses, RemoveNodesData, RemoveNodesErrors, RemoveNodesResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses
|
|
2
|
+
import type { AddEdgesData, AddEdgesErrors, AddEdgesResponses, AddNodesData, AddNodesErrors, AddNodesResponses, CreateAccountIdentityData, CreateAccountIdentityErrors, CreateAccountIdentityResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, 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, RemoveEdgesData, RemoveEdgesErrors, RemoveEdgesResponses, RemoveNodesData, RemoveNodesErrors, RemoveNodesResponses, 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
|
|
@@ -49,10 +49,6 @@ export declare const listInstallationBranches: <ThrowOnError extends boolean = f
|
|
|
49
49
|
* List GitHub App installations stored for the authenticated user.
|
|
50
50
|
*/
|
|
51
51
|
export declare const listUserInstallations: <ThrowOnError extends boolean = false>(options?: Options<ListUserInstallationsData, ThrowOnError>) => import("./client").RequestResult<ListUserInstallationsResponses, ListUserInstallationsErrors, ThrowOnError, "fields">;
|
|
52
|
-
/**
|
|
53
|
-
* Add a GitHub App installation to the authenticated user's stored installation list.
|
|
54
|
-
*/
|
|
55
|
-
export declare const updateUserInstallations: <ThrowOnError extends boolean = false>(options: Options<UpdateUserInstallationsData, ThrowOnError>) => import("./client").RequestResult<UpdateUserInstallationsResponses, UpdateUserInstallationsErrors, ThrowOnError, "fields">;
|
|
56
52
|
/**
|
|
57
53
|
* Create a space.
|
|
58
54
|
*/
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -139,21 +139,6 @@ export const listUserInstallations = (options) => {
|
|
|
139
139
|
...options
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
-
/**
|
|
143
|
-
* Add a GitHub App installation to the authenticated user's stored installation list.
|
|
144
|
-
*/
|
|
145
|
-
export const updateUserInstallations = (options) => {
|
|
146
|
-
return (options.client ?? client).patch({
|
|
147
|
-
security: [
|
|
148
|
-
{
|
|
149
|
-
scheme: 'bearer',
|
|
150
|
-
type: 'http'
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
url: '/auth/installations/{installationID}',
|
|
154
|
-
...options
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
142
|
/**
|
|
158
143
|
* Create a space.
|
|
159
144
|
*/
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ export type UserGithubInstallation = {
|
|
|
151
151
|
export type UserGithubInstallations = {
|
|
152
152
|
installations: Array<UserGithubInstallation>;
|
|
153
153
|
};
|
|
154
|
+
export type UserGithubInstallationsResponse = {
|
|
155
|
+
installations: Array<UserGithubInstallation>;
|
|
156
|
+
next_page?: number;
|
|
157
|
+
};
|
|
154
158
|
export type AccountProfile = {
|
|
155
159
|
preferredEmail: string;
|
|
156
160
|
phone: string;
|
|
@@ -640,7 +644,16 @@ export type ListInstallationBranchesResponse = ListInstallationBranchesResponses
|
|
|
640
644
|
export type ListUserInstallationsData = {
|
|
641
645
|
body?: never;
|
|
642
646
|
path?: never;
|
|
643
|
-
query?:
|
|
647
|
+
query?: {
|
|
648
|
+
/**
|
|
649
|
+
* Page number (1-based).
|
|
650
|
+
*/
|
|
651
|
+
page?: number;
|
|
652
|
+
/**
|
|
653
|
+
* Page size (max 100).
|
|
654
|
+
*/
|
|
655
|
+
limit?: number;
|
|
656
|
+
};
|
|
644
657
|
url: '/auth/installations';
|
|
645
658
|
};
|
|
646
659
|
export type ListUserInstallationsErrors = {
|
|
@@ -666,49 +679,9 @@ export type ListUserInstallationsResponses = {
|
|
|
666
679
|
/**
|
|
667
680
|
* Installations for the authenticated user.
|
|
668
681
|
*/
|
|
669
|
-
200:
|
|
682
|
+
200: UserGithubInstallationsResponse;
|
|
670
683
|
};
|
|
671
684
|
export type ListUserInstallationsResponse = ListUserInstallationsResponses[keyof ListUserInstallationsResponses];
|
|
672
|
-
export type UpdateUserInstallationsData = {
|
|
673
|
-
body?: never;
|
|
674
|
-
path: {
|
|
675
|
-
/**
|
|
676
|
-
* GitHub App installation ID.
|
|
677
|
-
*/
|
|
678
|
-
installationID: number;
|
|
679
|
-
};
|
|
680
|
-
query?: never;
|
|
681
|
-
url: '/auth/installations/{installationID}';
|
|
682
|
-
};
|
|
683
|
-
export type UpdateUserInstallationsErrors = {
|
|
684
|
-
/**
|
|
685
|
-
* Invalid request parameters.
|
|
686
|
-
*/
|
|
687
|
-
400: ErrorResponse;
|
|
688
|
-
/**
|
|
689
|
-
* Unauthorised user.
|
|
690
|
-
*/
|
|
691
|
-
401: ErrorResponse;
|
|
692
|
-
/**
|
|
693
|
-
* Invalid credentials.
|
|
694
|
-
*/
|
|
695
|
-
403: ErrorResponse;
|
|
696
|
-
/**
|
|
697
|
-
* Unexpected error.
|
|
698
|
-
*/
|
|
699
|
-
500: ErrorResponse;
|
|
700
|
-
};
|
|
701
|
-
export type UpdateUserInstallationsError = UpdateUserInstallationsErrors[keyof UpdateUserInstallationsErrors];
|
|
702
|
-
export type UpdateUserInstallationsResponses = {
|
|
703
|
-
/**
|
|
704
|
-
* Installation list updated.
|
|
705
|
-
*/
|
|
706
|
-
200: {
|
|
707
|
-
status: string;
|
|
708
|
-
installations: Array<UserGithubInstallation>;
|
|
709
|
-
};
|
|
710
|
-
};
|
|
711
|
-
export type UpdateUserInstallationsResponse = UpdateUserInstallationsResponses[keyof UpdateUserInstallationsResponses];
|
|
712
685
|
export type CreateSpaceData = {
|
|
713
686
|
body: CreateSpace;
|
|
714
687
|
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, CreateAccountIdentityData, CreateAccountIdentityResponses, GetConnectedAppUrlData, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData,
|
|
3
|
+
import { GetServiceHealthData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, CreateAccountIdentityData, CreateAccountIdentityResponses, GetConnectedAppUrlData, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, RemoveNodesData, RemoveNodesResponses, AddNodesData, AddNodesResponses, RemoveEdgesData, RemoveEdgesResponses, AddEdgesData, AddEdgesResponses } 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>;
|
|
@@ -31,15 +31,7 @@ export declare const useListInstallationBranches: (options: Omit<ListInstallatio
|
|
|
31
31
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubBranchesResponse | import("../../sdk/types.gen").GitHubBranchesAllResponse | undefined, Error>;
|
|
32
32
|
export declare const useListUserInstallations: (options?: Omit<ListUserInstallationsData, "url"> & {
|
|
33
33
|
enabled?: boolean;
|
|
34
|
-
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").
|
|
35
|
-
export declare const useUpdateUserInstallations: (config?: {
|
|
36
|
-
onSuccess?: (data: GetSuccessResponse<UpdateUserInstallationsResponses>) => void;
|
|
37
|
-
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
38
|
-
retry?: boolean;
|
|
39
|
-
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
40
|
-
status: string;
|
|
41
|
-
installations: Array<import("../../sdk/types.gen").UserGithubInstallation>;
|
|
42
|
-
} | undefined, unknown, Omit<UpdateUserInstallationsData, "url">, unknown>;
|
|
34
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").UserGithubInstallationsResponse | undefined, Error>;
|
|
43
35
|
export declare const useCreateSpace: (config?: {
|
|
44
36
|
onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>) => void;
|
|
45
37
|
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, createAccountIdentity, getConnectedAppUrl, listInstallationRepositories, listInstallationBranches, listUserInstallations,
|
|
5
|
+
import { getServiceHealth, requestAccountPasswordReset, getUserProfile, getUserIdentities, createAccountIdentity, getConnectedAppUrl, listInstallationRepositories, listInstallationBranches, listUserInstallations, createSpace, getSpaceOverview, fetchKindeOrganisationBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, removeNodes, addNodes, removeEdges, addEdges } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -188,25 +188,6 @@ export const useListUserInstallations = (options) => {
|
|
|
188
188
|
staleTime: 600000
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
|
-
export const useUpdateUserInstallations = (config) => {
|
|
192
|
-
const token = useToken();
|
|
193
|
-
const queryClient = useQueryClient();
|
|
194
|
-
const opts = { throwOnError: true, url: "/auth/installations/{installationID}" };
|
|
195
|
-
const funcer = async (options) => {
|
|
196
|
-
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
197
|
-
const res = await updateUserInstallations({ ...opts, ...options, auth });
|
|
198
|
-
return res?.data;
|
|
199
|
-
};
|
|
200
|
-
return useMutation({
|
|
201
|
-
mutationFn: funcer,
|
|
202
|
-
onSuccess: (res, options, c, ctx) => {
|
|
203
|
-
queryClient.invalidateQueries({ queryKey: ["installations", options?.path?.installationID] });
|
|
204
|
-
config?.onSuccess && config.onSuccess(res);
|
|
205
|
-
},
|
|
206
|
-
onError: config?.onError,
|
|
207
|
-
retry: config?.retry
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
191
|
export const useCreateSpace = (config) => {
|
|
211
192
|
const token = useToken();
|
|
212
193
|
const queryClient = useQueryClient();
|