shoal-web-sdk 0.0.119 → 0.0.120
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/@tanstack/react-query.gen.d.ts +57 -1
- package/dist/sdk/@tanstack/react-query.gen.js +37 -1
- package/dist/sdk/sdk.gen.d.ts +9 -1
- package/dist/sdk/sdk.gen.js +30 -0
- package/dist/sdk/types.gen.d.ts +183 -1
- package/dist/sdk/zod.gen.d.ts +127 -20
- package/dist/sdk/zod.gen.js +82 -2
- package/dist/tanstack-codegen/generated/generated.d.ts +7 -1
- package/dist/tanstack-codegen/generated/generated.js +43 -1
- package/package.json +1 -1
|
@@ -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 { CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError } from '../types.gen';
|
|
3
|
+
import type { CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSetupIntentData, CreateSetupIntentError, CreateSetupIntentResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchBillingPricesData, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, FetchLogsData, FetchNodeM2mData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListBillingInvoicesData, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RecordCloudUsageData, RecordCloudUsageError, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RequestSignedUploadUrlError, RequestSignedUploadUrlResponse, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphM2mData, UpdateGraphM2mError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError } from '../types.gen';
|
|
4
4
|
export type QueryKey<TOptions extends Options> = [
|
|
5
5
|
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
6
6
|
_id: string;
|
|
@@ -736,6 +736,34 @@ export declare const getProjectOverviewOptions: (options: Options<GetProjectOver
|
|
|
736
736
|
[dataTagErrorSymbol]: Error;
|
|
737
737
|
};
|
|
738
738
|
};
|
|
739
|
+
export declare const fetchLogsQueryKey: (options: Options<FetchLogsData>) => [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
740
|
+
_id: string;
|
|
741
|
+
_infinite?: boolean;
|
|
742
|
+
tags?: ReadonlyArray<string>;
|
|
743
|
+
}];
|
|
744
|
+
/**
|
|
745
|
+
* Fetch a series of paginated log entries.
|
|
746
|
+
*/
|
|
747
|
+
export declare const fetchLogsOptions: (options: Options<FetchLogsData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").Logs, Error, import("../types.gen").Logs, [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
748
|
+
_id: string;
|
|
749
|
+
_infinite?: boolean;
|
|
750
|
+
tags?: ReadonlyArray<string>;
|
|
751
|
+
}]>, "queryFn"> & {
|
|
752
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").Logs, [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
753
|
+
_id: string;
|
|
754
|
+
_infinite?: boolean;
|
|
755
|
+
tags?: ReadonlyArray<string>;
|
|
756
|
+
}], never> | undefined;
|
|
757
|
+
} & {
|
|
758
|
+
queryKey: [Pick<Options<FetchLogsData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
759
|
+
_id: string;
|
|
760
|
+
_infinite?: boolean;
|
|
761
|
+
tags?: ReadonlyArray<string>;
|
|
762
|
+
}] & {
|
|
763
|
+
[dataTagSymbol]: import("../types.gen").Logs;
|
|
764
|
+
[dataTagErrorSymbol]: Error;
|
|
765
|
+
};
|
|
766
|
+
};
|
|
739
767
|
/**
|
|
740
768
|
* Create an environment inside a project.
|
|
741
769
|
*/
|
|
@@ -940,3 +968,31 @@ export declare const fetchBillingPricesOptions: (options: Options<FetchBillingPr
|
|
|
940
968
|
[dataTagErrorSymbol]: Error;
|
|
941
969
|
};
|
|
942
970
|
};
|
|
971
|
+
export declare const listBillingInvoicesQueryKey: (options: Options<ListBillingInvoicesData>) => [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
972
|
+
_id: string;
|
|
973
|
+
_infinite?: boolean;
|
|
974
|
+
tags?: ReadonlyArray<string>;
|
|
975
|
+
}];
|
|
976
|
+
/**
|
|
977
|
+
* List past invoices for the space, newest first.
|
|
978
|
+
*/
|
|
979
|
+
export declare const listBillingInvoicesOptions: (options: Options<ListBillingInvoicesData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").InvoicesResponse, Error, import("../types.gen").InvoicesResponse, [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
980
|
+
_id: string;
|
|
981
|
+
_infinite?: boolean;
|
|
982
|
+
tags?: ReadonlyArray<string>;
|
|
983
|
+
}]>, "queryFn"> & {
|
|
984
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").InvoicesResponse, [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
985
|
+
_id: string;
|
|
986
|
+
_infinite?: boolean;
|
|
987
|
+
tags?: ReadonlyArray<string>;
|
|
988
|
+
}], never> | undefined;
|
|
989
|
+
} & {
|
|
990
|
+
queryKey: [Pick<Options<ListBillingInvoicesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
991
|
+
_id: string;
|
|
992
|
+
_infinite?: boolean;
|
|
993
|
+
tags?: ReadonlyArray<string>;
|
|
994
|
+
}] & {
|
|
995
|
+
[dataTagSymbol]: import("../types.gen").InvoicesResponse;
|
|
996
|
+
[dataTagErrorSymbol]: Error;
|
|
997
|
+
};
|
|
998
|
+
};
|
|
@@ -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 { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile } from '../sdk.gen';
|
|
4
|
+
import { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchBillingPrices, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, fetchLogs, fetchNodeM2M, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listBillingInvoices, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, recordCloudUsage, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, updateGraphM2M, updateGraphState, updateUsername, updateUserProfile } 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) {
|
|
@@ -793,6 +793,24 @@ export const getProjectOverviewOptions = (options) => {
|
|
|
793
793
|
queryKey: getProjectOverviewQueryKey(options)
|
|
794
794
|
});
|
|
795
795
|
};
|
|
796
|
+
export const fetchLogsQueryKey = (options) => createQueryKey('fetchLogs', options);
|
|
797
|
+
/**
|
|
798
|
+
* Fetch a series of paginated log entries.
|
|
799
|
+
*/
|
|
800
|
+
export const fetchLogsOptions = (options) => {
|
|
801
|
+
return queryOptions({
|
|
802
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
803
|
+
const { data } = await fetchLogs({
|
|
804
|
+
...options,
|
|
805
|
+
...queryKey[0],
|
|
806
|
+
signal,
|
|
807
|
+
throwOnError: true
|
|
808
|
+
});
|
|
809
|
+
return data;
|
|
810
|
+
},
|
|
811
|
+
queryKey: fetchLogsQueryKey(options)
|
|
812
|
+
});
|
|
813
|
+
};
|
|
796
814
|
/**
|
|
797
815
|
* Create an environment inside a project.
|
|
798
816
|
*/
|
|
@@ -1045,3 +1063,21 @@ export const fetchBillingPricesOptions = (options) => {
|
|
|
1045
1063
|
queryKey: fetchBillingPricesQueryKey(options)
|
|
1046
1064
|
});
|
|
1047
1065
|
};
|
|
1066
|
+
export const listBillingInvoicesQueryKey = (options) => createQueryKey('listBillingInvoices', options);
|
|
1067
|
+
/**
|
|
1068
|
+
* List past invoices for the space, newest first.
|
|
1069
|
+
*/
|
|
1070
|
+
export const listBillingInvoicesOptions = (options) => {
|
|
1071
|
+
return queryOptions({
|
|
1072
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1073
|
+
const { data } = await listBillingInvoices({
|
|
1074
|
+
...options,
|
|
1075
|
+
...queryKey[0],
|
|
1076
|
+
signal,
|
|
1077
|
+
throwOnError: true
|
|
1078
|
+
});
|
|
1079
|
+
return data;
|
|
1080
|
+
},
|
|
1081
|
+
queryKey: listBillingInvoicesQueryKey(options)
|
|
1082
|
+
});
|
|
1083
|
+
};
|
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, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, 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, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListPaymentMethodsData, ListPaymentMethodsErrors, ListPaymentMethodsResponses, ListSpaceMemberRolesData, ListSpaceMemberRolesErrors, ListSpaceMemberRolesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RecordCloudUsageData, RecordCloudUsageErrors, RecordCloudUsageResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses } from './types.gen';
|
|
2
|
+
import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSetupIntentData, CreateSetupIntentErrors, CreateSetupIntentResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchBillingPricesData, FetchBillingPricesErrors, FetchBillingPricesResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, FetchLogsData, FetchLogsErrors, FetchLogsResponses, FetchNodeM2mData, FetchNodeM2mErrors, FetchNodeM2mResponses, GetBillingPlanData, GetBillingPlanErrors, GetBillingPlanResponses, GetBillingUsageData, GetBillingUsageErrors, GetBillingUsageResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOrgCodeData, GetSpaceOrgCodeErrors, GetSpaceOrgCodeResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, 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, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphM2mData, UpdateGraphM2mErrors, UpdateGraphM2mResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses } 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
|
|
@@ -141,6 +141,10 @@ export declare const createProject: <ThrowOnError extends boolean = false>(optio
|
|
|
141
141
|
* Get the project overview.
|
|
142
142
|
*/
|
|
143
143
|
export declare const getProjectOverview: <ThrowOnError extends boolean = false>(options: Options<GetProjectOverviewData, ThrowOnError>) => import("./client").RequestResult<GetProjectOverviewResponses, GetProjectOverviewErrors, ThrowOnError, "fields">;
|
|
144
|
+
/**
|
|
145
|
+
* Fetch a series of paginated log entries.
|
|
146
|
+
*/
|
|
147
|
+
export declare const fetchLogs: <ThrowOnError extends boolean = false>(options: Options<FetchLogsData, ThrowOnError>) => import("./client").RequestResult<FetchLogsResponses, FetchLogsErrors, ThrowOnError, "fields">;
|
|
144
148
|
/**
|
|
145
149
|
* Create an environment inside a project.
|
|
146
150
|
*/
|
|
@@ -201,3 +205,7 @@ export declare const getBillingUsage: <ThrowOnError extends boolean = false>(opt
|
|
|
201
205
|
* Fetch live unit prices for all paid plans from Stripe.
|
|
202
206
|
*/
|
|
203
207
|
export declare const fetchBillingPrices: <ThrowOnError extends boolean = false>(options: Options<FetchBillingPricesData, ThrowOnError>) => import("./client").RequestResult<FetchBillingPricesResponses, FetchBillingPricesErrors, ThrowOnError, "fields">;
|
|
208
|
+
/**
|
|
209
|
+
* List past invoices for the space, newest first.
|
|
210
|
+
*/
|
|
211
|
+
export declare const listBillingInvoices: <ThrowOnError extends boolean = false>(options: Options<ListBillingInvoicesData, ThrowOnError>) => import("./client").RequestResult<ListBillingInvoicesResponses, ListBillingInvoicesErrors, ThrowOnError, "fields">;
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -508,6 +508,21 @@ export const getProjectOverview = (options) => {
|
|
|
508
508
|
...options
|
|
509
509
|
});
|
|
510
510
|
};
|
|
511
|
+
/**
|
|
512
|
+
* Fetch a series of paginated log entries.
|
|
513
|
+
*/
|
|
514
|
+
export const fetchLogs = (options) => {
|
|
515
|
+
return (options.client ?? client).get({
|
|
516
|
+
security: [
|
|
517
|
+
{
|
|
518
|
+
scheme: 'bearer',
|
|
519
|
+
type: 'http'
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
url: '/auth/{spaceHandle}/{projectHandle}/logs',
|
|
523
|
+
...options
|
|
524
|
+
});
|
|
525
|
+
};
|
|
511
526
|
/**
|
|
512
527
|
* Create an environment inside a project.
|
|
513
528
|
*/
|
|
@@ -749,3 +764,18 @@ export const fetchBillingPrices = (options) => {
|
|
|
749
764
|
...options
|
|
750
765
|
});
|
|
751
766
|
};
|
|
767
|
+
/**
|
|
768
|
+
* List past invoices for the space, newest first.
|
|
769
|
+
*/
|
|
770
|
+
export const listBillingInvoices = (options) => {
|
|
771
|
+
return (options.client ?? client).get({
|
|
772
|
+
security: [
|
|
773
|
+
{
|
|
774
|
+
scheme: 'bearer',
|
|
775
|
+
type: 'http'
|
|
776
|
+
}
|
|
777
|
+
],
|
|
778
|
+
url: '/auth/{spaceHandle}/billing/invoices',
|
|
779
|
+
...options
|
|
780
|
+
});
|
|
781
|
+
};
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
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 LogEntry = {
|
|
5
|
+
id: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
projectID: string;
|
|
8
|
+
environmentID: string;
|
|
9
|
+
nodeID: string;
|
|
10
|
+
payload: unknown;
|
|
11
|
+
};
|
|
12
|
+
export type Logs = {
|
|
13
|
+
logs: Array<LogEntry>;
|
|
14
|
+
nextPage?: string;
|
|
15
|
+
limit: unknown;
|
|
16
|
+
};
|
|
4
17
|
export type PlatformTier = 'free' | 'hobby' | 'pro';
|
|
5
18
|
export type BillingInterval = 'monthly' | 'annual';
|
|
6
19
|
export type BillingPlanLookupKey = 'free-monthly' | 'hobby-monthly' | 'hobby-annual' | 'pro-monthly' | 'pro-annual';
|
|
@@ -330,7 +343,7 @@ export type ContainerNodeProps = {
|
|
|
330
343
|
};
|
|
331
344
|
export type Region = 'africa-south1' | 'asia-east1' | 'asia-east2' | 'asia-northeast1' | 'asia-northeast2' | 'asia-northeast3' | 'asia-south1' | 'asia-southeast1' | 'asia-southeast2' | 'australia-southeast1' | 'europe-north1' | 'europe-west1' | 'europe-west2' | 'europe-west3' | 'europe-west4' | 'europe-west6' | 'northamerica-northeast1' | 'northamerica-northeast2' | 'southamerica-east1' | 'southamerica-west1' | 'us-central1' | 'us-east1' | 'us-east4' | 'us-west1' | 'us-west2' | 'us-west3' | 'us-west4';
|
|
332
345
|
export type Cpu = '1' | '2' | '4' | '6' | '8' | '16' | '32';
|
|
333
|
-
export type Memory = '
|
|
346
|
+
export type Memory = '512Mi' | '1Gi' | '2Gi' | '4Gi' | '8Gi' | '16Gi' | '32Gi';
|
|
334
347
|
export type Ingress = 'INGRESS_TRAFFIC_ALL' | 'INGRESS_TRAFFIC_INTERNAL_ONLY' | 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER';
|
|
335
348
|
export type CronJobNodeProps = {
|
|
336
349
|
cronTab?: string;
|
|
@@ -402,6 +415,59 @@ export type RecordUsageRequest = {
|
|
|
402
415
|
*/
|
|
403
416
|
timestamp?: number;
|
|
404
417
|
};
|
|
418
|
+
export type Invoice = {
|
|
419
|
+
/**
|
|
420
|
+
* Stripe invoice ID.
|
|
421
|
+
*/
|
|
422
|
+
id: string;
|
|
423
|
+
/**
|
|
424
|
+
* Human-readable invoice number (e.g. "INV-0001").
|
|
425
|
+
*/
|
|
426
|
+
number: string;
|
|
427
|
+
/**
|
|
428
|
+
* Invoice status (paid, open, void, draft, uncollectible).
|
|
429
|
+
*/
|
|
430
|
+
status: string;
|
|
431
|
+
/**
|
|
432
|
+
* Total amount due in the smallest currency unit (e.g. cents).
|
|
433
|
+
*/
|
|
434
|
+
amountDue: number;
|
|
435
|
+
/**
|
|
436
|
+
* Amount already paid in the smallest currency unit.
|
|
437
|
+
*/
|
|
438
|
+
amountPaid: number;
|
|
439
|
+
/**
|
|
440
|
+
* ISO 4217 currency code (e.g. "usd").
|
|
441
|
+
*/
|
|
442
|
+
currency: string;
|
|
443
|
+
/**
|
|
444
|
+
* Start of the billing period this invoice covers.
|
|
445
|
+
*/
|
|
446
|
+
periodStart: string;
|
|
447
|
+
/**
|
|
448
|
+
* End of the billing period this invoice covers.
|
|
449
|
+
*/
|
|
450
|
+
periodEnd: string;
|
|
451
|
+
/**
|
|
452
|
+
* When the invoice was created.
|
|
453
|
+
*/
|
|
454
|
+
created: string;
|
|
455
|
+
/**
|
|
456
|
+
* URL to download the invoice PDF.
|
|
457
|
+
*/
|
|
458
|
+
invoicePdfUrl: string;
|
|
459
|
+
/**
|
|
460
|
+
* URL to the Stripe-hosted invoice page.
|
|
461
|
+
*/
|
|
462
|
+
hostedInvoiceUrl: string;
|
|
463
|
+
};
|
|
464
|
+
export type InvoicesResponse = {
|
|
465
|
+
invoices: Array<Invoice>;
|
|
466
|
+
/**
|
|
467
|
+
* Pass this as `starting_after` in the next request to fetch the next page. Absent when there are no more pages.
|
|
468
|
+
*/
|
|
469
|
+
nextPageToken?: string;
|
|
470
|
+
};
|
|
405
471
|
export type PlanPriceResponse = {
|
|
406
472
|
/**
|
|
407
473
|
* Plan code (e.g. "hobby-monthly", "pro-annual").
|
|
@@ -420,6 +486,14 @@ export type PlanPriceResponse = {
|
|
|
420
486
|
*/
|
|
421
487
|
interval: string;
|
|
422
488
|
};
|
|
489
|
+
/**
|
|
490
|
+
* The from time to start querying logs from.
|
|
491
|
+
*/
|
|
492
|
+
export type FromTime = string;
|
|
493
|
+
/**
|
|
494
|
+
* The to time to start querying logs to.
|
|
495
|
+
*/
|
|
496
|
+
export type ToTime = string;
|
|
423
497
|
/**
|
|
424
498
|
* Expiry query.
|
|
425
499
|
*/
|
|
@@ -432,6 +506,14 @@ export type NodeUuid = string;
|
|
|
432
506
|
* An invite UUID.
|
|
433
507
|
*/
|
|
434
508
|
export type InviteUuid = string;
|
|
509
|
+
/**
|
|
510
|
+
* The environment UUID.
|
|
511
|
+
*/
|
|
512
|
+
export type EnvironmentId = string;
|
|
513
|
+
/**
|
|
514
|
+
* The node UUID.
|
|
515
|
+
*/
|
|
516
|
+
export type NodeId = string;
|
|
435
517
|
/**
|
|
436
518
|
* A version UUID.
|
|
437
519
|
*/
|
|
@@ -472,6 +554,10 @@ export type Page = number;
|
|
|
472
554
|
* Page size (max 100).
|
|
473
555
|
*/
|
|
474
556
|
export type Limit = number;
|
|
557
|
+
/**
|
|
558
|
+
* The next page token for paginated results from the log service.
|
|
559
|
+
*/
|
|
560
|
+
export type LogServiceNextPageToken = string;
|
|
475
561
|
/**
|
|
476
562
|
* Opaque pagination token returned by the previous response.
|
|
477
563
|
*/
|
|
@@ -1729,6 +1815,64 @@ export type GetProjectOverviewResponses = {
|
|
|
1729
1815
|
200: ProjectOverview;
|
|
1730
1816
|
};
|
|
1731
1817
|
export type GetProjectOverviewResponse = GetProjectOverviewResponses[keyof GetProjectOverviewResponses];
|
|
1818
|
+
export type FetchLogsData = {
|
|
1819
|
+
body?: never;
|
|
1820
|
+
path: {
|
|
1821
|
+
/**
|
|
1822
|
+
* The space handle. This must be globally unique.
|
|
1823
|
+
*/
|
|
1824
|
+
spaceHandle: string;
|
|
1825
|
+
/**
|
|
1826
|
+
* A project name. This must be unique to a space.
|
|
1827
|
+
*/
|
|
1828
|
+
projectHandle: string;
|
|
1829
|
+
};
|
|
1830
|
+
query: {
|
|
1831
|
+
/**
|
|
1832
|
+
* The environment UUID.
|
|
1833
|
+
*/
|
|
1834
|
+
environment: string;
|
|
1835
|
+
/**
|
|
1836
|
+
* The node UUID.
|
|
1837
|
+
*/
|
|
1838
|
+
node: string;
|
|
1839
|
+
/**
|
|
1840
|
+
* The from time to start querying logs from.
|
|
1841
|
+
*/
|
|
1842
|
+
from?: string;
|
|
1843
|
+
/**
|
|
1844
|
+
* The to time to start querying logs to.
|
|
1845
|
+
*/
|
|
1846
|
+
to?: string;
|
|
1847
|
+
/**
|
|
1848
|
+
* Page size (max 100).
|
|
1849
|
+
*/
|
|
1850
|
+
limit?: number;
|
|
1851
|
+
/**
|
|
1852
|
+
* The next page token for paginated results from the log service.
|
|
1853
|
+
*/
|
|
1854
|
+
token?: string;
|
|
1855
|
+
};
|
|
1856
|
+
url: '/auth/{spaceHandle}/{projectHandle}/logs';
|
|
1857
|
+
};
|
|
1858
|
+
export type FetchLogsErrors = {
|
|
1859
|
+
/**
|
|
1860
|
+
* Bad request.
|
|
1861
|
+
*/
|
|
1862
|
+
400: ErrorResponse;
|
|
1863
|
+
/**
|
|
1864
|
+
* Unexpected error.
|
|
1865
|
+
*/
|
|
1866
|
+
500: ErrorResponse;
|
|
1867
|
+
};
|
|
1868
|
+
export type FetchLogsError = FetchLogsErrors[keyof FetchLogsErrors];
|
|
1869
|
+
export type FetchLogsResponses = {
|
|
1870
|
+
/**
|
|
1871
|
+
* Paginated log entries matching query
|
|
1872
|
+
*/
|
|
1873
|
+
200: Logs;
|
|
1874
|
+
};
|
|
1875
|
+
export type FetchLogsResponse = FetchLogsResponses[keyof FetchLogsResponses];
|
|
1732
1876
|
export type CreateEnvironmentData = {
|
|
1733
1877
|
body: CreateEnvironment;
|
|
1734
1878
|
path: {
|
|
@@ -2327,3 +2471,41 @@ export type FetchBillingPricesResponses = {
|
|
|
2327
2471
|
200: Array<PlanPriceResponse>;
|
|
2328
2472
|
};
|
|
2329
2473
|
export type FetchBillingPricesResponse = FetchBillingPricesResponses[keyof FetchBillingPricesResponses];
|
|
2474
|
+
export type ListBillingInvoicesData = {
|
|
2475
|
+
body?: never;
|
|
2476
|
+
path: {
|
|
2477
|
+
/**
|
|
2478
|
+
* The space handle. This must be globally unique.
|
|
2479
|
+
*/
|
|
2480
|
+
spaceHandle: string;
|
|
2481
|
+
};
|
|
2482
|
+
query?: {
|
|
2483
|
+
/**
|
|
2484
|
+
* Invoice ID to start after (cursor for next page, taken from `next_page_token`).
|
|
2485
|
+
*/
|
|
2486
|
+
starting_after?: string;
|
|
2487
|
+
};
|
|
2488
|
+
url: '/auth/{spaceHandle}/billing/invoices';
|
|
2489
|
+
};
|
|
2490
|
+
export type ListBillingInvoicesErrors = {
|
|
2491
|
+
/**
|
|
2492
|
+
* Unauthorised user.
|
|
2493
|
+
*/
|
|
2494
|
+
401: ErrorResponse;
|
|
2495
|
+
/**
|
|
2496
|
+
* Invalid credentials.
|
|
2497
|
+
*/
|
|
2498
|
+
403: ErrorResponse;
|
|
2499
|
+
/**
|
|
2500
|
+
* Unexpected error.
|
|
2501
|
+
*/
|
|
2502
|
+
500: ErrorResponse;
|
|
2503
|
+
};
|
|
2504
|
+
export type ListBillingInvoicesError = ListBillingInvoicesErrors[keyof ListBillingInvoicesErrors];
|
|
2505
|
+
export type ListBillingInvoicesResponses = {
|
|
2506
|
+
/**
|
|
2507
|
+
* A page of invoices.
|
|
2508
|
+
*/
|
|
2509
|
+
200: InvoicesResponse;
|
|
2510
|
+
};
|
|
2511
|
+
export type ListBillingInvoicesResponse = ListBillingInvoicesResponses[keyof ListBillingInvoicesResponses];
|
package/dist/sdk/zod.gen.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const zLogEntry: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
timestamp: z.ZodISODateTime;
|
|
5
|
+
projectID: z.ZodString;
|
|
6
|
+
environmentID: z.ZodString;
|
|
7
|
+
nodeID: z.ZodString;
|
|
8
|
+
payload: z.ZodUnknown;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const zLogs: z.ZodObject<{
|
|
11
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
timestamp: z.ZodISODateTime;
|
|
14
|
+
projectID: z.ZodString;
|
|
15
|
+
environmentID: z.ZodString;
|
|
16
|
+
nodeID: z.ZodString;
|
|
17
|
+
payload: z.ZodUnknown;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
nextPage: z.ZodOptional<z.ZodString>;
|
|
20
|
+
limit: z.ZodUnknown;
|
|
21
|
+
}, z.core.$strip>;
|
|
2
22
|
export declare const zPlatformTier: z.ZodEnum<{
|
|
3
23
|
free: "free";
|
|
4
24
|
hobby: "hobby";
|
|
@@ -495,8 +515,6 @@ export declare const zCpu: z.ZodEnum<{
|
|
|
495
515
|
32: "32";
|
|
496
516
|
}>;
|
|
497
517
|
export declare const zMemory: z.ZodEnum<{
|
|
498
|
-
"128Mi": "128Mi";
|
|
499
|
-
"256Mi": "256Mi";
|
|
500
518
|
"512Mi": "512Mi";
|
|
501
519
|
"1Gi": "1Gi";
|
|
502
520
|
"2Gi": "2Gi";
|
|
@@ -551,8 +569,6 @@ export declare const zContainerNodeProps: z.ZodObject<{
|
|
|
551
569
|
32: "32";
|
|
552
570
|
}>;
|
|
553
571
|
memory: z.ZodEnum<{
|
|
554
|
-
"128Mi": "128Mi";
|
|
555
|
-
"256Mi": "256Mi";
|
|
556
572
|
"512Mi": "512Mi";
|
|
557
573
|
"1Gi": "1Gi";
|
|
558
574
|
"2Gi": "2Gi";
|
|
@@ -682,8 +698,6 @@ export declare const zNode: z.ZodObject<{
|
|
|
682
698
|
32: "32";
|
|
683
699
|
}>;
|
|
684
700
|
memory: z.ZodEnum<{
|
|
685
|
-
"128Mi": "128Mi";
|
|
686
|
-
"256Mi": "256Mi";
|
|
687
701
|
"512Mi": "512Mi";
|
|
688
702
|
"1Gi": "1Gi";
|
|
689
703
|
"2Gi": "2Gi";
|
|
@@ -826,8 +840,6 @@ export declare const zNodes: z.ZodObject<{
|
|
|
826
840
|
32: "32";
|
|
827
841
|
}>;
|
|
828
842
|
memory: z.ZodEnum<{
|
|
829
|
-
"128Mi": "128Mi";
|
|
830
|
-
"256Mi": "256Mi";
|
|
831
843
|
"512Mi": "512Mi";
|
|
832
844
|
"1Gi": "1Gi";
|
|
833
845
|
"2Gi": "2Gi";
|
|
@@ -972,8 +984,6 @@ export declare const zGraph: z.ZodObject<{
|
|
|
972
984
|
32: "32";
|
|
973
985
|
}>;
|
|
974
986
|
memory: z.ZodEnum<{
|
|
975
|
-
"128Mi": "128Mi";
|
|
976
|
-
"256Mi": "256Mi";
|
|
977
987
|
"512Mi": "512Mi";
|
|
978
988
|
"1Gi": "1Gi";
|
|
979
989
|
"2Gi": "2Gi";
|
|
@@ -1073,12 +1083,49 @@ export declare const zRecordUsageRequest: z.ZodObject<{
|
|
|
1073
1083
|
quantity: z.ZodCoercedBigInt<unknown>;
|
|
1074
1084
|
timestamp: z.ZodOptional<z.ZodCoercedBigInt<unknown>>;
|
|
1075
1085
|
}, z.core.$strip>;
|
|
1086
|
+
export declare const zInvoice: z.ZodObject<{
|
|
1087
|
+
id: z.ZodString;
|
|
1088
|
+
number: z.ZodString;
|
|
1089
|
+
status: z.ZodString;
|
|
1090
|
+
amountDue: z.ZodCoercedBigInt<unknown>;
|
|
1091
|
+
amountPaid: z.ZodCoercedBigInt<unknown>;
|
|
1092
|
+
currency: z.ZodString;
|
|
1093
|
+
periodStart: z.ZodISODateTime;
|
|
1094
|
+
periodEnd: z.ZodISODateTime;
|
|
1095
|
+
created: z.ZodISODateTime;
|
|
1096
|
+
invoicePdfUrl: z.ZodString;
|
|
1097
|
+
hostedInvoiceUrl: z.ZodString;
|
|
1098
|
+
}, z.core.$strip>;
|
|
1099
|
+
export declare const zInvoicesResponse: z.ZodObject<{
|
|
1100
|
+
invoices: z.ZodArray<z.ZodObject<{
|
|
1101
|
+
id: z.ZodString;
|
|
1102
|
+
number: z.ZodString;
|
|
1103
|
+
status: z.ZodString;
|
|
1104
|
+
amountDue: z.ZodCoercedBigInt<unknown>;
|
|
1105
|
+
amountPaid: z.ZodCoercedBigInt<unknown>;
|
|
1106
|
+
currency: z.ZodString;
|
|
1107
|
+
periodStart: z.ZodISODateTime;
|
|
1108
|
+
periodEnd: z.ZodISODateTime;
|
|
1109
|
+
created: z.ZodISODateTime;
|
|
1110
|
+
invoicePdfUrl: z.ZodString;
|
|
1111
|
+
hostedInvoiceUrl: z.ZodString;
|
|
1112
|
+
}, z.core.$strip>>;
|
|
1113
|
+
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
1114
|
+
}, z.core.$strip>;
|
|
1076
1115
|
export declare const zPlanPriceResponse: z.ZodObject<{
|
|
1077
1116
|
code: z.ZodString;
|
|
1078
1117
|
unit_amount_cents: z.ZodCoercedBigInt<unknown>;
|
|
1079
1118
|
currency: z.ZodString;
|
|
1080
1119
|
interval: z.ZodString;
|
|
1081
1120
|
}, z.core.$strip>;
|
|
1121
|
+
/**
|
|
1122
|
+
* The from time to start querying logs from.
|
|
1123
|
+
*/
|
|
1124
|
+
export declare const zFromTime: z.ZodISODateTime;
|
|
1125
|
+
/**
|
|
1126
|
+
* The to time to start querying logs to.
|
|
1127
|
+
*/
|
|
1128
|
+
export declare const zToTime: z.ZodISODateTime;
|
|
1082
1129
|
/**
|
|
1083
1130
|
* Expiry query.
|
|
1084
1131
|
*/
|
|
@@ -1091,6 +1138,14 @@ export declare const zNodeUuid: z.ZodUUID;
|
|
|
1091
1138
|
* An invite UUID.
|
|
1092
1139
|
*/
|
|
1093
1140
|
export declare const zInviteUuid: z.ZodUUID;
|
|
1141
|
+
/**
|
|
1142
|
+
* The environment UUID.
|
|
1143
|
+
*/
|
|
1144
|
+
export declare const zEnvironmentId: z.ZodUUID;
|
|
1145
|
+
/**
|
|
1146
|
+
* The node UUID.
|
|
1147
|
+
*/
|
|
1148
|
+
export declare const zNodeId: z.ZodUUID;
|
|
1094
1149
|
/**
|
|
1095
1150
|
* A version UUID.
|
|
1096
1151
|
*/
|
|
@@ -1131,6 +1186,10 @@ export declare const zPage: z.ZodDefault<z.ZodInt>;
|
|
|
1131
1186
|
* Page size (max 100).
|
|
1132
1187
|
*/
|
|
1133
1188
|
export declare const zLimit: z.ZodDefault<z.ZodInt>;
|
|
1189
|
+
/**
|
|
1190
|
+
* The next page token for paginated results from the log service.
|
|
1191
|
+
*/
|
|
1192
|
+
export declare const zLogServiceNextPageToken: z.ZodString;
|
|
1134
1193
|
/**
|
|
1135
1194
|
* Opaque pagination token returned by the previous response.
|
|
1136
1195
|
*/
|
|
@@ -1269,8 +1328,6 @@ export declare const zFetchGraphM2mResponse: z.ZodObject<{
|
|
|
1269
1328
|
32: "32";
|
|
1270
1329
|
}>;
|
|
1271
1330
|
memory: z.ZodEnum<{
|
|
1272
|
-
"128Mi": "128Mi";
|
|
1273
|
-
"256Mi": "256Mi";
|
|
1274
1331
|
"512Mi": "512Mi";
|
|
1275
1332
|
"1Gi": "1Gi";
|
|
1276
1333
|
"2Gi": "2Gi";
|
|
@@ -1415,8 +1472,6 @@ export declare const zUpdateGraphM2mData: z.ZodObject<{
|
|
|
1415
1472
|
32: "32";
|
|
1416
1473
|
}>;
|
|
1417
1474
|
memory: z.ZodEnum<{
|
|
1418
|
-
"128Mi": "128Mi";
|
|
1419
|
-
"256Mi": "256Mi";
|
|
1420
1475
|
"512Mi": "512Mi";
|
|
1421
1476
|
"1Gi": "1Gi";
|
|
1422
1477
|
"2Gi": "2Gi";
|
|
@@ -1575,8 +1630,6 @@ export declare const zFetchNodeM2mResponse: z.ZodObject<{
|
|
|
1575
1630
|
32: "32";
|
|
1576
1631
|
}>;
|
|
1577
1632
|
memory: z.ZodEnum<{
|
|
1578
|
-
"128Mi": "128Mi";
|
|
1579
|
-
"256Mi": "256Mi";
|
|
1580
1633
|
"512Mi": "512Mi";
|
|
1581
1634
|
"1Gi": "1Gi";
|
|
1582
1635
|
"2Gi": "2Gi";
|
|
@@ -2160,6 +2213,36 @@ export declare const zGetProjectOverviewResponse: z.ZodObject<{
|
|
|
2160
2213
|
versions: z.ZodInt;
|
|
2161
2214
|
}, z.core.$strip>>;
|
|
2162
2215
|
}, z.core.$strip>;
|
|
2216
|
+
export declare const zFetchLogsData: z.ZodObject<{
|
|
2217
|
+
body: z.ZodOptional<z.ZodNever>;
|
|
2218
|
+
path: z.ZodObject<{
|
|
2219
|
+
spaceHandle: z.ZodString;
|
|
2220
|
+
projectHandle: z.ZodString;
|
|
2221
|
+
}, z.core.$strip>;
|
|
2222
|
+
query: z.ZodObject<{
|
|
2223
|
+
environment: z.ZodUUID;
|
|
2224
|
+
node: z.ZodUUID;
|
|
2225
|
+
from: z.ZodOptional<z.ZodISODateTime>;
|
|
2226
|
+
to: z.ZodOptional<z.ZodISODateTime>;
|
|
2227
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
|
|
2228
|
+
token: z.ZodOptional<z.ZodString>;
|
|
2229
|
+
}, z.core.$strip>;
|
|
2230
|
+
}, z.core.$strip>;
|
|
2231
|
+
/**
|
|
2232
|
+
* Paginated log entries matching query
|
|
2233
|
+
*/
|
|
2234
|
+
export declare const zFetchLogsResponse: z.ZodObject<{
|
|
2235
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
2236
|
+
id: z.ZodString;
|
|
2237
|
+
timestamp: z.ZodISODateTime;
|
|
2238
|
+
projectID: z.ZodString;
|
|
2239
|
+
environmentID: z.ZodString;
|
|
2240
|
+
nodeID: z.ZodString;
|
|
2241
|
+
payload: z.ZodUnknown;
|
|
2242
|
+
}, z.core.$strip>>;
|
|
2243
|
+
nextPage: z.ZodOptional<z.ZodString>;
|
|
2244
|
+
limit: z.ZodUnknown;
|
|
2245
|
+
}, z.core.$strip>;
|
|
2163
2246
|
export declare const zCreateEnvironmentData: z.ZodObject<{
|
|
2164
2247
|
body: z.ZodObject<{
|
|
2165
2248
|
name: z.ZodString;
|
|
@@ -2309,8 +2392,6 @@ export declare const zGetGraphOverviewResponse: z.ZodObject<{
|
|
|
2309
2392
|
32: "32";
|
|
2310
2393
|
}>;
|
|
2311
2394
|
memory: z.ZodEnum<{
|
|
2312
|
-
"128Mi": "128Mi";
|
|
2313
|
-
"256Mi": "256Mi";
|
|
2314
2395
|
"512Mi": "512Mi";
|
|
2315
2396
|
"1Gi": "1Gi";
|
|
2316
2397
|
"2Gi": "2Gi";
|
|
@@ -2455,8 +2536,6 @@ export declare const zUpdateGraphStateData: z.ZodObject<{
|
|
|
2455
2536
|
32: "32";
|
|
2456
2537
|
}>;
|
|
2457
2538
|
memory: z.ZodEnum<{
|
|
2458
|
-
"128Mi": "128Mi";
|
|
2459
|
-
"256Mi": "256Mi";
|
|
2460
2539
|
"512Mi": "512Mi";
|
|
2461
2540
|
"1Gi": "1Gi";
|
|
2462
2541
|
"2Gi": "2Gi";
|
|
@@ -2678,3 +2757,31 @@ export declare const zFetchBillingPricesResponse: z.ZodArray<z.ZodObject<{
|
|
|
2678
2757
|
currency: z.ZodString;
|
|
2679
2758
|
interval: z.ZodString;
|
|
2680
2759
|
}, z.core.$strip>>;
|
|
2760
|
+
export declare const zListBillingInvoicesData: z.ZodObject<{
|
|
2761
|
+
body: z.ZodOptional<z.ZodNever>;
|
|
2762
|
+
path: z.ZodObject<{
|
|
2763
|
+
spaceHandle: z.ZodString;
|
|
2764
|
+
}, z.core.$strip>;
|
|
2765
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
2766
|
+
starting_after: z.ZodOptional<z.ZodString>;
|
|
2767
|
+
}, z.core.$strip>>;
|
|
2768
|
+
}, z.core.$strip>;
|
|
2769
|
+
/**
|
|
2770
|
+
* A page of invoices.
|
|
2771
|
+
*/
|
|
2772
|
+
export declare const zListBillingInvoicesResponse: z.ZodObject<{
|
|
2773
|
+
invoices: z.ZodArray<z.ZodObject<{
|
|
2774
|
+
id: z.ZodString;
|
|
2775
|
+
number: z.ZodString;
|
|
2776
|
+
status: z.ZodString;
|
|
2777
|
+
amountDue: z.ZodCoercedBigInt<unknown>;
|
|
2778
|
+
amountPaid: z.ZodCoercedBigInt<unknown>;
|
|
2779
|
+
currency: z.ZodString;
|
|
2780
|
+
periodStart: z.ZodISODateTime;
|
|
2781
|
+
periodEnd: z.ZodISODateTime;
|
|
2782
|
+
created: z.ZodISODateTime;
|
|
2783
|
+
invoicePdfUrl: z.ZodString;
|
|
2784
|
+
hostedInvoiceUrl: z.ZodString;
|
|
2785
|
+
}, z.core.$strip>>;
|
|
2786
|
+
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
2787
|
+
}, z.core.$strip>;
|
package/dist/sdk/zod.gen.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
export const zLogEntry = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
timestamp: z.iso.datetime(),
|
|
6
|
+
projectID: z.string(),
|
|
7
|
+
environmentID: z.string(),
|
|
8
|
+
nodeID: z.string(),
|
|
9
|
+
payload: z.unknown()
|
|
10
|
+
});
|
|
11
|
+
export const zLogs = z.object({
|
|
12
|
+
logs: z.array(zLogEntry),
|
|
13
|
+
nextPage: z.optional(z.string()),
|
|
14
|
+
limit: z.unknown()
|
|
15
|
+
});
|
|
3
16
|
export const zPlatformTier = z.enum([
|
|
4
17
|
'free',
|
|
5
18
|
'hobby',
|
|
@@ -345,8 +358,6 @@ export const zCpu = z.enum([
|
|
|
345
358
|
'32'
|
|
346
359
|
]);
|
|
347
360
|
export const zMemory = z.enum([
|
|
348
|
-
'128Mi',
|
|
349
|
-
'256Mi',
|
|
350
361
|
'512Mi',
|
|
351
362
|
'1Gi',
|
|
352
363
|
'2Gi',
|
|
@@ -478,12 +489,37 @@ export const zRecordUsageRequest = z.object({
|
|
|
478
489
|
quantity: z.coerce.bigint(),
|
|
479
490
|
timestamp: z.optional(z.coerce.bigint())
|
|
480
491
|
});
|
|
492
|
+
export const zInvoice = z.object({
|
|
493
|
+
id: z.string(),
|
|
494
|
+
number: z.string(),
|
|
495
|
+
status: z.string(),
|
|
496
|
+
amountDue: z.coerce.bigint(),
|
|
497
|
+
amountPaid: z.coerce.bigint(),
|
|
498
|
+
currency: z.string(),
|
|
499
|
+
periodStart: z.iso.datetime(),
|
|
500
|
+
periodEnd: z.iso.datetime(),
|
|
501
|
+
created: z.iso.datetime(),
|
|
502
|
+
invoicePdfUrl: z.string(),
|
|
503
|
+
hostedInvoiceUrl: z.string()
|
|
504
|
+
});
|
|
505
|
+
export const zInvoicesResponse = z.object({
|
|
506
|
+
invoices: z.array(zInvoice),
|
|
507
|
+
nextPageToken: z.optional(z.string())
|
|
508
|
+
});
|
|
481
509
|
export const zPlanPriceResponse = z.object({
|
|
482
510
|
code: z.string(),
|
|
483
511
|
unit_amount_cents: z.coerce.bigint(),
|
|
484
512
|
currency: z.string(),
|
|
485
513
|
interval: z.string()
|
|
486
514
|
});
|
|
515
|
+
/**
|
|
516
|
+
* The from time to start querying logs from.
|
|
517
|
+
*/
|
|
518
|
+
export const zFromTime = z.iso.datetime();
|
|
519
|
+
/**
|
|
520
|
+
* The to time to start querying logs to.
|
|
521
|
+
*/
|
|
522
|
+
export const zToTime = z.iso.datetime();
|
|
487
523
|
/**
|
|
488
524
|
* Expiry query.
|
|
489
525
|
*/
|
|
@@ -496,6 +532,14 @@ export const zNodeUuid = z.uuid();
|
|
|
496
532
|
* An invite UUID.
|
|
497
533
|
*/
|
|
498
534
|
export const zInviteUuid = z.uuid();
|
|
535
|
+
/**
|
|
536
|
+
* The environment UUID.
|
|
537
|
+
*/
|
|
538
|
+
export const zEnvironmentId = z.uuid();
|
|
539
|
+
/**
|
|
540
|
+
* The node UUID.
|
|
541
|
+
*/
|
|
542
|
+
export const zNodeId = z.uuid();
|
|
499
543
|
/**
|
|
500
544
|
* A version UUID.
|
|
501
545
|
*/
|
|
@@ -536,6 +580,10 @@ export const zPage = z.int().gte(1).default(1);
|
|
|
536
580
|
* Page size (max 100).
|
|
537
581
|
*/
|
|
538
582
|
export const zLimit = z.int().gte(1).lte(100).default(10);
|
|
583
|
+
/**
|
|
584
|
+
* The next page token for paginated results from the log service.
|
|
585
|
+
*/
|
|
586
|
+
export const zLogServiceNextPageToken = z.string();
|
|
539
587
|
/**
|
|
540
588
|
* Opaque pagination token returned by the previous response.
|
|
541
589
|
*/
|
|
@@ -889,6 +937,25 @@ export const zGetProjectOverviewData = z.object({
|
|
|
889
937
|
* Project overview.
|
|
890
938
|
*/
|
|
891
939
|
export const zGetProjectOverviewResponse = zProjectOverview;
|
|
940
|
+
export const zFetchLogsData = z.object({
|
|
941
|
+
body: z.optional(z.never()),
|
|
942
|
+
path: z.object({
|
|
943
|
+
spaceHandle: z.string(),
|
|
944
|
+
projectHandle: z.string()
|
|
945
|
+
}),
|
|
946
|
+
query: z.object({
|
|
947
|
+
environment: z.uuid(),
|
|
948
|
+
node: z.uuid(),
|
|
949
|
+
from: z.optional(z.iso.datetime()),
|
|
950
|
+
to: z.optional(z.iso.datetime()),
|
|
951
|
+
limit: z.optional(z.int().gte(1).lte(100)).default(10),
|
|
952
|
+
token: z.optional(z.string())
|
|
953
|
+
})
|
|
954
|
+
});
|
|
955
|
+
/**
|
|
956
|
+
* Paginated log entries matching query
|
|
957
|
+
*/
|
|
958
|
+
export const zFetchLogsResponse = zLogs;
|
|
892
959
|
export const zCreateEnvironmentData = z.object({
|
|
893
960
|
body: zCreateEnvironment,
|
|
894
961
|
path: z.object({
|
|
@@ -1054,3 +1121,16 @@ export const zFetchBillingPricesData = z.object({
|
|
|
1054
1121
|
* A list of plan prices.
|
|
1055
1122
|
*/
|
|
1056
1123
|
export const zFetchBillingPricesResponse = z.array(zPlanPriceResponse);
|
|
1124
|
+
export const zListBillingInvoicesData = z.object({
|
|
1125
|
+
body: z.optional(z.never()),
|
|
1126
|
+
path: z.object({
|
|
1127
|
+
spaceHandle: z.string()
|
|
1128
|
+
}),
|
|
1129
|
+
query: z.optional(z.object({
|
|
1130
|
+
starting_after: z.optional(z.string())
|
|
1131
|
+
}))
|
|
1132
|
+
});
|
|
1133
|
+
/**
|
|
1134
|
+
* A page of invoices.
|
|
1135
|
+
*/
|
|
1136
|
+
export const zListBillingInvoicesResponse = zInvoicesResponse;
|
|
@@ -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, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData } from "../../sdk/types.gen";
|
|
3
|
+
import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, FetchLogsData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, 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>;
|
|
@@ -125,6 +125,9 @@ export declare const useCreateProject: (config?: {
|
|
|
125
125
|
export declare const useGetProjectOverview: (options: Omit<GetProjectOverviewData, "url"> & {
|
|
126
126
|
enabled?: boolean;
|
|
127
127
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").ProjectOverview | undefined, Error>;
|
|
128
|
+
export declare const useFetchLogs: (options: Omit<FetchLogsData, "url"> & {
|
|
129
|
+
enabled?: boolean;
|
|
130
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Logs | undefined, Error>;
|
|
128
131
|
export declare const useCreateEnvironment: (config?: {
|
|
129
132
|
onSuccess?: (data: GetSuccessResponse<CreateEnvironmentResponses>) => void;
|
|
130
133
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
@@ -188,3 +191,6 @@ export declare const useGetBillingUsage: (options: Omit<GetBillingUsageData, "ur
|
|
|
188
191
|
export declare const useFetchBillingPrices: (options: Omit<FetchBillingPricesData, "url"> & {
|
|
189
192
|
enabled?: boolean;
|
|
190
193
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").PlanPriceResponse[] | undefined, Error>;
|
|
194
|
+
export declare const useListBillingInvoices: (options: Omit<ListBillingInvoicesData, "url"> & {
|
|
195
|
+
enabled?: boolean;
|
|
196
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").InvoicesResponse | 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, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, requestSignedUploadUrl, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices } from "../../sdk/sdk.gen";
|
|
5
|
+
import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, fetchLogs, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, requestSignedUploadUrl, 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 };
|
|
@@ -647,6 +647,27 @@ export const useGetProjectOverview = (options) => {
|
|
|
647
647
|
staleTime: 600000
|
|
648
648
|
});
|
|
649
649
|
};
|
|
650
|
+
export const useFetchLogs = (options) => {
|
|
651
|
+
const token = useToken();
|
|
652
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
653
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/logs" };
|
|
654
|
+
const funcer = async () => {
|
|
655
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
656
|
+
if (isPromise(token) && !token)
|
|
657
|
+
return;
|
|
658
|
+
const res = await fetchLogs({ ...opts, ...rest, auth });
|
|
659
|
+
return res.data;
|
|
660
|
+
};
|
|
661
|
+
if (!token)
|
|
662
|
+
enabled = false;
|
|
663
|
+
return useQuery({
|
|
664
|
+
queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, "logs", options.query ?? {}],
|
|
665
|
+
queryFn: funcer,
|
|
666
|
+
enabled,
|
|
667
|
+
retry: false,
|
|
668
|
+
staleTime: 600000
|
|
669
|
+
});
|
|
670
|
+
};
|
|
650
671
|
export const useCreateEnvironment = (config) => {
|
|
651
672
|
const token = useToken();
|
|
652
673
|
const queryClient = useQueryClient();
|
|
@@ -944,3 +965,24 @@ export const useFetchBillingPrices = (options) => {
|
|
|
944
965
|
staleTime: 600000
|
|
945
966
|
});
|
|
946
967
|
};
|
|
968
|
+
export const useListBillingInvoices = (options) => {
|
|
969
|
+
const token = useToken();
|
|
970
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
971
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/billing/invoices" };
|
|
972
|
+
const funcer = async () => {
|
|
973
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
974
|
+
if (isPromise(token) && !token)
|
|
975
|
+
return;
|
|
976
|
+
const res = await listBillingInvoices({ ...opts, ...rest, auth });
|
|
977
|
+
return res.data;
|
|
978
|
+
};
|
|
979
|
+
if (!token)
|
|
980
|
+
enabled = false;
|
|
981
|
+
return useQuery({
|
|
982
|
+
queryKey: [options?.path?.spaceHandle, "billing", "invoices", options.query ?? {}],
|
|
983
|
+
queryFn: funcer,
|
|
984
|
+
enabled,
|
|
985
|
+
retry: false,
|
|
986
|
+
staleTime: 600000
|
|
987
|
+
});
|
|
988
|
+
};
|