mirror of
https://github.com/documenso/documenso.git
synced 2025-11-11 04:52:41 +10:00
Compare commits
2 Commits
experiment
...
v1.9.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
| 07c852744b | |||
| 4fab98c633 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/web",
|
"name": "@documenso/web",
|
||||||
"version": "1.9.0-rc.5",
|
"version": "1.9.0-rc.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
|
|||||||
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
import type { Document, Recipient, User } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type DocumentPageViewInformationProps = {
|
export type DocumentPageViewInformationProps = {
|
||||||
userId: string;
|
userId: number;
|
||||||
document: Document & {
|
document: Document & {
|
||||||
User: Pick<User, 'id' | 'name' | 'email'>;
|
User: Pick<User, 'id' | 'name' | 'email'>;
|
||||||
Recipient: Recipient[];
|
Recipient: Recipient[];
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { cn } from '@documenso/ui/lib/utils';
|
|||||||
|
|
||||||
export type DocumentPageViewRecentActivityProps = {
|
export type DocumentPageViewRecentActivityProps = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DocumentPageViewRecentActivity = ({
|
export const DocumentPageViewRecentActivity = ({
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
|
|||||||
import type { Template, User } from '@documenso/prisma/client';
|
import type { Template, User } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type TemplatePageViewInformationProps = {
|
export type TemplatePageViewInformationProps = {
|
||||||
userId: string;
|
userId: number;
|
||||||
template: Template & {
|
template: Template & {
|
||||||
User: Pick<User, 'id' | 'name' | 'email'>;
|
User: Pick<User, 'id' | 'name' | 'email'>;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,15 +7,17 @@ import { useRouter } from 'next/navigation';
|
|||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { Trans, msg } from '@lingui/macro';
|
import { Trans, msg } from '@lingui/macro';
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { InfoIcon, Plus } from 'lucide-react';
|
import { InfoIcon, Plus, Upload, X } from 'lucide-react';
|
||||||
import { useFieldArray, useForm } from 'react-hook-form';
|
import { useFieldArray, useForm } from 'react-hook-form';
|
||||||
import * as z from 'zod';
|
import * as z from 'zod';
|
||||||
|
|
||||||
|
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
||||||
import {
|
import {
|
||||||
TEMPLATE_RECIPIENT_EMAIL_PLACEHOLDER_REGEX,
|
TEMPLATE_RECIPIENT_EMAIL_PLACEHOLDER_REGEX,
|
||||||
TEMPLATE_RECIPIENT_NAME_PLACEHOLDER_REGEX,
|
TEMPLATE_RECIPIENT_NAME_PLACEHOLDER_REGEX,
|
||||||
} from '@documenso/lib/constants/template';
|
} from '@documenso/lib/constants/template';
|
||||||
import { AppError } from '@documenso/lib/errors/app-error';
|
import { AppError } from '@documenso/lib/errors/app-error';
|
||||||
|
import { putPdfFile } from '@documenso/lib/universal/upload/put-file';
|
||||||
import type { Recipient } from '@documenso/prisma/client';
|
import type { Recipient } from '@documenso/prisma/client';
|
||||||
import { DocumentDistributionMethod, DocumentSigningOrder } from '@documenso/prisma/client';
|
import { DocumentDistributionMethod, DocumentSigningOrder } from '@documenso/prisma/client';
|
||||||
import { trpc } from '@documenso/trpc/react';
|
import { trpc } from '@documenso/trpc/react';
|
||||||
@ -50,6 +52,11 @@ import { useOptionalCurrentTeam } from '~/providers/team';
|
|||||||
const ZAddRecipientsForNewDocumentSchema = z
|
const ZAddRecipientsForNewDocumentSchema = z
|
||||||
.object({
|
.object({
|
||||||
distributeDocument: z.boolean(),
|
distributeDocument: z.boolean(),
|
||||||
|
useCustomDocument: z.boolean().default(false),
|
||||||
|
customDocumentData: z
|
||||||
|
.any()
|
||||||
|
.refine((data) => data instanceof File || data === undefined)
|
||||||
|
.optional(),
|
||||||
recipients: z.array(
|
recipients: z.array(
|
||||||
z.object({
|
z.object({
|
||||||
id: z.number(),
|
id: z.number(),
|
||||||
@ -119,6 +126,8 @@ export function UseTemplateDialog({
|
|||||||
resolver: zodResolver(ZAddRecipientsForNewDocumentSchema),
|
resolver: zodResolver(ZAddRecipientsForNewDocumentSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
distributeDocument: false,
|
distributeDocument: false,
|
||||||
|
useCustomDocument: false,
|
||||||
|
customDocumentData: undefined,
|
||||||
recipients: recipients
|
recipients: recipients
|
||||||
.sort((a, b) => (a.signingOrder || 0) - (b.signingOrder || 0))
|
.sort((a, b) => (a.signingOrder || 0) - (b.signingOrder || 0))
|
||||||
.map((recipient) => {
|
.map((recipient) => {
|
||||||
@ -145,11 +154,19 @@ export function UseTemplateDialog({
|
|||||||
|
|
||||||
const onSubmit = async (data: TAddRecipientsForNewDocumentSchema) => {
|
const onSubmit = async (data: TAddRecipientsForNewDocumentSchema) => {
|
||||||
try {
|
try {
|
||||||
|
let customDocumentDataId: string | undefined = undefined;
|
||||||
|
|
||||||
|
if (data.useCustomDocument && data.customDocumentData) {
|
||||||
|
const customDocumentData = await putPdfFile(data.customDocumentData);
|
||||||
|
customDocumentDataId = customDocumentData.id;
|
||||||
|
}
|
||||||
|
|
||||||
const { id } = await createDocumentFromTemplate({
|
const { id } = await createDocumentFromTemplate({
|
||||||
templateId,
|
templateId,
|
||||||
teamId: team?.id,
|
teamId: team?.id,
|
||||||
recipients: data.recipients,
|
recipients: data.recipients,
|
||||||
distributeDocument: data.distributeDocument,
|
distributeDocument: data.distributeDocument,
|
||||||
|
customDocumentDataId,
|
||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
@ -300,89 +317,245 @@ export function UseTemplateDialog({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{recipients.length > 0 && (
|
||||||
|
<div className="mt-4 flex flex-row items-center">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="distributeDocument"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<div className="flex flex-row items-center">
|
||||||
|
<Checkbox
|
||||||
|
id="distributeDocument"
|
||||||
|
className="h-5 w-5"
|
||||||
|
checked={field.value}
|
||||||
|
onCheckedChange={field.onChange}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{documentDistributionMethod === DocumentDistributionMethod.EMAIL && (
|
||||||
|
<label
|
||||||
|
className="text-muted-foreground ml-2 flex items-center text-sm"
|
||||||
|
htmlFor="distributeDocument"
|
||||||
|
>
|
||||||
|
<Trans>Send document</Trans>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger type="button">
|
||||||
|
<InfoIcon className="mx-1 h-4 w-4" />
|
||||||
|
</TooltipTrigger>
|
||||||
|
|
||||||
|
<TooltipContent className="text-muted-foreground z-[99999] max-w-md space-y-2 p-4">
|
||||||
|
<p>
|
||||||
|
<Trans>
|
||||||
|
The document will be immediately sent to recipients if this
|
||||||
|
is checked.
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<Trans>
|
||||||
|
Otherwise, the document will be created as a draft.
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{documentDistributionMethod === DocumentDistributionMethod.NONE && (
|
||||||
|
<label
|
||||||
|
className="text-muted-foreground ml-2 flex items-center text-sm"
|
||||||
|
htmlFor="distributeDocument"
|
||||||
|
>
|
||||||
|
<Trans>Create as pending</Trans>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger type="button">
|
||||||
|
<InfoIcon className="mx-1 h-4 w-4" />
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent className="text-muted-foreground z-[99999] max-w-md space-y-2 p-4">
|
||||||
|
<p>
|
||||||
|
<Trans>
|
||||||
|
Create the document as pending and ready to sign.
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<Trans>We won't send anything to notify recipients.</Trans>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p className="mt-2">
|
||||||
|
<Trans>
|
||||||
|
We will generate signing links for you, which you can send
|
||||||
|
to the recipients through your method of choice.
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</label>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="useCustomDocument"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<div className="flex flex-row items-center">
|
||||||
|
<Checkbox
|
||||||
|
id="useCustomDocument"
|
||||||
|
className="h-5 w-5"
|
||||||
|
checked={field.value}
|
||||||
|
onCheckedChange={(checked) => {
|
||||||
|
field.onChange(checked);
|
||||||
|
if (!checked) {
|
||||||
|
form.setValue('customDocumentData', undefined);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className="text-muted-foreground ml-2 flex items-center text-sm"
|
||||||
|
htmlFor="useCustomDocument"
|
||||||
|
>
|
||||||
|
<Trans>Upload custom document</Trans>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger type="button">
|
||||||
|
<InfoIcon className="mx-1 h-4 w-4" />
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent className="text-muted-foreground z-[99999] max-w-md space-y-2 p-4">
|
||||||
|
<p>
|
||||||
|
<Trans>
|
||||||
|
Upload a custom document to use instead of the template's default
|
||||||
|
document
|
||||||
|
</Trans>
|
||||||
|
</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{form.watch('useCustomDocument') && (
|
||||||
|
<div className="my-4">
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="customDocumentData"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormControl>
|
||||||
|
<div className="w-full space-y-4">
|
||||||
|
<label
|
||||||
|
className={cn(
|
||||||
|
'text-muted-foreground hover:border-muted-foreground/50 group relative flex min-h-[150px] cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed border-gray-300 px-6 py-10 transition-colors',
|
||||||
|
{
|
||||||
|
'border-destructive hover:border-destructive':
|
||||||
|
form.formState.errors.customDocumentData,
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="text-center">
|
||||||
|
{!field.value && (
|
||||||
|
<>
|
||||||
|
<Upload className="text-muted-foreground/50 mx-auto h-10 w-10" />
|
||||||
|
<div className="mt-4 flex text-sm leading-6">
|
||||||
|
<span className="text-muted-foreground relative">
|
||||||
|
<Trans>
|
||||||
|
<span className="text-primary font-semibold">
|
||||||
|
Click to upload
|
||||||
|
</span>{' '}
|
||||||
|
or drag and drop
|
||||||
|
</Trans>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-muted-foreground/80 text-xs">
|
||||||
|
PDF files only
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{field.value && (
|
||||||
|
<div className="text-muted-foreground space-y-1">
|
||||||
|
<p className="text-sm font-medium">{field.value.name}</p>
|
||||||
|
<p className="text-muted-foreground/60 text-xs">
|
||||||
|
{(field.value.size / (1024 * 1024)).toFixed(2)} MB
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
className="absolute h-full w-full opacity-0"
|
||||||
|
accept=".pdf,application/pdf"
|
||||||
|
onChange={(e) => {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
field.onChange(undefined);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.type !== 'application/pdf') {
|
||||||
|
form.setError('customDocumentData', {
|
||||||
|
type: 'manual',
|
||||||
|
message: _(msg`Please select a PDF file`),
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.size > APP_DOCUMENT_UPLOAD_SIZE_LIMIT * 1024 * 1024) {
|
||||||
|
form.setError('customDocumentData', {
|
||||||
|
type: 'manual',
|
||||||
|
message: _(
|
||||||
|
msg`File size exceeds the limit of ${APP_DOCUMENT_UPLOAD_SIZE_LIMIT} MB`,
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
field.onChange(file);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{field.value && (
|
||||||
|
<div className="absolute right-2 top-2">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="destructive"
|
||||||
|
className="h-6 w-6 p-0"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
field.onChange(undefined);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<X className="h-4 w-4" />
|
||||||
|
<div className="sr-only">
|
||||||
|
<Trans>Clear file</Trans>
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{recipients.length > 0 && (
|
<DialogFooter className="mt-4">
|
||||||
<div className="mt-4 flex flex-row items-center">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="distributeDocument"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem>
|
|
||||||
<div className="flex flex-row items-center">
|
|
||||||
<Checkbox
|
|
||||||
id="distributeDocument"
|
|
||||||
className="h-5 w-5"
|
|
||||||
checked={field.value}
|
|
||||||
onCheckedChange={field.onChange}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{documentDistributionMethod === DocumentDistributionMethod.EMAIL && (
|
|
||||||
<label
|
|
||||||
className="text-muted-foreground ml-2 flex items-center text-sm"
|
|
||||||
htmlFor="distributeDocument"
|
|
||||||
>
|
|
||||||
<Trans>Send document</Trans>
|
|
||||||
<Tooltip>
|
|
||||||
<TooltipTrigger type="button">
|
|
||||||
<InfoIcon className="mx-1 h-4 w-4" />
|
|
||||||
</TooltipTrigger>
|
|
||||||
|
|
||||||
<TooltipContent className="text-muted-foreground z-[99999] max-w-md space-y-2 p-4">
|
|
||||||
<p>
|
|
||||||
<Trans>
|
|
||||||
The document will be immediately sent to recipients if this is
|
|
||||||
checked.
|
|
||||||
</Trans>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<Trans>
|
|
||||||
Otherwise, the document will be created as a draft.
|
|
||||||
</Trans>
|
|
||||||
</p>
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{documentDistributionMethod === DocumentDistributionMethod.NONE && (
|
|
||||||
<label
|
|
||||||
className="text-muted-foreground ml-2 flex items-center text-sm"
|
|
||||||
htmlFor="distributeDocument"
|
|
||||||
>
|
|
||||||
<Trans>Create as pending</Trans>
|
|
||||||
<Tooltip>
|
|
||||||
<TooltipTrigger type="button">
|
|
||||||
<InfoIcon className="mx-1 h-4 w-4" />
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent className="text-muted-foreground z-[99999] max-w-md space-y-2 p-4">
|
|
||||||
<p>
|
|
||||||
<Trans>Create the document as pending and ready to sign.</Trans>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<Trans>We won't send anything to notify recipients.</Trans>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p className="mt-2">
|
|
||||||
<Trans>
|
|
||||||
We will generate signing links for you, which you can send to
|
|
||||||
the recipients through your method of choice.
|
|
||||||
</Trans>
|
|
||||||
</p>
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</label>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<DialogFooter>
|
|
||||||
<DialogClose asChild>
|
<DialogClose asChild>
|
||||||
<Button type="button" variant="secondary">
|
<Button type="button" variant="secondary">
|
||||||
<Trans>Close</Trans>
|
<Trans>Close</Trans>
|
||||||
|
|||||||
@ -45,7 +45,7 @@ import { useToast } from '@documenso/ui/primitives/use-toast';
|
|||||||
export type TransferTeamDialogProps = {
|
export type TransferTeamDialogProps = {
|
||||||
teamId: number;
|
teamId: number;
|
||||||
teamName: string;
|
teamName: string;
|
||||||
ownerUserId: string;
|
ownerUserId: number;
|
||||||
trigger?: React.ReactNode;
|
trigger?: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ export const TransferTeamDialog = ({
|
|||||||
try {
|
try {
|
||||||
await requestTeamOwnershipTransfer({
|
await requestTeamOwnershipTransfer({
|
||||||
teamId,
|
teamId,
|
||||||
newOwnerUserId,
|
newOwnerUserId: Number.parseInt(newOwnerUserId),
|
||||||
clearPaymentMethods,
|
clearPaymentMethods,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ import { UpdateTeamMemberDialog } from '../dialogs/update-team-member-dialog';
|
|||||||
|
|
||||||
export type TeamMembersDataTableProps = {
|
export type TeamMembersDataTableProps = {
|
||||||
currentUserTeamRole: TeamMemberRole;
|
currentUserTeamRole: TeamMemberRole;
|
||||||
teamOwneruserId: string;
|
teamOwnerUserId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
teamName: string;
|
teamName: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export type TeamsMemberPageDataTableProps = {
|
|||||||
currentUserTeamRole: TeamMemberRole;
|
currentUserTeamRole: TeamMemberRole;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
teamName: string;
|
teamName: string;
|
||||||
teamOwneruserId: string;
|
teamOwnerUserId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TeamsMemberPageDataTable = ({
|
export const TeamsMemberPageDataTable = ({
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import { DocumentHistorySheetChanges } from './document-history-sheet-changes';
|
|||||||
|
|
||||||
export type DocumentHistorySheetProps = {
|
export type DocumentHistorySheetProps = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
isMenuOpen?: boolean;
|
isMenuOpen?: boolean;
|
||||||
onMenuOpenChange?: (_value: boolean) => void;
|
onMenuOpenChange?: (_value: boolean) => void;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|||||||
193
package-lock.json
generated
193
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "1.9.0-rc.5",
|
"version": "1.9.0-rc.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "1.9.0-rc.5",
|
"version": "1.9.0-rc.6",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*",
|
"apps/*",
|
||||||
"packages/*"
|
"packages/*"
|
||||||
@ -15,12 +15,10 @@
|
|||||||
"@documenso/pdf-sign": "^0.1.0",
|
"@documenso/pdf-sign": "^0.1.0",
|
||||||
"@documenso/prisma": "^0.0.0",
|
"@documenso/prisma": "^0.0.0",
|
||||||
"@lingui/core": "^4.11.3",
|
"@lingui/core": "^4.11.3",
|
||||||
"@prisma/client": "^6.1.0",
|
|
||||||
"inngest-cli": "^0.29.1",
|
"inngest-cli": "^0.29.1",
|
||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"mupdf": "^1.0.0",
|
"mupdf": "^1.0.0",
|
||||||
"next-runtime-env": "^3.2.0",
|
"next-runtime-env": "^3.2.0",
|
||||||
"prisma": "^6.1.0",
|
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"zod": "3.24.1"
|
"zod": "3.24.1"
|
||||||
},
|
},
|
||||||
@ -135,7 +133,7 @@
|
|||||||
},
|
},
|
||||||
"apps/web": {
|
"apps/web": {
|
||||||
"name": "@documenso/web",
|
"name": "@documenso/web",
|
||||||
"version": "1.9.0-rc.5",
|
"version": "1.9.0-rc.6",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@documenso/api": "*",
|
"@documenso/api": "*",
|
||||||
@ -5638,13 +5636,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@prisma/client": {
|
"node_modules/@prisma/client": {
|
||||||
"version": "6.1.0",
|
"version": "5.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.4.2.tgz",
|
||||||
"integrity": "sha512-AbQYc5+EJKm1Ydfq3KxwcGiy7wIbm4/QbjCKWWoNROtvy7d6a3gmAGkKjK0iUCzh+rHV8xDhD5Cge8ke/kiy5Q==",
|
"integrity": "sha512-2xsPaz4EaMKj1WS9iW6MlPhmbqtBsXAOeVttSePp8vTFTtvzh2hZbDgswwBdSCgPzmmwF+tLB259QzggvCmJqA==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"dependencies": {
|
||||||
|
"@prisma/engines-version": "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.18"
|
"node": ">=16.13"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prisma": "*"
|
"prisma": "*"
|
||||||
@ -5676,49 +5676,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@prisma/engines": {
|
"node_modules/@prisma/engines": {
|
||||||
"version": "6.1.0",
|
"version": "5.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.4.2.tgz",
|
||||||
"integrity": "sha512-GnYJbCiep3Vyr1P/415ReYrgJUjP79fBNc1wCo7NP6Eia0CzL2Ot9vK7Infczv3oK7JLrCcawOSAxFxNFsAERQ==",
|
"integrity": "sha512-fqeucJ3LH0e1eyFdT0zRx+oETLancu5+n4lhiYECyEz6H2RDskPJHJYHkVc0LhkU4Uv7fuEnppKU3nVKNzMh8g==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"@prisma/debug": "6.1.0",
|
|
||||||
"@prisma/engines-version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
|
|
||||||
"@prisma/fetch-engine": "6.1.0",
|
|
||||||
"@prisma/get-platform": "6.1.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/@prisma/engines-version": {
|
"node_modules/@prisma/engines-version": {
|
||||||
"version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
|
"version": "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574.tgz",
|
||||||
"integrity": "sha512-PdJqmYM2Fd8K0weOOtQThWylwjsDlTig+8Pcg47/jszMuLL9iLIaygC3cjWJLda69siRW4STlCTMSgOjZzvKPQ==",
|
"integrity": "sha512-wvupDL4AA1vf4TQNANg7kR7y98ITqPsk6aacfBxZKtrJKRIsWjURHkZCGcQliHdqCiW/hGreO6d6ZuSv9MhdAA=="
|
||||||
"license": "Apache-2.0"
|
|
||||||
},
|
|
||||||
"node_modules/@prisma/engines/node_modules/@prisma/debug": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-0himsvcM4DGBTtvXkd2Tggv6sl2JyUYLzEGXXleFY+7Kp6rZeSS3hiTW9mwtUlXrwYbJP6pwlVNB7jYElrjWUg==",
|
|
||||||
"license": "Apache-2.0"
|
|
||||||
},
|
|
||||||
"node_modules/@prisma/engines/node_modules/@prisma/fetch-engine": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-asdFi7TvPlEZ8CzSZ/+Du5wZ27q6OJbRSXh+S8ISZguu+S9KtS/gP7NeXceZyb1Jv1SM1S5YfiCv+STDsG6rrg==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"@prisma/debug": "6.1.0",
|
|
||||||
"@prisma/engines-version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
|
|
||||||
"@prisma/get-platform": "6.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@prisma/engines/node_modules/@prisma/get-platform": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-ia8bNjboBoHkmKGGaWtqtlgQOhCi7+f85aOkPJKgNwWvYrT6l78KgojLekE8zMhVk0R9lWcifV0Pf8l3/15V0Q==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"@prisma/debug": "6.1.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/@prisma/fetch-engine": {
|
"node_modules/@prisma/fetch-engine": {
|
||||||
"version": "5.3.1",
|
"version": "5.3.1",
|
||||||
@ -20122,6 +20088,14 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/kysely": {
|
||||||
|
"version": "0.27.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.3.tgz",
|
||||||
|
"integrity": "sha512-lG03Ru+XyOJFsjH3OMY6R/9U38IjDPfnOfDgO3ynhbDr+Dz8fak+X6L62vqu3iybQnj+lG84OttBuU9KY3L9kA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/language-subtag-registry": {
|
"node_modules/language-subtag-registry": {
|
||||||
"version": "0.3.22",
|
"version": "0.3.22",
|
||||||
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz",
|
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz",
|
||||||
@ -26188,22 +26162,26 @@
|
|||||||
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew=="
|
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew=="
|
||||||
},
|
},
|
||||||
"node_modules/prisma": {
|
"node_modules/prisma": {
|
||||||
"version": "6.1.0",
|
"version": "5.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/prisma/-/prisma-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.4.2.tgz",
|
||||||
"integrity": "sha512-aFI3Yi+ApUxkwCJJwyQSwpyzUX7YX3ihzuHNHOyv4GJg3X5tQsmRaJEnZ+ZyfHpMtnyahhmXVfbTZ+lS8ZtfKw==",
|
"integrity": "sha512-GDMZwZy7mysB2oXU+angQqJ90iaPFdD0rHaZNkn+dio5NRkGLmMqmXs31//tg/qXT3iB0cTQwnGGQNuirhSTZg==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/engines": "6.1.0"
|
"@prisma/engines": "5.4.2"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"prisma": "build/index.js"
|
"prisma": "build/index.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.18"
|
"node": ">=16.13"
|
||||||
},
|
}
|
||||||
"optionalDependencies": {
|
},
|
||||||
"fsevents": "2.3.3"
|
"node_modules/prisma-extension-kysely": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prisma-extension-kysely/-/prisma-extension-kysely-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-s1hujYjrNzfQc9Z79s93464mkTkkt9ZPqPELDRFe9jEmiIlM/JRXZtqIyyN3FM0GDkN/BDPVtpPtdC52XnjAcQ==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@prisma/client": "latest"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prisma-kysely": {
|
"node_modules/prisma-kysely": {
|
||||||
@ -34092,6 +34070,36 @@
|
|||||||
"zod": "^3.20.2"
|
"zod": "^3.20.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/zod-prisma-types": {
|
||||||
|
"version": "3.1.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/zod-prisma-types/-/zod-prisma-types-3.1.8.tgz",
|
||||||
|
"integrity": "sha512-5oe0ays3ur4u2GtuUqlhgCraKBcsuMaMI8o7VMV4YAnFeOuVid7K2zGvjI19V0ue9PeNF2ICyVREQVohaQm5dw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/generator-helper": "^5.14.0",
|
||||||
|
"code-block-writer": "^12.0.0",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"zod": "^3.23.8"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"zod-prisma-types": "dist/bin.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/zod-prisma-types/node_modules/@prisma/debug": {
|
||||||
|
"version": "5.22.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz",
|
||||||
|
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/zod-prisma-types/node_modules/@prisma/generator-helper": {
|
||||||
|
"version": "5.22.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-5.22.0.tgz",
|
||||||
|
"integrity": "sha512-LwqcBQ5/QsuAaLNQZAIVIAJDJBMjHwMwn16e06IYx/3Okj/xEEfw9IvrqB2cJCl3b2mCBlh3eVH0w9WGmi4aHg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/debug": "5.22.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/zod-to-json-schema": {
|
"node_modules/zod-to-json-schema": {
|
||||||
"version": "3.24.1",
|
"version": "3.24.1",
|
||||||
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz",
|
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz",
|
||||||
@ -35458,10 +35466,10 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.1.0",
|
"@prisma/client": "5.4.2",
|
||||||
"kysely": "^0.27.5",
|
"kysely": "^0.27.3",
|
||||||
"prisma": "^6.1.0",
|
"prisma": "5.4.2",
|
||||||
"prisma-extension-kysely": "^3.0.0",
|
"prisma-extension-kysely": "^2.1.0",
|
||||||
"ts-pattern": "^5.0.6"
|
"ts-pattern": "^5.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -35470,42 +35478,7 @@
|
|||||||
"prisma-kysely": "^1.8.0",
|
"prisma-kysely": "^1.8.0",
|
||||||
"tsx": "^4.11.0",
|
"tsx": "^4.11.0",
|
||||||
"typescript": "5.2.2",
|
"typescript": "5.2.2",
|
||||||
"zod-prisma-types": "^3.2.1"
|
"zod-prisma-types": "^3.1.8"
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/prisma/node_modules/@prisma/debug": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-0himsvcM4DGBTtvXkd2Tggv6sl2JyUYLzEGXXleFY+7Kp6rZeSS3hiTW9mwtUlXrwYbJP6pwlVNB7jYElrjWUg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "Apache-2.0"
|
|
||||||
},
|
|
||||||
"packages/prisma/node_modules/@prisma/generator-helper": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-drHaTKRmRsz6esHk2dpn7aPoxfttoqkYWSaI7zXsL5YQz73jww1YgJpGbPgOUiblriJAtdT4o7mibMqnf8TOsA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"@prisma/debug": "6.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/prisma/node_modules/kysely": {
|
|
||||||
"version": "0.27.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.5.tgz",
|
|
||||||
"integrity": "sha512-s7hZHcQeSNKpzCkHRm8yA+0JPLjncSWnjb+2TIElwS2JAqYr+Kv3Ess+9KFfJS0C1xcQ1i9NkNHpWwCYpHMWsA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/prisma/node_modules/prisma-extension-kysely": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/prisma-extension-kysely/-/prisma-extension-kysely-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-J8gtIINuqsmbucei7PehAiuKvlPEe6SpRNXM6SdG7wXvY2aNxm5RnjnTwWITLTvzM3smarsKfMMfpMcNua82mA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@prisma/client": "latest"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/prisma/node_modules/ts-pattern": {
|
"packages/prisma/node_modules/ts-pattern": {
|
||||||
@ -35526,26 +35499,6 @@
|
|||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/prisma/node_modules/zod-prisma-types": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/zod-prisma-types/-/zod-prisma-types-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-qsOD8aMVx3Yg9gHctvhTRpavaJizt8xUda6qjwOcH7suvrirXax38tjs0ilKcY7GKbyY57q2rZ+uoSDnzVXpag==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@prisma/generator-helper": "^6.0.1",
|
|
||||||
"code-block-writer": "^12.0.0",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"zod": "^3.23.8"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"zod-prisma-types": "dist/bin.js"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@prisma/client": "^4.x.x || ^5.x.x || ^6.x.x",
|
|
||||||
"prisma": "^4.x.x || ^5.x.x || ^6.x.x"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packages/signing": {
|
"packages/signing": {
|
||||||
"name": "@documenso/signing",
|
"name": "@documenso/signing",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.9.0-rc.5",
|
"version": "1.9.0-rc.6",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"build:web": "turbo run build --filter=@documenso/web",
|
"build:web": "turbo run build --filter=@documenso/web",
|
||||||
@ -70,18 +70,14 @@
|
|||||||
"luxon": "^3.5.0",
|
"luxon": "^3.5.0",
|
||||||
"mupdf": "^1.0.0",
|
"mupdf": "^1.0.0",
|
||||||
"next-runtime-env": "^3.2.0",
|
"next-runtime-env": "^3.2.0",
|
||||||
"@prisma/client": "^6.1.0",
|
|
||||||
"prisma": "^6.1.0",
|
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"zod": "3.24.1"
|
"zod": "3.24.1"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"next": "14.2.6",
|
"next": "14.2.6",
|
||||||
"@prisma/client": "^6.1.0",
|
|
||||||
"prisma": "^6.1.0",
|
|
||||||
"zod": "3.24.1"
|
"zod": "3.24.1"
|
||||||
},
|
},
|
||||||
"trigger.dev": {
|
"trigger.dev": {
|
||||||
"endpointId": "documenso-app"
|
"endpointId": "documenso-app"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
import { expect, test } from '@playwright/test';
|
import { expect, test } from '@playwright/test';
|
||||||
|
import fs from 'fs';
|
||||||
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import { extractDocumentAuthMethods } from '@documenso/lib/utils/document-auth';
|
import { extractDocumentAuthMethods } from '@documenso/lib/utils/document-auth';
|
||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
import { DocumentDataType } from '@documenso/prisma/client';
|
||||||
import { seedUserSubscription } from '@documenso/prisma/seed/subscriptions';
|
import { seedUserSubscription } from '@documenso/prisma/seed/subscriptions';
|
||||||
import { seedTeam } from '@documenso/prisma/seed/teams';
|
import { seedTeam } from '@documenso/prisma/seed/teams';
|
||||||
import { seedBlankTemplate } from '@documenso/prisma/seed/templates';
|
import { seedBlankTemplate } from '@documenso/prisma/seed/templates';
|
||||||
@ -13,6 +17,20 @@ test.describe.configure({ mode: 'parallel' });
|
|||||||
|
|
||||||
const enterprisePriceId = process.env.NEXT_PUBLIC_STRIPE_ENTERPRISE_PLAN_MONTHLY_PRICE_ID || '';
|
const enterprisePriceId = process.env.NEXT_PUBLIC_STRIPE_ENTERPRISE_PLAN_MONTHLY_PRICE_ID || '';
|
||||||
|
|
||||||
|
// Create a temporary PDF file for testing
|
||||||
|
function createTempPdfFile() {
|
||||||
|
const tempDir = os.tmpdir();
|
||||||
|
const tempFilePath = path.join(tempDir, 'test.pdf');
|
||||||
|
|
||||||
|
// Create a simple PDF file with some content
|
||||||
|
const pdfContent = Buffer.from(
|
||||||
|
'%PDF-1.4\n1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj 3 0 obj<</Type/Page/MediaBox[0 0 612 792]/Parent 2 0 R>>endobj\nxref\n0 4\n0000000000 65535 f\n0000000009 00000 n\n0000000052 00000 n\n0000000101 00000 n\ntrailer<</Size 4/Root 1 0 R>>\nstartxref\n178\n%%EOF',
|
||||||
|
);
|
||||||
|
|
||||||
|
fs.writeFileSync(tempFilePath, pdfContent);
|
||||||
|
return tempFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. Create a template with all settings filled out
|
* 1. Create a template with all settings filled out
|
||||||
* 2. Create a document from the template
|
* 2. Create a document from the template
|
||||||
@ -283,3 +301,231 @@ test('[TEMPLATE]: should create a team document from a team template', async ({
|
|||||||
expect(recipientOneAuth.derivedRecipientAccessAuth).toEqual('ACCOUNT');
|
expect(recipientOneAuth.derivedRecipientAccessAuth).toEqual('ACCOUNT');
|
||||||
expect(recipientTwoAuth.derivedRecipientAccessAuth).toEqual('ACCOUNT');
|
expect(recipientTwoAuth.derivedRecipientAccessAuth).toEqual('ACCOUNT');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test verifies that we can create a document from a template using a custom document
|
||||||
|
* instead of the template's default document.
|
||||||
|
*/
|
||||||
|
test('[TEMPLATE]: should create a document from a template with custom document', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const user = await seedUser();
|
||||||
|
const template = await seedBlankTemplate(user);
|
||||||
|
|
||||||
|
// Create a temporary PDF file for upload
|
||||||
|
const testPdfPath = createTempPdfFile();
|
||||||
|
const pdfContent = fs.readFileSync(testPdfPath).toString('base64');
|
||||||
|
|
||||||
|
try {
|
||||||
|
await apiSignin({
|
||||||
|
page,
|
||||||
|
email: user.email,
|
||||||
|
redirectPath: `/templates/${template.id}/edit`,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set template title
|
||||||
|
await page.getByLabel('Title').fill('TEMPLATE_WITH_CUSTOM_DOC');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Placeholder' })).toBeVisible();
|
||||||
|
|
||||||
|
// Add a signer
|
||||||
|
await page.getByPlaceholder('Email').fill('recipient@documenso.com');
|
||||||
|
await page.getByPlaceholder('Name').fill('Recipient');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Fields' })).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Save template' }).click();
|
||||||
|
|
||||||
|
// Use template with custom document
|
||||||
|
await page.waitForURL('/templates');
|
||||||
|
await page.getByRole('button', { name: 'Use Template' }).click();
|
||||||
|
|
||||||
|
// Enable custom document upload and upload file
|
||||||
|
await page.getByLabel('Upload custom document').check();
|
||||||
|
await page.locator('input[type="file"]').setInputFiles(testPdfPath);
|
||||||
|
|
||||||
|
// Wait for upload to complete
|
||||||
|
await expect(page.getByText(path.basename(testPdfPath))).toBeVisible();
|
||||||
|
|
||||||
|
// Create document with custom document data
|
||||||
|
await page.getByRole('button', { name: 'Create as draft' }).click();
|
||||||
|
|
||||||
|
// Review that the document was created with the custom document data
|
||||||
|
await page.waitForURL(/documents/);
|
||||||
|
|
||||||
|
const documentId = Number(page.url().split('/').pop());
|
||||||
|
|
||||||
|
const document = await prisma.document.findFirstOrThrow({
|
||||||
|
where: {
|
||||||
|
id: documentId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
documentData: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(document.title).toEqual('TEMPLATE_WITH_CUSTOM_DOC');
|
||||||
|
expect(document.documentData.type).toEqual(DocumentDataType.BYTES_64);
|
||||||
|
expect(document.documentData.data).toEqual(pdfContent);
|
||||||
|
expect(document.documentData.initialData).toEqual(pdfContent);
|
||||||
|
} finally {
|
||||||
|
// Clean up the temporary file
|
||||||
|
fs.unlinkSync(testPdfPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test verifies that we can create a team document from a template using a custom document
|
||||||
|
* instead of the template's default document.
|
||||||
|
*/
|
||||||
|
test('[TEMPLATE]: should create a team document from a template with custom document', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const { owner, ...team } = await seedTeam({
|
||||||
|
createTeamMembers: 2,
|
||||||
|
});
|
||||||
|
|
||||||
|
const template = await seedBlankTemplate(owner, {
|
||||||
|
createTemplateOptions: {
|
||||||
|
teamId: team.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a temporary PDF file for upload
|
||||||
|
const testPdfPath = createTempPdfFile();
|
||||||
|
const pdfContent = fs.readFileSync(testPdfPath).toString('base64');
|
||||||
|
|
||||||
|
try {
|
||||||
|
await apiSignin({
|
||||||
|
page,
|
||||||
|
email: owner.email,
|
||||||
|
redirectPath: `/t/${team.url}/templates/${template.id}/edit`,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set template title
|
||||||
|
await page.getByLabel('Title').fill('TEAM_TEMPLATE_WITH_CUSTOM_DOC');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Placeholder' })).toBeVisible();
|
||||||
|
|
||||||
|
// Add a signer
|
||||||
|
await page.getByPlaceholder('Email').fill('recipient@documenso.com');
|
||||||
|
await page.getByPlaceholder('Name').fill('Recipient');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Fields' })).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Save template' }).click();
|
||||||
|
|
||||||
|
// Use template with custom document
|
||||||
|
await page.waitForURL(`/t/${team.url}/templates`);
|
||||||
|
await page.getByRole('button', { name: 'Use Template' }).click();
|
||||||
|
|
||||||
|
// Enable custom document upload and upload file
|
||||||
|
await page.getByLabel('Upload custom document').check();
|
||||||
|
await page.locator('input[type="file"]').setInputFiles(testPdfPath);
|
||||||
|
|
||||||
|
// Wait for upload to complete
|
||||||
|
await expect(page.getByText(path.basename(testPdfPath))).toBeVisible();
|
||||||
|
|
||||||
|
// Create document with custom document data
|
||||||
|
await page.getByRole('button', { name: 'Create as draft' }).click();
|
||||||
|
|
||||||
|
// Review that the document was created with the custom document data
|
||||||
|
await page.waitForURL(/documents/);
|
||||||
|
|
||||||
|
const documentId = Number(page.url().split('/').pop());
|
||||||
|
|
||||||
|
const document = await prisma.document.findFirstOrThrow({
|
||||||
|
where: {
|
||||||
|
id: documentId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
documentData: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(document.teamId).toEqual(team.id);
|
||||||
|
expect(document.title).toEqual('TEAM_TEMPLATE_WITH_CUSTOM_DOC');
|
||||||
|
expect(document.documentData.type).toEqual(DocumentDataType.BYTES_64);
|
||||||
|
expect(document.documentData.data).toEqual(pdfContent);
|
||||||
|
expect(document.documentData.initialData).toEqual(pdfContent);
|
||||||
|
} finally {
|
||||||
|
// Clean up the temporary file
|
||||||
|
fs.unlinkSync(testPdfPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test verifies that when custom document upload is not enabled,
|
||||||
|
* the document uses the template's original document data.
|
||||||
|
*/
|
||||||
|
test('[TEMPLATE]: should create a document from a template using template document when custom document is not enabled', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const user = await seedUser();
|
||||||
|
const template = await seedBlankTemplate(user);
|
||||||
|
|
||||||
|
await apiSignin({
|
||||||
|
page,
|
||||||
|
email: user.email,
|
||||||
|
redirectPath: `/templates/${template.id}/edit`,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set template title
|
||||||
|
await page.getByLabel('Title').fill('TEMPLATE_WITH_ORIGINAL_DOC');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Placeholder' })).toBeVisible();
|
||||||
|
|
||||||
|
// Add a signer
|
||||||
|
await page.getByPlaceholder('Email').fill('recipient@documenso.com');
|
||||||
|
await page.getByPlaceholder('Name').fill('Recipient');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Continue' }).click();
|
||||||
|
await expect(page.getByRole('heading', { name: 'Add Fields' })).toBeVisible();
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Save template' }).click();
|
||||||
|
|
||||||
|
// Use template without custom document
|
||||||
|
await page.waitForURL('/templates');
|
||||||
|
await page.getByRole('button', { name: 'Use Template' }).click();
|
||||||
|
|
||||||
|
// Verify custom document upload is not checked by default
|
||||||
|
await expect(page.getByLabel('Upload custom document')).not.toBeChecked();
|
||||||
|
|
||||||
|
// Create document without custom document data
|
||||||
|
await page.getByRole('button', { name: 'Create as draft' }).click();
|
||||||
|
|
||||||
|
// Review that the document was created with the template's document data
|
||||||
|
await page.waitForURL(/documents/);
|
||||||
|
|
||||||
|
const documentId = Number(page.url().split('/').pop());
|
||||||
|
|
||||||
|
const document = await prisma.document.findFirstOrThrow({
|
||||||
|
where: {
|
||||||
|
id: documentId,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
documentData: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const templateWithData = await prisma.template.findFirstOrThrow({
|
||||||
|
where: {
|
||||||
|
id: template.id,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
templateDocumentData: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(document.title).toEqual('TEMPLATE_WITH_ORIGINAL_DOC');
|
||||||
|
expect(document.documentData.data).toEqual(templateWithData.templateDocumentData.data);
|
||||||
|
expect(document.documentData.initialData).toEqual(
|
||||||
|
templateWithData.templateDocumentData.initialData,
|
||||||
|
);
|
||||||
|
expect(document.documentData.type).toEqual(templateWithData.templateDocumentData.type);
|
||||||
|
});
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export const getStripeCustomerIdByUser = async (user: User) => {
|
|||||||
return await getStripeCustomerByUser(user).then((session) => session.stripeCustomer.id);
|
return await getStripeCustomerByUser(user).then((session) => session.stripeCustomer.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const syncStripeCustomerSubscriptions = async (userId: string, stripeCustomerId: string) => {
|
const syncStripeCustomerSubscriptions = async (userId: number, stripeCustomerId: string) => {
|
||||||
const stripeSubscriptions = await stripe.subscriptions.list({
|
const stripeSubscriptions = await stripe.subscriptions.list({
|
||||||
customer: stripeCustomerId,
|
customer: stripeCustomerId,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import type { Subscription } from '@documenso/prisma/client';
|
|||||||
import { getEnterprisePlanPriceIds } from '../stripe/get-enterprise-plan-prices';
|
import { getEnterprisePlanPriceIds } from '../stripe/get-enterprise-plan-prices';
|
||||||
|
|
||||||
export type IsUserEnterpriseOptions = {
|
export type IsUserEnterpriseOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: user.id,
|
id: Number(user.id),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
emailVerified: user.emailVerified?.toISOString() ?? null,
|
emailVerified: user.emailVerified?.toISOString() ?? null,
|
||||||
@ -140,7 +140,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
|
|
||||||
profile(profile) {
|
profile(profile) {
|
||||||
return {
|
return {
|
||||||
id: profile.sub,
|
id: Number(profile.sub),
|
||||||
name: profile.name || `${profile.given_name} ${profile.family_name}`.trim(),
|
name: profile.name || `${profile.given_name} ${profile.family_name}`.trim(),
|
||||||
email: profile.email,
|
email: profile.email,
|
||||||
emailVerified: profile.email_verified ? new Date().toISOString() : null,
|
emailVerified: profile.email_verified ? new Date().toISOString() : null,
|
||||||
@ -274,7 +274,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: user.id,
|
id: Number(user.id),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
emailVerified: user.emailVerified?.toISOString() ?? null,
|
emailVerified: user.emailVerified?.toISOString() ?? null,
|
||||||
@ -308,7 +308,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
|
|
||||||
const { userId, email } = parsedCredential;
|
const { userId, email } = parsedCredential;
|
||||||
|
|
||||||
if (typeof userId !== 'string' || typeof email !== 'string') {
|
if (typeof userId !== 'number' || typeof email !== 'string') {
|
||||||
throw new AppError(AppErrorCode.INVALID_REQUEST);
|
throw new AppError(AppErrorCode.INVALID_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: user.id,
|
id: Number(user.id),
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
emailVerified: user.emailVerified?.toISOString() ?? null,
|
emailVerified: user.emailVerified?.toISOString() ?? null,
|
||||||
@ -340,7 +340,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
} satisfies JWT;
|
} satisfies JWT;
|
||||||
|
|
||||||
if (!merged.email || typeof merged.emailVerified !== 'string') {
|
if (!merged.email || typeof merged.emailVerified !== 'string') {
|
||||||
const userId = merged.id ?? token.sub;
|
const userId = Number(merged.id ?? token.sub);
|
||||||
|
|
||||||
const retrieved = await prisma.user.findFirst({
|
const retrieved = await prisma.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
@ -367,7 +367,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
|
|
||||||
const user = await prisma.user.update({
|
const user = await prisma.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: merged.id,
|
id: Number(merged.id),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
lastSignedIn: merged.lastSignedIn,
|
lastSignedIn: merged.lastSignedIn,
|
||||||
@ -384,7 +384,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
|
|
||||||
await prisma.user.update({
|
await prisma.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: merged.id,
|
id: Number(merged.id),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
emailVerified: merged.emailVerified,
|
emailVerified: merged.emailVerified,
|
||||||
@ -407,7 +407,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
|||||||
return {
|
return {
|
||||||
...session,
|
...session,
|
||||||
user: {
|
user: {
|
||||||
id: token.id,
|
id: Number(token.id),
|
||||||
name: token.name,
|
name: token.name,
|
||||||
email: token.email,
|
email: token.email,
|
||||||
emailVerified: token.emailVerified ?? null,
|
emailVerified: token.emailVerified ?? null,
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
|||||||
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
||||||
|
|
||||||
type CreatePasskeyAuthenticationOptions = {
|
type CreatePasskeyAuthenticationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the passkey to request authentication for.
|
* The ID of the passkey to request authentication for.
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { PASSKEY_TIMEOUT } from '../../constants/auth';
|
|||||||
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
||||||
|
|
||||||
type CreatePasskeyRegistrationOptions = {
|
type CreatePasskeyRegistrationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createPasskeyRegistrationOptions = async ({
|
export const createPasskeyRegistrationOptions = async ({
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
|||||||
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
import { getAuthenticatorOptions } from '../../utils/authenticator';
|
||||||
|
|
||||||
type CreatePasskeyOptions = {
|
type CreatePasskeyOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
passkeyName: string;
|
passkeyName: string;
|
||||||
verificationResponse: RegistrationResponseJSON;
|
verificationResponse: RegistrationResponseJSON;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { UserSecurityAuditLogType } from '@documenso/prisma/client';
|
|||||||
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
||||||
|
|
||||||
export interface DeletePasskeyOptions {
|
export interface DeletePasskeyOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
passkeyId: string;
|
passkeyId: string;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { Prisma } from '@documenso/prisma/client';
|
|||||||
import type { FindResultResponse } from '../../types/search-params';
|
import type { FindResultResponse } from '../../types/search-params';
|
||||||
|
|
||||||
export interface FindPasskeysOptions {
|
export interface FindPasskeysOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
perPage?: number;
|
perPage?: number;
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
|
|||||||
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
||||||
|
|
||||||
export interface SendConfirmationEmailProps {
|
export interface SendConfirmationEmailProps {
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sendConfirmationEmail = async ({ userId }: SendConfirmationEmailProps) => {
|
export const sendConfirmationEmail = async ({ userId }: SendConfirmationEmailProps) => {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
|
|||||||
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
||||||
|
|
||||||
export interface SendForgotPasswordOptions {
|
export interface SendForgotPasswordOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sendForgotPassword = async ({ userId }: SendForgotPasswordOptions) => {
|
export const sendForgotPassword = async ({ userId }: SendForgotPasswordOptions) => {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
|
|||||||
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
||||||
|
|
||||||
export interface SendResetPasswordOptions {
|
export interface SendResetPasswordOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sendResetPassword = async ({ userId }: SendResetPasswordOptions) => {
|
export const sendResetPassword = async ({ userId }: SendResetPasswordOptions) => {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { UserSecurityAuditLogType } from '@documenso/prisma/client';
|
|||||||
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
||||||
|
|
||||||
export interface UpdateAuthenticatorsOptions {
|
export interface UpdateAuthenticatorsOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
passkeyId: string;
|
passkeyId: string;
|
||||||
name: string;
|
name: string;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export type CreateDocumentMetaOptions = {
|
|||||||
distributionMethod?: DocumentDistributionMethod;
|
distributionMethod?: DocumentDistributionMethod;
|
||||||
typedSignatureEnabled?: boolean;
|
typedSignatureEnabled?: boolean;
|
||||||
language?: SupportedLanguageCodes;
|
language?: SupportedLanguageCodes;
|
||||||
userId: string;
|
userId: number;
|
||||||
requestMetadata: RequestMetadata;
|
requestMetadata: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import { triggerWebhook } from '../webhooks/trigger/trigger-webhook';
|
|||||||
export type CreateDocumentOptions = {
|
export type CreateDocumentOptions = {
|
||||||
title: string;
|
title: string;
|
||||||
externalId?: string | null;
|
externalId?: string | null;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
documentDataId: string;
|
documentDataId: string;
|
||||||
formValues?: Record<string, string | number | boolean>;
|
formValues?: Record<string, string | number | boolean>;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-t
|
|||||||
|
|
||||||
export type DeleteDocumentOptions = {
|
export type DeleteDocumentOptions = {
|
||||||
id: number;
|
id: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
|
|||||||
|
|
||||||
export interface DuplicateDocumentOptions {
|
export interface DuplicateDocumentOptions {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import type { FindResultResponse } from '../../types/search-params';
|
|||||||
import { parseDocumentAuditLogData } from '../../utils/document-audit-logs';
|
import { parseDocumentAuditLogData } from '../../utils/document-audit-logs';
|
||||||
|
|
||||||
export interface FindDocumentAuditLogsOptions {
|
export interface FindDocumentAuditLogsOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
page?: number;
|
page?: number;
|
||||||
perPage?: number;
|
perPage?: number;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import { maskRecipientTokensForDocument } from '../../utils/mask-recipient-token
|
|||||||
export type PeriodSelectorValue = '' | '7d' | '14d' | '30d';
|
export type PeriodSelectorValue = '' | '7d' | '14d' | '30d';
|
||||||
|
|
||||||
export type FindDocumentsOptions = {
|
export type FindDocumentsOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
templateId?: number;
|
templateId?: number;
|
||||||
source?: DocumentSource;
|
source?: DocumentSource;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { getTeamById } from '../team/get-team';
|
|||||||
|
|
||||||
export type GetDocumentByIdOptions = {
|
export type GetDocumentByIdOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ export const getDocumentById = async ({ documentId, userId, teamId }: GetDocumen
|
|||||||
|
|
||||||
export type GetDocumentWhereInputOptions = {
|
export type GetDocumentWhereInputOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
|
|||||||
|
|
||||||
export type GetDocumentWithDetailsByIdOptions = {
|
export type GetDocumentWithDetailsByIdOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -170,7 +170,7 @@ type GetTeamCountsOption = {
|
|||||||
teamEmail?: string;
|
teamEmail?: string;
|
||||||
senderIds?: number[];
|
senderIds?: number[];
|
||||||
currentUserEmail: string;
|
currentUserEmail: string;
|
||||||
userId: string;
|
userId: number;
|
||||||
createdAt: Prisma.DocumentWhereInput['createdAt'];
|
createdAt: Prisma.DocumentWhereInput['createdAt'];
|
||||||
currentTeamMemberRole?: TeamMemberRole;
|
currentTeamMemberRole?: TeamMemberRole;
|
||||||
search?: string;
|
search?: string;
|
||||||
|
|||||||
@ -124,7 +124,7 @@ type VerifyPasskeyOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user who initiated the request.
|
* The ID of the user who initiated the request.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The secondary ID of the verification token.
|
* The secondary ID of the verification token.
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
|
|||||||
export type MoveDocumentToTeamOptions = {
|
export type MoveDocumentToTeamOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
|
|||||||
|
|
||||||
export type ResendDocumentOptions = {
|
export type ResendDocumentOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
recipients: number[];
|
recipients: number[];
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
requestMetadata: RequestMetadata;
|
requestMetadata: RequestMetadata;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { DocumentVisibility, TeamMemberRole } from '@documenso/prisma/client';
|
|||||||
|
|
||||||
export type SearchDocumentsWithKeywordOptions = {
|
export type SearchDocumentsWithKeywordOptions = {
|
||||||
query: string;
|
query: string;
|
||||||
userId: string;
|
userId: number;
|
||||||
limit?: number;
|
limit?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import { triggerWebhook } from '../webhooks/trigger/trigger-webhook';
|
|||||||
|
|
||||||
export type SendDocumentOptions = {
|
export type SendDocumentOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
sendEmail?: boolean;
|
sendEmail?: boolean;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import type { TDocumentAccessAuthTypes, TDocumentActionAuthTypes } from '../../t
|
|||||||
import { createDocumentAuthOptions, extractDocumentAuthMethods } from '../../utils/document-auth';
|
import { createDocumentAuthOptions, extractDocumentAuthMethods } from '../../utils/document-auth';
|
||||||
|
|
||||||
export type UpdateDocumentSettingsOptions = {
|
export type UpdateDocumentSettingsOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
export type UpdateDocumentOptions = {
|
export type UpdateDocumentOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
data: Prisma.DocumentUpdateInput;
|
data: Prisma.DocumentUpdateInput;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { createDocumentAuditLogData } from '@documenso/lib/utils/document-audit-
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type UpdateTitleOptions = {
|
export type UpdateTitleOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
|
|||||||
|
|
||||||
export type CreateFieldOptions = {
|
export type CreateFieldOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
recipientId: number;
|
recipientId: number;
|
||||||
type: FieldType;
|
type: FieldType;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
|
|||||||
export type DeleteFieldOptions = {
|
export type DeleteFieldOptions = {
|
||||||
fieldId: number;
|
fieldId: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { FieldSchema } from '@documenso/prisma/generated/zod';
|
|||||||
import { AppError, AppErrorCode } from '../../errors/app-error';
|
import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||||
|
|
||||||
export type GetFieldByIdOptions = {
|
export type GetFieldByIdOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
fieldId: number;
|
fieldId: number;
|
||||||
documentId?: number;
|
documentId?: number;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
|
|
||||||
export interface GetFieldsForDocumentOptions {
|
export interface GetFieldsForDocumentOptions {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DocumentField = Awaited<ReturnType<typeof getFieldsForDocument>>[number];
|
export type DocumentField = Awaited<ReturnType<typeof getFieldsForDocument>>[number];
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
|
|
||||||
export interface GetFieldsForTemplateOptions {
|
export interface GetFieldsForTemplateOptions {
|
||||||
templateId: number;
|
templateId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getFieldsForTemplate = async ({ templateId, userId }: GetFieldsForTemplateOptions) => {
|
export const getFieldsForTemplate = async ({ templateId, userId }: GetFieldsForTemplateOptions) => {
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
|||||||
import { canRecipientFieldsBeModified } from '../../utils/recipients';
|
import { canRecipientFieldsBeModified } from '../../utils/recipients';
|
||||||
|
|
||||||
export interface SetFieldsForDocumentOptions {
|
export interface SetFieldsForDocumentOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
fields: FieldData[];
|
fields: FieldData[];
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { FieldType } from '@documenso/prisma/client';
|
|||||||
import { FieldSchema } from '@documenso/prisma/generated/zod';
|
import { FieldSchema } from '@documenso/prisma/generated/zod';
|
||||||
|
|
||||||
export type SetFieldsForTemplateOptions = {
|
export type SetFieldsForTemplateOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
templateId: number;
|
templateId: number;
|
||||||
fields: {
|
fields: {
|
||||||
id?: number | null;
|
id?: number | null;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { createDocumentAuditLogData, diffFieldChanges } from '../../utils/docume
|
|||||||
export type UpdateFieldOptions = {
|
export type UpdateFieldOptions = {
|
||||||
fieldId: number;
|
fieldId: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
recipientId?: number;
|
recipientId?: number;
|
||||||
type?: FieldType;
|
type?: FieldType;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
|||||||
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
import type { RequestMetadata } from '../../universal/extract-request-metadata';
|
||||||
|
|
||||||
export type SetAvatarImageOptions = {
|
export type SetAvatarImageOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number | null;
|
teamId?: number | null;
|
||||||
bytes?: string | null;
|
bytes?: string | null;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ type TimeConstants = typeof timeConstants & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type CreateApiTokenInput = {
|
type CreateApiTokenInput = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
tokenName: string;
|
tokenName: string;
|
||||||
expiresIn: string | null;
|
expiresIn: string | null;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
|
|||||||
|
|
||||||
export type DeleteTokenByIdOptions = {
|
export type DeleteTokenByIdOptions = {
|
||||||
id: number;
|
id: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { TeamMemberRole } from '@documenso/prisma/client';
|
import { TeamMemberRole } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type GetUserTokensOptions = {
|
export type GetUserTokensOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type GetUserTokensOptions = {
|
export type GetUserTokensOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getUserTokens = async ({ userId }: GetUserTokensOptions) => {
|
export const getUserTokens = async ({ userId }: GetUserTokensOptions) => {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
|
|
||||||
export type GetApiTokenByIdOptions = {
|
export type GetApiTokenByIdOptions = {
|
||||||
id: number;
|
id: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getApiTokenById = async ({ id, userId }: GetApiTokenByIdOptions) => {
|
export const getApiTokenById = async ({ id, userId }: GetApiTokenByIdOptions) => {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
|
|||||||
export type DeleteRecipientOptions = {
|
export type DeleteRecipientOptions = {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
recipientId: number;
|
recipientId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
|||||||
|
|
||||||
export type GetRecipientByIdOptions = {
|
export type GetRecipientByIdOptions = {
|
||||||
recipientId: number;
|
recipientId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
|
|
||||||
export interface GetRecipientsForDocumentOptions {
|
export interface GetRecipientsForDocumentOptions {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
|
|
||||||
export interface GetRecipientsForTemplateOptions {
|
export interface GetRecipientsForTemplateOptions {
|
||||||
templateId: number;
|
templateId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getRecipientsForTemplate = async ({
|
export const getRecipientsForTemplate = async ({
|
||||||
|
|||||||
@ -34,7 +34,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
|||||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||||
|
|
||||||
export interface SetRecipientsForDocumentOptions {
|
export interface SetRecipientsForDocumentOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
documentId: number;
|
documentId: number;
|
||||||
recipients: RecipientData[];
|
recipients: RecipientData[];
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { nanoid } from '../../universal/id';
|
|||||||
import { createRecipientAuthOptions } from '../../utils/document-auth';
|
import { createRecipientAuthOptions } from '../../utils/document-auth';
|
||||||
|
|
||||||
export type SetRecipientsForTemplateOptions = {
|
export type SetRecipientsForTemplateOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
templateId: number;
|
templateId: number;
|
||||||
recipients: {
|
recipients: {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export type UpdateRecipientOptions = {
|
|||||||
role?: RecipientRole;
|
role?: RecipientRole;
|
||||||
signingOrder?: number | null;
|
signingOrder?: number | null;
|
||||||
actionAuth?: TRecipientActionAuthTypes | null;
|
actionAuth?: TRecipientActionAuthTypes | null;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
requestMetadata?: RequestMetadata;
|
requestMetadata?: RequestMetadata;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export type CreateSharingIdOptions =
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
documentId: number;
|
documentId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createOrGetShareLink = async ({ documentId, ...options }: CreateSharingIdOptions) => {
|
export const createOrGetShareLink = async ({ documentId, ...options }: CreateSharingIdOptions) => {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import type { TSiteSettingSchema } from './schema';
|
import type { TSiteSettingSchema } from './schema';
|
||||||
|
|
||||||
export type UpsertSiteSettingOptions = TSiteSettingSchema & {
|
export type UpsertSiteSettingOptions = TSiteSettingSchema & {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const upsertSiteSetting = async ({
|
export const upsertSiteSetting = async ({
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { SubscriptionStatus } from '@documenso/prisma/client';
|
import { SubscriptionStatus } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type GetActiveSubscriptionsByUserIdOptions = {
|
export type GetActiveSubscriptionsByUserIdOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getActiveSubscriptionsByUserId = async ({
|
export const getActiveSubscriptionsByUserId = async ({
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type GetSubscriptionsByUserIdOptions = {
|
export type GetSubscriptionsByUserIdOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSubscriptionsByUserId = async ({ userId }: GetSubscriptionsByUserIdOptions) => {
|
export const getSubscriptionsByUserId = async ({ userId }: GetSubscriptionsByUserIdOptions) => {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { TeamMemberInviteStatus } from '@documenso/prisma/client';
|
|||||||
import { jobs } from '../../jobs/client';
|
import { jobs } from '../../jobs/client';
|
||||||
|
|
||||||
export type AcceptTeamInvitationOptions = {
|
export type AcceptTeamInvitationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '@documenso/lib/constants/teams
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type CreateTeamBillingPortalOptions = {
|
export type CreateTeamBillingPortalOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type CreateTeamPendingCheckoutSession = {
|
export type CreateTeamPendingCheckoutSession = {
|
||||||
userId: string;
|
userId: number;
|
||||||
pendingTeamId: number;
|
pendingTeamId: number;
|
||||||
interval: 'monthly' | 'yearly';
|
interval: 'monthly' | 'yearly';
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
|||||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||||
|
|
||||||
export type CreateTeamEmailVerificationOptions = {
|
export type CreateTeamEmailVerificationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
data: {
|
data: {
|
||||||
email: string;
|
email: string;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
|||||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||||
|
|
||||||
export type CreateTeamMemberInvitesOptions = {
|
export type CreateTeamMemberInvitesOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
userName: string;
|
userName: string;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
invitations: TCreateTeamMemberInvitesMutationSchema['invitations'];
|
invitations: TCreateTeamMemberInvitesMutationSchema['invitations'];
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export type CreateTeamOptions = {
|
|||||||
/**
|
/**
|
||||||
* ID of the user creating the Team.
|
* ID of the user creating the Team.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the team to display.
|
* Name of the team to display.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type DeclineTeamInvitationOptions = {
|
export type DeclineTeamInvitationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '@documenso/lib/constants/teams
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type DeleteTeamEmailVerificationOptions = {
|
export type DeleteTeamEmailVerificationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
|||||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||||
|
|
||||||
export type DeleteTeamEmailOptions = {
|
export type DeleteTeamEmailOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
userEmail: string;
|
userEmail: string;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export type DeleteTeamMemberInvitationsOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user who is initiating this action.
|
* The ID of the user who is initiating this action.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the team to remove members from.
|
* The ID of the team to remove members from.
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export type DeleteTeamMembersOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user who is initiating this action.
|
* The ID of the user who is initiating this action.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the team to remove members from.
|
* The ID of the team to remove members from.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type DeleteTeamPendingOptions = {
|
export type DeleteTeamPendingOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
pendingTeamId: number;
|
pendingTeamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export type DeleteTeamTransferRequestOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user deleting the transfer.
|
* The ID of the user deleting the transfer.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the team whose team transfer request should be deleted.
|
* The ID of the team whose team transfer request should be deleted.
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
|||||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||||
|
|
||||||
export type DeleteTeamOptions = {
|
export type DeleteTeamOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export interface FindTeamInvoicesOptions {
|
export interface FindTeamInvoicesOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '../../constants/teams';
|
|||||||
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
|
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
|
||||||
|
|
||||||
export interface FindTeamMemberInvitesOptions {
|
export interface FindTeamMemberInvitesOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import type { FindResultResponse } from '../../types/search-params';
|
|||||||
import { ZFindResultResponse } from '../../types/search-params';
|
import { ZFindResultResponse } from '../../types/search-params';
|
||||||
|
|
||||||
export interface FindTeamMembersOptions {
|
export interface FindTeamMembersOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { TeamPendingSchema } from '@documenso/prisma/generated/zod';
|
|||||||
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
|
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
|
||||||
|
|
||||||
export interface FindTeamsPendingOptions {
|
export interface FindTeamsPendingOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
perPage?: number;
|
perPage?: number;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { Prisma } from '@documenso/prisma/client';
|
|||||||
import type { FindResultResponse } from '../../types/search-params';
|
import type { FindResultResponse } from '../../types/search-params';
|
||||||
|
|
||||||
export interface FindTeamsOptions {
|
export interface FindTeamsOptions {
|
||||||
userId: string;
|
userId: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
perPage?: number;
|
perPage?: number;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { TeamMemberSchema, UserSchema } from '@documenso/prisma/generated/zod';
|
import { TeamMemberSchema, UserSchema } from '@documenso/prisma/generated/zod';
|
||||||
|
|
||||||
export type GetTeamMembersOptions = {
|
export type GetTeamMembersOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
|||||||
import { updateTeamPublicProfile } from './update-team-public-profile';
|
import { updateTeamPublicProfile } from './update-team-public-profile';
|
||||||
|
|
||||||
export type GetTeamPublicProfileOptions = {
|
export type GetTeamPublicProfileOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export const getTeamById = async ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type GetTeamByUrlOptions = {
|
export type GetTeamByUrlOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamUrl: string;
|
teamUrl: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { TeamMemberSchema, TeamSchema } from '@documenso/prisma/generated/zod';
|
import { TeamMemberSchema, TeamSchema } from '@documenso/prisma/generated/zod';
|
||||||
|
|
||||||
export type GetTeamsOptions = {
|
export type GetTeamsOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ZGetTeamsResponseSchema = TeamSchema.extend({
|
export const ZGetTeamsResponseSchema = TeamSchema.extend({
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export type LeaveTeamOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user who is leaving the team.
|
* The ID of the user who is leaving the team.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the team the user is leaving.
|
* The ID of the team the user is leaving.
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export type RequestTeamOwnershipTransferOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user initiating the transfer.
|
* The ID of the user initiating the transfer.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the user initiating the transfer.
|
* The name of the user initiating the transfer.
|
||||||
@ -31,7 +31,7 @@ export type RequestTeamOwnershipTransferOptions = {
|
|||||||
/**
|
/**
|
||||||
* The user ID of the new owner.
|
* The user ID of the new owner.
|
||||||
*/
|
*/
|
||||||
newOwneruserId: string;
|
newOwnerUserId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to clear any current payment methods attached to the team.
|
* Whether to clear any current payment methods attached to the team.
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { sendTeamEmailVerificationEmail } from './create-team-email-verification';
|
import { sendTeamEmailVerificationEmail } from './create-team-email-verification';
|
||||||
|
|
||||||
export type ResendTeamMemberInvitationOptions = {
|
export type ResendTeamMemberInvitationOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export type ResendTeamMemberInvitationOptions = {
|
|||||||
/**
|
/**
|
||||||
* The ID of the user who is initiating this action.
|
* The ID of the user who is initiating this action.
|
||||||
*/
|
*/
|
||||||
userId: string;
|
userId: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the user who is initiating this action.
|
* The name of the user who is initiating this action.
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
|
|||||||
import { TeamGlobalSettingsSchema } from '@documenso/prisma/generated/zod';
|
import { TeamGlobalSettingsSchema } from '@documenso/prisma/generated/zod';
|
||||||
|
|
||||||
export type UpdateTeamBrandingSettingsOptions = {
|
export type UpdateTeamBrandingSettingsOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { TeamGlobalSettingsSchema } from '@documenso/prisma/generated/zod';
|
|||||||
import type { SupportedLanguageCodes } from '../../constants/i18n';
|
import type { SupportedLanguageCodes } from '../../constants/i18n';
|
||||||
|
|
||||||
export type UpdateTeamDocumentSettingsOptions = {
|
export type UpdateTeamDocumentSettingsOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '../../constants/teams';
|
import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '../../constants/teams';
|
||||||
|
|
||||||
export type UpdateTeamEmailOptions = {
|
export type UpdateTeamEmailOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
data: {
|
data: {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import type { TeamMemberRole } from '@documenso/prisma/client';
|
import type { TeamMemberRole } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type UpdateTeamMemberOptions = {
|
export type UpdateTeamMemberOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
teamMemberId: number;
|
teamMemberId: number;
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
export type UpdatePublicProfileOptions = {
|
export type UpdatePublicProfileOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
data: {
|
data: {
|
||||||
bio?: string;
|
bio?: string;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { prisma } from '@documenso/prisma';
|
|||||||
import { Prisma } from '@documenso/prisma/client';
|
import { Prisma } from '@documenso/prisma/client';
|
||||||
|
|
||||||
export type UpdateTeamOptions = {
|
export type UpdateTeamOptions = {
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId: number;
|
teamId: number;
|
||||||
data: {
|
data: {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { DocumentSource, type RecipientRole } from '@documenso/prisma/client';
|
|||||||
|
|
||||||
export type CreateDocumentFromTemplateLegacyOptions = {
|
export type CreateDocumentFromTemplateLegacyOptions = {
|
||||||
templateId: number;
|
templateId: number;
|
||||||
userId: string;
|
userId: number;
|
||||||
teamId?: number;
|
teamId?: number;
|
||||||
recipients?: {
|
recipients?: {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user