shoal-web-sdk 0.0.70 → 0.0.72

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 { 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';
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, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, 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
@@ -69,6 +69,10 @@ export declare const getSpaceOverview: <ThrowOnError extends boolean = false>(op
69
69
  * The space billing agreements.
70
70
  */
71
71
  export declare const fetchKindeOrganisationBillingAgreements: <ThrowOnError extends boolean = false>(options: Options<FetchKindeOrganisationBillingAgreementsData, ThrowOnError>) => import("./client").RequestResult<FetchKindeOrganisationBillingAgreementsResponses, FetchKindeOrganisationBillingAgreementsErrors, ThrowOnError, "fields">;
72
+ /**
73
+ * List members for a space.
74
+ */
75
+ export declare const listSpaceMembers: <ThrowOnError extends boolean = false>(options: Options<ListSpaceMembersData, ThrowOnError>) => import("./client").RequestResult<ListSpaceMembersResponses, ListSpaceMembersErrors, ThrowOnError, "fields">;
72
76
  /**
73
77
  * Create a project inside a space.
74
78
  */
@@ -214,6 +214,21 @@ export const fetchKindeOrganisationBillingAgreements = (options) => {
214
214
  ...options
215
215
  });
216
216
  };
217
+ /**
218
+ * List members for a space.
219
+ */
220
+ export const listSpaceMembers = (options) => {
221
+ return (options.client ?? client).get({
222
+ security: [
223
+ {
224
+ scheme: 'bearer',
225
+ type: 'http'
226
+ }
227
+ ],
228
+ url: '/auth/{spaceHandle}/members/view',
229
+ ...options
230
+ });
231
+ };
217
232
  /**
218
233
  * Create a project inside a space.
219
234
  */
@@ -176,36 +176,28 @@ export type UserSpacesResponse = {
176
176
  spaces: Array<UserSpace>;
177
177
  next_page?: number;
178
178
  };
179
+ export type SpaceMember = {
180
+ id: string;
181
+ email?: string;
182
+ first_name?: string;
183
+ last_name?: string;
184
+ full_name?: string;
185
+ roles?: Array<string>;
186
+ permissions?: Array<string>;
187
+ };
188
+ export type SpaceMembersResponse = {
189
+ members: Array<SpaceMember>;
190
+ next_page_token?: string;
191
+ };
179
192
  export type KindeOrganisationBillingAgreement = {
180
193
  /**
181
194
  * The friendly id of an agreement
182
195
  */
183
- id?: string;
196
+ agreement_id?: string;
184
197
  /**
185
198
  * The plan code the billing customer is subscribed to
186
199
  */
187
200
  plan_code?: string;
188
- /**
189
- * The date the agreement expired (and was no longer active)
190
- */
191
- expires_on?: string;
192
- /**
193
- * The friendly id of the billing group this agreement's plan is part of
194
- */
195
- billing_group_id?: string;
196
- /**
197
- * A list of billing entitlements that is part of this agreement
198
- */
199
- entitlements?: Array<{
200
- /**
201
- * The feature code of the feature corresponding to this entitlement
202
- */
203
- feature_code?: string;
204
- /**
205
- * The friendly id of an entitlement
206
- */
207
- entitlement_id?: string;
208
- }>;
209
201
  };
210
202
  export type Nodes = {
211
203
  nodes: Array<Node>;
@@ -313,6 +305,10 @@ export type Page = number;
313
305
  * Page size (max 100).
314
306
  */
315
307
  export type Limit = number;
308
+ /**
309
+ * Opaque pagination token returned by the previous response.
310
+ */
311
+ export type NextPageToken = string;
316
312
  /**
317
313
  * Connected app key code reference from Kinde.
318
314
  */
@@ -837,9 +833,62 @@ export type FetchKindeOrganisationBillingAgreementsResponses = {
837
833
  /**
838
834
  * A list of the space's billing agreements.
839
835
  */
840
- 200: Array<KindeOrganisationBillingAgreement>;
836
+ 200: unknown;
837
+ };
838
+ export type ListSpaceMembersData = {
839
+ body?: never;
840
+ path: {
841
+ /**
842
+ * The space handle. This must be globally unique.
843
+ */
844
+ spaceHandle: string;
845
+ };
846
+ query?: {
847
+ /**
848
+ * Page number (1-based).
849
+ */
850
+ page?: number;
851
+ /**
852
+ * Page size (max 100).
853
+ */
854
+ limit?: number;
855
+ /**
856
+ * Opaque pagination token returned by the previous response.
857
+ */
858
+ next_page_token?: string;
859
+ };
860
+ url: '/auth/{spaceHandle}/members/view';
861
+ };
862
+ export type ListSpaceMembersErrors = {
863
+ /**
864
+ * Invalid request parameters.
865
+ */
866
+ 400: ErrorResponse;
867
+ /**
868
+ * Unauthorised user.
869
+ */
870
+ 401: ErrorResponse;
871
+ /**
872
+ * Invalid credentials.
873
+ */
874
+ 403: ErrorResponse;
875
+ /**
876
+ * Related content not found.
877
+ */
878
+ 404: ErrorResponse;
879
+ /**
880
+ * Unexpected error.
881
+ */
882
+ 500: ErrorResponse;
883
+ };
884
+ export type ListSpaceMembersError = ListSpaceMembersErrors[keyof ListSpaceMembersErrors];
885
+ export type ListSpaceMembersResponses = {
886
+ /**
887
+ * A list of space members.
888
+ */
889
+ 200: SpaceMembersResponse;
841
890
  };
842
- export type FetchKindeOrganisationBillingAgreementsResponse = FetchKindeOrganisationBillingAgreementsResponses[keyof FetchKindeOrganisationBillingAgreementsResponses];
891
+ export type ListSpaceMembersResponse = ListSpaceMembersResponses[keyof ListSpaceMembersResponses];
843
892
  export type CreateProjectData = {
844
893
  body: CreateProject;
845
894
  path: {
@@ -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, ListUserSpacesData, 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, ListSpaceMembersData, 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>;
@@ -50,7 +50,10 @@ export declare const useGetSpaceOverview: (options: Omit<GetSpaceOverviewData, "
50
50
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpaceOverview | undefined, Error>;
51
51
  export declare const useFetchKindeOrganisationBillingAgreements: (options: Omit<FetchKindeOrganisationBillingAgreementsData, "url"> & {
52
52
  enabled?: boolean;
53
- }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").KindeOrganisationBillingAgreement[] | undefined, Error>;
53
+ }) => import("@tanstack/react-query").UseQueryResult<unknown, Error>;
54
+ export declare const useListSpaceMembers: (options: Omit<ListSpaceMembersData, "url"> & {
55
+ enabled?: boolean;
56
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpaceMembersResponse | undefined, Error>;
54
57
  export declare const useCreateProject: (config?: {
55
58
  onSuccess?: (data: GetSuccessResponse<CreateProjectResponses>) => void;
56
59
  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, listUserSpaces, 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, listSpaceMembers, 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 };
@@ -289,6 +289,27 @@ export const useFetchKindeOrganisationBillingAgreements = (options) => {
289
289
  staleTime: 600000
290
290
  });
291
291
  };
292
+ export const useListSpaceMembers = (options) => {
293
+ const token = useToken();
294
+ let { enabled, ...rest } = options || { enabled: true };
295
+ const opts = { throwOnError: true, url: "/auth/{spaceHandle}/members/view" };
296
+ const funcer = async () => {
297
+ const auth = isPromise(token) ? (await token) || "" : token || "";
298
+ if (isPromise(token) && !token)
299
+ return;
300
+ const res = await listSpaceMembers({ ...opts, ...rest, auth });
301
+ return res.data;
302
+ };
303
+ if (!token)
304
+ enabled = false;
305
+ return useQuery({
306
+ queryKey: [options?.path?.spaceHandle, "members", "view", options.query ?? {}],
307
+ queryFn: funcer,
308
+ enabled,
309
+ retry: false,
310
+ staleTime: 600000
311
+ });
312
+ };
292
313
  export const useCreateProject = (config) => {
293
314
  const token = useToken();
294
315
  const queryClient = useQueryClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",