shoal-web-sdk 0.0.106 → 0.0.108
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 +1 -33
- package/dist/sdk/@tanstack/react-query.gen.js +1 -35
- package/dist/sdk/sdk.gen.d.ts +1 -9
- package/dist/sdk/sdk.gen.js +0 -34
- package/dist/sdk/types.gen.d.ts +1 -100
- package/dist/sdk/zod.gen.d.ts +2 -38
- package/dist/sdk/zod.gen.js +1 -28
- package/dist/tanstack-codegen/generated/generated.d.ts +1 -9
- package/dist/tanstack-codegen/generated/generated.js +1 -41
- 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,
|
|
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, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, GetBillingPlanData, GetBillingUsageData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOrgCodeData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListPaymentMethodsData, ListSpaceMemberRolesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RemovePaymentMethodData, RemovePaymentMethodError, RemovePaymentMethodResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RequestSignedUploadUrlData, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, SetDefaultPaymentMethodData, SetDefaultPaymentMethodError, SetDefaultPaymentMethodResponse, UpdateBillingPlanData, UpdateBillingPlanError, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, 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;
|
|
@@ -800,10 +800,6 @@ export declare const requestSignedUploadUrlOptions: (options: Options<RequestSig
|
|
|
800
800
|
[dataTagErrorSymbol]: Error;
|
|
801
801
|
};
|
|
802
802
|
};
|
|
803
|
-
/**
|
|
804
|
-
* Record a cloud usage event for a space (M2M only).
|
|
805
|
-
*/
|
|
806
|
-
export declare const recordCloudUsageMutation: (options?: Partial<Options<RecordCloudUsageData>>) => UseMutationOptions<unknown, RecordCloudUsageError, Options<RecordCloudUsageData>>;
|
|
807
803
|
export declare const getBillingPlanQueryKey: (options: Options<GetBillingPlanData>) => [Pick<Options<GetBillingPlanData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
808
804
|
_id: string;
|
|
809
805
|
_infinite?: boolean;
|
|
@@ -904,31 +900,3 @@ export declare const getBillingUsageOptions: (options: Options<GetBillingUsageDa
|
|
|
904
900
|
[dataTagErrorSymbol]: Error;
|
|
905
901
|
};
|
|
906
902
|
};
|
|
907
|
-
export declare const fetchBillingPricesQueryKey: (options: Options<FetchBillingPricesData>) => [Pick<Options<FetchBillingPricesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
908
|
-
_id: string;
|
|
909
|
-
_infinite?: boolean;
|
|
910
|
-
tags?: ReadonlyArray<string>;
|
|
911
|
-
}];
|
|
912
|
-
/**
|
|
913
|
-
* Fetch live unit prices for all paid plans from Stripe.
|
|
914
|
-
*/
|
|
915
|
-
export declare const fetchBillingPricesOptions: (options: Options<FetchBillingPricesData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").PlanPriceResponse[], Error, import("../types.gen").PlanPriceResponse[], [Pick<Options<FetchBillingPricesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
916
|
-
_id: string;
|
|
917
|
-
_infinite?: boolean;
|
|
918
|
-
tags?: ReadonlyArray<string>;
|
|
919
|
-
}]>, "queryFn"> & {
|
|
920
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<import("../types.gen").PlanPriceResponse[], [Pick<Options<FetchBillingPricesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
921
|
-
_id: string;
|
|
922
|
-
_infinite?: boolean;
|
|
923
|
-
tags?: ReadonlyArray<string>;
|
|
924
|
-
}], never> | undefined;
|
|
925
|
-
} & {
|
|
926
|
-
queryKey: [Pick<Options<FetchBillingPricesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
927
|
-
_id: string;
|
|
928
|
-
_infinite?: boolean;
|
|
929
|
-
tags?: ReadonlyArray<string>;
|
|
930
|
-
}] & {
|
|
931
|
-
[dataTagSymbol]: import("../types.gen").PlanPriceResponse[];
|
|
932
|
-
[dataTagErrorSymbol]: Error;
|
|
933
|
-
};
|
|
934
|
-
};
|
|
@@ -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,
|
|
4
|
+
import { createEnvironment, createProject, createSetupIntent, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, getBillingPlan, getBillingUsage, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOrgCode, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listPaymentMethods, listSpaceMemberRoles, listSpaceMembers, listUserInstallations, listUserSpaces, rejectSpaceInvite, removePaymentMethod, requestAccountPasswordReset, requestSignedUploadUrl, revokeSpaceInvite, setDefaultPaymentMethod, updateBillingPlan, updateConnectedAppToken, 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) {
|
|
@@ -861,22 +861,6 @@ export const requestSignedUploadUrlOptions = (options) => {
|
|
|
861
861
|
queryKey: requestSignedUploadUrlQueryKey(options)
|
|
862
862
|
});
|
|
863
863
|
};
|
|
864
|
-
/**
|
|
865
|
-
* Record a cloud usage event for a space (M2M only).
|
|
866
|
-
*/
|
|
867
|
-
export const recordCloudUsageMutation = (options) => {
|
|
868
|
-
const mutationOptions = {
|
|
869
|
-
mutationFn: async (fnOptions) => {
|
|
870
|
-
const { data } = await recordCloudUsage({
|
|
871
|
-
...options,
|
|
872
|
-
...fnOptions,
|
|
873
|
-
throwOnError: true
|
|
874
|
-
});
|
|
875
|
-
return data;
|
|
876
|
-
}
|
|
877
|
-
};
|
|
878
|
-
return mutationOptions;
|
|
879
|
-
};
|
|
880
864
|
export const getBillingPlanQueryKey = (options) => createQueryKey('getBillingPlan', options);
|
|
881
865
|
/**
|
|
882
866
|
* Get the current billing plan for a space.
|
|
@@ -995,21 +979,3 @@ export const getBillingUsageOptions = (options) => {
|
|
|
995
979
|
queryKey: getBillingUsageQueryKey(options)
|
|
996
980
|
});
|
|
997
981
|
};
|
|
998
|
-
export const fetchBillingPricesQueryKey = (options) => createQueryKey('fetchBillingPrices', options);
|
|
999
|
-
/**
|
|
1000
|
-
* Fetch live unit prices for all paid plans from Stripe.
|
|
1001
|
-
*/
|
|
1002
|
-
export const fetchBillingPricesOptions = (options) => {
|
|
1003
|
-
return queryOptions({
|
|
1004
|
-
queryFn: async ({ queryKey, signal }) => {
|
|
1005
|
-
const { data } = await fetchBillingPrices({
|
|
1006
|
-
...options,
|
|
1007
|
-
...queryKey[0],
|
|
1008
|
-
signal,
|
|
1009
|
-
throwOnError: true
|
|
1010
|
-
});
|
|
1011
|
-
return data;
|
|
1012
|
-
},
|
|
1013
|
-
queryKey: fetchBillingPricesQueryKey(options)
|
|
1014
|
-
});
|
|
1015
|
-
};
|
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,
|
|
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, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, 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, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RemovePaymentMethodData, RemovePaymentMethodErrors, RemovePaymentMethodResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RequestSignedUploadUrlData, RequestSignedUploadUrlErrors, RequestSignedUploadUrlResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodErrors, SetDefaultPaymentMethodResponses, UpdateBillingPlanData, UpdateBillingPlanErrors, UpdateBillingPlanResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, 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
|
|
@@ -157,10 +157,6 @@ export declare const deployVersion: <ThrowOnError extends boolean = false>(optio
|
|
|
157
157
|
* Request a signed upload URL to upload source code zip files.
|
|
158
158
|
*/
|
|
159
159
|
export declare const requestSignedUploadUrl: <ThrowOnError extends boolean = false>(options: Options<RequestSignedUploadUrlData, ThrowOnError>) => import("./client").RequestResult<RequestSignedUploadUrlResponses, RequestSignedUploadUrlErrors, ThrowOnError, "fields">;
|
|
160
|
-
/**
|
|
161
|
-
* Record a cloud usage event for a space (M2M only).
|
|
162
|
-
*/
|
|
163
|
-
export declare const recordCloudUsage: <ThrowOnError extends boolean = false>(options: Options<RecordCloudUsageData, ThrowOnError>) => import("./client").RequestResult<RecordCloudUsageResponses, RecordCloudUsageErrors, ThrowOnError, "fields">;
|
|
164
160
|
/**
|
|
165
161
|
* Get the current billing plan for a space.
|
|
166
162
|
*/
|
|
@@ -189,7 +185,3 @@ export declare const setDefaultPaymentMethod: <ThrowOnError extends boolean = fa
|
|
|
189
185
|
* Get metered cloud usage for the current billing period.
|
|
190
186
|
*/
|
|
191
187
|
export declare const getBillingUsage: <ThrowOnError extends boolean = false>(options: Options<GetBillingUsageData, ThrowOnError>) => import("./client").RequestResult<GetBillingUsageResponses, GetBillingUsageErrors, ThrowOnError, "fields">;
|
|
192
|
-
/**
|
|
193
|
-
* Fetch live unit prices for all paid plans from Stripe.
|
|
194
|
-
*/
|
|
195
|
-
export declare const fetchBillingPrices: <ThrowOnError extends boolean = false>(options: Options<FetchBillingPricesData, ThrowOnError>) => import("./client").RequestResult<FetchBillingPricesResponses, FetchBillingPricesErrors, ThrowOnError, "fields">;
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -572,25 +572,6 @@ export const requestSignedUploadUrl = (options) => {
|
|
|
572
572
|
...options
|
|
573
573
|
});
|
|
574
574
|
};
|
|
575
|
-
/**
|
|
576
|
-
* Record a cloud usage event for a space (M2M only).
|
|
577
|
-
*/
|
|
578
|
-
export const recordCloudUsage = (options) => {
|
|
579
|
-
return (options.client ?? client).post({
|
|
580
|
-
security: [
|
|
581
|
-
{
|
|
582
|
-
scheme: 'bearer',
|
|
583
|
-
type: 'http'
|
|
584
|
-
}
|
|
585
|
-
],
|
|
586
|
-
url: '/m2m/billing/usage/record',
|
|
587
|
-
...options,
|
|
588
|
-
headers: {
|
|
589
|
-
'Content-Type': 'application/json',
|
|
590
|
-
...options.headers
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
};
|
|
594
575
|
/**
|
|
595
576
|
* Get the current billing plan for a space.
|
|
596
577
|
*/
|
|
@@ -700,18 +681,3 @@ export const getBillingUsage = (options) => {
|
|
|
700
681
|
...options
|
|
701
682
|
});
|
|
702
683
|
};
|
|
703
|
-
/**
|
|
704
|
-
* Fetch live unit prices for all paid plans from Stripe.
|
|
705
|
-
*/
|
|
706
|
-
export const fetchBillingPrices = (options) => {
|
|
707
|
-
return (options.client ?? client).get({
|
|
708
|
-
security: [
|
|
709
|
-
{
|
|
710
|
-
scheme: 'bearer',
|
|
711
|
-
type: 'http'
|
|
712
|
-
}
|
|
713
|
-
],
|
|
714
|
-
url: '/auth/{spaceHandle}/billing/prices',
|
|
715
|
-
...options
|
|
716
|
-
});
|
|
717
|
-
};
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -359,10 +359,7 @@ export type BillingPlan = {
|
|
|
359
359
|
entitlements: Array<string>;
|
|
360
360
|
};
|
|
361
361
|
export type UpdatePlanRequest = {
|
|
362
|
-
|
|
363
|
-
* Stripe price lookup key (e.g. "hobby-monthly"). Empty string = Free tier.
|
|
364
|
-
*/
|
|
365
|
-
lookup_key: string;
|
|
362
|
+
priceId: string;
|
|
366
363
|
};
|
|
367
364
|
export type PaymentMethod = {
|
|
368
365
|
id: string;
|
|
@@ -378,38 +375,6 @@ export type SetupIntentResponse = {
|
|
|
378
375
|
export type BillingUsage = {
|
|
379
376
|
totalUnits: number;
|
|
380
377
|
};
|
|
381
|
-
export type RecordUsageRequest = {
|
|
382
|
-
/**
|
|
383
|
-
* The Kinde organisation code for the space.
|
|
384
|
-
*/
|
|
385
|
-
orgCode: string;
|
|
386
|
-
/**
|
|
387
|
-
* Usage quantity to record.
|
|
388
|
-
*/
|
|
389
|
-
quantity: number;
|
|
390
|
-
/**
|
|
391
|
-
* Unix timestamp (seconds) at which the usage occurred. Defaults to now if omitted.
|
|
392
|
-
*/
|
|
393
|
-
timestamp?: number;
|
|
394
|
-
};
|
|
395
|
-
export type PlanPriceResponse = {
|
|
396
|
-
/**
|
|
397
|
-
* Plan code (e.g. "hobby-monthly", "pro-annual").
|
|
398
|
-
*/
|
|
399
|
-
code: string;
|
|
400
|
-
/**
|
|
401
|
-
* Price per seat in the smallest currency unit (e.g. cents).
|
|
402
|
-
*/
|
|
403
|
-
unit_amount_cents: number;
|
|
404
|
-
/**
|
|
405
|
-
* ISO 4217 currency code (e.g. "usd").
|
|
406
|
-
*/
|
|
407
|
-
currency: string;
|
|
408
|
-
/**
|
|
409
|
-
* Billing interval ("month" or "year").
|
|
410
|
-
*/
|
|
411
|
-
interval: string;
|
|
412
|
-
};
|
|
413
378
|
/**
|
|
414
379
|
* Expiry query.
|
|
415
380
|
*/
|
|
@@ -1926,37 +1891,6 @@ export type RequestSignedUploadUrlResponses = {
|
|
|
1926
1891
|
200: SignedUrlUploadResponse;
|
|
1927
1892
|
};
|
|
1928
1893
|
export type RequestSignedUploadUrlResponse = RequestSignedUploadUrlResponses[keyof RequestSignedUploadUrlResponses];
|
|
1929
|
-
export type RecordCloudUsageData = {
|
|
1930
|
-
body: RecordUsageRequest;
|
|
1931
|
-
path?: never;
|
|
1932
|
-
query?: never;
|
|
1933
|
-
url: '/m2m/billing/usage/record';
|
|
1934
|
-
};
|
|
1935
|
-
export type RecordCloudUsageErrors = {
|
|
1936
|
-
/**
|
|
1937
|
-
* Bad request.
|
|
1938
|
-
*/
|
|
1939
|
-
400: ErrorResponse;
|
|
1940
|
-
/**
|
|
1941
|
-
* Unauthorised.
|
|
1942
|
-
*/
|
|
1943
|
-
401: ErrorResponse;
|
|
1944
|
-
/**
|
|
1945
|
-
* Invalid credentials.
|
|
1946
|
-
*/
|
|
1947
|
-
403: ErrorResponse;
|
|
1948
|
-
/**
|
|
1949
|
-
* Unexpected error.
|
|
1950
|
-
*/
|
|
1951
|
-
500: ErrorResponse;
|
|
1952
|
-
};
|
|
1953
|
-
export type RecordCloudUsageError = RecordCloudUsageErrors[keyof RecordCloudUsageErrors];
|
|
1954
|
-
export type RecordCloudUsageResponses = {
|
|
1955
|
-
/**
|
|
1956
|
-
* Usage recorded successfully.
|
|
1957
|
-
*/
|
|
1958
|
-
202: unknown;
|
|
1959
|
-
};
|
|
1960
1894
|
export type GetBillingPlanData = {
|
|
1961
1895
|
body?: never;
|
|
1962
1896
|
path: {
|
|
@@ -2199,36 +2133,3 @@ export type GetBillingUsageResponses = {
|
|
|
2199
2133
|
200: BillingUsage;
|
|
2200
2134
|
};
|
|
2201
2135
|
export type GetBillingUsageResponse = GetBillingUsageResponses[keyof GetBillingUsageResponses];
|
|
2202
|
-
export type FetchBillingPricesData = {
|
|
2203
|
-
body?: never;
|
|
2204
|
-
path: {
|
|
2205
|
-
/**
|
|
2206
|
-
* The space handle. This must be globally unique.
|
|
2207
|
-
*/
|
|
2208
|
-
spaceHandle: string;
|
|
2209
|
-
};
|
|
2210
|
-
query?: never;
|
|
2211
|
-
url: '/auth/{spaceHandle}/billing/prices';
|
|
2212
|
-
};
|
|
2213
|
-
export type FetchBillingPricesErrors = {
|
|
2214
|
-
/**
|
|
2215
|
-
* Unauthorised user.
|
|
2216
|
-
*/
|
|
2217
|
-
401: ErrorResponse;
|
|
2218
|
-
/**
|
|
2219
|
-
* Invalid credentials.
|
|
2220
|
-
*/
|
|
2221
|
-
403: ErrorResponse;
|
|
2222
|
-
/**
|
|
2223
|
-
* Unexpected error.
|
|
2224
|
-
*/
|
|
2225
|
-
500: ErrorResponse;
|
|
2226
|
-
};
|
|
2227
|
-
export type FetchBillingPricesError = FetchBillingPricesErrors[keyof FetchBillingPricesErrors];
|
|
2228
|
-
export type FetchBillingPricesResponses = {
|
|
2229
|
-
/**
|
|
2230
|
-
* A list of plan prices.
|
|
2231
|
-
*/
|
|
2232
|
-
200: Array<PlanPriceResponse>;
|
|
2233
|
-
};
|
|
2234
|
-
export type FetchBillingPricesResponse = FetchBillingPricesResponses[keyof FetchBillingPricesResponses];
|
package/dist/sdk/zod.gen.d.ts
CHANGED
|
@@ -1031,7 +1031,7 @@ export declare const zBillingPlan: z.ZodObject<{
|
|
|
1031
1031
|
entitlements: z.ZodArray<z.ZodString>;
|
|
1032
1032
|
}, z.core.$strip>;
|
|
1033
1033
|
export declare const zUpdatePlanRequest: z.ZodObject<{
|
|
1034
|
-
|
|
1034
|
+
priceId: z.ZodString;
|
|
1035
1035
|
}, z.core.$strip>;
|
|
1036
1036
|
export declare const zPaymentMethod: z.ZodObject<{
|
|
1037
1037
|
id: z.ZodString;
|
|
@@ -1047,17 +1047,6 @@ export declare const zSetupIntentResponse: z.ZodObject<{
|
|
|
1047
1047
|
export declare const zBillingUsage: z.ZodObject<{
|
|
1048
1048
|
totalUnits: z.ZodCoercedBigInt<unknown>;
|
|
1049
1049
|
}, z.core.$strip>;
|
|
1050
|
-
export declare const zRecordUsageRequest: z.ZodObject<{
|
|
1051
|
-
orgCode: z.ZodString;
|
|
1052
|
-
quantity: z.ZodCoercedBigInt<unknown>;
|
|
1053
|
-
timestamp: z.ZodOptional<z.ZodCoercedBigInt<unknown>>;
|
|
1054
|
-
}, z.core.$strip>;
|
|
1055
|
-
export declare const zPlanPriceResponse: z.ZodObject<{
|
|
1056
|
-
code: z.ZodString;
|
|
1057
|
-
unit_amount_cents: z.ZodCoercedBigInt<unknown>;
|
|
1058
|
-
currency: z.ZodString;
|
|
1059
|
-
interval: z.ZodString;
|
|
1060
|
-
}, z.core.$strip>;
|
|
1061
1050
|
/**
|
|
1062
1051
|
* Expiry query.
|
|
1063
1052
|
*/
|
|
@@ -2217,15 +2206,6 @@ export declare const zRequestSignedUploadUrlResponse: z.ZodObject<{
|
|
|
2217
2206
|
signedUrl: z.ZodString;
|
|
2218
2207
|
expiration: z.ZodISODateTime;
|
|
2219
2208
|
}, z.core.$strip>;
|
|
2220
|
-
export declare const zRecordCloudUsageData: z.ZodObject<{
|
|
2221
|
-
body: z.ZodObject<{
|
|
2222
|
-
orgCode: z.ZodString;
|
|
2223
|
-
quantity: z.ZodCoercedBigInt<unknown>;
|
|
2224
|
-
timestamp: z.ZodOptional<z.ZodCoercedBigInt<unknown>>;
|
|
2225
|
-
}, z.core.$strip>;
|
|
2226
|
-
path: z.ZodOptional<z.ZodNever>;
|
|
2227
|
-
query: z.ZodOptional<z.ZodNever>;
|
|
2228
|
-
}, z.core.$strip>;
|
|
2229
2209
|
export declare const zGetBillingPlanData: z.ZodObject<{
|
|
2230
2210
|
body: z.ZodOptional<z.ZodNever>;
|
|
2231
2211
|
path: z.ZodObject<{
|
|
@@ -2257,7 +2237,7 @@ export declare const zGetBillingPlanResponse: z.ZodObject<{
|
|
|
2257
2237
|
}, z.core.$strip>;
|
|
2258
2238
|
export declare const zUpdateBillingPlanData: z.ZodObject<{
|
|
2259
2239
|
body: z.ZodObject<{
|
|
2260
|
-
|
|
2240
|
+
priceId: z.ZodString;
|
|
2261
2241
|
}, z.core.$strip>;
|
|
2262
2242
|
path: z.ZodObject<{
|
|
2263
2243
|
spaceHandle: z.ZodString;
|
|
@@ -2332,19 +2312,3 @@ export declare const zGetBillingUsageData: z.ZodObject<{
|
|
|
2332
2312
|
export declare const zGetBillingUsageResponse: z.ZodObject<{
|
|
2333
2313
|
totalUnits: z.ZodCoercedBigInt<unknown>;
|
|
2334
2314
|
}, z.core.$strip>;
|
|
2335
|
-
export declare const zFetchBillingPricesData: z.ZodObject<{
|
|
2336
|
-
body: z.ZodOptional<z.ZodNever>;
|
|
2337
|
-
path: z.ZodObject<{
|
|
2338
|
-
spaceHandle: z.ZodString;
|
|
2339
|
-
}, z.core.$strip>;
|
|
2340
|
-
query: z.ZodOptional<z.ZodNever>;
|
|
2341
|
-
}, z.core.$strip>;
|
|
2342
|
-
/**
|
|
2343
|
-
* A list of plan prices.
|
|
2344
|
-
*/
|
|
2345
|
-
export declare const zFetchBillingPricesResponse: z.ZodArray<z.ZodObject<{
|
|
2346
|
-
code: z.ZodString;
|
|
2347
|
-
unit_amount_cents: z.ZodCoercedBigInt<unknown>;
|
|
2348
|
-
currency: z.ZodString;
|
|
2349
|
-
interval: z.ZodString;
|
|
2350
|
-
}, z.core.$strip>>;
|
package/dist/sdk/zod.gen.js
CHANGED
|
@@ -450,7 +450,7 @@ export const zBillingPlan = z.object({
|
|
|
450
450
|
entitlements: z.array(z.string())
|
|
451
451
|
});
|
|
452
452
|
export const zUpdatePlanRequest = z.object({
|
|
453
|
-
|
|
453
|
+
priceId: z.string()
|
|
454
454
|
});
|
|
455
455
|
export const zPaymentMethod = z.object({
|
|
456
456
|
id: z.string(),
|
|
@@ -466,17 +466,6 @@ export const zSetupIntentResponse = z.object({
|
|
|
466
466
|
export const zBillingUsage = z.object({
|
|
467
467
|
totalUnits: z.coerce.bigint()
|
|
468
468
|
});
|
|
469
|
-
export const zRecordUsageRequest = z.object({
|
|
470
|
-
orgCode: z.string(),
|
|
471
|
-
quantity: z.coerce.bigint(),
|
|
472
|
-
timestamp: z.optional(z.coerce.bigint())
|
|
473
|
-
});
|
|
474
|
-
export const zPlanPriceResponse = z.object({
|
|
475
|
-
code: z.string(),
|
|
476
|
-
unit_amount_cents: z.coerce.bigint(),
|
|
477
|
-
currency: z.string(),
|
|
478
|
-
interval: z.string()
|
|
479
|
-
});
|
|
480
469
|
/**
|
|
481
470
|
* Expiry query.
|
|
482
471
|
*/
|
|
@@ -937,11 +926,6 @@ export const zRequestSignedUploadUrlData = z.object({
|
|
|
937
926
|
* A successfully generated signed url.
|
|
938
927
|
*/
|
|
939
928
|
export const zRequestSignedUploadUrlResponse = zSignedUrlUploadResponse;
|
|
940
|
-
export const zRecordCloudUsageData = z.object({
|
|
941
|
-
body: zRecordUsageRequest,
|
|
942
|
-
path: z.optional(z.never()),
|
|
943
|
-
query: z.optional(z.never())
|
|
944
|
-
});
|
|
945
929
|
export const zGetBillingPlanData = z.object({
|
|
946
930
|
body: z.optional(z.never()),
|
|
947
931
|
path: z.object({
|
|
@@ -1017,14 +1001,3 @@ export const zGetBillingUsageData = z.object({
|
|
|
1017
1001
|
* Current billing period usage.
|
|
1018
1002
|
*/
|
|
1019
1003
|
export const zGetBillingUsageResponse = zBillingUsage;
|
|
1020
|
-
export const zFetchBillingPricesData = z.object({
|
|
1021
|
-
body: z.optional(z.never()),
|
|
1022
|
-
path: z.object({
|
|
1023
|
-
spaceHandle: z.string()
|
|
1024
|
-
}),
|
|
1025
|
-
query: z.optional(z.never())
|
|
1026
|
-
});
|
|
1027
|
-
/**
|
|
1028
|
-
* A list of plan prices.
|
|
1029
|
-
*/
|
|
1030
|
-
export const zFetchBillingPricesResponse = z.array(zPlanPriceResponse);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { GetSuccessResponse } from "../util";
|
|
3
|
-
import { GetServiceHealthData, FetchGraphM2mData, 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,
|
|
3
|
+
import { GetServiceHealthData, FetchGraphM2mData, 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, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData } 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>;
|
|
@@ -141,11 +141,6 @@ export declare const useDeployVersion: (config?: {
|
|
|
141
141
|
export declare const useRequestSignedUploadUrl: (options: Omit<RequestSignedUploadUrlData, "url"> & {
|
|
142
142
|
enabled?: boolean;
|
|
143
143
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SignedUrlUploadResponse | undefined, Error>;
|
|
144
|
-
export declare const useRecordCloudUsage: (config?: {
|
|
145
|
-
onSuccess?: (data: GetSuccessResponse<RecordCloudUsageResponses>) => void;
|
|
146
|
-
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
147
|
-
retry?: boolean;
|
|
148
|
-
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<RecordCloudUsageData, "url">, unknown>;
|
|
149
144
|
export declare const useGetBillingPlan: (options: Omit<GetBillingPlanData, "url"> & {
|
|
150
145
|
enabled?: boolean;
|
|
151
146
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").BillingPlan | undefined, Error>;
|
|
@@ -175,6 +170,3 @@ export declare const useSetDefaultPaymentMethod: (config?: {
|
|
|
175
170
|
export declare const useGetBillingUsage: (options: Omit<GetBillingUsageData, "url"> & {
|
|
176
171
|
enabled?: boolean;
|
|
177
172
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").BillingUsage | undefined, Error>;
|
|
178
|
-
export declare const useFetchBillingPrices: (options: Omit<FetchBillingPricesData, "url"> & {
|
|
179
|
-
enabled?: boolean;
|
|
180
|
-
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").PlanPriceResponse[] | 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, 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,
|
|
5
|
+
import { getServiceHealth, fetchGraphM2M, 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, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -727,25 +727,6 @@ export const useRequestSignedUploadUrl = (options) => {
|
|
|
727
727
|
staleTime: 600000
|
|
728
728
|
});
|
|
729
729
|
};
|
|
730
|
-
export const useRecordCloudUsage = (config) => {
|
|
731
|
-
const token = useToken();
|
|
732
|
-
const queryClient = useQueryClient();
|
|
733
|
-
const opts = { throwOnError: true, url: "/m2m/billing/usage/record" };
|
|
734
|
-
const funcer = async (options) => {
|
|
735
|
-
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
736
|
-
const res = await recordCloudUsage({ ...opts, ...options, auth });
|
|
737
|
-
return res?.data;
|
|
738
|
-
};
|
|
739
|
-
return useMutation({
|
|
740
|
-
mutationFn: funcer,
|
|
741
|
-
onSuccess: (res, options, c, ctx) => {
|
|
742
|
-
queryClient.invalidateQueries({ queryKey: ["m2m", "billing", "usage", "record"] });
|
|
743
|
-
config?.onSuccess && config.onSuccess(res);
|
|
744
|
-
},
|
|
745
|
-
onError: config?.onError,
|
|
746
|
-
retry: config?.retry
|
|
747
|
-
});
|
|
748
|
-
};
|
|
749
730
|
export const useGetBillingPlan = (options) => {
|
|
750
731
|
const token = useToken();
|
|
751
732
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -885,24 +866,3 @@ export const useGetBillingUsage = (options) => {
|
|
|
885
866
|
staleTime: 600000
|
|
886
867
|
});
|
|
887
868
|
};
|
|
888
|
-
export const useFetchBillingPrices = (options) => {
|
|
889
|
-
const token = useToken();
|
|
890
|
-
let { enabled, ...rest } = options || { enabled: true };
|
|
891
|
-
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/billing/prices" };
|
|
892
|
-
const funcer = async () => {
|
|
893
|
-
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
894
|
-
if (isPromise(token) && !token)
|
|
895
|
-
return;
|
|
896
|
-
const res = await fetchBillingPrices({ ...opts, ...rest, auth });
|
|
897
|
-
return res.data;
|
|
898
|
-
};
|
|
899
|
-
if (!token)
|
|
900
|
-
enabled = false;
|
|
901
|
-
return useQuery({
|
|
902
|
-
queryKey: [options?.path?.spaceHandle, "billing", "prices", options.query ?? {}],
|
|
903
|
-
queryFn: funcer,
|
|
904
|
-
enabled,
|
|
905
|
-
retry: false,
|
|
906
|
-
staleTime: 600000
|
|
907
|
-
});
|
|
908
|
-
};
|