shoal-web-sdk 0.0.89 → 0.0.91
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 +13 -1
- package/dist/sdk/@tanstack/react-query.gen.js +49 -1
- package/dist/sdk/sdk.gen.d.ts +13 -1
- package/dist/sdk/sdk.gen.js +57 -0
- package/dist/sdk/types.gen.d.ts +104 -3
- package/dist/sdk/zod.gen.d.ts +29 -6
- package/dist/sdk/zod.gen.js +22 -3
- package/dist/tanstack-codegen/generated/generated.d.ts +16 -1
- package/dist/tanstack-codegen/generated/generated.js +58 -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, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphStateData, UpdateGraphStateError, UploadNodeSourceZipData, UploadNodeSourceZipError, UploadNodeSourceZipResponse } from '../types.gen';
|
|
3
|
+
import type { CreateEnvironmentData, CreateEnvironmentError, CreateEnvironmentResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, CreateSpaceData, CreateSpaceError, CreateSpaceInviteData, CreateSpaceInviteError, CreateSpaceInviteResponse, CreateSpaceResponse, CreateUsernameData, CreateUsernameError, DeleteAccountIdentityData, DeleteAccountIdentityError, DeleteAccountIdentityResponse, DeployVersionData, DeployVersionError, FetchGraphM2mData, FetchKindeOrganisationBillingAgreementsData, GetConnectedAppUrlData, GetEnvironmentOverviewData, GetGraphOverviewData, GetProjectOverviewData, GetServiceHealthData, GetSpaceInvitesData, GetSpaceOverviewData, GetUserIdentitiesData, GetUserInvitesData, GetUserProfileData, JoinSpaceData, JoinSpaceError, LeaveSpaceData, LeaveSpaceError, ListInstallationBranchesData, ListInstallationRepositoriesData, ListSpaceMembersData, ListUserInstallationsData, ListUserSpacesData, RejectSpaceInviteData, RejectSpaceInviteError, RejectSpaceInviteResponse, RequestAccountPasswordResetData, RequestAccountPasswordResetError, RevokeSpaceInviteData, RevokeSpaceInviteError, RevokeSpaceInviteResponse, UpdateConnectedAppTokenData, UpdateConnectedAppTokenError, UpdateGraphStateData, UpdateGraphStateError, UpdateUsernameData, UpdateUsernameError, UpdateUserProfileData, UpdateUserProfileError, UploadNodeSourceZipData, UploadNodeSourceZipError, UploadNodeSourceZipResponse } from '../types.gen';
|
|
4
4
|
export type QueryKey<TOptions extends Options> = [
|
|
5
5
|
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
6
6
|
_id: string;
|
|
@@ -68,6 +68,14 @@ export declare const fetchGraphM2mOptions: (options: Options<FetchGraphM2mData>)
|
|
|
68
68
|
* This will submit a password reset request requiring the user to reset their password on next sign in.
|
|
69
69
|
*/
|
|
70
70
|
export declare const requestAccountPasswordResetMutation: (options?: Partial<Options<RequestAccountPasswordResetData>>) => UseMutationOptions<unknown, RequestAccountPasswordResetError, Options<RequestAccountPasswordResetData>>;
|
|
71
|
+
/**
|
|
72
|
+
* Update username for current user
|
|
73
|
+
*/
|
|
74
|
+
export declare const updateUsernameMutation: (options?: Partial<Options<UpdateUsernameData>>) => UseMutationOptions<unknown, UpdateUsernameError, Options<UpdateUsernameData>>;
|
|
75
|
+
/**
|
|
76
|
+
* Create username for current user
|
|
77
|
+
*/
|
|
78
|
+
export declare const createUsernameMutation: (options?: Partial<Options<CreateUsernameData>>) => UseMutationOptions<unknown, CreateUsernameError, Options<CreateUsernameData>>;
|
|
71
79
|
export declare const getUserProfileQueryKey: (options?: Options<GetUserProfileData>) => [Pick<Options<GetUserProfileData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
72
80
|
_id: string;
|
|
73
81
|
_infinite?: boolean;
|
|
@@ -96,6 +104,10 @@ export declare const getUserProfileOptions: (options?: Options<GetUserProfileDat
|
|
|
96
104
|
[dataTagErrorSymbol]: Error;
|
|
97
105
|
};
|
|
98
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* Update the authenticated user's Kinde profile fields.
|
|
109
|
+
*/
|
|
110
|
+
export declare const updateUserProfileMutation: (options?: Partial<Options<UpdateUserProfileData>>) => UseMutationOptions<unknown, UpdateUserProfileError, Options<UpdateUserProfileData>>;
|
|
99
111
|
export declare const getUserIdentitiesQueryKey: (options?: Options<GetUserIdentitiesData>) => [Pick<Options<GetUserIdentitiesData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
|
|
100
112
|
_id: string;
|
|
101
113
|
_infinite?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
import { infiniteQueryOptions, queryOptions } from '@tanstack/react-query';
|
|
3
3
|
import { client } from '../client.gen';
|
|
4
|
-
import { createEnvironment, createProject, createSpace, createSpaceInvite, deleteAccountIdentity, deployVersion, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listSpaceMembers, listUserInstallations, listUserSpaces, rejectSpaceInvite, requestAccountPasswordReset, revokeSpaceInvite, updateConnectedAppToken, updateGraphState, uploadNodeSourceZip } from '../sdk.gen';
|
|
4
|
+
import { createEnvironment, createProject, createSpace, createSpaceInvite, createUsername, deleteAccountIdentity, deployVersion, fetchGraphM2M, fetchKindeOrganisationBillingAgreements, getConnectedAppUrl, getEnvironmentOverview, getGraphOverview, getProjectOverview, getServiceHealth, getSpaceInvites, getSpaceOverview, getUserIdentities, getUserInvites, getUserProfile, joinSpace, leaveSpace, listInstallationBranches, listInstallationRepositories, listSpaceMembers, listUserInstallations, listUserSpaces, rejectSpaceInvite, requestAccountPasswordReset, revokeSpaceInvite, updateConnectedAppToken, updateGraphState, updateUsername, updateUserProfile, uploadNodeSourceZip } 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) {
|
|
@@ -78,6 +78,38 @@ export const requestAccountPasswordResetMutation = (options) => {
|
|
|
78
78
|
};
|
|
79
79
|
return mutationOptions;
|
|
80
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Update username for current user
|
|
83
|
+
*/
|
|
84
|
+
export const updateUsernameMutation = (options) => {
|
|
85
|
+
const mutationOptions = {
|
|
86
|
+
mutationFn: async (fnOptions) => {
|
|
87
|
+
const { data } = await updateUsername({
|
|
88
|
+
...options,
|
|
89
|
+
...fnOptions,
|
|
90
|
+
throwOnError: true
|
|
91
|
+
});
|
|
92
|
+
return data;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return mutationOptions;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Create username for current user
|
|
99
|
+
*/
|
|
100
|
+
export const createUsernameMutation = (options) => {
|
|
101
|
+
const mutationOptions = {
|
|
102
|
+
mutationFn: async (fnOptions) => {
|
|
103
|
+
const { data } = await createUsername({
|
|
104
|
+
...options,
|
|
105
|
+
...fnOptions,
|
|
106
|
+
throwOnError: true
|
|
107
|
+
});
|
|
108
|
+
return data;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return mutationOptions;
|
|
112
|
+
};
|
|
81
113
|
export const getUserProfileQueryKey = (options) => createQueryKey('getUserProfile', options);
|
|
82
114
|
/**
|
|
83
115
|
* Fetch the users profile.
|
|
@@ -96,6 +128,22 @@ export const getUserProfileOptions = (options) => {
|
|
|
96
128
|
queryKey: getUserProfileQueryKey(options)
|
|
97
129
|
});
|
|
98
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* Update the authenticated user's Kinde profile fields.
|
|
133
|
+
*/
|
|
134
|
+
export const updateUserProfileMutation = (options) => {
|
|
135
|
+
const mutationOptions = {
|
|
136
|
+
mutationFn: async (fnOptions) => {
|
|
137
|
+
const { data } = await updateUserProfile({
|
|
138
|
+
...options,
|
|
139
|
+
...fnOptions,
|
|
140
|
+
throwOnError: true
|
|
141
|
+
});
|
|
142
|
+
return data;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return mutationOptions;
|
|
146
|
+
};
|
|
99
147
|
export const getUserIdentitiesQueryKey = (options) => createQueryKey('getUserIdentities', options);
|
|
100
148
|
/**
|
|
101
149
|
* Fetch the users identities.
|
package/dist/sdk/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client, type Options as Options2, type TDataShape } from './client';
|
|
2
|
-
import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UploadNodeSourceZipData, UploadNodeSourceZipErrors, UploadNodeSourceZipResponses } from './types.gen';
|
|
2
|
+
import type { CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceInviteData, CreateSpaceInviteErrors, CreateSpaceInviteResponses, CreateSpaceResponses, CreateUsernameData, CreateUsernameErrors, CreateUsernameResponses, DeleteAccountIdentityData, DeleteAccountIdentityErrors, DeleteAccountIdentityResponses, DeployVersionData, DeployVersionErrors, DeployVersionResponses, FetchGraphM2mData, FetchGraphM2mErrors, FetchGraphM2mResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceInvitesData, GetSpaceInvitesErrors, GetSpaceInvitesResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, JoinSpaceData, JoinSpaceErrors, JoinSpaceResponses, LeaveSpaceData, LeaveSpaceErrors, LeaveSpaceResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListSpaceMembersData, ListSpaceMembersErrors, ListSpaceMembersResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, ListUserSpacesData, ListUserSpacesErrors, ListUserSpacesResponses, RejectSpaceInviteData, RejectSpaceInviteErrors, RejectSpaceInviteResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, RevokeSpaceInviteData, RevokeSpaceInviteErrors, RevokeSpaceInviteResponses, UpdateConnectedAppTokenData, UpdateConnectedAppTokenErrors, UpdateConnectedAppTokenResponses, UpdateGraphStateData, UpdateGraphStateErrors, UpdateGraphStateResponses, UpdateUsernameData, UpdateUsernameErrors, UpdateUsernameResponses, UpdateUserProfileData, UpdateUserProfileErrors, UpdateUserProfileResponses, UploadNodeSourceZipData, UploadNodeSourceZipErrors, UploadNodeSourceZipResponses } 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
|
|
@@ -25,10 +25,22 @@ export declare const fetchGraphM2M: <ThrowOnError extends boolean = false>(optio
|
|
|
25
25
|
* This will submit a password reset request requiring the user to reset their password on next sign in.
|
|
26
26
|
*/
|
|
27
27
|
export declare const requestAccountPasswordReset: <ThrowOnError extends boolean = false>(options?: Options<RequestAccountPasswordResetData, ThrowOnError>) => import("./client").RequestResult<RequestAccountPasswordResetResponses, RequestAccountPasswordResetErrors, ThrowOnError, "fields">;
|
|
28
|
+
/**
|
|
29
|
+
* Update username for current user
|
|
30
|
+
*/
|
|
31
|
+
export declare const updateUsername: <ThrowOnError extends boolean = false>(options: Options<UpdateUsernameData, ThrowOnError>) => import("./client").RequestResult<UpdateUsernameResponses, UpdateUsernameErrors, ThrowOnError, "fields">;
|
|
32
|
+
/**
|
|
33
|
+
* Create username for current user
|
|
34
|
+
*/
|
|
35
|
+
export declare const createUsername: <ThrowOnError extends boolean = false>(options: Options<CreateUsernameData, ThrowOnError>) => import("./client").RequestResult<CreateUsernameResponses, CreateUsernameErrors, ThrowOnError, "fields">;
|
|
28
36
|
/**
|
|
29
37
|
* Fetch the users profile.
|
|
30
38
|
*/
|
|
31
39
|
export declare const getUserProfile: <ThrowOnError extends boolean = false>(options?: Options<GetUserProfileData, ThrowOnError>) => import("./client").RequestResult<GetUserProfileResponses, GetUserProfileErrors, ThrowOnError, "fields">;
|
|
40
|
+
/**
|
|
41
|
+
* Update the authenticated user's Kinde profile fields.
|
|
42
|
+
*/
|
|
43
|
+
export declare const updateUserProfile: <ThrowOnError extends boolean = false>(options: Options<UpdateUserProfileData, ThrowOnError>) => import("./client").RequestResult<UpdateUserProfileResponses, UpdateUserProfileErrors, ThrowOnError, "fields">;
|
|
32
44
|
/**
|
|
33
45
|
* Fetch the users identities.
|
|
34
46
|
*/
|
package/dist/sdk/sdk.gen.js
CHANGED
|
@@ -46,6 +46,44 @@ export const requestAccountPasswordReset = (options) => {
|
|
|
46
46
|
...options
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Update username for current user
|
|
51
|
+
*/
|
|
52
|
+
export const updateUsername = (options) => {
|
|
53
|
+
return (options.client ?? client).patch({
|
|
54
|
+
security: [
|
|
55
|
+
{
|
|
56
|
+
scheme: 'bearer',
|
|
57
|
+
type: 'http'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
url: '/auth/account/username',
|
|
61
|
+
...options,
|
|
62
|
+
headers: {
|
|
63
|
+
'Content-Type': 'application/json',
|
|
64
|
+
...options.headers
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Create username for current user
|
|
70
|
+
*/
|
|
71
|
+
export const createUsername = (options) => {
|
|
72
|
+
return (options.client ?? client).post({
|
|
73
|
+
security: [
|
|
74
|
+
{
|
|
75
|
+
scheme: 'bearer',
|
|
76
|
+
type: 'http'
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
url: '/auth/account/username',
|
|
80
|
+
...options,
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
...options.headers
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};
|
|
49
87
|
/**
|
|
50
88
|
* Fetch the users profile.
|
|
51
89
|
*/
|
|
@@ -61,6 +99,25 @@ export const getUserProfile = (options) => {
|
|
|
61
99
|
...options
|
|
62
100
|
});
|
|
63
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Update the authenticated user's Kinde profile fields.
|
|
104
|
+
*/
|
|
105
|
+
export const updateUserProfile = (options) => {
|
|
106
|
+
return (options.client ?? client).patch({
|
|
107
|
+
security: [
|
|
108
|
+
{
|
|
109
|
+
scheme: 'bearer',
|
|
110
|
+
type: 'http'
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
url: '/auth/account/profile',
|
|
114
|
+
...options,
|
|
115
|
+
headers: {
|
|
116
|
+
'Content-Type': 'application/json',
|
|
117
|
+
...options.headers
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
64
121
|
/**
|
|
65
122
|
* Fetch the users identities.
|
|
66
123
|
*/
|
package/dist/sdk/types.gen.d.ts
CHANGED
|
@@ -47,9 +47,6 @@ export type CreateInvite = {
|
|
|
47
47
|
export type CreateSpace = {
|
|
48
48
|
name: string;
|
|
49
49
|
handle: string;
|
|
50
|
-
senderName: string;
|
|
51
|
-
senderEmail: string;
|
|
52
|
-
billingEmail: string;
|
|
53
50
|
billingPlanCode: string;
|
|
54
51
|
};
|
|
55
52
|
export type CreateEnvironment = {
|
|
@@ -185,6 +182,13 @@ export type AccountProfile = {
|
|
|
185
182
|
lastSignedIn: string;
|
|
186
183
|
createdOn: string;
|
|
187
184
|
};
|
|
185
|
+
export type UserInfo = {
|
|
186
|
+
firstname: string;
|
|
187
|
+
lastname: string;
|
|
188
|
+
};
|
|
189
|
+
export type UsernamePayload = {
|
|
190
|
+
username: string;
|
|
191
|
+
};
|
|
188
192
|
export type UserSpace = {
|
|
189
193
|
code: string;
|
|
190
194
|
name: string;
|
|
@@ -463,6 +467,72 @@ export type RequestAccountPasswordResetResponses = {
|
|
|
463
467
|
*/
|
|
464
468
|
202: unknown;
|
|
465
469
|
};
|
|
470
|
+
export type UpdateUsernameData = {
|
|
471
|
+
body: UsernamePayload;
|
|
472
|
+
path?: never;
|
|
473
|
+
query?: never;
|
|
474
|
+
url: '/auth/account/username';
|
|
475
|
+
};
|
|
476
|
+
export type UpdateUsernameErrors = {
|
|
477
|
+
/**
|
|
478
|
+
* Bad request.
|
|
479
|
+
*/
|
|
480
|
+
400: ErrorResponse;
|
|
481
|
+
/**
|
|
482
|
+
* Unauthorised user.
|
|
483
|
+
*/
|
|
484
|
+
401: ErrorResponse;
|
|
485
|
+
/**
|
|
486
|
+
* Invalid credentials.
|
|
487
|
+
*/
|
|
488
|
+
403: ErrorResponse;
|
|
489
|
+
/**
|
|
490
|
+
* Username identity not found.
|
|
491
|
+
*/
|
|
492
|
+
404: ErrorResponse;
|
|
493
|
+
/**
|
|
494
|
+
* Unexpected error.
|
|
495
|
+
*/
|
|
496
|
+
500: ErrorResponse;
|
|
497
|
+
};
|
|
498
|
+
export type UpdateUsernameError = UpdateUsernameErrors[keyof UpdateUsernameErrors];
|
|
499
|
+
export type UpdateUsernameResponses = {
|
|
500
|
+
/**
|
|
501
|
+
* Username update accepted.
|
|
502
|
+
*/
|
|
503
|
+
202: unknown;
|
|
504
|
+
};
|
|
505
|
+
export type CreateUsernameData = {
|
|
506
|
+
body: UsernamePayload;
|
|
507
|
+
path?: never;
|
|
508
|
+
query?: never;
|
|
509
|
+
url: '/auth/account/username';
|
|
510
|
+
};
|
|
511
|
+
export type CreateUsernameErrors = {
|
|
512
|
+
/**
|
|
513
|
+
* Bad request.
|
|
514
|
+
*/
|
|
515
|
+
400: ErrorResponse;
|
|
516
|
+
/**
|
|
517
|
+
* Unauthorised user.
|
|
518
|
+
*/
|
|
519
|
+
401: ErrorResponse;
|
|
520
|
+
/**
|
|
521
|
+
* Invalid credentials.
|
|
522
|
+
*/
|
|
523
|
+
403: ErrorResponse;
|
|
524
|
+
/**
|
|
525
|
+
* Unexpected error.
|
|
526
|
+
*/
|
|
527
|
+
500: ErrorResponse;
|
|
528
|
+
};
|
|
529
|
+
export type CreateUsernameError = CreateUsernameErrors[keyof CreateUsernameErrors];
|
|
530
|
+
export type CreateUsernameResponses = {
|
|
531
|
+
/**
|
|
532
|
+
* Username creation accepted.
|
|
533
|
+
*/
|
|
534
|
+
202: unknown;
|
|
535
|
+
};
|
|
466
536
|
export type GetUserProfileData = {
|
|
467
537
|
body?: never;
|
|
468
538
|
path?: never;
|
|
@@ -495,6 +565,37 @@ export type GetUserProfileResponses = {
|
|
|
495
565
|
200: AccountProfile;
|
|
496
566
|
};
|
|
497
567
|
export type GetUserProfileResponse = GetUserProfileResponses[keyof GetUserProfileResponses];
|
|
568
|
+
export type UpdateUserProfileData = {
|
|
569
|
+
body: UserInfo;
|
|
570
|
+
path?: never;
|
|
571
|
+
query?: never;
|
|
572
|
+
url: '/auth/account/profile';
|
|
573
|
+
};
|
|
574
|
+
export type UpdateUserProfileErrors = {
|
|
575
|
+
/**
|
|
576
|
+
* Bad request.
|
|
577
|
+
*/
|
|
578
|
+
400: ErrorResponse;
|
|
579
|
+
/**
|
|
580
|
+
* Unauthorised user.
|
|
581
|
+
*/
|
|
582
|
+
401: ErrorResponse;
|
|
583
|
+
/**
|
|
584
|
+
* Invalid credentials.
|
|
585
|
+
*/
|
|
586
|
+
403: ErrorResponse;
|
|
587
|
+
/**
|
|
588
|
+
* Unexpected error.
|
|
589
|
+
*/
|
|
590
|
+
500: ErrorResponse;
|
|
591
|
+
};
|
|
592
|
+
export type UpdateUserProfileError = UpdateUserProfileErrors[keyof UpdateUserProfileErrors];
|
|
593
|
+
export type UpdateUserProfileResponses = {
|
|
594
|
+
/**
|
|
595
|
+
* User profile update accepted.
|
|
596
|
+
*/
|
|
597
|
+
202: unknown;
|
|
598
|
+
};
|
|
498
599
|
export type GetUserIdentitiesData = {
|
|
499
600
|
body?: never;
|
|
500
601
|
path?: never;
|
package/dist/sdk/zod.gen.d.ts
CHANGED
|
@@ -68,9 +68,6 @@ export declare const zCreateInvite: z.ZodObject<{
|
|
|
68
68
|
export declare const zCreateSpace: z.ZodObject<{
|
|
69
69
|
name: z.ZodString;
|
|
70
70
|
handle: z.ZodString;
|
|
71
|
-
senderName: z.ZodEmail;
|
|
72
|
-
senderEmail: z.ZodEmail;
|
|
73
|
-
billingEmail: z.ZodEmail;
|
|
74
71
|
billingPlanCode: z.ZodString;
|
|
75
72
|
}, z.core.$strip>;
|
|
76
73
|
export declare const zCreateEnvironment: z.ZodObject<{
|
|
@@ -304,6 +301,13 @@ export declare const zAccountProfile: z.ZodObject<{
|
|
|
304
301
|
lastSignedIn: z.ZodISODateTime;
|
|
305
302
|
createdOn: z.ZodISODateTime;
|
|
306
303
|
}, z.core.$strip>;
|
|
304
|
+
export declare const zUserInfo: z.ZodObject<{
|
|
305
|
+
firstname: z.ZodString;
|
|
306
|
+
lastname: z.ZodString;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
export declare const zUsernamePayload: z.ZodObject<{
|
|
309
|
+
username: z.ZodString;
|
|
310
|
+
}, z.core.$strip>;
|
|
307
311
|
export declare const zUserSpace: z.ZodObject<{
|
|
308
312
|
code: z.ZodString;
|
|
309
313
|
name: z.ZodString;
|
|
@@ -1157,6 +1161,20 @@ export declare const zRequestAccountPasswordResetData: z.ZodObject<{
|
|
|
1157
1161
|
path: z.ZodOptional<z.ZodNever>;
|
|
1158
1162
|
query: z.ZodOptional<z.ZodNever>;
|
|
1159
1163
|
}, z.core.$strip>;
|
|
1164
|
+
export declare const zUpdateUsernameData: z.ZodObject<{
|
|
1165
|
+
body: z.ZodObject<{
|
|
1166
|
+
username: z.ZodString;
|
|
1167
|
+
}, z.core.$strip>;
|
|
1168
|
+
path: z.ZodOptional<z.ZodNever>;
|
|
1169
|
+
query: z.ZodOptional<z.ZodNever>;
|
|
1170
|
+
}, z.core.$strip>;
|
|
1171
|
+
export declare const zCreateUsernameData: z.ZodObject<{
|
|
1172
|
+
body: z.ZodObject<{
|
|
1173
|
+
username: z.ZodString;
|
|
1174
|
+
}, z.core.$strip>;
|
|
1175
|
+
path: z.ZodOptional<z.ZodNever>;
|
|
1176
|
+
query: z.ZodOptional<z.ZodNever>;
|
|
1177
|
+
}, z.core.$strip>;
|
|
1160
1178
|
export declare const zGetUserProfileData: z.ZodObject<{
|
|
1161
1179
|
body: z.ZodOptional<z.ZodNever>;
|
|
1162
1180
|
path: z.ZodOptional<z.ZodNever>;
|
|
@@ -1178,6 +1196,14 @@ export declare const zGetUserProfileResponse: z.ZodObject<{
|
|
|
1178
1196
|
lastSignedIn: z.ZodISODateTime;
|
|
1179
1197
|
createdOn: z.ZodISODateTime;
|
|
1180
1198
|
}, z.core.$strip>;
|
|
1199
|
+
export declare const zUpdateUserProfileData: z.ZodObject<{
|
|
1200
|
+
body: z.ZodObject<{
|
|
1201
|
+
firstname: z.ZodString;
|
|
1202
|
+
lastname: z.ZodString;
|
|
1203
|
+
}, z.core.$strip>;
|
|
1204
|
+
path: z.ZodOptional<z.ZodNever>;
|
|
1205
|
+
query: z.ZodOptional<z.ZodNever>;
|
|
1206
|
+
}, z.core.$strip>;
|
|
1181
1207
|
export declare const zGetUserIdentitiesData: z.ZodObject<{
|
|
1182
1208
|
body: z.ZodOptional<z.ZodNever>;
|
|
1183
1209
|
path: z.ZodOptional<z.ZodNever>;
|
|
@@ -1354,9 +1380,6 @@ export declare const zCreateSpaceData: z.ZodObject<{
|
|
|
1354
1380
|
body: z.ZodObject<{
|
|
1355
1381
|
name: z.ZodString;
|
|
1356
1382
|
handle: z.ZodString;
|
|
1357
|
-
senderName: z.ZodEmail;
|
|
1358
|
-
senderEmail: z.ZodEmail;
|
|
1359
|
-
billingEmail: z.ZodEmail;
|
|
1360
1383
|
billingPlanCode: z.ZodString;
|
|
1361
1384
|
}, z.core.$strip>;
|
|
1362
1385
|
path: z.ZodOptional<z.ZodNever>;
|
package/dist/sdk/zod.gen.js
CHANGED
|
@@ -48,9 +48,6 @@ export const zCreateInvite = z.object({
|
|
|
48
48
|
export const zCreateSpace = z.object({
|
|
49
49
|
name: z.string(),
|
|
50
50
|
handle: z.string(),
|
|
51
|
-
senderName: z.email(),
|
|
52
|
-
senderEmail: z.email(),
|
|
53
|
-
billingEmail: z.email(),
|
|
54
51
|
billingPlanCode: z.string()
|
|
55
52
|
});
|
|
56
53
|
export const zCreateEnvironment = z.object({
|
|
@@ -194,6 +191,13 @@ export const zAccountProfile = z.object({
|
|
|
194
191
|
lastSignedIn: z.iso.datetime(),
|
|
195
192
|
createdOn: z.iso.datetime()
|
|
196
193
|
});
|
|
194
|
+
export const zUserInfo = z.object({
|
|
195
|
+
firstname: z.string(),
|
|
196
|
+
lastname: z.string()
|
|
197
|
+
});
|
|
198
|
+
export const zUsernamePayload = z.object({
|
|
199
|
+
username: z.string()
|
|
200
|
+
});
|
|
197
201
|
export const zUserSpace = z.object({
|
|
198
202
|
code: z.string(),
|
|
199
203
|
name: z.string(),
|
|
@@ -491,6 +495,16 @@ export const zRequestAccountPasswordResetData = z.object({
|
|
|
491
495
|
path: z.optional(z.never()),
|
|
492
496
|
query: z.optional(z.never())
|
|
493
497
|
});
|
|
498
|
+
export const zUpdateUsernameData = z.object({
|
|
499
|
+
body: zUsernamePayload,
|
|
500
|
+
path: z.optional(z.never()),
|
|
501
|
+
query: z.optional(z.never())
|
|
502
|
+
});
|
|
503
|
+
export const zCreateUsernameData = z.object({
|
|
504
|
+
body: zUsernamePayload,
|
|
505
|
+
path: z.optional(z.never()),
|
|
506
|
+
query: z.optional(z.never())
|
|
507
|
+
});
|
|
494
508
|
export const zGetUserProfileData = z.object({
|
|
495
509
|
body: z.optional(z.never()),
|
|
496
510
|
path: z.optional(z.never()),
|
|
@@ -500,6 +514,11 @@ export const zGetUserProfileData = z.object({
|
|
|
500
514
|
* The users profile.
|
|
501
515
|
*/
|
|
502
516
|
export const zGetUserProfileResponse = zAccountProfile;
|
|
517
|
+
export const zUpdateUserProfileData = z.object({
|
|
518
|
+
body: zUserInfo,
|
|
519
|
+
path: z.optional(z.never()),
|
|
520
|
+
query: z.optional(z.never())
|
|
521
|
+
});
|
|
503
522
|
export const zGetUserIdentitiesData = z.object({
|
|
504
523
|
body: z.optional(z.never()),
|
|
505
524
|
path: z.optional(z.never()),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { GetSuccessResponse } from "../util";
|
|
3
|
-
import { GetServiceHealthData, FetchGraphM2mData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, DeleteAccountIdentityData, DeleteAccountIdentityResponses, GetConnectedAppUrlData, UpdateConnectedAppTokenData, UpdateConnectedAppTokenResponses, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, ListUserSpacesData, CreateSpaceData, CreateSpaceResponses, GetUserInvitesData, JoinSpaceData, JoinSpaceResponses, RejectSpaceInviteData, RejectSpaceInviteResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, UploadNodeSourceZipData, UploadNodeSourceZipResponses } from "../../sdk/types.gen";
|
|
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, FetchKindeOrganisationBillingAgreementsData, GetSpaceInvitesData, CreateSpaceInviteData, CreateSpaceInviteResponses, RevokeSpaceInviteData, RevokeSpaceInviteResponses, ListSpaceMembersData, LeaveSpaceData, LeaveSpaceResponses, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, UpdateGraphStateData, UpdateGraphStateResponses, DeployVersionData, DeployVersionResponses, UploadNodeSourceZipData, UploadNodeSourceZipResponses } 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>;
|
|
@@ -12,9 +12,24 @@ export declare const useRequestAccountPasswordReset: (config?: {
|
|
|
12
12
|
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
13
13
|
retry?: boolean;
|
|
14
14
|
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<RequestAccountPasswordResetData, "url"> | undefined, unknown>;
|
|
15
|
+
export declare const useUpdateUsername: (config?: {
|
|
16
|
+
onSuccess?: (data: GetSuccessResponse<UpdateUsernameResponses>) => void;
|
|
17
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
18
|
+
retry?: boolean;
|
|
19
|
+
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<UpdateUsernameData, "url">, unknown>;
|
|
20
|
+
export declare const useCreateUsername: (config?: {
|
|
21
|
+
onSuccess?: (data: GetSuccessResponse<CreateUsernameResponses>) => void;
|
|
22
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
23
|
+
retry?: boolean;
|
|
24
|
+
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<CreateUsernameData, "url">, unknown>;
|
|
15
25
|
export declare const useGetUserProfile: (options?: Omit<GetUserProfileData, "url"> & {
|
|
16
26
|
enabled?: boolean;
|
|
17
27
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").AccountProfile | undefined, Error>;
|
|
28
|
+
export declare const useUpdateUserProfile: (config?: {
|
|
29
|
+
onSuccess?: (data: GetSuccessResponse<UpdateUserProfileResponses>) => void;
|
|
30
|
+
onError?: Parameters<typeof useMutation>["0"]["onError"];
|
|
31
|
+
retry?: boolean;
|
|
32
|
+
}) => import("@tanstack/react-query").UseMutationResult<unknown, unknown, Omit<UpdateUserProfileData, "url">, unknown>;
|
|
18
33
|
export declare const useGetUserIdentities: (options?: Omit<GetUserIdentitiesData, "url"> & {
|
|
19
34
|
enabled?: boolean;
|
|
20
35
|
}) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").AccountIdentities | 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, getUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, uploadNodeSourceZip } from "../../sdk/sdk.gen";
|
|
5
|
+
import { getServiceHealth, fetchGraphM2M, requestAccountPasswordReset, updateUsername, createUsername, getUserProfile, updateUserProfile, getUserIdentities, deleteAccountIdentity, getConnectedAppUrl, updateConnectedAppToken, listInstallationRepositories, listInstallationBranches, listUserInstallations, listUserSpaces, createSpace, getUserInvites, joinSpace, rejectSpaceInvite, getSpaceOverview, fetchKindeOrganisationBillingAgreements, getSpaceInvites, createSpaceInvite, revokeSpaceInvite, listSpaceMembers, leaveSpace, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, updateGraphState, deployVersion, uploadNodeSourceZip } from "../../sdk/sdk.gen";
|
|
6
6
|
export const useGetServiceHealth = (options) => {
|
|
7
7
|
const token = useToken();
|
|
8
8
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -64,6 +64,44 @@ export const useRequestAccountPasswordReset = (config) => {
|
|
|
64
64
|
retry: config?.retry
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
export const useUpdateUsername = (config) => {
|
|
68
|
+
const token = useToken();
|
|
69
|
+
const queryClient = useQueryClient();
|
|
70
|
+
const opts = { throwOnError: true, url: "/auth/account/username" };
|
|
71
|
+
const funcer = async (options) => {
|
|
72
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
73
|
+
const res = await updateUsername({ ...opts, ...options, auth });
|
|
74
|
+
return res?.data;
|
|
75
|
+
};
|
|
76
|
+
return useMutation({
|
|
77
|
+
mutationFn: funcer,
|
|
78
|
+
onSuccess: (res, options, c, ctx) => {
|
|
79
|
+
queryClient.invalidateQueries({ queryKey: ["account", "username"] });
|
|
80
|
+
config?.onSuccess && config.onSuccess(res);
|
|
81
|
+
},
|
|
82
|
+
onError: config?.onError,
|
|
83
|
+
retry: config?.retry
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export const useCreateUsername = (config) => {
|
|
87
|
+
const token = useToken();
|
|
88
|
+
const queryClient = useQueryClient();
|
|
89
|
+
const opts = { throwOnError: true, url: "/auth/account/username" };
|
|
90
|
+
const funcer = async (options) => {
|
|
91
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
92
|
+
const res = await createUsername({ ...opts, ...options, auth });
|
|
93
|
+
return res?.data;
|
|
94
|
+
};
|
|
95
|
+
return useMutation({
|
|
96
|
+
mutationFn: funcer,
|
|
97
|
+
onSuccess: (res, options, c, ctx) => {
|
|
98
|
+
queryClient.invalidateQueries({ queryKey: ["account", "username"] });
|
|
99
|
+
config?.onSuccess && config.onSuccess(res);
|
|
100
|
+
},
|
|
101
|
+
onError: config?.onError,
|
|
102
|
+
retry: config?.retry
|
|
103
|
+
});
|
|
104
|
+
};
|
|
67
105
|
export const useGetUserProfile = (options) => {
|
|
68
106
|
const token = useToken();
|
|
69
107
|
let { enabled, ...rest } = options || { enabled: true };
|
|
@@ -85,6 +123,25 @@ export const useGetUserProfile = (options) => {
|
|
|
85
123
|
staleTime: 600000
|
|
86
124
|
});
|
|
87
125
|
};
|
|
126
|
+
export const useUpdateUserProfile = (config) => {
|
|
127
|
+
const token = useToken();
|
|
128
|
+
const queryClient = useQueryClient();
|
|
129
|
+
const opts = { throwOnError: true, url: "/auth/account/profile" };
|
|
130
|
+
const funcer = async (options) => {
|
|
131
|
+
const auth = isPromise(token) ? (await token) || "" : token || "";
|
|
132
|
+
const res = await updateUserProfile({ ...opts, ...options, auth });
|
|
133
|
+
return res?.data;
|
|
134
|
+
};
|
|
135
|
+
return useMutation({
|
|
136
|
+
mutationFn: funcer,
|
|
137
|
+
onSuccess: (res, options, c, ctx) => {
|
|
138
|
+
queryClient.invalidateQueries({ queryKey: ["account", "profile"] });
|
|
139
|
+
config?.onSuccess && config.onSuccess(res);
|
|
140
|
+
},
|
|
141
|
+
onError: config?.onError,
|
|
142
|
+
retry: config?.retry
|
|
143
|
+
});
|
|
144
|
+
};
|
|
88
145
|
export const useGetUserIdentities = (options) => {
|
|
89
146
|
const token = useToken();
|
|
90
147
|
let { enabled, ...rest } = options || { enabled: true };
|