add pending email to UserResource and update openapi client

This commit is contained in:
Gregor Vostrak
2026-05-26 18:02:15 +02:00
committed by Constantin Graf
parent c1ecd0eff5
commit 8f02f98afc
6 changed files with 94 additions and 1 deletions

View File

@@ -124,6 +124,9 @@ export type CreateInvoiceBody = ZodiosBodyByAlias<SolidTimeApi, 'createInvoice'>
export type UpdateInvoiceBody = ZodiosBodyByAlias<SolidTimeApi, 'updateInvoice'>;
export type User = ZodiosResponseByAlias<SolidTimeApi, 'getMe'>['data'];
export type UpdateUserBody = ZodiosBodyByAlias<SolidTimeApi, 'updateUser'>;
const api = createApiClient('/api', { validate: 'none' });
export { createApiClient, api };

View File

@@ -688,11 +688,22 @@ const UserResource = z
id: z.string(),
name: z.string(),
email: z.string(),
pending_email: z.union([z.string(), z.null()]),
profile_photo_url: z.string(),
timezone: z.string(),
week_start: Weekday,
})
.passthrough();
const UserUpdateRequest = z
.object({
name: z.string(),
email: z.string(),
photo: z.union([z.string(), z.null()]),
timezone: z.string(),
week_start: Weekday,
})
.partial()
.passthrough();
const PersonalMembershipResource = z
.object({
id: z.string(),
@@ -764,6 +775,7 @@ export const schemas = {
TimeEntryUpdateMultipleRequest,
TimeEntryUpdateRequest,
UserResource,
UserUpdateRequest,
PersonalMembershipResource,
};
@@ -4467,7 +4479,7 @@ The report is considered public if the &#x60;is_public&#x60; field is set to &#x
method: 'get',
path: '/v1/users/me',
alias: 'getMe',
description: `This endpoint is independent of organization.`,
description: `This endpoint is independent of the organization.`,
requestFormat: 'json',
response: z.object({ data: UserResource }).passthrough(),
errors: [
@@ -4483,6 +4495,79 @@ The report is considered public if the &#x60;is_public&#x60; field is set to &#x
},
],
},
{
method: 'put',
path: '/v1/users/:user',
alias: 'updateUser',
description: `This endpoint is independent of the organization.`,
requestFormat: 'json',
parameters: [
{
name: 'body',
type: 'Body',
schema: UserUpdateRequest,
},
{
name: 'user',
type: 'Path',
schema: z.string(),
},
],
response: z.object({ data: UserResource }).passthrough(),
errors: [
{
status: 401,
description: `Unauthenticated`,
schema: z.object({ message: z.string() }).passthrough(),
},
{
status: 403,
description: `Authorization error`,
schema: z.object({ message: z.string() }).passthrough(),
},
{
status: 422,
description: `Validation error`,
schema: z
.object({ message: z.string(), errors: z.record(z.array(z.string())) })
.passthrough(),
},
],
},
{
method: 'post',
path: '/v1/users/:user/resend-email-verification',
alias: 'resendUserEmailVerification',
description: `This endpoint is independent of the organization.`,
requestFormat: 'json',
parameters: [
{
name: 'user',
type: 'Path',
schema: z.string(),
},
],
response: z.void(),
errors: [
{
status: 400,
description: `API exception`,
schema: z
.object({ error: z.boolean(), key: z.string(), message: z.string() })
.passthrough(),
},
{
status: 401,
description: `Unauthenticated`,
schema: z.object({ message: z.string() }).passthrough(),
},
{
status: 403,
description: `Authorization error`,
schema: z.object({ message: z.string() }).passthrough(),
},
],
},
{
method: 'get',
path: '/v1/users/me/api-tokens',

View File

@@ -63,6 +63,7 @@ export interface User {
id: string;
name: string;
email: string;
pending_email: string | null;
email_verified_at: string | null;
password?: string;
remember_token?: string | null;

View File

@@ -80,6 +80,7 @@ export interface User {
id: string;
name: string;
email: string;
pending_email: string | null;
email_verified_at: string | null;
password?: string;
remember_token?: string | null;