mirror of
https://github.com/documenso/documenso.git
synced 2025-11-21 20:21:38 +10:00
fix: merge conflicts
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
/// <reference types="@documenso/prisma/types/types.d.ts" />
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { Kysely, PostgresAdapter, PostgresIntrospector, PostgresQueryCompiler } from 'kysely';
|
||||
import kyselyExtension from 'prisma-extension-kysely';
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "WebhookTriggerEvents" ADD VALUE 'DOCUMENT_CANCELLED';
|
||||
@ -30,9 +30,10 @@
|
||||
"devDependencies": {
|
||||
"dotenv": "^16.3.1",
|
||||
"dotenv-cli": "^7.3.0",
|
||||
"prisma-json-types-generator": "^3.2.2",
|
||||
"prisma-kysely": "^1.8.0",
|
||||
"tsx": "^4.11.0",
|
||||
"typescript": "5.2.2",
|
||||
"zod-prisma-types": "^3.1.8"
|
||||
"typescript": "5.6.2",
|
||||
"zod-prisma-types": "3.1.9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,8 +6,15 @@ generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
generator json {
|
||||
provider = "prisma-json-types-generator"
|
||||
}
|
||||
|
||||
generator zod {
|
||||
provider = "zod-prisma-types"
|
||||
provider = "zod-prisma-types"
|
||||
createInputTypes = false
|
||||
writeBarrelFiles = true
|
||||
useMultipleFiles = true
|
||||
}
|
||||
|
||||
datasource db {
|
||||
@ -46,9 +53,9 @@ model User {
|
||||
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
Document Document[]
|
||||
Subscription Subscription[]
|
||||
PasswordResetToken PasswordResetToken[]
|
||||
documents Document[]
|
||||
subscriptions Subscription[]
|
||||
passwordResetTokens PasswordResetToken[]
|
||||
ownedTeams Team[]
|
||||
ownedPendingTeams TeamPending[]
|
||||
teamMembers TeamMember[]
|
||||
@ -57,15 +64,15 @@ model User {
|
||||
twoFactorBackupCodes String?
|
||||
url String? @unique
|
||||
|
||||
profile UserProfile?
|
||||
VerificationToken VerificationToken[]
|
||||
ApiToken ApiToken[]
|
||||
Template Template[]
|
||||
securityAuditLogs UserSecurityAuditLog[]
|
||||
Webhooks Webhook[]
|
||||
siteSettings SiteSettings[]
|
||||
passkeys Passkey[]
|
||||
avatarImage AvatarImage? @relation(fields: [avatarImageId], references: [id], onDelete: SetNull)
|
||||
profile UserProfile?
|
||||
verificationTokens VerificationToken[]
|
||||
apiTokens ApiToken[]
|
||||
templates Template[]
|
||||
securityAuditLogs UserSecurityAuditLog[]
|
||||
webhooks Webhook[]
|
||||
siteSettings SiteSettings[]
|
||||
passkeys Passkey[]
|
||||
avatarImage AvatarImage? @relation(fields: [avatarImageId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([email])
|
||||
}
|
||||
@ -113,7 +120,7 @@ model UserSecurityAuditLog {
|
||||
userAgent String?
|
||||
ipAddress String?
|
||||
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model PasswordResetToken {
|
||||
@ -122,7 +129,7 @@ model PasswordResetToken {
|
||||
createdAt DateTime @default(now())
|
||||
expiry DateTime
|
||||
userId Int
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model Passkey {
|
||||
@ -139,7 +146,7 @@ model Passkey {
|
||||
credentialBackedUp Boolean
|
||||
transports String[]
|
||||
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model AnonymousVerificationToken {
|
||||
@ -168,6 +175,7 @@ enum WebhookTriggerEvents {
|
||||
DOCUMENT_SIGNED
|
||||
DOCUMENT_COMPLETED
|
||||
DOCUMENT_REJECTED
|
||||
DOCUMENT_CANCELLED
|
||||
}
|
||||
|
||||
model Webhook {
|
||||
@ -179,10 +187,10 @@ model Webhook {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
userId Int
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
teamId Int?
|
||||
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
WebhookCall WebhookCall[]
|
||||
webhookCalls WebhookCall[]
|
||||
}
|
||||
|
||||
enum WebhookCallStatus {
|
||||
@ -240,7 +248,7 @@ model Subscription {
|
||||
cancelAtPeriodEnd Boolean @default(false)
|
||||
|
||||
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
User User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId])
|
||||
}
|
||||
@ -294,19 +302,20 @@ enum DocumentVisibility {
|
||||
ADMIN
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZDocumentAuthOptionsSchema } from '@documenso/lib/types/document-auth';", "import { ZDocumentFormValuesSchema } from '@documenso/lib/types/document-form-values';"])
|
||||
model Document {
|
||||
id Int @id @default(autoincrement())
|
||||
externalId String?
|
||||
userId Int
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
authOptions Json?
|
||||
formValues Json?
|
||||
externalId String? /// @zod.string.describe("A custom external ID you can use to identify the document.")
|
||||
userId Int /// @zod.number.describe("The ID of the user that created this document.")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
authOptions Json? /// [DocumentAuthOptions] @zod.custom.use(ZDocumentAuthOptionsSchema)
|
||||
formValues Json? /// [DocumentFormValues] @zod.custom.use(ZDocumentFormValuesSchema)
|
||||
visibility DocumentVisibility @default(EVERYONE)
|
||||
title String
|
||||
status DocumentStatus @default(DRAFT)
|
||||
Recipient Recipient[]
|
||||
Field Field[]
|
||||
ShareLink DocumentShareLink[]
|
||||
recipients Recipient[]
|
||||
fields Field[]
|
||||
shareLinks DocumentShareLink[]
|
||||
documentDataId String
|
||||
documentData DocumentData @relation(fields: [documentDataId], references: [id], onDelete: Cascade)
|
||||
documentMeta DocumentMeta?
|
||||
@ -361,8 +370,8 @@ model DocumentData {
|
||||
type DocumentDataType
|
||||
data String
|
||||
initialData String
|
||||
Document Document?
|
||||
Template Template?
|
||||
document Document?
|
||||
template Template?
|
||||
}
|
||||
|
||||
enum DocumentDistributionMethod {
|
||||
@ -370,6 +379,7 @@ enum DocumentDistributionMethod {
|
||||
NONE
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZDocumentEmailSettingsSchema } from '@documenso/lib/types/document-email';"])
|
||||
model DocumentMeta {
|
||||
id String @id @default(cuid())
|
||||
subject String?
|
||||
@ -384,7 +394,7 @@ model DocumentMeta {
|
||||
typedSignatureEnabled Boolean @default(true)
|
||||
language String @default("en")
|
||||
distributionMethod DocumentDistributionMethod @default(EMAIL)
|
||||
emailSettings Json?
|
||||
emailSettings Json? /// [DocumentEmailSettings] @zod.custom.use(ZDocumentEmailSettingsSchema)
|
||||
}
|
||||
|
||||
model DocumentAccessToken {
|
||||
@ -427,6 +437,7 @@ enum RecipientRole {
|
||||
APPROVER
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZRecipientAuthOptionsSchema } from '@documenso/lib/types/document-auth';"])
|
||||
model Recipient {
|
||||
id Int @id @default(autoincrement())
|
||||
documentId Int?
|
||||
@ -437,17 +448,17 @@ model Recipient {
|
||||
documentDeletedAt DateTime?
|
||||
expired DateTime?
|
||||
signedAt DateTime?
|
||||
authOptions Json?
|
||||
signingOrder Int?
|
||||
authOptions Json? /// [RecipientAuthOptions] @zod.custom.use(ZRecipientAuthOptionsSchema)
|
||||
signingOrder Int? /// @zod.number.describe("The order in which the recipient should sign the document. Only works if the document is set to sequential signing.")
|
||||
rejectionReason String?
|
||||
role RecipientRole @default(SIGNER)
|
||||
readStatus ReadStatus @default(NOT_OPENED)
|
||||
signingStatus SigningStatus @default(NOT_SIGNED)
|
||||
sendStatus SendStatus @default(NOT_SENT)
|
||||
Document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||
Template Template? @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
Field Field[]
|
||||
Signature Signature[]
|
||||
document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||
template Template? @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
fields Field[]
|
||||
signatures Signature[]
|
||||
|
||||
@@unique([documentId, email])
|
||||
@@unique([templateId, email])
|
||||
@ -470,6 +481,7 @@ enum FieldType {
|
||||
DROPDOWN
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZFieldMetaNotOptionalSchema } from '@documenso/lib/types/field-meta';"])
|
||||
model Field {
|
||||
id Int @id @default(autoincrement())
|
||||
secondaryId String @unique @default(cuid())
|
||||
@ -477,18 +489,18 @@ model Field {
|
||||
templateId Int?
|
||||
recipientId Int
|
||||
type FieldType
|
||||
page Int
|
||||
page Int /// @zod.number.describe("The page number of the field on the document. Starts from 1.")
|
||||
positionX Decimal @default(0)
|
||||
positionY Decimal @default(0)
|
||||
width Decimal @default(-1)
|
||||
height Decimal @default(-1)
|
||||
customText String
|
||||
inserted Boolean
|
||||
Document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||
Template Template? @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||
Signature Signature?
|
||||
fieldMeta Json?
|
||||
document Document? @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||
template Template? @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||
signature Signature?
|
||||
fieldMeta Json? /// [FieldMeta] @zod.custom.use(ZFieldMetaNotOptionalSchema)
|
||||
|
||||
@@index([documentId])
|
||||
@@index([templateId])
|
||||
@ -503,8 +515,8 @@ model Signature {
|
||||
signatureImageAsBase64 String?
|
||||
typedSignature String?
|
||||
|
||||
Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||
Field Field @relation(fields: [fieldId], references: [id], onDelete: Cascade)
|
||||
recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||
field Field @relation(fields: [fieldId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([recipientId])
|
||||
}
|
||||
@ -572,10 +584,10 @@ model Team {
|
||||
owner User @relation(fields: [ownerUserId], references: [id], onDelete: Cascade)
|
||||
subscription Subscription?
|
||||
|
||||
document Document[]
|
||||
documents Document[]
|
||||
templates Template[]
|
||||
ApiToken ApiToken[]
|
||||
Webhook Webhook[]
|
||||
apiTokens ApiToken[]
|
||||
webhooks Webhook[]
|
||||
}
|
||||
|
||||
model TeamPending {
|
||||
@ -653,6 +665,7 @@ enum TemplateType {
|
||||
PRIVATE
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZDocumentEmailSettingsSchema } from '@documenso/lib/types/document-email';"])
|
||||
model TemplateMeta {
|
||||
id String @id @default(cuid())
|
||||
subject String?
|
||||
@ -668,9 +681,10 @@ model TemplateMeta {
|
||||
template Template @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
redirectUrl String?
|
||||
language String @default("en")
|
||||
emailSettings Json?
|
||||
emailSettings Json? /// [DocumentEmailSettings] @zod.custom.use(ZDocumentEmailSettingsSchema)
|
||||
}
|
||||
|
||||
/// @zod.import(["import { ZDocumentAuthOptionsSchema } from '@documenso/lib/types/document-auth';"])
|
||||
model Template {
|
||||
id Int @id @default(autoincrement())
|
||||
externalId String?
|
||||
@ -679,7 +693,7 @@ model Template {
|
||||
userId Int
|
||||
teamId Int?
|
||||
visibility DocumentVisibility @default(EVERYONE)
|
||||
authOptions Json?
|
||||
authOptions Json? /// [DocumentAuthOptions] @zod.custom.use(ZDocumentAuthOptionsSchema)
|
||||
templateMeta TemplateMeta?
|
||||
templateDocumentDataId String
|
||||
createdAt DateTime @default(now())
|
||||
@ -689,9 +703,9 @@ model Template {
|
||||
|
||||
team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
templateDocumentData DocumentData @relation(fields: [templateDocumentDataId], references: [id], onDelete: Cascade)
|
||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
Recipient Recipient[]
|
||||
Field Field[]
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
recipients Recipient[]
|
||||
fields Field[]
|
||||
directLink TemplateDirectLink?
|
||||
documents Document[]
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ export const seedDraftDocument = async (
|
||||
|
||||
for (const recipient of recipients) {
|
||||
const email = typeof recipient === 'string' ? recipient : recipient.email;
|
||||
const name = typeof recipient === 'string' ? recipient : recipient.name ?? '';
|
||||
const name = typeof recipient === 'string' ? recipient : (recipient.name ?? '');
|
||||
|
||||
await prisma.recipient.create({
|
||||
data: {
|
||||
@ -126,12 +126,12 @@ export const seedDraftDocument = async (
|
||||
sendStatus: SendStatus.NOT_SENT,
|
||||
signingStatus: SigningStatus.NOT_SIGNED,
|
||||
signedAt: new Date(),
|
||||
Document: {
|
||||
document: {
|
||||
connect: {
|
||||
id: document.id,
|
||||
},
|
||||
},
|
||||
Field: {
|
||||
fields: {
|
||||
create: {
|
||||
page: 1,
|
||||
type: FieldType.NAME,
|
||||
@ -184,7 +184,7 @@ export const seedPendingDocument = async (
|
||||
|
||||
for (const recipient of recipients) {
|
||||
const email = typeof recipient === 'string' ? recipient : recipient.email;
|
||||
const name = typeof recipient === 'string' ? recipient : recipient.name ?? '';
|
||||
const name = typeof recipient === 'string' ? recipient : (recipient.name ?? '');
|
||||
|
||||
await prisma.recipient.create({
|
||||
data: {
|
||||
@ -195,12 +195,12 @@ export const seedPendingDocument = async (
|
||||
sendStatus: SendStatus.SENT,
|
||||
signingStatus: SigningStatus.NOT_SIGNED,
|
||||
signedAt: new Date(),
|
||||
Document: {
|
||||
document: {
|
||||
connect: {
|
||||
id: document.id,
|
||||
},
|
||||
},
|
||||
Field: {
|
||||
fields: {
|
||||
create: {
|
||||
page: 1,
|
||||
type: FieldType.NAME,
|
||||
@ -222,7 +222,7 @@ export const seedPendingDocument = async (
|
||||
id: document.id,
|
||||
},
|
||||
include: {
|
||||
Recipient: true,
|
||||
recipients: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -240,7 +240,7 @@ export const seedPendingDocumentNoFields = async ({
|
||||
|
||||
for (const recipient of recipients) {
|
||||
const email = typeof recipient === 'string' ? recipient : recipient.email;
|
||||
const name = typeof recipient === 'string' ? recipient : recipient.name ?? '';
|
||||
const name = typeof recipient === 'string' ? recipient : (recipient.name ?? '');
|
||||
|
||||
await prisma.recipient.create({
|
||||
data: {
|
||||
@ -251,7 +251,7 @@ export const seedPendingDocumentNoFields = async ({
|
||||
sendStatus: SendStatus.SENT,
|
||||
signingStatus: SigningStatus.NOT_SIGNED,
|
||||
signedAt: new Date(),
|
||||
Document: {
|
||||
document: {
|
||||
connect: {
|
||||
id: document.id,
|
||||
},
|
||||
@ -265,7 +265,7 @@ export const seedPendingDocumentNoFields = async ({
|
||||
documentId: document.id,
|
||||
},
|
||||
include: {
|
||||
Field: true,
|
||||
fields: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -301,7 +301,7 @@ export const seedPendingDocumentWithFullFields = async ({
|
||||
|
||||
for (const [recipientIndex, recipient] of recipients.entries()) {
|
||||
const email = typeof recipient === 'string' ? recipient : recipient.email;
|
||||
const name = typeof recipient === 'string' ? recipient : recipient.name ?? '';
|
||||
const name = typeof recipient === 'string' ? recipient : (recipient.name ?? '');
|
||||
|
||||
await prisma.recipient.create({
|
||||
data: {
|
||||
@ -312,12 +312,12 @@ export const seedPendingDocumentWithFullFields = async ({
|
||||
sendStatus: SendStatus.SENT,
|
||||
signingStatus: SigningStatus.NOT_SIGNED,
|
||||
signedAt: new Date(),
|
||||
Document: {
|
||||
document: {
|
||||
connect: {
|
||||
id: document.id,
|
||||
},
|
||||
},
|
||||
Field: {
|
||||
fields: {
|
||||
createMany: {
|
||||
data: fields.map((fieldType, fieldIndex) => ({
|
||||
page: 1,
|
||||
@ -342,7 +342,7 @@ export const seedPendingDocumentWithFullFields = async ({
|
||||
documentId: document.id,
|
||||
},
|
||||
include: {
|
||||
Field: true,
|
||||
fields: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -393,7 +393,7 @@ export const seedCompletedDocument = async (
|
||||
|
||||
for (const recipient of recipients) {
|
||||
const email = typeof recipient === 'string' ? recipient : recipient.email;
|
||||
const name = typeof recipient === 'string' ? recipient : recipient.name ?? '';
|
||||
const name = typeof recipient === 'string' ? recipient : (recipient.name ?? '');
|
||||
|
||||
await prisma.recipient.create({
|
||||
data: {
|
||||
@ -404,12 +404,12 @@ export const seedCompletedDocument = async (
|
||||
sendStatus: SendStatus.SENT,
|
||||
signingStatus: SigningStatus.SIGNED,
|
||||
signedAt: new Date(),
|
||||
Document: {
|
||||
document: {
|
||||
connect: {
|
||||
id: document.id,
|
||||
},
|
||||
},
|
||||
Field: {
|
||||
fields: {
|
||||
create: {
|
||||
page: 1,
|
||||
type: FieldType.NAME,
|
||||
|
||||
@ -58,7 +58,7 @@ export const seedDatabase = async () => {
|
||||
title: 'Example Document',
|
||||
documentDataId: examplePdfData.id,
|
||||
userId: exampleUser.id,
|
||||
Recipient: {
|
||||
recipients: {
|
||||
create: {
|
||||
name: String(adminUser.name),
|
||||
email: adminUser.email,
|
||||
|
||||
@ -66,12 +66,12 @@ export const seedTemplate = async (options: SeedTemplateOptions) => {
|
||||
id: documentData.id,
|
||||
},
|
||||
},
|
||||
User: {
|
||||
user: {
|
||||
connect: {
|
||||
id: userId,
|
||||
},
|
||||
},
|
||||
Recipient: {
|
||||
recipients: {
|
||||
create: {
|
||||
email: 'recipient.1@documenso.com',
|
||||
name: 'Recipient 1',
|
||||
@ -114,12 +114,12 @@ export const seedDirectTemplate = async (options: SeedTemplateOptions) => {
|
||||
id: documentData.id,
|
||||
},
|
||||
},
|
||||
User: {
|
||||
user: {
|
||||
connect: {
|
||||
id: userId,
|
||||
},
|
||||
},
|
||||
Recipient: {
|
||||
recipients: {
|
||||
create: {
|
||||
email: DIRECT_TEMPLATE_RECIPIENT_EMAIL,
|
||||
name: DIRECT_TEMPLATE_RECIPIENT_NAME,
|
||||
@ -138,12 +138,12 @@ export const seedDirectTemplate = async (options: SeedTemplateOptions) => {
|
||||
...options.createTemplateOptions,
|
||||
},
|
||||
include: {
|
||||
Recipient: true,
|
||||
User: true,
|
||||
recipients: true,
|
||||
user: true,
|
||||
},
|
||||
});
|
||||
|
||||
const directTemplateRecpient = template.Recipient.find(
|
||||
const directTemplateRecpient = template.recipients.find(
|
||||
(recipient) => recipient.email === DIRECT_TEMPLATE_RECIPIENT_EMAIL,
|
||||
);
|
||||
|
||||
@ -166,8 +166,8 @@ export const seedDirectTemplate = async (options: SeedTemplateOptions) => {
|
||||
},
|
||||
include: {
|
||||
directLink: true,
|
||||
Field: true,
|
||||
Recipient: true,
|
||||
fields: true,
|
||||
recipients: true,
|
||||
team: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
import type { Document, DocumentData, DocumentMeta } from '@documenso/prisma/client';
|
||||
|
||||
export type DocumentWithData = Document & {
|
||||
documentData?: DocumentData | null;
|
||||
documentMeta?: DocumentMeta | null;
|
||||
};
|
||||
@ -1,10 +1,10 @@
|
||||
import type { Document, DocumentData, Recipient } from '@documenso/prisma/client';
|
||||
|
||||
export type DocumentWithRecipients = Document & {
|
||||
Recipient: Recipient[];
|
||||
recipients: Recipient[];
|
||||
};
|
||||
|
||||
export type DocumentWithRecipient = Document & {
|
||||
Recipient: Recipient[];
|
||||
recipients: Recipient[];
|
||||
documentData: DocumentData;
|
||||
};
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
import type {
|
||||
Document,
|
||||
DocumentData,
|
||||
DocumentMeta,
|
||||
Field,
|
||||
Recipient,
|
||||
} from '@documenso/prisma/client';
|
||||
|
||||
export type DocumentWithRecipientAndSender = Omit<Document, 'document'> & {
|
||||
recipient: Recipient;
|
||||
sender: {
|
||||
id: number;
|
||||
name: string | null;
|
||||
email: string;
|
||||
};
|
||||
subject: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type DocumentWithDetails = Document & {
|
||||
documentData: DocumentData;
|
||||
documentMeta: DocumentMeta | null;
|
||||
Recipient: Recipient[];
|
||||
Field: Field[];
|
||||
};
|
||||
@ -2,6 +2,6 @@ import { type TFieldMetaSchema as FieldMeta } from '@documenso/lib/types/field-m
|
||||
import type { Field, Signature } from '@documenso/prisma/client';
|
||||
|
||||
export type FieldWithSignatureAndFieldMeta = Field & {
|
||||
Signature?: Signature | null;
|
||||
signature?: Signature | null;
|
||||
fieldMeta: FieldMeta | null;
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { Field, Signature } from '@documenso/prisma/client';
|
||||
|
||||
export type FieldWithSignature = Field & {
|
||||
Signature?: Signature | null;
|
||||
signature?: Signature | null;
|
||||
};
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
import type { TGetTemplateByIdResponse } from '@documenso/lib/server-only/template/get-template-by-id';
|
||||
import type { DocumentData, Template, TemplateMeta } from '@documenso/prisma/client';
|
||||
|
||||
export type TemplateWithData = Template & {
|
||||
templateDocumentData?: DocumentData | null;
|
||||
templateMeta?: TemplateMeta | null;
|
||||
};
|
||||
|
||||
export type TemplateWithDetails = TGetTemplateByIdResponse;
|
||||
25
packages/prisma/types/types.d.ts
vendored
Normal file
25
packages/prisma/types/types.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
import type {
|
||||
TDocumentAuthOptions,
|
||||
TRecipientAuthOptions,
|
||||
} from '@documenso/lib/types/document-auth';
|
||||
import type { TDocumentEmailSettings } from '@documenso/lib/types/document-email';
|
||||
import type { TDocumentFormValues } from '@documenso/lib/types/document-form-values';
|
||||
import type { TFieldMetaNotOptionalSchema } from '@documenso/lib/types/field-meta';
|
||||
|
||||
/**
|
||||
* Global types for Prisma.Json instances.
|
||||
*/
|
||||
declare global {
|
||||
namespace PrismaJson {
|
||||
type DocumentFormValues = TDocumentFormValues;
|
||||
type DocumentAuthOptions = TDocumentAuthOptions;
|
||||
type DocumentEmailSettings = TDocumentEmailSettings;
|
||||
|
||||
type RecipientAuthOptions = TRecipientAuthOptions;
|
||||
|
||||
type FieldMeta = TFieldMetaNotOptionalSchema;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user