kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
05d6b25781
commit
f2f33948ef
|
@ -14,7 +14,7 @@ import { getProviderToken } from '@/lib/auth/get-provider-token'
|
|||
|
||||
import { deployments } from './deployment'
|
||||
import { teams } from './team'
|
||||
import { type Webhook, webhookSchema } from './types'
|
||||
import { type Webhook } from './types'
|
||||
import { users } from './user'
|
||||
import {
|
||||
createInsertSchema,
|
||||
|
@ -151,18 +151,18 @@ export const projectInsertSchema = createInsertSchema(projects, {
|
|||
})
|
||||
|
||||
export const projectSelectSchema = createSelectSchema(projects, {
|
||||
_webhooks: z.array(webhookSchema),
|
||||
stripeMetricProductIds: z.record(z.string(), z.string()).optional(),
|
||||
_stripeCouponIds: z.record(z.string(), z.string()).optional(),
|
||||
_stripePlanIds: z
|
||||
.record(
|
||||
z.string(),
|
||||
z.object({
|
||||
basePlanId: z.string(),
|
||||
requestPlanId: z.string()
|
||||
})
|
||||
)
|
||||
.optional()
|
||||
stripeMetricProductIds: z.record(z.string(), z.string()).optional()
|
||||
// _webhooks: z.array(webhookSchema),
|
||||
// _stripeCouponIds: z.record(z.string(), z.string()).optional(),
|
||||
// _stripePlanIds: z
|
||||
// .record(
|
||||
// z.string(),
|
||||
// z.object({
|
||||
// basePlanId: z.string(),
|
||||
// requestPlanId: z.string()
|
||||
// })
|
||||
// )
|
||||
// .optional()
|
||||
})
|
||||
.omit({
|
||||
_secret: true,
|
||||
|
|
|
@ -31,7 +31,7 @@ export const authProviderSchema = z
|
|||
export type AuthProvider = z.infer<typeof authProviderSchema>
|
||||
|
||||
export const authProvidersSchema = z
|
||||
.record(authProviderTypeSchema, authProviderSchema)
|
||||
.record(authProviderTypeSchema, authProviderSchema.optional())
|
||||
.openapi('AuthProviders')
|
||||
export type AuthProviders = z.infer<typeof authProvidersSchema>
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ export const usersRelations = relations(users, ({ many }) => ({
|
|||
|
||||
export const userInsertSchema = createInsertSchema(users, {
|
||||
username: (schema) =>
|
||||
schema.nonempty().refine((username) => validators.username(username), {
|
||||
schema.refine((username) => validators.username(username), {
|
||||
message: 'Invalid username'
|
||||
}),
|
||||
|
||||
|
@ -98,7 +98,7 @@ export const userInsertSchema = createInsertSchema(users, {
|
|||
})
|
||||
|
||||
export const userSelectSchema = createSelectSchema(users, {
|
||||
providers: authProvidersSchema.optional()
|
||||
providers: authProvidersSchema
|
||||
}).openapi('User')
|
||||
|
||||
export const userUpdateSchema = createUpdateSchema(users)
|
||||
|
|
Ładowanie…
Reference in New Issue