mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 02:32:00 +10:00
fix: merge conflicts
This commit is contained in:
@ -3,6 +3,7 @@ import type { z } from 'zod';
|
||||
import { DocumentDataSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentDataSchema';
|
||||
import { DocumentMetaSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentMetaSchema';
|
||||
import { DocumentSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentSchema';
|
||||
import { FolderSchema } from '@documenso/prisma/generated/zod/modelSchema/FolderSchema';
|
||||
import { TeamSchema } from '@documenso/prisma/generated/zod/modelSchema/TeamSchema';
|
||||
import { UserSchema } from '@documenso/prisma/generated/zod/modelSchema/UserSchema';
|
||||
|
||||
@ -31,6 +32,7 @@ export const ZDocumentSchema = DocumentSchema.pick({
|
||||
deletedAt: true,
|
||||
teamId: true,
|
||||
templateId: true,
|
||||
folderId: true,
|
||||
}).extend({
|
||||
// Todo: Maybe we want to alter this a bit since this returns a lot of data.
|
||||
documentData: DocumentDataSchema.pick({
|
||||
@ -57,6 +59,18 @@ export const ZDocumentSchema = DocumentSchema.pick({
|
||||
language: true,
|
||||
emailSettings: true,
|
||||
}).nullable(),
|
||||
folder: FolderSchema.pick({
|
||||
id: true,
|
||||
name: true,
|
||||
type: true,
|
||||
visibility: true,
|
||||
userId: true,
|
||||
teamId: true,
|
||||
pinned: true,
|
||||
parentId: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
}).nullable(),
|
||||
recipients: ZRecipientLiteSchema.array(),
|
||||
fields: ZFieldSchema.array(),
|
||||
});
|
||||
@ -83,8 +97,12 @@ export const ZDocumentLiteSchema = DocumentSchema.pick({
|
||||
deletedAt: true,
|
||||
teamId: true,
|
||||
templateId: true,
|
||||
folderId: true,
|
||||
useLegacyFieldInsertion: true,
|
||||
});
|
||||
|
||||
export type TDocumentLite = z.infer<typeof ZDocumentLiteSchema>;
|
||||
|
||||
/**
|
||||
* A version of the document response schema when returning multiple documents at once from a single API endpoint.
|
||||
*/
|
||||
@ -105,6 +123,8 @@ export const ZDocumentManySchema = DocumentSchema.pick({
|
||||
deletedAt: true,
|
||||
teamId: true,
|
||||
templateId: true,
|
||||
folderId: true,
|
||||
useLegacyFieldInsertion: true,
|
||||
}).extend({
|
||||
user: UserSchema.pick({
|
||||
id: true,
|
||||
@ -117,3 +137,5 @@ export const ZDocumentManySchema = DocumentSchema.pick({
|
||||
url: true,
|
||||
}).nullable(),
|
||||
});
|
||||
|
||||
export type TDocumentMany = z.infer<typeof ZDocumentManySchema>;
|
||||
|
||||
@ -155,6 +155,10 @@ export const ZFieldMetaPrefillFieldsSchema = z
|
||||
label: z.string().optional(),
|
||||
value: z.string().optional(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('date'),
|
||||
value: z.string().optional(),
|
||||
}),
|
||||
]),
|
||||
);
|
||||
|
||||
|
||||
9
packages/lib/types/folder-type.ts
Normal file
9
packages/lib/types/folder-type.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const FolderType = {
|
||||
DOCUMENT: 'DOCUMENT',
|
||||
TEMPLATE: 'TEMPLATE',
|
||||
} as const;
|
||||
|
||||
export const ZFolderTypeSchema = z.enum([FolderType.DOCUMENT, FolderType.TEMPLATE]);
|
||||
export type TFolderType = z.infer<typeof ZFolderTypeSchema>;
|
||||
@ -1,6 +1,7 @@
|
||||
import type { z } from 'zod';
|
||||
|
||||
import { DocumentDataSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentDataSchema';
|
||||
import { FolderSchema } from '@documenso/prisma/generated/zod/modelSchema/FolderSchema';
|
||||
import TeamSchema from '@documenso/prisma/generated/zod/modelSchema/TeamSchema';
|
||||
import { TemplateDirectLinkSchema } from '@documenso/prisma/generated/zod/modelSchema/TemplateDirectLinkSchema';
|
||||
import { TemplateMetaSchema } from '@documenso/prisma/generated/zod/modelSchema/TemplateMetaSchema';
|
||||
@ -29,6 +30,7 @@ export const ZTemplateSchema = TemplateSchema.pick({
|
||||
updatedAt: true,
|
||||
publicTitle: true,
|
||||
publicDescription: true,
|
||||
folderId: true,
|
||||
}).extend({
|
||||
// Todo: Maybe we want to alter this a bit since this returns a lot of data.
|
||||
templateDocumentData: DocumentDataSchema.pick({
|
||||
@ -62,6 +64,18 @@ export const ZTemplateSchema = TemplateSchema.pick({
|
||||
}),
|
||||
recipients: ZRecipientLiteSchema.array(),
|
||||
fields: ZFieldSchema.array(),
|
||||
folder: FolderSchema.pick({
|
||||
id: true,
|
||||
name: true,
|
||||
type: true,
|
||||
visibility: true,
|
||||
userId: true,
|
||||
teamId: true,
|
||||
pinned: true,
|
||||
parentId: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
}).nullable(),
|
||||
});
|
||||
|
||||
export type TTemplate = z.infer<typeof ZTemplateSchema>;
|
||||
@ -83,6 +97,8 @@ export const ZTemplateLiteSchema = TemplateSchema.pick({
|
||||
updatedAt: true,
|
||||
publicTitle: true,
|
||||
publicDescription: true,
|
||||
folderId: true,
|
||||
useLegacyFieldInsertion: true,
|
||||
});
|
||||
|
||||
/**
|
||||
@ -102,6 +118,8 @@ export const ZTemplateManySchema = TemplateSchema.pick({
|
||||
updatedAt: true,
|
||||
publicTitle: true,
|
||||
publicDescription: true,
|
||||
folderId: true,
|
||||
useLegacyFieldInsertion: true,
|
||||
}).extend({
|
||||
team: TeamSchema.pick({
|
||||
id: true,
|
||||
|
||||
Reference in New Issue
Block a user