shoal-web-sdk 1.0.11 → 1.0.13
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 +148 -1
- package/dist/sdk/@tanstack/react-query.gen.js +171 -1
- package/dist/sdk/sdk.gen.d.ts +31 -1
- package/dist/sdk/sdk.gen.js +141 -0
- package/dist/sdk/types.gen.d.ts +461 -1
- package/dist/sdk/zod.gen.d.ts +608 -0
- package/dist/sdk/zod.gen.js +187 -0
- package/dist/tanstack-codegen/generated/generated.d.ts +47 -1
- package/dist/tanstack-codegen/generated/generated.js +138 -1
- package/package.json +1 -1
package/dist/sdk/zod.gen.js
CHANGED
|
@@ -8,6 +8,31 @@ export const zEnvironmentVariable = z.object({
|
|
|
8
8
|
export const zEnvironmentVariables = z.object({
|
|
9
9
|
vars: z.array(zEnvironmentVariable)
|
|
10
10
|
});
|
|
11
|
+
export const zUpdateBlueprint = z.object({
|
|
12
|
+
name: z.optional(z.string()),
|
|
13
|
+
shortDescription: z.optional(z.string()),
|
|
14
|
+
description: z.optional(z.string()),
|
|
15
|
+
exported: z.optional(z.array(z.string()))
|
|
16
|
+
});
|
|
17
|
+
export const zCreateBlueprint = z.object({
|
|
18
|
+
name: z.string(),
|
|
19
|
+
shortDescription: z.optional(z.string()),
|
|
20
|
+
description: z.string(),
|
|
21
|
+
exported: z.array(z.string())
|
|
22
|
+
});
|
|
23
|
+
export const zBlueprint = z.object({
|
|
24
|
+
id: z.uuid(),
|
|
25
|
+
environment: z.uuid(),
|
|
26
|
+
ref: z.uuid(),
|
|
27
|
+
updatedAt: z.iso.datetime(),
|
|
28
|
+
createdAt: z.iso.datetime(),
|
|
29
|
+
author: z.string(),
|
|
30
|
+
updatedBy: z.string(),
|
|
31
|
+
name: z.string(),
|
|
32
|
+
shortDescription: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
exported: z.array(zEnvironmentVariable)
|
|
35
|
+
});
|
|
11
36
|
export const zPlatformTier = z.enum([
|
|
12
37
|
'free',
|
|
13
38
|
'pro',
|
|
@@ -53,6 +78,9 @@ export const zPagination = z.object({
|
|
|
53
78
|
limit: z.int(),
|
|
54
79
|
total: z.int()
|
|
55
80
|
});
|
|
81
|
+
export const zPaginatedBlueprints = zPagination.and(z.object({
|
|
82
|
+
blueprints: z.array(zBlueprint)
|
|
83
|
+
}));
|
|
56
84
|
export const zInvite = z.object({
|
|
57
85
|
id: z.uuid(),
|
|
58
86
|
spaceName: z.string(),
|
|
@@ -319,6 +347,7 @@ export const zNodeType = z.enum([
|
|
|
319
347
|
'cronjob',
|
|
320
348
|
'database',
|
|
321
349
|
'function',
|
|
350
|
+
'neondb',
|
|
322
351
|
'queue',
|
|
323
352
|
'proxy',
|
|
324
353
|
'vm',
|
|
@@ -389,6 +418,21 @@ export const zCronJobNodeProps = z.object({
|
|
|
389
418
|
export const zDatabaseNodeProps = z.object({
|
|
390
419
|
space: z.optional(z.int())
|
|
391
420
|
});
|
|
421
|
+
export const zNeonDbNodeProps = z.object({
|
|
422
|
+
orgId: z.string(),
|
|
423
|
+
orgName: z.string(),
|
|
424
|
+
projectId: z.optional(z.string()),
|
|
425
|
+
projectName: z.optional(z.string()),
|
|
426
|
+
branchId: z.optional(z.string()),
|
|
427
|
+
branchName: z.optional(z.string()),
|
|
428
|
+
dbName: z.string(),
|
|
429
|
+
roleName: z.string(),
|
|
430
|
+
regionId: z.string(),
|
|
431
|
+
pgVersion: z.int().gte(14).lte(18),
|
|
432
|
+
autoscalingLimitMinCu: z.optional(z.number().gte(0.25)),
|
|
433
|
+
autoscalingLimitMaxCu: z.optional(z.number().gte(0.25)),
|
|
434
|
+
suspendTimeoutSeconds: z.int().gte(-1).lte(604800)
|
|
435
|
+
});
|
|
392
436
|
export const zFunctionNodeProps = z.object({
|
|
393
437
|
region: zRegion,
|
|
394
438
|
language: z.string(),
|
|
@@ -443,6 +487,9 @@ export const zNode = z.object({
|
|
|
443
487
|
z.object({
|
|
444
488
|
typ: z.literal('function')
|
|
445
489
|
}).and(zFunctionNodeProps),
|
|
490
|
+
z.object({
|
|
491
|
+
typ: z.literal('neondb')
|
|
492
|
+
}).and(zNeonDbNodeProps),
|
|
446
493
|
z.object({
|
|
447
494
|
typ: z.literal('queue')
|
|
448
495
|
}).and(zQueueNodeProps),
|
|
@@ -558,6 +605,17 @@ export const zDeploymentStatusInformation = z.object({
|
|
|
558
605
|
status: z.optional(zDeploymentStatus),
|
|
559
606
|
message: z.optional(z.string())
|
|
560
607
|
});
|
|
608
|
+
export const zSetSpacePropertyRequest = z.object({
|
|
609
|
+
key: z.string(),
|
|
610
|
+
value: z.string()
|
|
611
|
+
});
|
|
612
|
+
export const zSpaceProperty = z.object({
|
|
613
|
+
key: z.string(),
|
|
614
|
+
value: z.string()
|
|
615
|
+
});
|
|
616
|
+
export const zSpacePropertiesResponse = z.object({
|
|
617
|
+
properties: z.array(zSpaceProperty)
|
|
618
|
+
});
|
|
561
619
|
/**
|
|
562
620
|
* Clients known etag of the version.
|
|
563
621
|
*/
|
|
@@ -638,6 +696,25 @@ export const zRepoOwner = z.string();
|
|
|
638
696
|
* Repository name.
|
|
639
697
|
*/
|
|
640
698
|
export const zRepoName = z.string();
|
|
699
|
+
/**
|
|
700
|
+
* Blueprint UUID.
|
|
701
|
+
*/
|
|
702
|
+
export const zBlueprintIdQuery = z.uuid();
|
|
703
|
+
/**
|
|
704
|
+
* Blueprint UUID.
|
|
705
|
+
*/
|
|
706
|
+
export const zBlueprintId = z.uuid();
|
|
707
|
+
/**
|
|
708
|
+
* Search value for a searchable field on an endpoint.
|
|
709
|
+
*/
|
|
710
|
+
export const zSearch = z.string();
|
|
711
|
+
/**
|
|
712
|
+
* The order results will appear in.
|
|
713
|
+
*/
|
|
714
|
+
export const zOrder = z.enum([
|
|
715
|
+
'asc',
|
|
716
|
+
'desc'
|
|
717
|
+
]);
|
|
641
718
|
/**
|
|
642
719
|
* Page number (1-based).
|
|
643
720
|
*/
|
|
@@ -888,6 +965,45 @@ export const zRecordOnboardingAnalyticsData = z.object({
|
|
|
888
965
|
path: z.optional(z.never()),
|
|
889
966
|
query: z.optional(z.never())
|
|
890
967
|
});
|
|
968
|
+
export const zPreviewBlueprintData = z.object({
|
|
969
|
+
body: z.optional(z.never()),
|
|
970
|
+
path: z.object({
|
|
971
|
+
blueprint: z.uuid()
|
|
972
|
+
}),
|
|
973
|
+
query: z.optional(z.never())
|
|
974
|
+
});
|
|
975
|
+
/**
|
|
976
|
+
* The blueprint nodes.
|
|
977
|
+
*/
|
|
978
|
+
export const zPreviewBlueprintResponse = zNodes;
|
|
979
|
+
export const zViewBlueprintsData = z.object({
|
|
980
|
+
body: z.optional(z.never()),
|
|
981
|
+
path: z.optional(z.never()),
|
|
982
|
+
query: z.optional(z.object({
|
|
983
|
+
limit: z.optional(z.int().gte(1).lte(100)).default(10),
|
|
984
|
+
page: z.optional(z.int().gte(1)).default(1),
|
|
985
|
+
search: z.optional(z.string()),
|
|
986
|
+
order: z.optional(z.enum([
|
|
987
|
+
'asc',
|
|
988
|
+
'desc'
|
|
989
|
+
]))
|
|
990
|
+
}))
|
|
991
|
+
});
|
|
992
|
+
/**
|
|
993
|
+
* Paginated blueprints
|
|
994
|
+
*/
|
|
995
|
+
export const zViewBlueprintsResponse = zPaginatedBlueprints;
|
|
996
|
+
export const zGetBlueprintData = z.object({
|
|
997
|
+
body: z.optional(z.never()),
|
|
998
|
+
path: z.object({
|
|
999
|
+
blueprint: z.uuid()
|
|
1000
|
+
}),
|
|
1001
|
+
query: z.optional(z.never())
|
|
1002
|
+
});
|
|
1003
|
+
/**
|
|
1004
|
+
* The blueprint.
|
|
1005
|
+
*/
|
|
1006
|
+
export const zGetBlueprintResponse = zBlueprint;
|
|
891
1007
|
export const zCreateSpaceData = z.object({
|
|
892
1008
|
body: zCreateSpace,
|
|
893
1009
|
path: z.optional(z.never()),
|
|
@@ -1164,6 +1280,47 @@ export const zCreateEnvironmentVariableData = z.object({
|
|
|
1164
1280
|
}),
|
|
1165
1281
|
query: z.optional(z.never())
|
|
1166
1282
|
});
|
|
1283
|
+
export const zDeleteBlueprintData = z.object({
|
|
1284
|
+
body: z.optional(z.never()),
|
|
1285
|
+
path: z.object({
|
|
1286
|
+
blueprint: z.uuid(),
|
|
1287
|
+
spaceHandle: z.string(),
|
|
1288
|
+
projectHandle: z.string(),
|
|
1289
|
+
environmentHandle: z.string()
|
|
1290
|
+
}),
|
|
1291
|
+
query: z.optional(z.never())
|
|
1292
|
+
});
|
|
1293
|
+
/**
|
|
1294
|
+
* Blueprint deleted.
|
|
1295
|
+
*/
|
|
1296
|
+
export const zDeleteBlueprintResponse = z.void();
|
|
1297
|
+
export const zUpdateBlueprintData = z.object({
|
|
1298
|
+
body: zUpdateBlueprint,
|
|
1299
|
+
path: z.object({
|
|
1300
|
+
blueprint: z.uuid(),
|
|
1301
|
+
spaceHandle: z.string(),
|
|
1302
|
+
projectHandle: z.string(),
|
|
1303
|
+
environmentHandle: z.string()
|
|
1304
|
+
}),
|
|
1305
|
+
query: z.optional(z.never())
|
|
1306
|
+
});
|
|
1307
|
+
/**
|
|
1308
|
+
* Updated Blueprint.
|
|
1309
|
+
*/
|
|
1310
|
+
export const zUpdateBlueprintResponse = zBlueprint;
|
|
1311
|
+
export const zCreateBlueprintData = z.object({
|
|
1312
|
+
body: zCreateBlueprint,
|
|
1313
|
+
path: z.object({
|
|
1314
|
+
spaceHandle: z.string(),
|
|
1315
|
+
projectHandle: z.string(),
|
|
1316
|
+
environmentHandle: z.string()
|
|
1317
|
+
}),
|
|
1318
|
+
query: z.optional(z.never())
|
|
1319
|
+
});
|
|
1320
|
+
/**
|
|
1321
|
+
* Blueprint created
|
|
1322
|
+
*/
|
|
1323
|
+
export const zCreateBlueprintResponse = zBlueprint;
|
|
1167
1324
|
export const zGetVersionData = z.object({
|
|
1168
1325
|
body: z.optional(z.never()),
|
|
1169
1326
|
path: z.object({
|
|
@@ -1178,6 +1335,18 @@ export const zGetVersionData = z.object({
|
|
|
1178
1335
|
* The version (and deployment information).
|
|
1179
1336
|
*/
|
|
1180
1337
|
export const zGetVersionResponse = zVersion;
|
|
1338
|
+
export const zImportBlueprintData = z.object({
|
|
1339
|
+
body: z.optional(z.never()),
|
|
1340
|
+
path: z.object({
|
|
1341
|
+
spaceHandle: z.string(),
|
|
1342
|
+
projectHandle: z.string(),
|
|
1343
|
+
environmentHandle: z.string(),
|
|
1344
|
+
version: z.string()
|
|
1345
|
+
}),
|
|
1346
|
+
query: z.object({
|
|
1347
|
+
blueprint: z.uuid()
|
|
1348
|
+
})
|
|
1349
|
+
});
|
|
1181
1350
|
export const zGetGraphOverviewData = z.object({
|
|
1182
1351
|
body: z.optional(z.never()),
|
|
1183
1352
|
path: z.object({
|
|
@@ -1367,3 +1536,21 @@ export const zListBillingInvoicesData = z.object({
|
|
|
1367
1536
|
* A page of invoices.
|
|
1368
1537
|
*/
|
|
1369
1538
|
export const zListBillingInvoicesResponse = zInvoicesResponse;
|
|
1539
|
+
export const zGetSpacePropertiesData = z.object({
|
|
1540
|
+
body: z.optional(z.never()),
|
|
1541
|
+
path: z.object({
|
|
1542
|
+
spaceHandle: z.string()
|
|
1543
|
+
}),
|
|
1544
|
+
query: z.optional(z.never())
|
|
1545
|
+
});
|
|
1546
|
+
/**
|
|
1547
|
+
* The space properties.
|
|
1548
|
+
*/
|
|
1549
|
+
export const zGetSpacePropertiesResponse = zSpacePropertiesResponse;
|
|
1550
|
+
export const zSetSpacePropertyData = z.object({
|
|
1551
|
+
body: zSetSpacePropertyRequest,
|
|
1552
|
+
path: z.object({
|
|
1553
|
+
spaceHandle: z.string()
|
|
1554
|
+
}),
|
|
1555
|
+
query: z.optional(z.never())
|
|
1556
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { GetSuccessResponse } from "../util";
|
|
3
|
-
import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateFeatureRequestData, CreateFeatureRequestResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, CreateSpaceData, CreateSpaceResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, GetVersionData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedDownloadUrlData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData } from "../../sdk/types.gen";
|
|
3
|
+
import { GetServiceHealthData, FetchGraphM2mData, UpdateGraphM2mData, UpdateGraphM2mResponses, FetchNodeM2mData, UpdateNodeM2mData, UpdateNodeM2mResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, UpdateUsernameData, UpdateUsernameResponses, CreateUsernameData, CreateUsernameResponses, GetUserProfileData, UpdateUserProfileData, UpdateUserProfileResponses, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateFeatureRequestData, CreateFeatureRequestResponses, RecordOnboardingAnalyticsData, RecordOnboardingAnalyticsResponses, GetBlueprintData, CreateSpaceData, CreateSpaceResponses, GetPublicInviteData, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, GetSpaceOrgCodeData, GetSpaceStatsData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, ListSpaceMemberRolesData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetEnvironmentVersionsData, DeleteEnvironmentVariableData, DeleteEnvironmentVariableResponses, GetEnvironmentVariablesData, UpdateEnvironmentVariableData, UpdateEnvironmentVariableResponses, CreateEnvironmentVariableData, CreateEnvironmentVariableResponses, DeleteBlueprintData, DeleteBlueprintResponses, UpdateBlueprintData, UpdateBlueprintResponses, CreateBlueprintData, CreateBlueprintResponses, GetVersionData, ImportBlueprintData, ImportBlueprintResponses, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, RequestSignedDownloadUrlData, RequestSignedUploadUrlData, RequestSignedUploadUrlResponses, CheckSubdomainUniquenessData, RecordCloudUsageData, RecordCloudUsageResponses, GetBillingPlanData, UpdateBillingPlanData, UpdateBillingPlanResponses, CreateSetupIntentData, CreateSetupIntentResponses, ListPaymentMethodsData, RemovePaymentMethodData, RemovePaymentMethodResponses, SetDefaultPaymentMethodData, SetDefaultPaymentMethodResponses, GetBillingUsageData, FetchBillingPricesData, ListBillingInvoicesData, GetSpacePropertiesData, SetSpacePropertyData, SetSpacePropertyResponses } 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>;
|
|
@@ -111,6 +111,9 @@ export declare const useRecordOnboardingAnalytics: (config?: {
|
|
|
111
111
|
data: unknown;
|
|
112
112
|
headers: Headers;
|
|
113
113
|
}, unknown, Omit<RecordOnboardingAnalyticsData, "url">, unknown>;
|
|
114
|
+
export declare const useGetBlueprint: (options: Omit<GetBlueprintData, "url"> & {
|
|
115
|
+
enabled?: boolean;
|
|
116
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Blueprint | undefined, Error>;
|
|
114
117
|
export declare const useCreateSpace: (config?: {
|
|
115
118
|
onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>, headers: Headers) => void;
|
|
116
119
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
@@ -238,9 +241,41 @@ export declare const useCreateEnvironmentVariable: (config?: {
|
|
|
238
241
|
data: unknown;
|
|
239
242
|
headers: Headers;
|
|
240
243
|
}, unknown, Omit<CreateEnvironmentVariableData, "url">, unknown>;
|
|
244
|
+
export declare const useDeleteBlueprint: (config?: {
|
|
245
|
+
onSuccess?: (data: GetSuccessResponse<DeleteBlueprintResponses>, headers: Headers) => void;
|
|
246
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
247
|
+
retry?: boolean;
|
|
248
|
+
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
249
|
+
data: void | undefined;
|
|
250
|
+
headers: Headers;
|
|
251
|
+
}, unknown, Omit<DeleteBlueprintData, "url">, unknown>;
|
|
252
|
+
export declare const useUpdateBlueprint: (config?: {
|
|
253
|
+
onSuccess?: (data: GetSuccessResponse<UpdateBlueprintResponses>, headers: Headers) => void;
|
|
254
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
255
|
+
retry?: boolean;
|
|
256
|
+
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
257
|
+
data: import("../../sdk/types.gen").Blueprint | undefined;
|
|
258
|
+
headers: Headers;
|
|
259
|
+
}, unknown, Omit<UpdateBlueprintData, "url">, unknown>;
|
|
260
|
+
export declare const useCreateBlueprint: (config?: {
|
|
261
|
+
onSuccess?: (data: GetSuccessResponse<CreateBlueprintResponses>, headers: Headers) => void;
|
|
262
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
263
|
+
retry?: boolean;
|
|
264
|
+
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
265
|
+
data: import("../../sdk/types.gen").Blueprint | undefined;
|
|
266
|
+
headers: Headers;
|
|
267
|
+
}, unknown, Omit<CreateBlueprintData, "url">, unknown>;
|
|
241
268
|
export declare const useGetVersion: (options: Omit<GetVersionData, "url"> & {
|
|
242
269
|
enabled?: boolean;
|
|
243
270
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Version | undefined, Error>;
|
|
271
|
+
export declare const useImportBlueprint: (config?: {
|
|
272
|
+
onSuccess?: (data: GetSuccessResponse<ImportBlueprintResponses>, headers: Headers) => void;
|
|
273
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
274
|
+
retry?: boolean;
|
|
275
|
+
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
276
|
+
data: unknown;
|
|
277
|
+
headers: Headers;
|
|
278
|
+
}, unknown, Omit<ImportBlueprintData, "url">, unknown>;
|
|
244
279
|
export declare const useGetGraphOverview: (options: Omit<GetGraphOverviewData, "url"> & {
|
|
245
280
|
enabled?: boolean;
|
|
246
281
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").Graph | undefined, Error>;
|
|
@@ -329,3 +364,14 @@ export declare const useFetchBillingPrices: (options: Omit<FetchBillingPricesDat
|
|
|
329
364
|
export declare const useListBillingInvoices: (options: Omit<ListBillingInvoicesData, "url"> & {
|
|
330
365
|
enabled?: boolean;
|
|
331
366
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").InvoicesResponse | undefined, Error>;
|
|
367
|
+
export declare const useGetSpaceProperties: (options: Omit<GetSpacePropertiesData, "url"> & {
|
|
368
|
+
enabled?: boolean;
|
|
369
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpacePropertiesResponse | undefined, Error>;
|
|
370
|
+
export declare const useSetSpaceProperty: (config?: {
|
|
371
|
+
onSuccess?: (data: GetSuccessResponse<SetSpacePropertyResponses>, headers: Headers) => void;
|
|
372
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
373
|
+
retry?: boolean;
|
|
374
|
+
}) => import("@tanstack/react-query").UseMutationResult<{
|
|
375
|
+
data: unknown;
|
|
376
|
+
headers: Headers;
|
|
377
|
+
}, unknown, Omit<SetSpacePropertyData, "url">, unknown>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
3
|
import { isPromise } from "../util";
|
|
4
4
|
import { useToken } from "../../provider/token-provider";
|
|
5
|
-
import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createFeatureRequest, recordOnboardingAnalytics, createSpace, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, getVersion, getGraphOverview, updateGraphState, deployVersion, requestSignedDownloadUrl, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices } from "../../sdk/sdk.gen";
|
|
5
|
+
import { getServiceHealth, fetchGraphM2M, updateGraphM2M, fetchNodeM2M, updateNodeM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createFeatureRequest, recordOnboardingAnalytics, getBlueprint, createSpace, getPublicInvite, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, getSpaceOrgCode, getSpaceStats, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, listSpaceMemberRoles, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getEnvironmentVersions, deleteEnvironmentVariable, getEnvironmentVariables, updateEnvironmentVariable, createEnvironmentVariable, deleteBlueprint, updateBlueprint, createBlueprint, getVersion, importBlueprint, getGraphOverview, updateGraphState, deployVersion, requestSignedDownloadUrl, requestSignedUploadUrl, checkSubdomainUniqueness, recordCloudUsage, getBillingPlan, updateBillingPlan, createSetupIntent, listPaymentMethods, removePaymentMethod, setDefaultPaymentMethod, getBillingUsage, fetchBillingPrices, listBillingInvoices, getSpaceProperties, setSpaceProperty } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -403,6 +403,27 @@ export const useRecordOnboardingAnalytics = (config) => {
|
|
|
403
403
|
retry: config?.retry
|
|
404
404
|
});
|
|
405
405
|
};
|
|
406
|
+
export const useGetBlueprint = (options) => {
|
|
407
|
+
const token = useToken();
|
|
408
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
409
|
+
const opts = { throwOnError: true, url: "/blueprints/{blueprint}" };
|
|
410
|
+
const funcer = async () => {
|
|
411
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
412
|
+
if (isPromise(token) && !token)
|
|
413
|
+
return;
|
|
414
|
+
const res = await getBlueprint({ ...opts, ...rest, auth });
|
|
415
|
+
return res.data;
|
|
416
|
+
};
|
|
417
|
+
if (!token)
|
|
418
|
+
enabled = false;
|
|
419
|
+
return useQuery({
|
|
420
|
+
queryKey: ["blueprints", options?.path?.blueprint, options.query ?? {}],
|
|
421
|
+
queryFn: funcer,
|
|
422
|
+
enabled,
|
|
423
|
+
retry: false,
|
|
424
|
+
staleTime: 600000
|
|
425
|
+
});
|
|
426
|
+
};
|
|
406
427
|
export const useCreateSpace = (config) => {
|
|
407
428
|
const token = useToken();
|
|
408
429
|
const queryClient = useQueryClient();
|
|
@@ -885,6 +906,63 @@ export const useCreateEnvironmentVariable = (config) => {
|
|
|
885
906
|
retry: config?.retry
|
|
886
907
|
});
|
|
887
908
|
};
|
|
909
|
+
export const useDeleteBlueprint = (config) => {
|
|
910
|
+
const token = useToken();
|
|
911
|
+
const queryClient = useQueryClient();
|
|
912
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{blueprint}" };
|
|
913
|
+
const funcer = async (options) => {
|
|
914
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
915
|
+
const res = await deleteBlueprint({ ...opts, ...options, auth });
|
|
916
|
+
return { data: res.data, headers: res.response.headers };
|
|
917
|
+
};
|
|
918
|
+
return useMutation({
|
|
919
|
+
mutationFn: funcer,
|
|
920
|
+
onSuccess: (res, options, c, ctx) => {
|
|
921
|
+
queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, options?.path?.blueprint] });
|
|
922
|
+
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
923
|
+
},
|
|
924
|
+
onError: config?.onError,
|
|
925
|
+
retry: config?.retry
|
|
926
|
+
});
|
|
927
|
+
};
|
|
928
|
+
export const useUpdateBlueprint = (config) => {
|
|
929
|
+
const token = useToken();
|
|
930
|
+
const queryClient = useQueryClient();
|
|
931
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{blueprint}" };
|
|
932
|
+
const funcer = async (options) => {
|
|
933
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
934
|
+
const res = await updateBlueprint({ ...opts, ...options, auth });
|
|
935
|
+
return { data: res.data, headers: res.response.headers };
|
|
936
|
+
};
|
|
937
|
+
return useMutation({
|
|
938
|
+
mutationFn: funcer,
|
|
939
|
+
onSuccess: (res, options, c, ctx) => {
|
|
940
|
+
queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, options?.path?.blueprint] });
|
|
941
|
+
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
942
|
+
},
|
|
943
|
+
onError: config?.onError,
|
|
944
|
+
retry: config?.retry
|
|
945
|
+
});
|
|
946
|
+
};
|
|
947
|
+
export const useCreateBlueprint = (config) => {
|
|
948
|
+
const token = useToken();
|
|
949
|
+
const queryClient = useQueryClient();
|
|
950
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/blueprints/create" };
|
|
951
|
+
const funcer = async (options) => {
|
|
952
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
953
|
+
const res = await createBlueprint({ ...opts, ...options, auth });
|
|
954
|
+
return { data: res.data, headers: res.response.headers };
|
|
955
|
+
};
|
|
956
|
+
return useMutation({
|
|
957
|
+
mutationFn: funcer,
|
|
958
|
+
onSuccess: (res, options, c, ctx) => {
|
|
959
|
+
queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, "blueprints", "create"] });
|
|
960
|
+
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
961
|
+
},
|
|
962
|
+
onError: config?.onError,
|
|
963
|
+
retry: config?.retry
|
|
964
|
+
});
|
|
965
|
+
};
|
|
888
966
|
export const useGetVersion = (options) => {
|
|
889
967
|
const token = useToken();
|
|
890
968
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -906,6 +984,25 @@ export const useGetVersion = (options) => {
|
|
|
906
984
|
staleTime: 600000
|
|
907
985
|
});
|
|
908
986
|
};
|
|
987
|
+
export const useImportBlueprint = (config) => {
|
|
988
|
+
const token = useToken();
|
|
989
|
+
const queryClient = useQueryClient();
|
|
990
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/{projectHandle}/{environmentHandle}/{version}/import" };
|
|
991
|
+
const funcer = async (options) => {
|
|
992
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
993
|
+
const res = await importBlueprint({ ...opts, ...options, auth });
|
|
994
|
+
return { data: res.data, headers: res.response.headers };
|
|
995
|
+
};
|
|
996
|
+
return useMutation({
|
|
997
|
+
mutationFn: funcer,
|
|
998
|
+
onSuccess: (res, options, c, ctx) => {
|
|
999
|
+
queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, options?.path?.projectHandle, options?.path?.environmentHandle, options?.path?.version, "import"] });
|
|
1000
|
+
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
1001
|
+
},
|
|
1002
|
+
onError: config?.onError,
|
|
1003
|
+
retry: config?.retry
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
909
1006
|
export const useGetGraphOverview = (options) => {
|
|
910
1007
|
const token = useToken();
|
|
911
1008
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -1226,3 +1323,43 @@ export const useListBillingInvoices = (options) => {
|
|
|
1226
1323
|
staleTime: 600000
|
|
1227
1324
|
});
|
|
1228
1325
|
};
|
|
1326
|
+
export const useGetSpaceProperties = (options) => {
|
|
1327
|
+
const token = useToken();
|
|
1328
|
+
let { enabled, ...rest } = options || { enabled: true };
|
|
1329
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/properties" };
|
|
1330
|
+
const funcer = async () => {
|
|
1331
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
1332
|
+
if (isPromise(token) && !token)
|
|
1333
|
+
return;
|
|
1334
|
+
const res = await getSpaceProperties({ ...opts, ...rest, auth });
|
|
1335
|
+
return res.data;
|
|
1336
|
+
};
|
|
1337
|
+
if (!token)
|
|
1338
|
+
enabled = false;
|
|
1339
|
+
return useQuery({
|
|
1340
|
+
queryKey: [options?.path?.spaceHandle, "properties", options.query ?? {}],
|
|
1341
|
+
queryFn: funcer,
|
|
1342
|
+
enabled,
|
|
1343
|
+
retry: false,
|
|
1344
|
+
staleTime: 600000
|
|
1345
|
+
});
|
|
1346
|
+
};
|
|
1347
|
+
export const useSetSpaceProperty = (config) => {
|
|
1348
|
+
const token = useToken();
|
|
1349
|
+
const queryClient = useQueryClient();
|
|
1350
|
+
const opts = { throwOnError: true, url: "/auth/{spaceHandle}/properties" };
|
|
1351
|
+
const funcer = async (options) => {
|
|
1352
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
1353
|
+
const res = await setSpaceProperty({ ...opts, ...options, auth });
|
|
1354
|
+
return { data: res.data, headers: res.response.headers };
|
|
1355
|
+
};
|
|
1356
|
+
return useMutation({
|
|
1357
|
+
mutationFn: funcer,
|
|
1358
|
+
onSuccess: (res, options, c, ctx) => {
|
|
1359
|
+
queryClient.invalidateQueries({ queryKey: [options?.path?.spaceHandle, "properties"] });
|
|
1360
|
+
config?.onSuccess && config.onSuccess(res.data, res.headers);
|
|
1361
|
+
},
|
|
1362
|
+
onError: config?.onError,
|
|
1363
|
+
retry: config?.retry
|
|
1364
|
+
});
|
|
1365
|
+
};
|