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 { deployments } from './deployment'
|
||||||
import { teams } from './team'
|
import { teams } from './team'
|
||||||
import { type Webhook, webhookSchema } from './types'
|
import { type Webhook } from './types'
|
||||||
import { users } from './user'
|
import { users } from './user'
|
||||||
import {
|
import {
|
||||||
createInsertSchema,
|
createInsertSchema,
|
||||||
|
@ -151,18 +151,18 @@ export const projectInsertSchema = createInsertSchema(projects, {
|
||||||
})
|
})
|
||||||
|
|
||||||
export const projectSelectSchema = createSelectSchema(projects, {
|
export const projectSelectSchema = createSelectSchema(projects, {
|
||||||
_webhooks: z.array(webhookSchema),
|
stripeMetricProductIds: z.record(z.string(), z.string()).optional()
|
||||||
stripeMetricProductIds: z.record(z.string(), z.string()).optional(),
|
// _webhooks: z.array(webhookSchema),
|
||||||
_stripeCouponIds: z.record(z.string(), z.string()).optional(),
|
// _stripeCouponIds: z.record(z.string(), z.string()).optional(),
|
||||||
_stripePlanIds: z
|
// _stripePlanIds: z
|
||||||
.record(
|
// .record(
|
||||||
z.string(),
|
// z.string(),
|
||||||
z.object({
|
// z.object({
|
||||||
basePlanId: z.string(),
|
// basePlanId: z.string(),
|
||||||
requestPlanId: z.string()
|
// requestPlanId: z.string()
|
||||||
})
|
// })
|
||||||
)
|
// )
|
||||||
.optional()
|
// .optional()
|
||||||
})
|
})
|
||||||
.omit({
|
.omit({
|
||||||
_secret: true,
|
_secret: true,
|
||||||
|
|
|
@ -31,7 +31,7 @@ export const authProviderSchema = z
|
||||||
export type AuthProvider = z.infer<typeof authProviderSchema>
|
export type AuthProvider = z.infer<typeof authProviderSchema>
|
||||||
|
|
||||||
export const authProvidersSchema = z
|
export const authProvidersSchema = z
|
||||||
.record(authProviderTypeSchema, authProviderSchema)
|
.record(authProviderTypeSchema, authProviderSchema.optional())
|
||||||
.openapi('AuthProviders')
|
.openapi('AuthProviders')
|
||||||
export type AuthProviders = z.infer<typeof authProvidersSchema>
|
export type AuthProviders = z.infer<typeof authProvidersSchema>
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ export const usersRelations = relations(users, ({ many }) => ({
|
||||||
|
|
||||||
export const userInsertSchema = createInsertSchema(users, {
|
export const userInsertSchema = createInsertSchema(users, {
|
||||||
username: (schema) =>
|
username: (schema) =>
|
||||||
schema.nonempty().refine((username) => validators.username(username), {
|
schema.refine((username) => validators.username(username), {
|
||||||
message: 'Invalid username'
|
message: 'Invalid username'
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ export const userInsertSchema = createInsertSchema(users, {
|
||||||
})
|
})
|
||||||
|
|
||||||
export const userSelectSchema = createSelectSchema(users, {
|
export const userSelectSchema = createSelectSchema(users, {
|
||||||
providers: authProvidersSchema.optional()
|
providers: authProvidersSchema
|
||||||
}).openapi('User')
|
}).openapi('User')
|
||||||
|
|
||||||
export const userUpdateSchema = createUpdateSchema(users)
|
export const userUpdateSchema = createUpdateSchema(users)
|
||||||
|
|
Ładowanie…
Reference in New Issue