shoal-web-sdk 0.0.47 → 0.0.49

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.
@@ -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, UpdateUserInstallationsData, UpdateUserInstallationsErrors, UpdateUserInstallationsResponses } from './types.gen';
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
  */
@@ -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
  */
@@ -106,10 +106,6 @@ export type GitHubBranch = {
106
106
  sha: string;
107
107
  url: string;
108
108
  };
109
- [key: string]: unknown | string | boolean | {
110
- sha: string;
111
- url: string;
112
- } | undefined;
113
109
  };
114
110
  export type GitHubBranchesResponse = {
115
111
  branches: Array<GitHubBranch>;
@@ -151,6 +147,10 @@ export type UserGithubInstallation = {
151
147
  export type UserGithubInstallations = {
152
148
  installations: Array<UserGithubInstallation>;
153
149
  };
150
+ export type UserGithubInstallationsResponse = {
151
+ installations: Array<UserGithubInstallation>;
152
+ next_page?: number;
153
+ };
154
154
  export type AccountProfile = {
155
155
  preferredEmail: string;
156
156
  phone: string;
@@ -352,10 +352,6 @@ export type Page = number;
352
352
  * Page size (max 100).
353
353
  */
354
354
  export type Limit = number;
355
- /**
356
- * When true, fetch all pages and return the full list (branches only).
357
- */
358
- export type All = boolean;
359
355
  /**
360
356
  * Connected app key code reference from Kinde.
361
357
  */
@@ -604,10 +600,6 @@ export type ListInstallationBranchesData = {
604
600
  * Page size (max 100).
605
601
  */
606
602
  limit?: number;
607
- /**
608
- * When true, fetch all pages and return the full list (branches only).
609
- */
610
- all?: boolean;
611
603
  };
612
604
  url: '/auth/installations/{installationID}/branches';
613
605
  };
@@ -634,13 +626,22 @@ export type ListInstallationBranchesResponses = {
634
626
  /**
635
627
  * Branches for the repository.
636
628
  */
637
- 200: GitHubBranchesResponse | GitHubBranchesAllResponse;
629
+ 200: GitHubBranchesResponse;
638
630
  };
639
631
  export type ListInstallationBranchesResponse = ListInstallationBranchesResponses[keyof ListInstallationBranchesResponses];
640
632
  export type ListUserInstallationsData = {
641
633
  body?: never;
642
634
  path?: never;
643
- query?: never;
635
+ query?: {
636
+ /**
637
+ * Page number (1-based).
638
+ */
639
+ page?: number;
640
+ /**
641
+ * Page size (max 100).
642
+ */
643
+ limit?: number;
644
+ };
644
645
  url: '/auth/installations';
645
646
  };
646
647
  export type ListUserInstallationsErrors = {
@@ -666,49 +667,9 @@ export type ListUserInstallationsResponses = {
666
667
  /**
667
668
  * Installations for the authenticated user.
668
669
  */
669
- 200: UserGithubInstallations;
670
+ 200: UserGithubInstallationsResponse;
670
671
  };
671
672
  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
673
  export type CreateSpaceData = {
713
674
  body: CreateSpace;
714
675
  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, UpdateUserInstallationsData, UpdateUserInstallationsResponses, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, RemoveNodesData, RemoveNodesResponses, AddNodesData, AddNodesResponses, RemoveEdgesData, RemoveEdgesResponses, AddEdgesData, AddEdgesResponses } from "../../sdk/types.gen";
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>;
@@ -28,18 +28,10 @@ export declare const useListInstallationRepositories: (options: Omit<ListInstall
28
28
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubRepositoriesResponse | undefined, Error>;
29
29
  export declare const useListInstallationBranches: (options: Omit<ListInstallationBranchesData, "url"> & {
30
30
  enabled?: boolean;
31
- }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubBranchesResponse | import("../../sdk/types.gen").GitHubBranchesAllResponse | undefined, Error>;
31
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubBranchesResponse | 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").UserGithubInstallations | undefined, Error>;
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, updateUserInstallations, createSpace, getSpaceOverview, fetchKindeOrganisationBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, removeNodes, addNodes, removeEdges, addEdges } from "../../sdk/sdk.gen";
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",