feat(editor): ✨ Payment input
This commit is contained in:
@ -1,12 +1,16 @@
|
||||
import { Credentials as CredentialsFromPrisma } from 'db'
|
||||
|
||||
export type Credentials = SmtpCredentials | GoogleSheetsCredentials
|
||||
export type Credentials =
|
||||
| SmtpCredentials
|
||||
| GoogleSheetsCredentials
|
||||
| StripeCredentials
|
||||
|
||||
export type CredentialsBase = Omit<CredentialsFromPrisma, 'data' | 'type'>
|
||||
|
||||
export enum CredentialsType {
|
||||
GOOGLE_SHEETS = 'google sheets',
|
||||
SMTP = 'smtp',
|
||||
STRIPE = 'stripe',
|
||||
}
|
||||
|
||||
export type SmtpCredentials = CredentialsBase & {
|
||||
@ -19,6 +23,11 @@ export type GoogleSheetsCredentials = CredentialsBase & {
|
||||
data: GoogleSheetsCredentialsData
|
||||
}
|
||||
|
||||
export type StripeCredentials = CredentialsBase & {
|
||||
type: CredentialsType.STRIPE
|
||||
data: StripeCredentialsData
|
||||
}
|
||||
|
||||
export type GoogleSheetsCredentialsData = {
|
||||
refresh_token?: string | null
|
||||
expiry_date?: number | null
|
||||
@ -36,3 +45,14 @@ export type SmtpCredentialsData = {
|
||||
port: number
|
||||
from: { email?: string; name?: string }
|
||||
}
|
||||
|
||||
export type StripeCredentialsData = {
|
||||
live: {
|
||||
secretKey: string
|
||||
publicKey: string
|
||||
}
|
||||
test?: {
|
||||
secretKey?: string
|
||||
publicKey?: string
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user