mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +00:00
feat(cli): add shumai-cli and token authentication
This commit is contained in:
@@ -64,6 +64,7 @@ export const assetInfoSchema = z.object({
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
deletedAt: z.string().nullable().optional(),
|
||||
projectId: z.string().optional().nullable(),
|
||||
creator: assetUserInfoSchema.nullable().optional(),
|
||||
fieldValues: z.array(fieldValueInfoSchema).optional(),
|
||||
sortIndex: z.string().optional().nullable(),
|
||||
|
||||
@@ -5,3 +5,16 @@ export const signupInfoResponseSchema = z.object({
|
||||
})
|
||||
|
||||
export type SignupInfoResponse = z.infer<typeof signupInfoResponseSchema>
|
||||
|
||||
export const createApiTokenRequestSchema = z.object({
|
||||
name: z.string().min(1, 'Name is required').max(100, 'Name is too long'),
|
||||
})
|
||||
export type CreateApiTokenRequest = z.infer<typeof createApiTokenRequestSchema>
|
||||
|
||||
export const apiTokenResponseSchema = z.object({
|
||||
id: z.string(),
|
||||
token: z.string(),
|
||||
name: z.string(),
|
||||
createdAt: z.string(),
|
||||
})
|
||||
export type ApiTokenResponse = z.infer<typeof apiTokenResponseSchema>
|
||||
|
||||
@@ -18,6 +18,7 @@ export type UpdateProjectRequest = z.infer<typeof updateProjectRequestSchema>
|
||||
export const projectInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
teamId: z.string(),
|
||||
rootFolder: z.string().optional(),
|
||||
coverImage: z.string().optional(),
|
||||
coverImageKey: z.string().optional(),
|
||||
|
||||
@@ -36,6 +36,14 @@ export type PresignedUrl = z.infer<typeof presignedUrlSchema>
|
||||
export const createUploadTaskResponseSchema = z.object({
|
||||
taskId: z.string(),
|
||||
presignedUrls: z.array(presignedUrlSchema),
|
||||
createdAssets: z
|
||||
.array(
|
||||
z.object({
|
||||
tempId: z.string(),
|
||||
assetId: z.string(),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
})
|
||||
export type CreateUploadTaskResponse = z.infer<typeof createUploadTaskResponseSchema>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user