shoal-web-sdk 0.0.157 → 0.0.159

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,6 +1,6 @@
1
1
  import { type InfiniteData, type UseMutationOptions } from '@tanstack/react-query';
2
2
  import { type Options } from '../sdk.gen';
3
- import type { CheckSubdomainUniquenessData, CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateEnvironmentVariableData, CreateEnvironmentVariableError, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeleteEnvironmentVariableData, DeleteEnvironmentVariableError, DeleteEnvironmentVariableResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetEnvironmentVariablesData, GetEnvironmentVersionsData, GetGraphOverviewData, GetProjectOverviewData, GetPublicInviteData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetSpaceStatsData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateEnvironmentVariableData, UpdateEnvironmentVariableError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateNodeM2mData, UpdateNodeM2mError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError, VersionStatusData } from '../types.gen';
3
+ import type { CheckSubdomainUniquenessData, CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateEnvironmentVariableData, CreateEnvironmentVariableError, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeleteEnvironmentVariableData, DeleteEnvironmentVariableError, DeleteEnvironmentVariableResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetEnvironmentVariablesData, GetEnvironmentVersionsData, GetGraphOverviewData, GetProjectOverviewData, GetPublicInviteData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetSpaceStatsData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateEnvironmentVariableData, UpdateEnvironmentVariableError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateNodeM2mData, UpdateNodeM2mError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError, VersionStatusData } from '../types.gen';
4
4
  export type QueryKey<TOptions extends Options> = [
5
5
  Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
6
6
  _id: string;
@@ -420,6 +420,10 @@ export declare const listUserSpacesInfiniteOptions: (options?: Options<ListUserS
420
420
  * Record analytics data captured during the onboarding flow.
421
421
  */
422
422
  export declare const recordOnboardingAnalyticsMutation: (options?: Partial<Options<RecordOnboardingAnalyticsData>>) => UseMutationOptions<unknown, RecordOnboardingAnalyticsError, Options<RecordOnboardingAnalyticsData>>;
423
+ /**
424
+ * Create a space.
425
+ */
426
+ export declare const createSpaceMutation: (options?: Partial<Options<CreateSpaceData>>) => UseMutationOptions<CreateSpaceResponse, CreateSpaceError, Options<CreateSpaceData>>;
423
427
  export declare const getPublicInviteQueryKey: (options: Options<GetPublicInviteData>) => [Pick<Options<GetPublicInviteData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
424
428
  _id: string;
425
429
  _infinite?: boolean;
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { infiniteQueryOptions, queryOptions } from '@tanstack/react-query';
3
3
  import { client } from '../client.gen';
4
- import { checkSubdomainUniqueness, createEnvironment, createEnvironmentVariable, createProject, createSetupIntent, createSpaceInvite, createUsername, deleteAccountIdentity, deleteEnvironmentVariable, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getEnvironmentVariables, getEnvironmentVersions, getGraphOverview, getProjectOverview, getPublicInvite, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getSpaceStats, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, recordOnboardingAnalytics, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateEnvironmentVariable, updateGraphM2M, updateGraphState, updateNodeM2M, updateUsername, updateUserProfile, versionStatus } from '../sdk.gen';
4
+ import { checkSubdomainUniqueness, createEnvironment, createEnvironmentVariable, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deleteEnvironmentVariable, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getEnvironmentVariables, getEnvironmentVersions, getGraphOverview, getProjectOverview, getPublicInvite, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getSpaceStats, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, recordOnboardingAnalytics, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateEnvironmentVariable, updateGraphM2M, updateGraphState, updateNodeM2M, updateUsername, updateUserProfile, versionStatus } from '../sdk.gen';
5
5
  const createQueryKey = (id, options, infinite, tags) => {
6
6
  const params = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl };
7
7
  if (infinite) {
@@ -488,6 +488,22 @@ export const recordOnboardingAnalyticsMutation = (options) => {
488
488
  };
489
489
  return mutationOptions;
490
490
  };
491
+ /**
492
+ * Create a space.
493
+ */
494
+ export const createSpaceMutation = (options) => {
495
+ const mutationOptions = {
496
+ mutationFn: async (fnOptions) => {
497
+ const { data } = await createSpace({
498
+ ...options,
499
+ ...fnOptions,
500
+ throwOnError: true
501
+ });
502
+ return data;
503
+ }
504
+ };
505
+ return mutationOptions;
506
+ };
491
507
  export const getPublicInviteQueryKey = (options) => createQueryKey('getPublicInvite', options);
492
508
  /**
493
509
  * Fetch public invite details by UUID without authentication.
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { CheckSubdomainUniquenessData, CheckSubdomainUniquenessErrors, CheckSubdomainUniquenessResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableErrors, CreateEnvironmentVariableResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeleteEnvironmentVariableData, DeleteEnvironmentVariableErrors, DeleteEnvironmentVariableResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchBillingPricesData, FetchBillingPricesErrors, FetchBillingPricesResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, FetchNodeM2mData, FetchNodeM2mErrors, FetchNodeM2mResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetEnvironmentVariablesData, GetEnvironmentVariablesErrors, GetEnvironmentVariablesResponses, GetEnvironmentVersionsData, GetEnvironmentVersionsResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetPublicInviteData, GetPublicInviteErrors, GetPublicInviteResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetSpaceStatsData, GetSpaceStatsErrors, GetSpaceStatsResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListBillingInvoicesData, ListBillingInvoicesErrors, ListBillingInvoicesResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListPaymentMethodsData, ListPaymentMethodsErrors, ListPaymentMethodsResponses, ListSpaceMemberRolesData, ListSpaceMemberRolesErrors, ListSpaceMemberRolesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RecordCloudUsageData, RecordCloudUsageErrors, RecordCloudUsageResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsErrors, RecordOnboardingAnalyticsResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateEnvironmentVariableData, UpdateEnvironmentVariableErrors, UpdateEnvironmentVariableResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateNodeM2mData, UpdateNodeM2mErrors, UpdateNodeM2mResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses, VersionStatusData, VersionStatusErrors, VersionStatusResponses } from './types.gen';
2
+ import type { CheckSubdomainUniquenessData, CheckSubdomainUniquenessErrors, CheckSubdomainUniquenessResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableErrors, CreateEnvironmentVariableResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeleteEnvironmentVariableData, DeleteEnvironmentVariableErrors, DeleteEnvironmentVariableResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchBillingPricesData, FetchBillingPricesErrors, FetchBillingPricesResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, FetchNodeM2mData, FetchNodeM2mErrors, FetchNodeM2mResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetEnvironmentVariablesData, GetEnvironmentVariablesErrors, GetEnvironmentVariablesResponses, GetEnvironmentVersionsData, GetEnvironmentVersionsResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetPublicInviteData, GetPublicInviteErrors, GetPublicInviteResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetSpaceStatsData, GetSpaceStatsErrors, GetSpaceStatsResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListBillingInvoicesData, ListBillingInvoicesErrors, ListBillingInvoicesResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListPaymentMethodsData, ListPaymentMethodsErrors, ListPaymentMethodsResponses, ListSpaceMemberRolesData, ListSpaceMemberRolesErrors, ListSpaceMemberRolesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RecordCloudUsageData, RecordCloudUsageErrors, RecordCloudUsageResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsErrors, RecordOnboardingAnalyticsResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateEnvironmentVariableData, UpdateEnvironmentVariableErrors, UpdateEnvironmentVariableResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateNodeM2mData, UpdateNodeM2mErrors, UpdateNodeM2mResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses, VersionStatusData, VersionStatusErrors, VersionStatusResponses } 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
@@ -89,6 +89,10 @@ export declare const listUserSpaces: <ThrowOnError extends boolean = false>(opti
89
89
  * Record analytics data captured during the onboarding flow.
90
90
  */
91
91
  export declare const recordOnboardingAnalytics: <ThrowOnError extends boolean = false>(options: Options<RecordOnboardingAnalyticsData, ThrowOnError>) => import("./client").RequestResult<RecordOnboardingAnalyticsResponses, RecordOnboardingAnalyticsErrors, ThrowOnError, "fields">;
92
+ /**
93
+ * Create a space.
94
+ */
95
+ export declare const createSpace: <ThrowOnError extends boolean = false>(options: Options<CreateSpaceData, ThrowOnError>) => import("./client").RequestResult<CreateSpaceResponses, CreateSpaceErrors, ThrowOnError, "fields">;
92
96
  /**
93
97
  * Fetch public invite details by UUID without authentication.
94
98
  */
@@ -309,6 +309,25 @@ export const recordOnboardingAnalytics = (options) => {
309
309
  }
310
310
  });
311
311
  };
312
+ /**
313
+ * Create a space.
314
+ */
315
+ export const createSpace = (options) => {
316
+ return (options.client ?? client).post({
317
+ security: [
318
+ {
319
+ scheme: 'bearer',
320
+ type: 'http'
321
+ }
322
+ ],
323
+ url: '/auth/spaces/create',
324
+ ...options,
325
+ headers: {
326
+ 'Content-Type': 'application/json',
327
+ ...options.headers
328
+ }
329
+ });
330
+ };
312
331
  /**
313
332
  * Fetch public invite details by UUID without authentication.
314
333
  */
@@ -1,6 +1,7 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: 'http://localhost:8080/core-service' | 'https://api-dev.shoalstack.com/core-service' | (string & {});
3
3
  };
4
+ export type PlainString = string;
4
5
  export type EnvironmentVariables = {
5
6
  vars: Array<EnvironmentVariable>;
6
7
  };
@@ -26,7 +27,7 @@ export type ErrorResponse = {
26
27
  internalCode: ErrorCode;
27
28
  };
28
29
  export type CreateProject = {
29
- name: string;
30
+ name: PlainString;
30
31
  handle: string;
31
32
  description?: string;
32
33
  };
@@ -73,12 +74,12 @@ export type CreateInvite = {
73
74
  role: string;
74
75
  };
75
76
  export type CreateSpace = {
76
- name: string;
77
+ name: PlainString;
77
78
  handle: string;
78
79
  billingPlanCode: unknown;
79
80
  };
80
81
  export type CreateEnvironment = {
81
- name: string;
82
+ name: PlainString;
82
83
  handle: string;
83
84
  description?: string;
84
85
  };
@@ -293,8 +294,8 @@ export type KindeOrganisationBillingAgreement = {
293
294
  */
294
295
  plan_code?: string;
295
296
  };
296
- export type Nodes = {
297
- nodes: Array<Node>;
297
+ export type UpdateNodes = {
298
+ nodes: Array<UpdateNode>;
298
299
  };
299
300
  export type Uuids = {
300
301
  ids: Array<string>;
@@ -364,6 +365,38 @@ export type Node = {
364
365
  typ: 'scheduler';
365
366
  } & SchedulerNodeProps);
366
367
  };
368
+ export type UpdateNode = {
369
+ id: string;
370
+ name?: PlainString;
371
+ description?: string;
372
+ x: number;
373
+ y: number;
374
+ width: number;
375
+ height: number;
376
+ edges?: Array<Edge>;
377
+ typ: NodeType;
378
+ props?: ({
379
+ typ: 'comment';
380
+ } & CommentNodeProps) | ({
381
+ typ: 'cache';
382
+ } & CacheNodeProps) | ({
383
+ typ: 'container';
384
+ } & ContainerNodeProps) | ({
385
+ typ: 'cronjob';
386
+ } & CronJobNodeProps) | ({
387
+ typ: 'database';
388
+ } & DatabaseNodeProps) | ({
389
+ typ: 'function';
390
+ } & FunctionNodeProps) | ({
391
+ typ: 'queue';
392
+ } & QueueNodeProps) | ({
393
+ typ: 'proxy';
394
+ } & ProxyNodeProps) | ({
395
+ typ: 'vm';
396
+ } & VmNodeProps) | ({
397
+ typ: 'scheduler';
398
+ } & SchedulerNodeProps);
399
+ };
367
400
  export type EdgeType = 'network' | 'route';
368
401
  export type NodeType = 'cache' | 'comment' | 'container' | 'cronjob' | 'database' | 'function' | 'queue' | 'proxy' | 'vm' | 'scheduler';
369
402
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
@@ -700,7 +733,7 @@ export type FetchGraphM2mResponses = {
700
733
  };
701
734
  export type FetchGraphM2mResponse = FetchGraphM2mResponses[keyof FetchGraphM2mResponses];
702
735
  export type UpdateGraphM2mData = {
703
- body: Nodes;
736
+ body: UpdateNodes;
704
737
  path: {
705
738
  /**
706
739
  * A version UUID.
@@ -1348,6 +1381,38 @@ export type RecordOnboardingAnalyticsResponses = {
1348
1381
  */
1349
1382
  202: unknown;
1350
1383
  };
1384
+ export type CreateSpaceData = {
1385
+ body: CreateSpace;
1386
+ path?: never;
1387
+ query?: never;
1388
+ url: '/auth/spaces/create';
1389
+ };
1390
+ export type CreateSpaceErrors = {
1391
+ /**
1392
+ * Unauthorised user.
1393
+ */
1394
+ 401: ErrorResponse;
1395
+ /**
1396
+ * Invalid credentials.
1397
+ */
1398
+ 403: ErrorResponse;
1399
+ /**
1400
+ * Related content not found.
1401
+ */
1402
+ 404: ErrorResponse;
1403
+ /**
1404
+ * Unexpected error.
1405
+ */
1406
+ 500: ErrorResponse;
1407
+ };
1408
+ export type CreateSpaceError = CreateSpaceErrors[keyof CreateSpaceErrors];
1409
+ export type CreateSpaceResponses = {
1410
+ /**
1411
+ * Successfully created a space.
1412
+ */
1413
+ 201: SpaceOverview;
1414
+ };
1415
+ export type CreateSpaceResponse = CreateSpaceResponses[keyof CreateSpaceResponses];
1351
1416
  export type GetPublicInviteData = {
1352
1417
  body?: never;
1353
1418
  path: {
@@ -2378,7 +2443,7 @@ export type GetGraphOverviewResponses = {
2378
2443
  };
2379
2444
  export type GetGraphOverviewResponse = GetGraphOverviewResponses[keyof GetGraphOverviewResponses];
2380
2445
  export type UpdateGraphStateData = {
2381
- body: Nodes;
2446
+ body: UpdateNodes;
2382
2447
  path: {
2383
2448
  /**
2384
2449
  * The space handle. This must be globally unique.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ export declare const zPlainString: z.ZodString;
2
3
  export declare const zEnvironmentVariable: z.ZodObject<{
3
4
  key: z.ZodString;
4
5
  value: z.ZodString;
@@ -743,7 +744,8 @@ export declare const zNode: z.ZodObject<{
743
744
  paused: z.ZodBoolean;
744
745
  }, z.core.$strip>>]>>;
745
746
  }, z.core.$strip>;
746
- export declare const zNodes: z.ZodObject<{
747
+ export declare const zGraph: z.ZodObject<{
748
+ versionUUID: z.ZodUUID;
747
749
  nodes: z.ZodArray<z.ZodObject<{
748
750
  id: z.ZodUUID;
749
751
  name: z.ZodOptional<z.ZodString>;
@@ -863,8 +865,125 @@ export declare const zNodes: z.ZodObject<{
863
865
  }, z.core.$strip>>]>>;
864
866
  }, z.core.$strip>>;
865
867
  }, z.core.$strip>;
866
- export declare const zGraph: z.ZodObject<{
867
- versionUUID: z.ZodUUID;
868
+ export declare const zUpdateNode: z.ZodObject<{
869
+ id: z.ZodUUID;
870
+ name: z.ZodOptional<z.ZodString>;
871
+ description: z.ZodOptional<z.ZodString>;
872
+ x: z.ZodNumber;
873
+ y: z.ZodNumber;
874
+ width: z.ZodInt;
875
+ height: z.ZodInt;
876
+ edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
877
+ id: z.ZodUUID;
878
+ src: z.ZodUUID;
879
+ dst: z.ZodUUID;
880
+ typ: z.ZodEnum<{
881
+ network: "network";
882
+ route: "route";
883
+ }>;
884
+ props: z.ZodOptional<z.ZodUnion<readonly [z.ZodIntersection<z.ZodObject<{
885
+ typ: z.ZodLiteral<"network">;
886
+ }, z.core.$strip>, z.ZodObject<{
887
+ a: z.ZodOptional<z.ZodString>;
888
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
889
+ typ: z.ZodLiteral<"route">;
890
+ }, z.core.$strip>, z.ZodObject<{
891
+ path: z.ZodOptional<z.ZodString>;
892
+ }, z.core.$strip>>]>>;
893
+ }, z.core.$strip>>>;
894
+ typ: z.ZodEnum<{
895
+ function: "function";
896
+ cache: "cache";
897
+ comment: "comment";
898
+ container: "container";
899
+ cronjob: "cronjob";
900
+ database: "database";
901
+ queue: "queue";
902
+ proxy: "proxy";
903
+ vm: "vm";
904
+ scheduler: "scheduler";
905
+ }>;
906
+ props: z.ZodOptional<z.ZodUnion<readonly [z.ZodIntersection<z.ZodObject<{
907
+ typ: z.ZodLiteral<"comment">;
908
+ }, z.core.$strip>, z.ZodObject<{
909
+ comment: z.ZodOptional<z.ZodString>;
910
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
911
+ typ: z.ZodLiteral<"cache">;
912
+ }, z.core.$strip>, z.ZodObject<{
913
+ size: z.ZodOptional<z.ZodInt>;
914
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
915
+ typ: z.ZodLiteral<"container">;
916
+ }, z.core.$strip>, z.ZodObject<{
917
+ region: z.ZodEnum<{
918
+ "europe-west2": "europe-west2";
919
+ }>;
920
+ port: z.ZodInt;
921
+ cpu: z.ZodEnum<{
922
+ 1: "1";
923
+ 2: "2";
924
+ }>;
925
+ memory: z.ZodEnum<{
926
+ "512Mi": "512Mi";
927
+ "1Gi": "1Gi";
928
+ "2Gi": "2Gi";
929
+ }>;
930
+ ingress: z.ZodEnum<{
931
+ INGRESS_TRAFFIC_ALL: "INGRESS_TRAFFIC_ALL";
932
+ INGRESS_TRAFFIC_INTERNAL_ONLY: "INGRESS_TRAFFIC_INTERNAL_ONLY";
933
+ INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER: "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER";
934
+ }>;
935
+ timeoutSeconds: z.ZodOptional<z.ZodInt>;
936
+ maxInstances: z.ZodOptional<z.ZodInt>;
937
+ minInstances: z.ZodOptional<z.ZodInt>;
938
+ concurrency: z.ZodOptional<z.ZodInt>;
939
+ allowUnauthenticated: z.ZodOptional<z.ZodBoolean>;
940
+ uri: z.ZodOptional<z.ZodString>;
941
+ installationId: z.ZodOptional<z.ZodString>;
942
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
943
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
944
+ typ: z.ZodLiteral<"cronjob">;
945
+ }, z.core.$strip>, z.ZodObject<{
946
+ cronTab: z.ZodOptional<z.ZodString>;
947
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
948
+ typ: z.ZodLiteral<"database">;
949
+ }, z.core.$strip>, z.ZodObject<{
950
+ space: z.ZodOptional<z.ZodInt>;
951
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
952
+ typ: z.ZodLiteral<"function">;
953
+ }, z.core.$strip>, z.ZodObject<{
954
+ cpus: z.ZodOptional<z.ZodInt>;
955
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
956
+ typ: z.ZodLiteral<"queue">;
957
+ }, z.core.$strip>, z.ZodObject<{
958
+ foobar: z.ZodOptional<z.ZodString>;
959
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
960
+ typ: z.ZodLiteral<"proxy">;
961
+ }, z.core.$strip>, z.ZodObject<{
962
+ subdomain: z.ZodOptional<z.ZodString>;
963
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
964
+ typ: z.ZodLiteral<"vm">;
965
+ }, z.core.$strip>, z.ZodObject<{
966
+ os: z.ZodOptional<z.ZodString>;
967
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{
968
+ typ: z.ZodLiteral<"scheduler">;
969
+ }, z.core.$strip>, z.ZodObject<{
970
+ expression: z.ZodString;
971
+ timezone: z.ZodString;
972
+ requestMethod: z.ZodEnum<{
973
+ DELETE: "DELETE";
974
+ GET: "GET";
975
+ HEAD: "HEAD";
976
+ OPTIONS: "OPTIONS";
977
+ PATCH: "PATCH";
978
+ POST: "POST";
979
+ PUT: "PUT";
980
+ }>;
981
+ requestPayload: z.ZodOptional<z.ZodString>;
982
+ requestHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
983
+ paused: z.ZodBoolean;
984
+ }, z.core.$strip>>]>>;
985
+ }, z.core.$strip>;
986
+ export declare const zUpdateNodes: z.ZodObject<{
868
987
  nodes: z.ZodArray<z.ZodObject<{
869
988
  id: z.ZodUUID;
870
989
  name: z.ZodOptional<z.ZodString>;
@@ -1937,6 +2056,41 @@ export declare const zRecordOnboardingAnalyticsData: z.ZodObject<{
1937
2056
  path: z.ZodOptional<z.ZodNever>;
1938
2057
  query: z.ZodOptional<z.ZodNever>;
1939
2058
  }, z.core.$strip>;
2059
+ export declare const zCreateSpaceData: z.ZodObject<{
2060
+ body: z.ZodObject<{
2061
+ name: z.ZodString;
2062
+ handle: z.ZodString;
2063
+ billingPlanCode: z.ZodUnknown;
2064
+ }, z.core.$strip>;
2065
+ path: z.ZodOptional<z.ZodNever>;
2066
+ query: z.ZodOptional<z.ZodNever>;
2067
+ }, z.core.$strip>;
2068
+ /**
2069
+ * Successfully created a space.
2070
+ */
2071
+ export declare const zCreateSpaceResponse: z.ZodObject<{
2072
+ id: z.ZodString;
2073
+ name: z.ZodString;
2074
+ handle: z.ZodString;
2075
+ projects: z.ZodArray<z.ZodObject<{
2076
+ id: z.ZodUUID;
2077
+ orgCode: z.ZodString;
2078
+ name: z.ZodString;
2079
+ handle: z.ZodString;
2080
+ description: z.ZodString;
2081
+ createdAt: z.ZodISODateTime;
2082
+ updatedAt: z.ZodISODateTime;
2083
+ environments: z.ZodArray<z.ZodObject<{
2084
+ id: z.ZodUUID;
2085
+ name: z.ZodString;
2086
+ handle: z.ZodString;
2087
+ description: z.ZodString;
2088
+ createdAt: z.ZodISODateTime;
2089
+ updatedAt: z.ZodISODateTime;
2090
+ versions: z.ZodInt;
2091
+ }, z.core.$strip>>;
2092
+ }, z.core.$strip>>;
2093
+ }, z.core.$strip>;
1940
2094
  export declare const zGetPublicInviteData: z.ZodObject<{
1941
2095
  body: z.ZodOptional<z.ZodNever>;
1942
2096
  path: z.ZodObject<{
@@ -1,5 +1,6 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
  import { z } from 'zod';
3
+ export const zPlainString = z.string().regex(/^[a-zA-Z0-9 ]+$/);
3
4
  export const zEnvironmentVariable = z.object({
4
5
  key: z.string(),
5
6
  value: z.string()
@@ -58,7 +59,7 @@ export const zErrorResponse = z.object({
58
59
  internalCode: zErrorCode
59
60
  });
60
61
  export const zCreateProject = z.object({
61
- name: z.string(),
62
+ name: zPlainString,
62
63
  handle: z.string(),
63
64
  description: z.optional(z.string())
64
65
  });
@@ -92,12 +93,12 @@ export const zCreateInvite = z.object({
92
93
  role: z.string()
93
94
  });
94
95
  export const zCreateSpace = z.object({
95
- name: z.string(),
96
+ name: zPlainString,
96
97
  handle: z.string(),
97
98
  billingPlanCode: z.unknown()
98
99
  });
99
100
  export const zCreateEnvironment = z.object({
100
- name: z.string(),
101
+ name: zPlainString,
101
102
  handle: z.string(),
102
103
  description: z.optional(z.string())
103
104
  });
@@ -466,13 +467,56 @@ export const zNode = z.object({
466
467
  }).and(zSchedulerNodeProps)
467
468
  ]))
468
469
  });
469
- export const zNodes = z.object({
470
- nodes: z.array(zNode)
471
- });
472
470
  export const zGraph = z.object({
473
471
  versionUUID: z.uuid(),
474
472
  nodes: z.array(zNode)
475
473
  });
474
+ export const zUpdateNode = z.object({
475
+ id: z.uuid(),
476
+ name: z.optional(zPlainString),
477
+ description: z.optional(z.string()),
478
+ x: z.number(),
479
+ y: z.number(),
480
+ width: z.int(),
481
+ height: z.int(),
482
+ edges: z.optional(z.array(zEdge)),
483
+ typ: zNodeType,
484
+ props: z.optional(z.union([
485
+ z.object({
486
+ typ: z.literal('comment')
487
+ }).and(zCommentNodeProps),
488
+ z.object({
489
+ typ: z.literal('cache')
490
+ }).and(zCacheNodeProps),
491
+ z.object({
492
+ typ: z.literal('container')
493
+ }).and(zContainerNodeProps),
494
+ z.object({
495
+ typ: z.literal('cronjob')
496
+ }).and(zCronJobNodeProps),
497
+ z.object({
498
+ typ: z.literal('database')
499
+ }).and(zDatabaseNodeProps),
500
+ z.object({
501
+ typ: z.literal('function')
502
+ }).and(zFunctionNodeProps),
503
+ z.object({
504
+ typ: z.literal('queue')
505
+ }).and(zQueueNodeProps),
506
+ z.object({
507
+ typ: z.literal('proxy')
508
+ }).and(zProxyNodeProps),
509
+ z.object({
510
+ typ: z.literal('vm')
511
+ }).and(zVmNodeProps),
512
+ z.object({
513
+ typ: z.literal('scheduler')
514
+ }).and(zSchedulerNodeProps)
515
+ ]))
516
+ });
517
+ export const zUpdateNodes = z.object({
518
+ nodes: z.array(zUpdateNode)
519
+ });
476
520
  export const zSignedUrlUploadResponse = z.object({
477
521
  signedUrl: z.string(),
478
522
  expiration: z.iso.datetime(),
@@ -662,7 +706,7 @@ export const zFetchGraphM2mData = z.object({
662
706
  */
663
707
  export const zFetchGraphM2mResponse = zGraph;
664
708
  export const zUpdateGraphM2mData = z.object({
665
- body: zNodes,
709
+ body: zUpdateNodes,
666
710
  path: z.object({
667
711
  versionUUID: z.uuid()
668
712
  }),
@@ -819,6 +863,15 @@ export const zRecordOnboardingAnalyticsData = z.object({
819
863
  path: z.optional(z.never()),
820
864
  query: z.optional(z.never())
821
865
  });
866
+ export const zCreateSpaceData = z.object({
867
+ body: zCreateSpace,
868
+ path: z.optional(z.never()),
869
+ query: z.optional(z.never())
870
+ });
871
+ /**
872
+ * Successfully created a space.
873
+ */
874
+ export const zCreateSpaceResponse = zSpaceOverview;
822
875
  export const zGetPublicInviteData = z.object({
823
876
  body: z.optional(z.never()),
824
877
  path: z.object({
@@ -1104,7 +1157,7 @@ export const zGetGraphOverviewData = z.object({
1104
1157
  */
1105
1158
  export const zGetGraphOverviewResponse = zGraph;
1106
1159
  export const zUpdateGraphStateData = z.object({
1107
- body: zNodes,
1160
+ body: zUpdateNodes,
1108
1161
  path: z.object({
1109
1162
  spaceHandle: z.string(),
1110
1163
  projectHandle: z.string(),
@@ -1,6 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { GetSuccessResponse } from "../util";
3
- import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, VersionStatusData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData } from "../../sdk/types.gen";
3
+ import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, CreateSpaceData, CreateSpaceResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, VersionStatusData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData } 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>;
@@ -76,6 +76,11 @@ export declare const useRecordOnboardingAnalytics: (config?: {
76
76
  onError?: Parameters<typeof useMutation>["0"]["onError"];
77
77
  retry?: boolean;
78
78
  }) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<RecordOnboardingAnalyticsData, "url">, unknown>;
79
+ export declare const useCreateSpace: (config?: {
80
+ onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>) => void;
81
+ onError?: Parameters<typeof useMutation>["0"]["onError"];
82
+ retry?: boolean;
83
+ }) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").SpaceOverview | undefined, unknown, Omit<CreateSpaceData, "url">, unknown>;
79
84
  export declare const useGetPublicInvite: (options: Omit<GetPublicInviteData, "url"> & {
80
85
  enabled?: boolean;
81
86
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").PublicInvite | undefined, Error>;
@@ -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, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, recordOnboardingAnalytics, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, getGraphOverview, updateGraphState, deployVersion, versionStatus, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, recordOnboardingAnalytics, createSpace, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, getGraphOverview, updateGraphState, deployVersion, versionStatus, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices } from "../../sdk/sdk.gen";
6
6
  export const useGetServiceHealth = (options) => {
7
7
  const token = useToken();
8
8
  let { enabled, ...rest } = options || { enabled: true };
@@ -384,6 +384,25 @@ export const useRecordOnboardingAnalytics = (config) => {
384
384
  retry: config?.retry
385
385
  });
386
386
  };
387
+ export const useCreateSpace = (config) => {
388
+ const token = useToken();
389
+ const queryClient = useQueryClient();
390
+ const opts = { throwOnError: true, url: "/auth/spaces/create" };
391
+ const funcer = async (options) => {
392
+ const auth = isPromise(token) ? (await token) || "" : token || "";
393
+ const res = await createSpace({ ...opts, ...options, auth });
394
+ return res?.data;
395
+ };
396
+ return useMutation({
397
+ mutationFn: funcer,
398
+ onSuccess: (res, options, c, ctx) => {
399
+ queryClient.invalidateQueries({ queryKey: ["spaces", "create"] });
400
+ config?.onSuccess && config.onSuccess(res);
401
+ },
402
+ onError: config?.onError,
403
+ retry: config?.retry
404
+ });
405
+ };
387
406
  export const useGetPublicInvite = (options) => {
388
407
  const token = useToken();
389
408
  let { enabled, ...rest } = options || { enabled: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.157",
3
+ "version": "0.0.159",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",