mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 20:51:33 +10:00
Compare commits
21 Commits
chore/tran
...
exp/autopl
| Author | SHA1 | Date | |
|---|---|---|---|
| 654fc57639 | |||
| a0a3e7fb93 | |||
| 57c4c3fd48 | |||
| eb63ec436c | |||
| d6a1ce06d4 | |||
| 08e1dcaa76 | |||
| 92ec5e8ee4 | |||
| 548a74ab89 | |||
| c8e254aff1 | |||
| 8e2ca94020 | |||
| 13bd5815d9 | |||
| dbed8b362e | |||
| 9e0f07f806 | |||
| 5fbad9e367 | |||
| ac4b3737d6 | |||
| cdfd373958 | |||
| 233e6e603c | |||
| 134d5ac03e | |||
| 00e33c5331 | |||
| 29be66a844 | |||
| 94098bd762 |
14
.env.example
14
.env.example
@ -23,10 +23,6 @@ NEXT_PRIVATE_OIDC_CLIENT_ID=""
|
||||
NEXT_PRIVATE_OIDC_CLIENT_SECRET=""
|
||||
NEXT_PRIVATE_OIDC_PROVIDER_LABEL="OIDC"
|
||||
NEXT_PRIVATE_OIDC_SKIP_VERIFY=""
|
||||
# Specifies the prompt to use for OIDC signin, explicitly setting
|
||||
# an empty string will omit the prompt parameter.
|
||||
# See: https://www.cerberauth.com/blog/openid-connect-oauth2-prompts/
|
||||
NEXT_PRIVATE_OIDC_PROMPT="login"
|
||||
|
||||
# [[URLS]]
|
||||
NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000"
|
||||
@ -138,8 +134,14 @@ NEXT_PUBLIC_POSTHOG_KEY=""
|
||||
NEXT_PUBLIC_FEATURE_BILLING_ENABLED=
|
||||
# OPTIONAL: Leave blank to allow users to signup through /signup page.
|
||||
NEXT_PUBLIC_DISABLE_SIGNUP=
|
||||
# OPTIONAL: Set to true to use internal webapp url in browserless requests.
|
||||
NEXT_PUBLIC_USE_INTERNAL_URL_BROWSERLESS=false
|
||||
|
||||
# [[AI]]
|
||||
# AI Gateway
|
||||
AI_GATEWAY_API_KEY=""
|
||||
# OPTIONAL: API key for Google Generative AI (Gemini). Get your key from https://ai.google.dev
|
||||
GOOGLE_GENERATIVE_AI_API_KEY=""
|
||||
# OPTIONAL: Enable AI field detection debug mode to save preview images with bounding boxes
|
||||
NEXT_PUBLIC_AI_DEBUG_PREVIEW=
|
||||
|
||||
# [[E2E Tests]]
|
||||
E2E_TEST_AUTHENTICATE_USERNAME="Test User"
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -60,3 +60,6 @@ CLAUDE.md
|
||||
|
||||
# agents
|
||||
.specs
|
||||
|
||||
# ai debug previews
|
||||
packages/assets/ai-previews/
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
import nextra from 'nextra';
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
transpilePackages: [
|
||||
'@documenso/assets',
|
||||
'@documenso/lib',
|
||||
@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 3002",
|
||||
"build": "next build",
|
||||
"build": "next build && next-sitemap",
|
||||
"start": "next start -p 3002",
|
||||
"lint:fix": "next lint --fix",
|
||||
"clean": "rimraf .next && rimraf node_modules"
|
||||
@ -15,18 +15,18 @@
|
||||
"@documenso/tailwind-config": "*",
|
||||
"@documenso/trpc": "*",
|
||||
"@documenso/ui": "*",
|
||||
"next": "^15",
|
||||
"next-plausible": "^3.12.5",
|
||||
"nextra": "^3",
|
||||
"nextra-theme-docs": "^3",
|
||||
"next": "14.2.28",
|
||||
"next-plausible": "^3.12.0",
|
||||
"nextra": "^2.13.4",
|
||||
"nextra-theme-docs": "^2.13.4",
|
||||
"react": "^18",
|
||||
"react-dom": "^18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
"@types/react": "18.3.27",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"pagefind": "^1.2.0",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"typescript": "5.6.2"
|
||||
}
|
||||
}
|
||||
10
apps/documentation/pages/_app.mdx
Normal file
10
apps/documentation/pages/_app.mdx
Normal file
@ -0,0 +1,10 @@
|
||||
import { PlausibleProvider } from '../providers/plausible.tsx';
|
||||
import '../styles.css';
|
||||
|
||||
export default function App({ Component, pageProps }) {
|
||||
return (
|
||||
<PlausibleProvider>
|
||||
<Component {...pageProps} />
|
||||
</PlausibleProvider>
|
||||
);
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import React from 'react';
|
||||
|
||||
import { PlausibleProvider } from '../providers/plausible';
|
||||
import '../styles.css';
|
||||
|
||||
export type AppProps = {
|
||||
Component: React.ComponentType<any>;
|
||||
pageProps: any;
|
||||
};
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<PlausibleProvider>
|
||||
<Component {...pageProps} />
|
||||
</PlausibleProvider>
|
||||
);
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
export default {
|
||||
index: {
|
||||
type: 'page',
|
||||
title: 'Home',
|
||||
display: 'hidden',
|
||||
theme: {
|
||||
timestamp: false,
|
||||
},
|
||||
},
|
||||
users: {
|
||||
type: 'page',
|
||||
title: 'Users',
|
||||
},
|
||||
developers: {
|
||||
type: 'page',
|
||||
title: 'Developers',
|
||||
},
|
||||
updates: {
|
||||
title: "What's New",
|
||||
type: 'menu',
|
||||
items: {
|
||||
changelog: {
|
||||
title: 'Changelog',
|
||||
href: 'https://documenso.com/changelog',
|
||||
newWindow: true,
|
||||
},
|
||||
blog: {
|
||||
title: 'Blog',
|
||||
href: 'https://documenso.com/blog',
|
||||
newWindow: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
34
apps/documentation/pages/_meta.json
Normal file
34
apps/documentation/pages/_meta.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"index": {
|
||||
"type": "page",
|
||||
"title": "Home",
|
||||
"display": "hidden",
|
||||
"theme": {
|
||||
"timestamp": false
|
||||
}
|
||||
},
|
||||
"users": {
|
||||
"type": "page",
|
||||
"title": "Users"
|
||||
},
|
||||
"developers": {
|
||||
"type": "page",
|
||||
"title": "Developers"
|
||||
},
|
||||
"updates": {
|
||||
"title": "What's New",
|
||||
"type": "menu",
|
||||
"items": {
|
||||
"changelog": {
|
||||
"title": "Changelog",
|
||||
"href": "https://documenso.com/changelog",
|
||||
"newWindow": true
|
||||
},
|
||||
"blog": {
|
||||
"title": "Blog",
|
||||
"href": "https://documenso.com/blog",
|
||||
"newWindow": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
export default {
|
||||
index: 'Introduction',
|
||||
'-- Development & Deployment': {
|
||||
type: 'separator',
|
||||
title: 'Development & Deployment',
|
||||
},
|
||||
'local-development': 'Local Development',
|
||||
'developer-mode': 'Developer Mode',
|
||||
'self-hosting': 'Self Hosting',
|
||||
contributing: 'Contributing',
|
||||
'-- API & Integration Guides': {
|
||||
type: 'separator',
|
||||
title: 'API & Integration Guides',
|
||||
},
|
||||
'public-api': 'Public API',
|
||||
embedding: 'Embedding',
|
||||
webhooks: 'Webhooks',
|
||||
};
|
||||
18
apps/documentation/pages/developers/_meta.json
Normal file
18
apps/documentation/pages/developers/_meta.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"index": "Introduction",
|
||||
"-- Development & Deployment": {
|
||||
"type": "separator",
|
||||
"title": "Development & Deployment"
|
||||
},
|
||||
"local-development": "Local Development",
|
||||
"developer-mode": "Developer Mode",
|
||||
"self-hosting": "Self Hosting",
|
||||
"contributing": "Contributing",
|
||||
"-- API & Integration Guides": {
|
||||
"type": "separator",
|
||||
"title": "API & Integration Guides"
|
||||
},
|
||||
"public-api": "Public API",
|
||||
"embedding": "Embedding",
|
||||
"webhooks": "Webhooks"
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
export default {
|
||||
index: 'Getting Started',
|
||||
'contributing-translations': 'Contributing Translations',
|
||||
};
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"index": "Getting Started",
|
||||
"contributing-translations": "Contributing Translations"
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
export default {
|
||||
index: 'Get Started',
|
||||
react: 'React Integration',
|
||||
vue: 'Vue Integration',
|
||||
svelte: 'Svelte Integration',
|
||||
solid: 'Solid Integration',
|
||||
preact: 'Preact Integration',
|
||||
angular: 'Angular Integration',
|
||||
'css-variables': 'CSS Variables',
|
||||
authoring: 'Authoring',
|
||||
};
|
||||
11
apps/documentation/pages/developers/embedding/_meta.json
Normal file
11
apps/documentation/pages/developers/embedding/_meta.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"index": "Get Started",
|
||||
"react": "React Integration",
|
||||
"vue": "Vue Integration",
|
||||
"svelte": "Svelte Integration",
|
||||
"solid": "Solid Integration",
|
||||
"preact": "Preact Integration",
|
||||
"angular": "Angular Integration",
|
||||
"css-variables": "CSS Variables",
|
||||
"authoring": "Authoring"
|
||||
}
|
||||
@ -3,16 +3,16 @@ title: Developer Documentation
|
||||
description: Learn how to run Documenso locally, use our API, integrate webhooks, contribute to the project, and self-host Documenso.
|
||||
---
|
||||
|
||||
import { Cards } from 'nextra/components';
|
||||
import { Card, Cards } from 'nextra/components';
|
||||
|
||||
# Developer Documentation
|
||||
|
||||
The developer documentation is a comprehensive guide to help you:
|
||||
|
||||
<Cards>
|
||||
<Cards.Card title="Set up dev environment" href="/developers/local-development" />
|
||||
<Cards.Card title="Use the API" href="/developers/public-api" />
|
||||
<Cards.Card title="Integrate webhooks" href="/developers/webhooks" />
|
||||
<Cards.Card title="Contribute to the project" href="/developers/contributing" />
|
||||
<Cards.Card title="Self-host Documenso" href="/developers/self-hosting" />
|
||||
<Card title="Set up dev environment" href="/developers/local-development" />
|
||||
<Card title="Use the API" href="/developers/public-api" />
|
||||
<Card title="Integrate webhooks" href="/developers/webhooks" />
|
||||
<Card title="Contribute to the project" href="/developers/contributing" />
|
||||
<Card title="Self-host Documenso" href="/developers/self-hosting" />
|
||||
</Cards>
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
export default {
|
||||
index: 'Get Started',
|
||||
quickstart: 'Developer Quickstart',
|
||||
manual: 'Manual Setup',
|
||||
gitpod: 'Gitpod',
|
||||
'signing-certificate': 'Signing Certificate',
|
||||
translations: 'Translations',
|
||||
};
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"index": "Get Started",
|
||||
"quickstart": "Developer Quickstart",
|
||||
"manual": "Manual Setup",
|
||||
"gitpod": "Gitpod",
|
||||
"signing-certificate": "Signing Certificate",
|
||||
"translations": "Translations"
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
export default {
|
||||
index: 'Get Started',
|
||||
authentication: 'Authentication',
|
||||
'rate-limits': 'Rate Limits',
|
||||
versioning: 'Versioning',
|
||||
};
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"index": "Get Started",
|
||||
"authentication": "Authentication",
|
||||
"rate-limits": "Rate Limits",
|
||||
"versioning": "Versioning"
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
export default {
|
||||
index: 'Getting Started',
|
||||
'signing-certificate': 'Signing Certificate',
|
||||
'how-to': 'How To',
|
||||
'setting-up-oauth-providers': 'Setting up OAuth Providers',
|
||||
};
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"index": "Getting Started",
|
||||
"signing-certificate": "Signing Certificate",
|
||||
"how-to": "How To",
|
||||
"setting-up-oauth-providers": "Setting up OAuth Providers"
|
||||
}
|
||||
@ -275,15 +275,7 @@ The environment variables listed above are a subset of those available for confi
|
||||
| `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` | The secondary encryption key for symmetric encryption and decryption (at least 32 characters). |
|
||||
| `NEXT_PRIVATE_GOOGLE_CLIENT_ID` | The Google client ID for Google authentication (optional). |
|
||||
| `NEXT_PRIVATE_GOOGLE_CLIENT_SECRET` | The Google client secret for Google authentication (optional). |
|
||||
| `NEXT_PRIVATE_MICROSOFT_CLIENT_ID` | The Microsoft client ID for Microsoft authentication (optional). |
|
||||
| `NEXT_PRIVATE_MICROSOFT_CLIENT_SECRET` | The Microsoft client secret for Microsoft authentication (optional). |
|
||||
| `NEXT_PRIVATE_OIDC_CLIENT_ID` | The OIDC client ID for OIDC authentication (optional). |
|
||||
| `NEXT_PRIVATE_OIDC_CLIENT_SECRET` | The OIDC client secret for OIDC authentication (optional). |
|
||||
| `NEXT_PRIVATE_OIDC_WELL_KNOWN` | The well-known URL for the OIDC provider (optional). |
|
||||
| `NEXT_PRIVATE_OIDC_PROVIDER_LABEL` | The label to display for the OIDC provider button (optional). |
|
||||
| `NEXT_PRIVATE_OIDC_SKIP_VERIFY` | Whether to skip email verification for OIDC accounts (optional, default `false`). |
|
||||
| `NEXT_PUBLIC_WEBAPP_URL` | The URL for the web application. |
|
||||
| `NEXT_PUBLIC_SUPPORT_EMAIL` | The support email address displayed to users (default `support@documenso.com`). |
|
||||
| `NEXT_PRIVATE_DATABASE_URL` | The URL for the primary database connection (with connection pooling). |
|
||||
| `NEXT_PRIVATE_DIRECT_DATABASE_URL` | The URL for the direct database connection (without connection pooling). |
|
||||
| `NEXT_PRIVATE_SIGNING_TRANSPORT` | The signing transport to use. Available options: local (default) |
|
||||
@ -305,7 +297,6 @@ The environment variables listed above are a subset of those available for confi
|
||||
| `NEXT_PRIVATE_SMTP_APIKEY_USER` | The API key user for the SMTP server for the `smtp-api` transport. |
|
||||
| `NEXT_PRIVATE_SMTP_APIKEY` | The API key for the SMTP server for the `smtp-api` transport. |
|
||||
| `NEXT_PRIVATE_SMTP_SECURE` | Whether to force the use of TLS for the SMTP server for SMTP transports. |
|
||||
| `NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS` | Whether to ignore TLS errors for the SMTP server (useful for self-signed certificates). |
|
||||
| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | The email address for the "from" address. |
|
||||
| `NEXT_PRIVATE_SMTP_FROM_NAME` | The sender name for the "from" address. |
|
||||
| `NEXT_PRIVATE_RESEND_API_KEY` | The API key for Resend.com for the `resend` transport. |
|
||||
@ -317,7 +308,6 @@ The environment variables listed above are a subset of those available for confi
|
||||
| `NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT` | The maximum document upload limit displayed to the user (in MB). |
|
||||
| `NEXT_PUBLIC_POSTHOG_KEY` | The optional PostHog key for analytics and feature flags. |
|
||||
| `NEXT_PUBLIC_DISABLE_SIGNUP` | Whether to disable user signups through the /signup page. |
|
||||
| `NEXT_PRIVATE_BROWSERLESS_URL` | The URL for a Browserless.io instance to generate PDFs (optional). |
|
||||
|
||||
## Run as a Service
|
||||
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
export default {
|
||||
index: 'Introduction',
|
||||
support: 'Support',
|
||||
'-- How To Use': {
|
||||
type: 'separator',
|
||||
title: 'How To Use',
|
||||
},
|
||||
'get-started': 'Get Started',
|
||||
profile: 'Public Profile',
|
||||
organisations: 'Organisations',
|
||||
documents: 'Documents',
|
||||
templates: 'Templates',
|
||||
branding: 'Branding',
|
||||
'email-domains': 'Email Domains',
|
||||
'direct-links': 'Direct Signing Links',
|
||||
'-- Legal Overview': {
|
||||
type: 'separator',
|
||||
title: 'Legal Overview',
|
||||
},
|
||||
'fair-use': 'Fair Use Policy',
|
||||
licenses: 'Licenses',
|
||||
compliance: 'Compliance',
|
||||
};
|
||||
23
apps/documentation/pages/users/_meta.json
Normal file
23
apps/documentation/pages/users/_meta.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"index": "Introduction",
|
||||
"support": "Support",
|
||||
"-- How To Use": {
|
||||
"type": "separator",
|
||||
"title": "How To Use"
|
||||
},
|
||||
"get-started": "Get Started",
|
||||
"profile": "Public Profile",
|
||||
"organisations": "Organisations",
|
||||
"documents": "Documents",
|
||||
"templates": "Templates",
|
||||
"branding": "Branding",
|
||||
"email-domains": "Email Domains",
|
||||
"direct-links": "Direct Signing Links",
|
||||
"-- Legal Overview": {
|
||||
"type": "separator",
|
||||
"title": "Legal Overview"
|
||||
},
|
||||
"fair-use": "Fair Use Policy",
|
||||
"licenses": "Licenses",
|
||||
"compliance": "Compliance"
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
export default {
|
||||
'signature-levels': 'Signature Levels',
|
||||
'standards-and-regulations': 'Standards and Regulations',
|
||||
};
|
||||
4
apps/documentation/pages/users/compliance/_meta.json
Normal file
4
apps/documentation/pages/users/compliance/_meta.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"signature-levels": "Signature Levels",
|
||||
"standards-and-regulations": "Standards and Regulations"
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
export default {
|
||||
'sending-documents': 'Sending Documents',
|
||||
'document-preferences': 'Document Preferences',
|
||||
'document-visibility': 'Document Visibility',
|
||||
fields: 'Document Fields',
|
||||
'email-preferences': 'Email Preferences',
|
||||
};
|
||||
7
apps/documentation/pages/users/documents/_meta.json
Normal file
7
apps/documentation/pages/users/documents/_meta.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"sending-documents": "Sending Documents",
|
||||
"document-preferences": "Document Preferences",
|
||||
"document-visibility": "Document Visibility",
|
||||
"fields": "Document Fields",
|
||||
"email-preferences": "Email Preferences"
|
||||
}
|
||||
@ -178,7 +178,7 @@ The dropdown/select field collects a single choice from a list of options.
|
||||
|
||||
Place the dropdown/select field on the document where you want the signer to select a choice. The dropdown/select field comes with additional settings that can be configured.
|
||||
|
||||
{/*  */}
|
||||

|
||||
|
||||
The dropdown/select field settings include:
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
export default {
|
||||
index: 'Overview',
|
||||
'community-edition': 'Community Edition',
|
||||
'enterprise-edition': 'Enterprise Edition',
|
||||
};
|
||||
5
apps/documentation/pages/users/licenses/_meta.json
Normal file
5
apps/documentation/pages/users/licenses/_meta.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"index": "Overview",
|
||||
"community-edition": "Community Edition",
|
||||
"enterprise-edition": "Enterprise Edition"
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
export default {
|
||||
index: 'Introduction',
|
||||
members: 'Members',
|
||||
groups: 'Groups',
|
||||
teams: 'Teams',
|
||||
sso: 'SSO',
|
||||
billing: 'Billing',
|
||||
};
|
||||
8
apps/documentation/pages/users/organisations/_meta.json
Normal file
8
apps/documentation/pages/users/organisations/_meta.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"index": "Introduction",
|
||||
"members": "Members",
|
||||
"groups": "Groups",
|
||||
"teams": "Teams",
|
||||
"sso": "SSO",
|
||||
"billing": "Billing"
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
export default {
|
||||
index: 'Configuration',
|
||||
'microsoft-entra-id': 'Microsoft Entra ID',
|
||||
};
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"index": "Configuration",
|
||||
"microsoft-entra-id": "Microsoft Entra ID"
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
22
apps/documentation/public/pdf.worker.min.js
vendored
Normal file
22
apps/documentation/public/pdf.worker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
@ -8,9 +8,7 @@ module.exports = {
|
||||
...baseConfig.content,
|
||||
`${path.join(require.resolve('@documenso/ui'), '..')}/**/*.{ts,tsx}`,
|
||||
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./content/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||
],
|
||||
theme: {
|
||||
fontFamily: {
|
||||
@ -4,7 +4,7 @@ import { useConfig } from 'nextra-theme-docs';
|
||||
const themeConfig: DocsThemeConfig = {
|
||||
logo: <span>Documenso</span>,
|
||||
head: function useHead() {
|
||||
const config = useConfig();
|
||||
const config = useConfig<{ title?: string; description?: string }>();
|
||||
|
||||
const title = `${config.frontMatter.title} | Documenso Docs` || 'Documenso Docs';
|
||||
const description = config.frontMatter.description || 'The official Documenso documentation';
|
||||
@ -12,7 +12,6 @@ const themeConfig: DocsThemeConfig = {
|
||||
return (
|
||||
<>
|
||||
<meta httpEquiv="Content-Language" content="en" />
|
||||
<title>{title}</title>
|
||||
<meta name="title" content={title} />
|
||||
<meta name="og:title" content={title} />
|
||||
<meta name="description" content={description} />
|
||||
@ -47,7 +46,7 @@ const themeConfig: DocsThemeConfig = {
|
||||
},
|
||||
docsRepositoryBase: 'https://github.com/documenso/documenso/tree/main/apps/documentation',
|
||||
footer: {
|
||||
content: (
|
||||
text: (
|
||||
<span>
|
||||
{new Date().getFullYear()} ©{' '}
|
||||
<a href="https://documen.so" target="_blank">
|
||||
@ -57,9 +56,12 @@ const themeConfig: DocsThemeConfig = {
|
||||
</span>
|
||||
),
|
||||
},
|
||||
color: {
|
||||
hue: 100,
|
||||
saturation: 48.47,
|
||||
primaryHue: 100,
|
||||
primarySaturation: 48.47,
|
||||
useNextSeoProps() {
|
||||
return {
|
||||
titleTemplate: '%s | Documenso Docs',
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
@ -22,21 +18,10 @@
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
"@/*": ["./*"]
|
||||
},
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"target": "ES2017"
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
"tailwind.config.js"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "tailwind.config.js"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
4
apps/openpage-api/next.config.js
Normal file
4
apps/openpage-api/next.config.js
Normal file
@ -0,0 +1,4 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {};
|
||||
|
||||
module.exports = nextConfig;
|
||||
@ -1,5 +0,0 @@
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
const nextConfig: NextConfig = {};
|
||||
|
||||
export default nextConfig;
|
||||
@ -11,12 +11,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@documenso/prisma": "*",
|
||||
"luxon": "^3.7.2",
|
||||
"next": "^15"
|
||||
"luxon": "^3.5.0",
|
||||
"next": "14.2.28"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
"@types/react": "18.3.27",
|
||||
"@types/react": "18.3.5",
|
||||
"typescript": "5.6.2"
|
||||
}
|
||||
}
|
||||
@ -69,3 +69,4 @@
|
||||
--font-noto: 'Noto Sans', 'Noto Sans Korean', 'Noto Sans Japanese', 'Noto Sans Chinese';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@documenso/ui/primitives/dialog';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
import { useCurrentTeam } from '~/providers/team';
|
||||
@ -96,7 +96,7 @@ export const DocumentDuplicateDialog = ({
|
||||
</div>
|
||||
) : (
|
||||
<div className="p-2 [&>div]:h-[50vh] [&>div]:overflow-y-scroll">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={envelopeItems[0].id}
|
||||
envelopeItem={envelopeItems[0]}
|
||||
token={undefined}
|
||||
|
||||
@ -72,7 +72,6 @@ export const OrganisationEmailCreateDialog = ({
|
||||
const { mutateAsync: createOrganisationEmail, isPending } =
|
||||
trpc.enterprise.organisation.email.create.useMutation();
|
||||
|
||||
// Reset state when dialog closes
|
||||
useEffect(() => {
|
||||
if (!open) {
|
||||
form.reset();
|
||||
|
||||
@ -0,0 +1,251 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { match } from 'ts-pattern';
|
||||
|
||||
import { AnimateGenericFadeInOut } from '@documenso/ui/components/animate/animate-generic-fade-in-out';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@documenso/ui/primitives/dialog';
|
||||
|
||||
import type { RecipientForCreation } from '~/utils/detect-document-recipients';
|
||||
|
||||
import { SuggestedRecipientsForm } from './suggested-recipients-form';
|
||||
|
||||
type RecipientDetectionStep =
|
||||
| 'PROMPT_DETECT_RECIPIENTS'
|
||||
| 'DETECTING_RECIPIENTS'
|
||||
| 'REVIEW_RECIPIENTS'
|
||||
| 'DETECTING_FIELDS';
|
||||
|
||||
export type RecipientDetectionPromptDialogProps = {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
onAccept: () => Promise<void> | void;
|
||||
onSkip: () => void;
|
||||
recipients: RecipientForCreation[] | null;
|
||||
onRecipientsSubmit: (recipients: RecipientForCreation[]) => Promise<void> | void;
|
||||
onAutoAddFields?: (recipients: RecipientForCreation[]) => Promise<void> | void;
|
||||
isProcessingRecipients?: boolean;
|
||||
};
|
||||
|
||||
export const RecipientDetectionPromptDialog = ({
|
||||
open,
|
||||
onOpenChange,
|
||||
onAccept,
|
||||
onSkip,
|
||||
recipients,
|
||||
onRecipientsSubmit,
|
||||
onAutoAddFields,
|
||||
isProcessingRecipients = false,
|
||||
}: RecipientDetectionPromptDialogProps) => {
|
||||
const [currentStep, setCurrentStep] = useState<RecipientDetectionStep>(
|
||||
'PROMPT_DETECT_RECIPIENTS',
|
||||
);
|
||||
const [currentRecipients, setCurrentRecipients] = useState<RecipientForCreation[] | null>(
|
||||
recipients,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) {
|
||||
setCurrentStep('PROMPT_DETECT_RECIPIENTS');
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentRecipients(recipients);
|
||||
}, [recipients]);
|
||||
|
||||
useEffect(() => {
|
||||
if (recipients && currentStep === 'DETECTING_RECIPIENTS') {
|
||||
setCurrentStep('REVIEW_RECIPIENTS');
|
||||
}
|
||||
}, [recipients, currentStep]);
|
||||
|
||||
const handleStartDetection = (e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
setCurrentStep('DETECTING_RECIPIENTS');
|
||||
|
||||
Promise.resolve(onAccept()).catch(() => {
|
||||
setCurrentStep('PROMPT_DETECT_RECIPIENTS');
|
||||
});
|
||||
};
|
||||
|
||||
const handleSkip = () => {
|
||||
onSkip();
|
||||
};
|
||||
|
||||
const handleAutoAddFields = async (recipients: RecipientForCreation[]) => {
|
||||
if (!onAutoAddFields) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save the current state of recipients so if we fail and come back,
|
||||
// the form is restored with the user's changes.
|
||||
setCurrentRecipients(recipients);
|
||||
setCurrentStep('DETECTING_FIELDS');
|
||||
|
||||
try {
|
||||
await onAutoAddFields(recipients);
|
||||
} catch {
|
||||
setCurrentStep('REVIEW_RECIPIENTS');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
onOpenChange={(newOpen) => {
|
||||
// Prevent closing during processing
|
||||
if (
|
||||
!newOpen &&
|
||||
(currentStep === 'DETECTING_RECIPIENTS' ||
|
||||
currentStep === 'DETECTING_FIELDS' ||
|
||||
isProcessingRecipients)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
onOpenChange(newOpen);
|
||||
}}
|
||||
>
|
||||
<DialogContent
|
||||
className={
|
||||
currentStep === 'REVIEW_RECIPIENTS' ? 'max-h-[90vh] max-w-4xl overflow-y-auto' : ''
|
||||
}
|
||||
>
|
||||
<fieldset
|
||||
disabled={currentStep === 'DETECTING_RECIPIENTS' || currentStep === 'DETECTING_FIELDS'}
|
||||
>
|
||||
<AnimateGenericFadeInOut motionKey={currentStep} className="grid gap-4">
|
||||
{match(currentStep)
|
||||
.with('PROMPT_DETECT_RECIPIENTS', () => (
|
||||
<>
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
<Trans>Auto-detect recipients?</Trans>
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
<Trans>
|
||||
Would you like to automatically detect recipients in your document? This can
|
||||
save you time in setting up your document.
|
||||
</Trans>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<DialogFooter>
|
||||
<Button variant="ghost" onClick={handleSkip}>
|
||||
<Trans>Skip for now</Trans>
|
||||
</Button>
|
||||
<Button onClick={handleStartDetection}>
|
||||
<Trans>Detect recipients</Trans>
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</>
|
||||
))
|
||||
.with('DETECTING_RECIPIENTS', () => (
|
||||
<div className="flex flex-col items-center justify-center py-4">
|
||||
<div className="relative mb-4 flex items-center justify-center">
|
||||
<div
|
||||
className="border-muted-foreground/20 dark:bg-muted/80 z-10 flex aspect-[3/4] w-24 origin-top-left flex-col gap-y-1 overflow-hidden rounded-lg border px-2 py-4 backdrop-blur-sm"
|
||||
style={{ transform: 'translateZ(0px)' }}
|
||||
>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-5/6 rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
|
||||
<div className="bg-muted-foreground/20 h-2 w-4/5 rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-3/4 rounded-[2px]"></div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="bg-documenso/80 animate-scan pointer-events-none absolute left-1/2 top-0 z-20 h-0.5 w-24 -translate-x-1/2"
|
||||
style={{
|
||||
transform: 'translateX(-50%) translateZ(0px)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-center">
|
||||
<Trans>Analyzing your document</Trans>
|
||||
</DialogTitle>
|
||||
<DialogDescription className="text-center">
|
||||
<Trans>
|
||||
Scanning your document to detect recipient names, emails, and signing order.
|
||||
</Trans>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
</div>
|
||||
))
|
||||
.with('DETECTING_FIELDS', () => (
|
||||
<div className="flex flex-col items-center justify-center py-4">
|
||||
<div className="relative mb-4 flex items-center justify-center">
|
||||
<div
|
||||
className="border-muted-foreground/20 dark:bg-muted/80 z-10 flex aspect-[3/4] w-24 origin-top-left flex-col gap-y-1 overflow-hidden rounded-lg border px-2 py-4 backdrop-blur-sm"
|
||||
style={{ transform: 'translateZ(0px)' }}
|
||||
>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-5/6 rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
|
||||
<div className="bg-muted-foreground/20 h-2 w-4/5 rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-full rounded-[2px]"></div>
|
||||
<div className="bg-muted-foreground/20 h-2 w-3/4 rounded-[2px]"></div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="bg-documenso/80 animate-scan pointer-events-none absolute left-1/2 top-0 z-20 h-0.5 w-24 -translate-x-1/2"
|
||||
style={{
|
||||
transform: 'translateX(-50%) translateZ(0px)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-center">
|
||||
<Trans>Detecting fields</Trans>
|
||||
</DialogTitle>
|
||||
<DialogDescription className="text-center">
|
||||
<Trans>
|
||||
Scanning your document to intelligently place fields for your recipients.
|
||||
</Trans>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
</div>
|
||||
))
|
||||
.with('REVIEW_RECIPIENTS', () => (
|
||||
<>
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
<Trans>Review detected recipients</Trans>
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
<Trans>
|
||||
Confirm, edit, or add recipients before continuing. You can adjust any
|
||||
information below before importing it into your document.
|
||||
</Trans>
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<SuggestedRecipientsForm
|
||||
recipients={currentRecipients}
|
||||
onCancel={handleSkip}
|
||||
onSubmit={onRecipientsSubmit}
|
||||
onAutoAddFields={onAutoAddFields ? handleAutoAddFields : undefined}
|
||||
isProcessing={isProcessingRecipients}
|
||||
/>
|
||||
</>
|
||||
))
|
||||
.exhaustive()}
|
||||
</AnimateGenericFadeInOut>
|
||||
</fieldset>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
408
apps/remix/app/components/dialogs/suggested-recipients-form.tsx
Normal file
408
apps/remix/app/components/dialogs/suggested-recipients-form.tsx
Normal file
@ -0,0 +1,408 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { RecipientRole } from '@prisma/client';
|
||||
import { PlusIcon, TrashIcon } from 'lucide-react';
|
||||
import { type FieldError, useFieldArray, useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { useDebouncedValue } from '@documenso/lib/client-only/hooks/use-debounced-value';
|
||||
import { nanoid } from '@documenso/lib/universal/id';
|
||||
import { trpc } from '@documenso/trpc/react';
|
||||
import { RecipientAutoCompleteInput } from '@documenso/ui/components/recipient/recipient-autocomplete-input';
|
||||
import type { RecipientAutoCompleteOption } from '@documenso/ui/components/recipient/recipient-autocomplete-input';
|
||||
import { RecipientRoleSelect } from '@documenso/ui/components/recipient/recipient-role-select';
|
||||
import { cn } from '@documenso/ui/lib/utils';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import { DialogFooter } from '@documenso/ui/primitives/dialog';
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from '@documenso/ui/primitives/form/form';
|
||||
import { FormErrorMessage } from '@documenso/ui/primitives/form/form-error-message';
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from '@documenso/ui/primitives/tooltip';
|
||||
|
||||
import type { RecipientForCreation } from '~/utils/detect-document-recipients';
|
||||
|
||||
const ZSuggestedRecipientSchema = z.object({
|
||||
formId: z.string().min(1),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, { message: msg`Name is required`.id })
|
||||
.max(255),
|
||||
email: z
|
||||
.string()
|
||||
.min(1, { message: msg`Email is required`.id })
|
||||
.email({ message: msg`Invalid email`.id })
|
||||
.max(254),
|
||||
role: z.nativeEnum(RecipientRole),
|
||||
});
|
||||
|
||||
const ZSuggestedRecipientsFormSchema = z.object({
|
||||
recipients: z
|
||||
.array(ZSuggestedRecipientSchema)
|
||||
.min(1, { message: msg`Please add at least one recipient`.id }),
|
||||
});
|
||||
|
||||
type TSuggestedRecipientsFormSchema = z.infer<typeof ZSuggestedRecipientsFormSchema>;
|
||||
|
||||
export type SuggestedRecipientsFormProps = {
|
||||
recipients: RecipientForCreation[] | null;
|
||||
onCancel: () => void;
|
||||
onSubmit: (recipients: RecipientForCreation[]) => Promise<void> | void;
|
||||
onAutoAddFields?: (recipients: RecipientForCreation[]) => Promise<void> | void;
|
||||
isProcessing?: boolean;
|
||||
};
|
||||
|
||||
export const SuggestedRecipientsForm = ({
|
||||
recipients,
|
||||
onCancel,
|
||||
onSubmit,
|
||||
onAutoAddFields,
|
||||
isProcessing = false,
|
||||
}: SuggestedRecipientsFormProps) => {
|
||||
const { t } = useLingui();
|
||||
|
||||
const [recipientSearchQuery, setRecipientSearchQuery] = useState('');
|
||||
|
||||
const debouncedRecipientSearchQuery = useDebouncedValue(recipientSearchQuery, 500);
|
||||
|
||||
const { data: recipientSuggestionsData, isLoading } = trpc.recipient.suggestions.find.useQuery(
|
||||
{
|
||||
query: debouncedRecipientSearchQuery,
|
||||
},
|
||||
{
|
||||
enabled: debouncedRecipientSearchQuery.length > 1,
|
||||
},
|
||||
);
|
||||
|
||||
const recipientSuggestions = recipientSuggestionsData?.results || [];
|
||||
|
||||
const defaultRecipients = useMemo(() => {
|
||||
if (recipients && recipients.length > 0) {
|
||||
const sorted = [...recipients].sort((a, b) => {
|
||||
const orderA = a.signingOrder ?? 0;
|
||||
const orderB = b.signingOrder ?? 0;
|
||||
|
||||
return orderA - orderB;
|
||||
});
|
||||
|
||||
return sorted.map((recipient) => ({
|
||||
formId: nanoid(),
|
||||
name: recipient.name,
|
||||
email: recipient.email,
|
||||
role: recipient.role,
|
||||
}));
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
formId: nanoid(),
|
||||
name: '',
|
||||
email: '',
|
||||
role: RecipientRole.SIGNER,
|
||||
},
|
||||
];
|
||||
}, [recipients]);
|
||||
|
||||
const form = useForm<TSuggestedRecipientsFormSchema>({
|
||||
resolver: zodResolver(ZSuggestedRecipientsFormSchema),
|
||||
defaultValues: {
|
||||
recipients: defaultRecipients,
|
||||
},
|
||||
});
|
||||
const {
|
||||
formState: { isSubmitting },
|
||||
} = form;
|
||||
|
||||
useEffect(() => {
|
||||
form.reset({
|
||||
recipients: defaultRecipients,
|
||||
});
|
||||
}, [defaultRecipients, form]);
|
||||
|
||||
const { fields, append, remove } = useFieldArray({
|
||||
control: form.control,
|
||||
name: 'recipients',
|
||||
});
|
||||
|
||||
const handleRecipientAutoCompleteSelect = (
|
||||
index: number,
|
||||
suggestion: RecipientAutoCompleteOption,
|
||||
) => {
|
||||
form.setValue(`recipients.${index}.email`, suggestion.email);
|
||||
form.setValue(`recipients.${index}.name`, suggestion.name ?? suggestion.email);
|
||||
};
|
||||
|
||||
const handleAddSigner = () => {
|
||||
append({
|
||||
formId: nanoid(),
|
||||
name: '',
|
||||
email: '',
|
||||
role: RecipientRole.SIGNER,
|
||||
});
|
||||
};
|
||||
|
||||
const handleRemoveSigner = (index: number) => {
|
||||
remove(index);
|
||||
};
|
||||
|
||||
const handleSubmit = form.handleSubmit(async (values) => {
|
||||
const normalizedRecipients: RecipientForCreation[] = values.recipients.map(
|
||||
(recipient, index) => ({
|
||||
name: recipient.name.trim(),
|
||||
email: recipient.email.trim(),
|
||||
role: recipient.role,
|
||||
signingOrder: index + 1,
|
||||
}),
|
||||
);
|
||||
|
||||
try {
|
||||
await onSubmit(normalizedRecipients);
|
||||
} catch (error) {
|
||||
console.error('Failed to submit recipients:', error);
|
||||
}
|
||||
});
|
||||
|
||||
const handleAutoAddFields = form.handleSubmit(async (values) => {
|
||||
if (!onAutoAddFields) {
|
||||
return;
|
||||
}
|
||||
|
||||
const normalizedRecipients: RecipientForCreation[] = values.recipients.map(
|
||||
(recipient, index) => ({
|
||||
name: recipient.name.trim(),
|
||||
email: recipient.email.trim(),
|
||||
role: recipient.role,
|
||||
signingOrder: index + 1,
|
||||
}),
|
||||
);
|
||||
|
||||
try {
|
||||
await onAutoAddFields(normalizedRecipients);
|
||||
} catch (error) {
|
||||
console.error('Failed to auto-add fields:', error);
|
||||
}
|
||||
});
|
||||
|
||||
const getRecipientsRootError = (
|
||||
error: typeof form.formState.errors.recipients,
|
||||
): FieldError | undefined => {
|
||||
if (typeof error !== 'object' || !error || !('root' in error)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const candidate = (error as { root?: FieldError }).root;
|
||||
return typeof candidate === 'object' ? candidate : undefined;
|
||||
};
|
||||
|
||||
const recipientsRootError = getRecipientsRootError(form.formState.errors.recipients);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
<div className="space-y-4">
|
||||
{fields.map((field, index) => (
|
||||
<div
|
||||
key={field.id}
|
||||
className="flex flex-col gap-4 md:flex-row md:items-center md:gap-x-2"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`recipients.${index}.email`}
|
||||
render={({ field: emailField }) => (
|
||||
<FormItem
|
||||
className={cn('relative w-full', {
|
||||
'mb-6':
|
||||
form.formState.errors.recipients?.[index] &&
|
||||
!form.formState.errors.recipients[index]?.email,
|
||||
})}
|
||||
>
|
||||
{index === 0 && (
|
||||
<FormLabel required>
|
||||
<Trans>Email</Trans>
|
||||
</FormLabel>
|
||||
)}
|
||||
<FormControl>
|
||||
<RecipientAutoCompleteInput
|
||||
type="email"
|
||||
placeholder={t`Email`}
|
||||
value={emailField.value}
|
||||
options={recipientSuggestions}
|
||||
onSelect={(suggestion) =>
|
||||
handleRecipientAutoCompleteSelect(index, suggestion)
|
||||
}
|
||||
onSearchQueryChange={(query) => {
|
||||
emailField.onChange(query);
|
||||
setRecipientSearchQuery(query);
|
||||
}}
|
||||
loading={isLoading}
|
||||
disabled={isSubmitting}
|
||||
maxLength={254}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`recipients.${index}.name`}
|
||||
render={({ field: nameField }) => (
|
||||
<FormItem
|
||||
className={cn('w-full', {
|
||||
'mb-6':
|
||||
form.formState.errors.recipients?.[index] &&
|
||||
!form.formState.errors.recipients[index]?.name,
|
||||
})}
|
||||
>
|
||||
{index === 0 && (
|
||||
<FormLabel>
|
||||
<Trans>Name</Trans>
|
||||
</FormLabel>
|
||||
)}
|
||||
<FormControl>
|
||||
<RecipientAutoCompleteInput
|
||||
type="text"
|
||||
placeholder={t`Name`}
|
||||
value={nameField.value}
|
||||
options={recipientSuggestions}
|
||||
onSelect={(suggestion) =>
|
||||
handleRecipientAutoCompleteSelect(index, suggestion)
|
||||
}
|
||||
onSearchQueryChange={(query) => {
|
||||
nameField.onChange(query);
|
||||
setRecipientSearchQuery(query);
|
||||
}}
|
||||
loading={isLoading}
|
||||
disabled={isSubmitting}
|
||||
maxLength={255}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`recipients.${index}.role`}
|
||||
render={({ field: roleField }) => (
|
||||
<FormItem
|
||||
className={cn('mt-2 w-full md:mt-auto md:w-fit', {
|
||||
'mb-6':
|
||||
form.formState.errors.recipients?.[index] &&
|
||||
!form.formState.errors.recipients[index]?.role,
|
||||
})}
|
||||
>
|
||||
{index === 0 && (
|
||||
<FormLabel>
|
||||
<Trans>Role</Trans>
|
||||
</FormLabel>
|
||||
)}
|
||||
<FormControl>
|
||||
<RecipientRoleSelect
|
||||
value={roleField.value}
|
||||
onValueChange={roleField.onChange}
|
||||
disabled={isSubmitting}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
className={cn('mt-2 w-full px-2 md:mt-auto md:w-auto', {
|
||||
'mb-6': form.formState.errors.recipients?.[index],
|
||||
})}
|
||||
onClick={() => handleRemoveSigner(index)}
|
||||
disabled={isSubmitting || fields.length === 1}
|
||||
>
|
||||
<TrashIcon className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<FormErrorMessage className="mt-2" error={recipientsRootError} />
|
||||
|
||||
<div className="flex">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={handleAddSigner}
|
||||
className="w-full md:w-auto"
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
<PlusIcon className="mr-2 h-4 w-4" />
|
||||
<Trans>Add signer</Trans>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogFooter className="flex flex-col gap-2 sm:flex-row sm:justify-between sm:gap-3">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
onClick={onCancel}
|
||||
disabled={isSubmitting || isProcessing}
|
||||
>
|
||||
<Trans>Cancel</Trans>
|
||||
</Button>
|
||||
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:gap-3">
|
||||
<Button type="submit" disabled={isSubmitting || isProcessing}>
|
||||
<Trans>Use recipients</Trans>
|
||||
</Button>
|
||||
|
||||
{onAutoAddFields && (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={handleAutoAddFields}
|
||||
disabled={
|
||||
isSubmitting ||
|
||||
isProcessing ||
|
||||
fields.length === 0 ||
|
||||
!form.formState.isValid
|
||||
}
|
||||
>
|
||||
{isProcessing ? (
|
||||
<Trans>Processing...</Trans>
|
||||
) : (
|
||||
<Trans>Auto add fields</Trans>
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
{(fields.length === 0 || !form.formState.isValid) && (
|
||||
<TooltipContent>
|
||||
<Trans>Please add at least one valid recipient to auto-detect fields</Trans>
|
||||
</TooltipContent>
|
||||
)}
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
)}
|
||||
</div>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
@ -29,7 +29,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@documenso/ui/primitive
|
||||
import { useConfigureDocument } from './configure-document-context';
|
||||
import type { TConfigureEmbedFormSchema } from './configure-document-view.types';
|
||||
|
||||
// Define a type for signer items
|
||||
type SignerItem = TConfigureEmbedFormSchema['signers'][number];
|
||||
|
||||
export interface ConfigureDocumentRecipientsProps {
|
||||
@ -97,18 +96,15 @@ export const ConfigureDocumentRecipients = ({
|
||||
const currentSigners = getValues('signers') || [...signers];
|
||||
const signer = currentSigners[index];
|
||||
|
||||
// Remove signer from current position and insert at new position
|
||||
const remainingSigners = currentSigners.filter((_: unknown, idx: number) => idx !== index);
|
||||
const newPosition = Math.min(Math.max(0, newOrder - 1), currentSigners.length - 1);
|
||||
remainingSigners.splice(newPosition, 0, signer);
|
||||
|
||||
// Update signing order for each item
|
||||
const updatedSigners = remainingSigners.map((s: SignerItem, idx: number) => ({
|
||||
...s,
|
||||
signingOrder: signingOrder === DocumentSigningOrder.SEQUENTIAL ? idx + 1 : undefined,
|
||||
}));
|
||||
|
||||
// Update the form
|
||||
replace(updatedSigners);
|
||||
},
|
||||
[signers, replace, getValues],
|
||||
@ -118,17 +114,14 @@ export const ConfigureDocumentRecipients = ({
|
||||
(result: DropResult) => {
|
||||
if (!result.destination) return;
|
||||
|
||||
// Use the move function from useFieldArray which preserves input values
|
||||
move(result.source.index, result.destination.index);
|
||||
|
||||
// Update signing orders after move
|
||||
const currentSigners = getValues('signers');
|
||||
const updatedSigners = currentSigners.map((signer: SignerItem, index: number) => ({
|
||||
...signer,
|
||||
signingOrder: signingOrder === DocumentSigningOrder.SEQUENTIAL ? index + 1 : undefined,
|
||||
}));
|
||||
|
||||
// Update the form with new ordering
|
||||
replace(updatedSigners);
|
||||
},
|
||||
[move, replace, getValues],
|
||||
|
||||
@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { useLingui } from '@lingui/react';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import type { EnvelopeItem, FieldType } from '@prisma/client';
|
||||
import type { DocumentData, FieldType } from '@prisma/client';
|
||||
import { ReadStatus, type Recipient, SendStatus, SigningStatus } from '@prisma/client';
|
||||
import { base64 } from '@scure/base';
|
||||
import { ChevronsUpDown } from 'lucide-react';
|
||||
@ -23,7 +23,7 @@ import { FRIENDLY_FIELD_TYPE } from '@documenso/ui/primitives/document-flow/type
|
||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||
import { FieldSelector } from '@documenso/ui/primitives/field-selector';
|
||||
import { Form } from '@documenso/ui/primitives/form/form';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import PDFViewer from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { RecipientSelector } from '@documenso/ui/primitives/recipient-selector';
|
||||
import { Sheet, SheetContent, SheetTrigger } from '@documenso/ui/primitives/sheet';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
@ -40,8 +40,7 @@ const DEFAULT_WIDTH_PX = MIN_WIDTH_PX * 2.5;
|
||||
|
||||
export type ConfigureFieldsViewProps = {
|
||||
configData: TConfigureEmbedFormSchema;
|
||||
presignToken?: string | undefined;
|
||||
envelopeItem?: Pick<EnvelopeItem, 'id' | 'envelopeId'>;
|
||||
documentData?: DocumentData;
|
||||
defaultValues?: Partial<TConfigureFieldsFormSchema>;
|
||||
onBack?: (data: TConfigureFieldsFormSchema) => void;
|
||||
onSubmit: (data: TConfigureFieldsFormSchema) => void;
|
||||
@ -49,8 +48,7 @@ export type ConfigureFieldsViewProps = {
|
||||
|
||||
export const ConfigureFieldsView = ({
|
||||
configData,
|
||||
presignToken,
|
||||
envelopeItem,
|
||||
documentData,
|
||||
defaultValues,
|
||||
onBack,
|
||||
onSubmit,
|
||||
@ -84,25 +82,17 @@ export const ConfigureFieldsView = ({
|
||||
}, []);
|
||||
|
||||
const normalizedDocumentData = useMemo(() => {
|
||||
if (envelopeItem) {
|
||||
return undefined;
|
||||
if (documentData) {
|
||||
return documentData.data;
|
||||
}
|
||||
|
||||
if (!configData.documentData) {
|
||||
return undefined;
|
||||
return null;
|
||||
}
|
||||
|
||||
return base64.encode(configData.documentData.data);
|
||||
}, [configData.documentData]);
|
||||
|
||||
const normalizedEnvelopeItem = useMemo(() => {
|
||||
if (envelopeItem) {
|
||||
return envelopeItem;
|
||||
}
|
||||
|
||||
return { id: '', envelopeId: '' };
|
||||
}, [envelopeItem]);
|
||||
|
||||
const recipients = useMemo(() => {
|
||||
return configData.signers.map<Recipient>((signer, index) => ({
|
||||
id: signer.nativeId || index,
|
||||
@ -463,12 +453,12 @@ export const ConfigureFieldsView = ({
|
||||
{/* Desktop sidebar */}
|
||||
{!isMobile && (
|
||||
<div className="order-2 col-span-12 md:order-1 md:col-span-4">
|
||||
<div className="sticky top-4 max-h-[calc(100vh-2rem)] rounded-lg border border-border bg-widget p-4 pb-6">
|
||||
<div className="bg-widget border-border sticky top-4 max-h-[calc(100vh-2rem)] rounded-lg border p-4 pb-6">
|
||||
<h2 className="mb-1 text-lg font-medium">
|
||||
<Trans>Configure Fields</Trans>
|
||||
</h2>
|
||||
|
||||
<p className="mb-6 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mb-6 text-sm">
|
||||
<Trans>Configure the fields you want to place on the document.</Trans>
|
||||
</p>
|
||||
|
||||
@ -522,7 +512,7 @@ export const ConfigureFieldsView = ({
|
||||
{selectedField && (
|
||||
<div
|
||||
className={cn(
|
||||
'dark:text-muted-background pointer-events-none fixed z-50 flex cursor-pointer flex-col items-center justify-center bg-white text-muted-foreground transition duration-200 [container-type:size]',
|
||||
'text-muted-foreground dark:text-muted-background pointer-events-none fixed z-50 flex cursor-pointer flex-col items-center justify-center bg-white transition duration-200 [container-type:size]',
|
||||
selectedRecipientStyles.base,
|
||||
{
|
||||
'-rotate-6 scale-90 opacity-50 dark:bg-black/20': !isFieldWithinBounds,
|
||||
@ -544,11 +534,14 @@ export const ConfigureFieldsView = ({
|
||||
)}
|
||||
|
||||
<Form {...form}>
|
||||
{normalizedDocumentData && (
|
||||
<div>
|
||||
<PDFViewerLazy
|
||||
presignToken={presignToken}
|
||||
<PDFViewer
|
||||
overrideData={normalizedDocumentData}
|
||||
envelopeItem={normalizedEnvelopeItem}
|
||||
envelopeItem={{
|
||||
id: '',
|
||||
envelopeId: '',
|
||||
}}
|
||||
token={undefined}
|
||||
version="signed"
|
||||
/>
|
||||
@ -557,7 +550,9 @@ export const ConfigureFieldsView = ({
|
||||
target={`${PDF_VIEWER_PAGE_SELECTOR}[data-page-number="${highestPageNumber}"]`}
|
||||
>
|
||||
{localFields.map((field, index) => {
|
||||
const recipientIndex = recipients.findIndex((r) => r.id === field.recipientId);
|
||||
const recipientIndex = recipients.findIndex(
|
||||
(r) => r.id === field.recipientId,
|
||||
);
|
||||
|
||||
return (
|
||||
<FieldItem
|
||||
@ -588,6 +583,7 @@ export const ConfigureFieldsView = ({
|
||||
})}
|
||||
</ElementVisible>
|
||||
</div>
|
||||
)}
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
@ -597,14 +593,14 @@ export const ConfigureFieldsView = ({
|
||||
{isMobile && (
|
||||
<Sheet open={isDrawerOpen} onOpenChange={setIsDrawerOpen}>
|
||||
<SheetTrigger asChild>
|
||||
<div className="fixed bottom-6 left-6 right-6 z-50 flex items-center justify-between gap-2 rounded-lg border border-border bg-widget p-4">
|
||||
<div className="bg-widget border-border fixed bottom-6 left-6 right-6 z-50 flex items-center justify-between gap-2 rounded-lg border p-4">
|
||||
<span className="text-lg font-medium">
|
||||
<Trans>Configure Fields</Trans>
|
||||
</span>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="inline-flex h-10 w-10 items-center justify-center rounded-lg border border-border text-muted-foreground"
|
||||
className="border-border text-muted-foreground inline-flex h-10 w-10 items-center justify-center rounded-lg border"
|
||||
>
|
||||
<ChevronsUpDown className="h-6 w-6" />
|
||||
</button>
|
||||
@ -614,13 +610,13 @@ export const ConfigureFieldsView = ({
|
||||
<SheetContent
|
||||
position="bottom"
|
||||
size="xl"
|
||||
className="h-fit max-h-[80vh] overflow-y-auto rounded-t-xl bg-widget p-4"
|
||||
className="bg-widget h-fit max-h-[80vh] overflow-y-auto rounded-t-xl p-4"
|
||||
>
|
||||
<h2 className="mb-1 text-lg font-medium">
|
||||
<Trans>Configure Fields</Trans>
|
||||
</h2>
|
||||
|
||||
<p className="mb-6 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mb-6 text-sm">
|
||||
<Trans>Configure the fields you want to place on the document.</Trans>
|
||||
</p>
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ import { Button } from '@documenso/ui/primitives/button';
|
||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||
import { Input } from '@documenso/ui/primitives/input';
|
||||
import { Label } from '@documenso/ui/primitives/label';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { SignaturePadDialog } from '@documenso/ui/primitives/signature-pad/signature-pad-dialog';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
@ -334,7 +334,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
<div className="relative flex w-full flex-col gap-x-6 gap-y-12 md:flex-row">
|
||||
{/* Viewer */}
|
||||
<div className="flex-1">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
envelopeItem={envelopeItems[0]}
|
||||
token={recipient.token}
|
||||
version="signed"
|
||||
@ -348,11 +348,11 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
className="group/document-widget fixed bottom-8 left-0 z-50 h-fit max-h-[calc(100dvh-2rem)] w-full flex-shrink-0 px-6 md:sticky md:bottom-[unset] md:top-4 md:z-auto md:w-[350px] md:px-0"
|
||||
data-expanded={isExpanded || undefined}
|
||||
>
|
||||
<div className="flex h-fit w-full flex-col rounded-xl border border-border bg-widget px-4 py-4 md:min-h-[min(calc(100dvh-2rem),48rem)] md:py-6">
|
||||
<div className="border-border bg-widget flex h-fit w-full flex-col rounded-xl border px-4 py-4 md:min-h-[min(calc(100dvh-2rem),48rem)] md:py-6">
|
||||
{/* Header */}
|
||||
<div>
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<h3 className="text-xl font-semibold text-foreground md:text-2xl">
|
||||
<h3 className="text-foreground text-xl font-semibold md:text-2xl">
|
||||
<Trans>Sign document</Trans>
|
||||
</h3>
|
||||
|
||||
@ -362,7 +362,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
className="h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(false)}
|
||||
>
|
||||
<LucideChevronDown className="h-5 w-5 text-muted-foreground" />
|
||||
<LucideChevronDown className="text-muted-foreground h-5 w-5" />
|
||||
</Button>
|
||||
) : pendingFields.length > 0 ? (
|
||||
<Button
|
||||
@ -370,7 +370,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
className="h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(true)}
|
||||
>
|
||||
<LucideChevronUp className="h-5 w-5 text-muted-foreground" />
|
||||
<LucideChevronUp className="text-muted-foreground h-5 w-5" />
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@ -388,11 +388,11 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
</div>
|
||||
|
||||
<div className="hidden group-data-[expanded]/document-widget:block md:block">
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>Sign the document to complete the process.</Trans>
|
||||
</p>
|
||||
|
||||
<hr className="mb-8 mt-4 border-border" />
|
||||
<hr className="border-border mb-8 mt-4" />
|
||||
</div>
|
||||
|
||||
{/* Form */}
|
||||
@ -406,7 +406,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
<Input
|
||||
type="text"
|
||||
id="full-name"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
disabled={isNameLocked}
|
||||
value={fullName}
|
||||
onChange={(e) => !isNameLocked && setFullName(e.target.value)}
|
||||
@ -421,7 +421,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
<Input
|
||||
type="email"
|
||||
id="email"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
disabled={isEmailLocked}
|
||||
value={email}
|
||||
onChange={(e) => !isEmailLocked && setEmail(e.target.value.trim())}
|
||||
@ -490,7 +490,7 @@ export const EmbedDirectTemplateClientPage = ({
|
||||
</div>
|
||||
|
||||
{!hidePoweredBy && (
|
||||
<div className="fixed bottom-0 left-0 z-40 rounded-tr bg-primary px-2 py-1 text-xs font-medium text-primary-foreground opacity-60 hover:opacity-100">
|
||||
<div className="bg-primary text-primary-foreground fixed bottom-0 left-0 z-40 rounded-tr px-2 py-1 text-xs font-medium opacity-60 hover:opacity-100">
|
||||
<span>Powered by</span>
|
||||
<BrandingLogo className="ml-2 inline-block h-[14px]" />
|
||||
</div>
|
||||
|
||||
@ -22,7 +22,7 @@ import { Button } from '@documenso/ui/primitives/button';
|
||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||
import { Input } from '@documenso/ui/primitives/input';
|
||||
import { Label } from '@documenso/ui/primitives/label';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { RadioGroup, RadioGroupItem } from '@documenso/ui/primitives/radio-group';
|
||||
import { SignaturePadDialog } from '@documenso/ui/primitives/signature-pad/signature-pad-dialog';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
@ -286,7 +286,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
<div className="embed--DocumentContainer relative flex w-full flex-col gap-x-6 gap-y-12 md:flex-row">
|
||||
{/* Viewer */}
|
||||
<div className="embed--DocumentViewer flex-1">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
envelopeItem={envelopeItems[0]}
|
||||
token={token}
|
||||
version="signed"
|
||||
@ -300,11 +300,11 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
className="embed--DocumentWidgetContainer group/document-widget fixed bottom-8 left-0 z-50 h-fit max-h-[calc(100dvh-2rem)] w-full flex-shrink-0 px-6 md:sticky md:bottom-[unset] md:top-4 md:z-auto md:w-[350px] md:px-0"
|
||||
data-expanded={isExpanded || undefined}
|
||||
>
|
||||
<div className="embed--DocumentWidget flex w-full flex-col rounded-xl border border-border bg-widget px-4 py-4 md:py-6">
|
||||
<div className="embed--DocumentWidget border-border bg-widget flex w-full flex-col rounded-xl border px-4 py-4 md:py-6">
|
||||
{/* Header */}
|
||||
<div className="embed--DocumentWidgetHeader">
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<h3 className="text-xl font-semibold text-foreground md:text-2xl">
|
||||
<h3 className="text-foreground text-xl font-semibold md:text-2xl">
|
||||
{isAssistantMode ? (
|
||||
<Trans>Assist with signing</Trans>
|
||||
) : (
|
||||
@ -315,18 +315,18 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
{isExpanded ? (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-8 w-8 bg-background p-0 md:hidden dark:bg-foreground"
|
||||
className="bg-background dark:bg-foreground h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(false)}
|
||||
>
|
||||
<LucideChevronDown className="h-5 w-5 text-muted-foreground dark:text-background" />
|
||||
<LucideChevronDown className="text-muted-foreground dark:text-background h-5 w-5" />
|
||||
</Button>
|
||||
) : pendingFields.length > 0 ? (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-8 w-8 bg-background p-0 md:hidden dark:bg-foreground"
|
||||
className="bg-background dark:bg-foreground h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(true)}
|
||||
>
|
||||
<LucideChevronUp className="h-5 w-5 text-muted-foreground dark:text-background" />
|
||||
<LucideChevronUp className="text-muted-foreground dark:text-background h-5 w-5" />
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@ -346,7 +346,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
</div>
|
||||
|
||||
<div className="embed--DocumentWidgetContent hidden group-data-[expanded]/document-widget:block md:block">
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
{isAssistantMode ? (
|
||||
<Trans>Help complete the document for other signers.</Trans>
|
||||
) : (
|
||||
@ -354,7 +354,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
)}
|
||||
</p>
|
||||
|
||||
<hr className="mb-8 mt-4 border-border" />
|
||||
<hr className="border-border mb-8 mt-4" />
|
||||
</div>
|
||||
|
||||
{/* Form */}
|
||||
@ -366,7 +366,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
<Trans>Signing for</Trans>
|
||||
</Label>
|
||||
|
||||
<fieldset className="mt-2 rounded-2xl border border-border bg-white p-3 dark:bg-background">
|
||||
<fieldset className="dark:bg-background border-border mt-2 rounded-2xl border bg-white p-3">
|
||||
<RadioGroup
|
||||
className="gap-0 space-y-3 shadow-none"
|
||||
value={selectedSignerId?.toString()}
|
||||
@ -377,7 +377,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
.map((r) => (
|
||||
<div
|
||||
key={`${assistantSignersId}-${r.id}`}
|
||||
className="relative flex flex-col gap-4 rounded-lg border border-border bg-widget p-4"
|
||||
className="bg-widget border-border relative flex flex-col gap-4 rounded-lg border p-4"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
@ -395,15 +395,15 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
{r.name}
|
||||
|
||||
{r.id === recipient.id && (
|
||||
<span className="ml-2 text-muted-foreground">
|
||||
<span className="text-muted-foreground ml-2">
|
||||
{_(msg`(You)`)}
|
||||
</span>
|
||||
)}
|
||||
</Label>
|
||||
<p className="text-xs text-muted-foreground">{r.email}</p>
|
||||
<p className="text-muted-foreground text-xs">{r.email}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs leading-[inherit] text-muted-foreground">
|
||||
<div className="text-muted-foreground text-xs leading-[inherit]">
|
||||
{r.fields.length} {r.fields.length === 1 ? 'field' : 'fields'}
|
||||
</div>
|
||||
</div>
|
||||
@ -424,7 +424,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
<Input
|
||||
type="text"
|
||||
id="full-name"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
disabled={isNameLocked}
|
||||
value={fullName}
|
||||
onChange={(e) => !isNameLocked && setFullName(e.target.value)}
|
||||
@ -439,7 +439,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
<Input
|
||||
type="email"
|
||||
id="email"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
value={email}
|
||||
disabled
|
||||
/>
|
||||
@ -507,7 +507,7 @@ export const EmbedSignDocumentV1ClientPage = ({
|
||||
</div>
|
||||
|
||||
{!hidePoweredBy && (
|
||||
<div className="fixed bottom-0 left-0 z-40 rounded-tr bg-primary px-2 py-1 text-xs font-medium text-primary-foreground opacity-60 hover:opacity-100">
|
||||
<div className="bg-primary text-primary-foreground fixed bottom-0 left-0 z-40 rounded-tr px-2 py-1 text-xs font-medium opacity-60 hover:opacity-100">
|
||||
<span>Powered by</span>
|
||||
<BrandingLogo className="ml-2 inline-block h-[14px]" />
|
||||
</div>
|
||||
|
||||
@ -21,7 +21,7 @@ import { Button } from '@documenso/ui/primitives/button';
|
||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||
import { Input } from '@documenso/ui/primitives/input';
|
||||
import { Label } from '@documenso/ui/primitives/label';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import PDFViewer from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { SignaturePadDialog } from '@documenso/ui/primitives/signature-pad/signature-pad-dialog';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
@ -177,14 +177,14 @@ export const MultiSignDocumentSigningView = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen overflow-hidden bg-background">
|
||||
<div className="bg-background min-h-screen overflow-hidden">
|
||||
<div id="document-field-portal-root" className="relative h-full w-full overflow-y-auto p-8">
|
||||
{match({ isLoading, document })
|
||||
.with({ isLoading: true }, () => (
|
||||
<div className="flex min-h-[400px] w-full items-center justify-center">
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<Loader className="h-8 w-8 animate-spin text-primary" />
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<Loader className="text-primary h-8 w-8 animate-spin" />
|
||||
<p className="text-muted-foreground text-sm">
|
||||
<Trans>Loading document...</Trans>
|
||||
</p>
|
||||
</div>
|
||||
@ -192,7 +192,7 @@ export const MultiSignDocumentSigningView = ({
|
||||
))
|
||||
.with({ isLoading: false, document: undefined }, () => (
|
||||
<div className="flex min-h-[400px] w-full items-center justify-center">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground text-sm">
|
||||
<Trans>Failed to load document</Trans>
|
||||
</p>
|
||||
</div>
|
||||
@ -225,7 +225,7 @@ export const MultiSignDocumentSigningView = ({
|
||||
'md:mx-auto md:max-w-2xl': document.status === DocumentStatus.COMPLETED,
|
||||
})}
|
||||
>
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
envelopeItem={document.envelopeItems[0]}
|
||||
token={token}
|
||||
version="signed"
|
||||
@ -243,23 +243,23 @@ export const MultiSignDocumentSigningView = ({
|
||||
className="embed--DocumentWidgetContainer group/document-widget fixed bottom-8 left-0 z-50 h-fit max-h-[calc(100dvh-2rem)] w-full flex-shrink-0 px-6 md:sticky md:bottom-[unset] md:top-0 md:z-auto md:w-[350px] md:px-0"
|
||||
data-expanded={isExpanded || undefined}
|
||||
>
|
||||
<div className="embed--DocumentWidget flex w-full flex-col rounded-xl border border-border bg-widget px-4 py-4 md:py-6">
|
||||
<div className="embed--DocumentWidget border-border bg-widget flex w-full flex-col rounded-xl border px-4 py-4 md:py-6">
|
||||
{/* Header */}
|
||||
<div className="embed--DocumentWidgetHeader">
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<h3 className="text-xl font-semibold text-foreground md:text-2xl">
|
||||
<h3 className="text-foreground text-xl font-semibold md:text-2xl">
|
||||
<Trans>Sign document</Trans>
|
||||
</h3>
|
||||
|
||||
<Button variant="outline" className="h-8 w-8 p-0 md:hidden">
|
||||
{isExpanded ? (
|
||||
<LucideChevronDown
|
||||
className="h-5 w-5 text-muted-foreground"
|
||||
className="text-muted-foreground h-5 w-5"
|
||||
onClick={() => setIsExpanded(false)}
|
||||
/>
|
||||
) : (
|
||||
<LucideChevronUp
|
||||
className="h-5 w-5 text-muted-foreground"
|
||||
className="text-muted-foreground h-5 w-5"
|
||||
onClick={() => setIsExpanded(true)}
|
||||
/>
|
||||
)}
|
||||
@ -268,11 +268,11 @@ export const MultiSignDocumentSigningView = ({
|
||||
</div>
|
||||
|
||||
<div className="embed--DocumentWidgetContent hidden group-data-[expanded]/document-widget:block md:block">
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
<Trans>Sign the document to complete the process.</Trans>
|
||||
</p>
|
||||
|
||||
<hr className="mb-8 mt-4 border-border" />
|
||||
<hr className="border-border mb-8 mt-4" />
|
||||
</div>
|
||||
|
||||
{/* Form */}
|
||||
@ -288,7 +288,7 @@ export const MultiSignDocumentSigningView = ({
|
||||
<Input
|
||||
type="text"
|
||||
id="full-name"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
disabled={isNameLocked}
|
||||
value={fullName}
|
||||
onChange={(e) => !isNameLocked && setFullName(e.target.value)}
|
||||
@ -303,7 +303,7 @@ export const MultiSignDocumentSigningView = ({
|
||||
<Input
|
||||
type="email"
|
||||
id="email"
|
||||
className="mt-2 bg-background"
|
||||
className="bg-background mt-2"
|
||||
value={email}
|
||||
disabled
|
||||
/>
|
||||
|
||||
@ -42,7 +42,7 @@ import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
import { ZCreateOrganisationFormSchema } from '../dialogs/organisation-create-dialog';
|
||||
|
||||
const MotionCard = motion.create(Card);
|
||||
const MotionCard = motion(Card);
|
||||
|
||||
export type BillingPlansProps = {
|
||||
plans: InternalClaimPlans;
|
||||
@ -101,7 +101,7 @@ export const BillingPlans = ({ plans }: BillingPlansProps) => {
|
||||
<CardContent className="flex h-full flex-col p-6">
|
||||
<CardTitle>{price.product.name}</CardTitle>
|
||||
|
||||
<div className="mt-2 text-lg font-medium text-muted-foreground">
|
||||
<div className="text-muted-foreground mt-2 text-lg font-medium">
|
||||
{price.friendlyPrice + ' '}
|
||||
<span className="text-xs">
|
||||
{interval === 'monthlyPrice' ? (
|
||||
@ -112,12 +112,12 @@ export const BillingPlans = ({ plans }: BillingPlansProps) => {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-1.5 text-sm text-muted-foreground">
|
||||
<div className="text-muted-foreground mt-1.5 text-sm">
|
||||
{price.product.description}
|
||||
</div>
|
||||
|
||||
{price.product.features && price.product.features.length > 0 && (
|
||||
<div className="mt-4 text-muted-foreground">
|
||||
<div className="text-muted-foreground mt-4">
|
||||
<div className="text-sm font-medium">Includes:</div>
|
||||
|
||||
<ul className="mt-1 divide-y text-sm">
|
||||
@ -261,7 +261,7 @@ const BillingDialog = ({
|
||||
<Building2Icon className="h-4 w-4" />
|
||||
<Trans>Update current organisation</Trans>
|
||||
</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground text-sm">
|
||||
<Trans>
|
||||
Upgrade <strong>{organisation.name}</strong> to {planName}
|
||||
</Trans>
|
||||
@ -276,7 +276,7 @@ const BillingDialog = ({
|
||||
<PlusIcon className="h-4 w-4" />
|
||||
<Trans>Create separate organisation</Trans>
|
||||
</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground text-sm">
|
||||
<Trans>
|
||||
Create a new organisation with {planName} plan. Keep your current organisation
|
||||
on it's current plan
|
||||
|
||||
@ -13,7 +13,7 @@ import { trpc } from '@documenso/trpc/react';
|
||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||
import { DocumentFlowFormContainer } from '@documenso/ui/primitives/document-flow/document-flow-root';
|
||||
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { Stepper } from '@documenso/ui/primitives/stepper';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
@ -151,7 +151,7 @@ export const DirectTemplatePageView = ({
|
||||
gradient
|
||||
>
|
||||
<CardContent className="p-2">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={template.id}
|
||||
envelopeItem={template.envelopeItems[0]}
|
||||
token={directTemplateRecipient.token}
|
||||
|
||||
@ -30,7 +30,7 @@ import { DocumentReadOnlyFields } from '@documenso/ui/components/document/docume
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||
import { ElementVisible } from '@documenso/ui/primitives/element-visible';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
|
||||
import { DocumentSigningAttachmentsPopover } from '~/components/general/document-signing/document-signing-attachments-popover';
|
||||
import { DocumentSigningAutoSign } from '~/components/general/document-signing/document-signing-auto-sign';
|
||||
@ -187,7 +187,7 @@ export const DocumentSigningPageViewV1 = ({
|
||||
|
||||
<div className="mt-1.5 flex flex-wrap items-center justify-between gap-y-2 sm:mt-2.5 sm:gap-y-0">
|
||||
<div className="max-w-[50ch]">
|
||||
<span className="truncate text-muted-foreground" title={senderName}>
|
||||
<span className="text-muted-foreground truncate" title={senderName}>
|
||||
{senderName} {senderEmail}
|
||||
</span>{' '}
|
||||
<span className="text-muted-foreground">
|
||||
@ -245,7 +245,7 @@ export const DocumentSigningPageViewV1 = ({
|
||||
<div className="flex-1">
|
||||
<Card className="rounded-xl before:rounded-xl" gradient>
|
||||
<CardContent className="p-2">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={document.envelopeItems[0].id}
|
||||
envelopeItem={document.envelopeItems[0]}
|
||||
token={recipient.token}
|
||||
@ -260,9 +260,9 @@ export const DocumentSigningPageViewV1 = ({
|
||||
className="group/document-widget fixed bottom-6 left-0 z-50 h-fit max-h-[calc(100dvh-2rem)] w-full flex-shrink-0 px-4 md:sticky md:bottom-[unset] md:top-4 md:z-auto md:w-[350px] md:px-0"
|
||||
data-expanded={isExpanded || undefined}
|
||||
>
|
||||
<div className="flex w-full flex-col rounded-xl border border-border bg-widget px-4 py-4 md:py-6">
|
||||
<div className="border-border bg-widget flex w-full flex-col rounded-xl border px-4 py-4 md:py-6">
|
||||
<div className="flex items-center justify-between gap-x-2">
|
||||
<h3 className="text-xl font-semibold text-foreground md:text-2xl">
|
||||
<h3 className="text-foreground text-xl font-semibold md:text-2xl">
|
||||
{match(recipient.role)
|
||||
.with(RecipientRole.VIEWER, () => <Trans>View Document</Trans>)
|
||||
.with(RecipientRole.SIGNER, () => <Trans>Sign Document</Trans>)
|
||||
@ -305,25 +305,25 @@ export const DocumentSigningPageViewV1 = ({
|
||||
.with({ isExpanded: true }, () => (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-8 w-8 bg-background p-0 md:hidden dark:bg-foreground"
|
||||
className="bg-background dark:bg-foreground h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(false)}
|
||||
>
|
||||
<LucideChevronDown className="h-5 w-5 text-muted-foreground dark:text-background" />
|
||||
<LucideChevronDown className="text-muted-foreground dark:text-background h-5 w-5" />
|
||||
</Button>
|
||||
))
|
||||
.otherwise(() => (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-8 w-8 bg-background p-0 md:hidden dark:bg-foreground"
|
||||
className="bg-background dark:bg-foreground h-8 w-8 p-0 md:hidden"
|
||||
onClick={() => setIsExpanded(true)}
|
||||
>
|
||||
<LucideChevronUp className="h-5 w-5 text-muted-foreground dark:text-background" />
|
||||
<LucideChevronUp className="text-muted-foreground dark:text-background h-5 w-5" />
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="hidden group-data-[expanded]/document-widget:block md:block">
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 text-sm">
|
||||
{match(recipient.role)
|
||||
.with(RecipientRole.VIEWER, () => (
|
||||
<Trans>Please mark as viewed to complete.</Trans>
|
||||
@ -340,7 +340,7 @@ export const DocumentSigningPageViewV1 = ({
|
||||
.otherwise(() => null)}
|
||||
</p>
|
||||
|
||||
<hr className="mb-8 mt-4 border-border" />
|
||||
<hr className="border-border mb-8 mt-4" />
|
||||
</div>
|
||||
|
||||
<div className="-mx-2 hidden px-2 group-data-[expanded]/document-widget:block md:block">
|
||||
|
||||
@ -34,7 +34,7 @@ import { DocumentSigningRejectDialog } from './document-signing-reject-dialog';
|
||||
import { useRequiredEnvelopeSigningContext } from './envelope-signing-provider';
|
||||
|
||||
const EnvelopeSignerPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-signing/envelope-signer-page-renderer'),
|
||||
async () => import('../envelope-signing/envelope-signer-page-renderer'),
|
||||
);
|
||||
|
||||
export const DocumentSigningPageViewV2 = () => {
|
||||
@ -71,7 +71,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
}, [recipientFieldsRemaining, selectedAssistantRecipientFields, currentEnvelopeItem]);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen w-screen bg-gray-50 dark:bg-background">
|
||||
<div className="dark:bg-background min-h-screen w-screen bg-gray-50">
|
||||
<SignFieldEmailDialog.Root />
|
||||
<SignFieldTextDialog.Root />
|
||||
<SignFieldNumberDialog.Root />
|
||||
@ -86,9 +86,9 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
{/* Main Content Area */}
|
||||
<div className="flex h-[calc(100vh-4rem)] w-screen">
|
||||
{/* Left Section - Step Navigation */}
|
||||
<div className="embed--DocumentWidgetContainer hidden w-80 flex-shrink-0 flex-col overflow-y-auto border-r border-border bg-background py-4 lg:flex">
|
||||
<div className="embed--DocumentWidgetContainer bg-background border-border hidden w-80 flex-shrink-0 flex-col overflow-y-auto border-r py-4 lg:flex">
|
||||
<div className="px-4">
|
||||
<h3 className="flex items-end justify-between text-sm font-semibold text-foreground">
|
||||
<h3 className="text-foreground flex items-end justify-between text-sm font-semibold">
|
||||
{match(recipient.role)
|
||||
.with(RecipientRole.VIEWER, () => <Trans>View Document</Trans>)
|
||||
.with(RecipientRole.SIGNER, () => <Trans>Sign Document</Trans>)
|
||||
@ -96,7 +96,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
.with(RecipientRole.ASSISTANT, () => <Trans>Assist Document</Trans>)
|
||||
.otherwise(() => null)}
|
||||
|
||||
<span className="ml-2 rounded border bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground">
|
||||
<span className="text-muted-foreground bg-muted/50 ml-2 rounded border px-2 py-0.5 text-xs">
|
||||
<Plural
|
||||
value={recipientFieldsRemaining.length}
|
||||
one="1 Field Remaining"
|
||||
@ -105,11 +105,11 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
</span>
|
||||
</h3>
|
||||
|
||||
<div className="relative my-4 h-[4px] rounded-md bg-muted">
|
||||
<div className="bg-muted relative my-4 h-[4px] rounded-md">
|
||||
<motion.div
|
||||
layout="size"
|
||||
layoutId="document-flow-container-step"
|
||||
className="absolute inset-y-0 left-0 bg-documenso"
|
||||
className="bg-documenso absolute inset-y-0 left-0"
|
||||
style={{
|
||||
width: `${100 - (100 / requiredRecipientFields.length) * (recipientFieldsRemaining.length ?? 0)}%`,
|
||||
}}
|
||||
@ -126,7 +126,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
{/* Quick Actions. */}
|
||||
{!isDirectTemplate && (
|
||||
<div className="embed--Actions space-y-3 px-4">
|
||||
<h4 className="text-sm font-semibold text-foreground">
|
||||
<h4 className="text-foreground text-sm font-semibold">
|
||||
<Trans>Actions</Trans>
|
||||
</h4>
|
||||
|
||||
@ -173,7 +173,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="w-full justify-start hover:text-destructive"
|
||||
className="hover:text-destructive w-full justify-start"
|
||||
>
|
||||
<BanIcon className="mr-2 h-4 w-4" />
|
||||
<Trans>Reject Document</Trans>
|
||||
@ -235,7 +235,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-32">
|
||||
<p className="text-sm text-foreground">
|
||||
<p className="text-foreground text-sm">
|
||||
<Trans>No documents found</Trans>
|
||||
</p>
|
||||
</div>
|
||||
@ -250,7 +250,7 @@ export const DocumentSigningPageViewV2 = () => {
|
||||
<a
|
||||
href="https://documenso.com"
|
||||
target="_blank"
|
||||
className="fixed bottom-0 right-0 z-40 hidden cursor-pointer rounded-tl bg-primary px-2 py-1 text-xs font-medium text-primary-foreground opacity-60 hover:opacity-100 lg:block"
|
||||
className="bg-primary text-primary-foreground fixed bottom-0 right-0 z-40 hidden cursor-pointer rounded-tl px-2 py-1 text-xs font-medium opacity-60 hover:opacity-100 lg:block"
|
||||
>
|
||||
<span>Powered by</span>
|
||||
<BrandingLogo className="ml-2 inline-block h-[14px]" />
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { lazy, useEffect, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { type DocumentData, DocumentStatus, type EnvelopeItem, EnvelopeType } from '@prisma/client';
|
||||
@ -21,15 +21,12 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@documenso/ui/primitives/dialog';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
|
||||
import { EnvelopeDownloadDialog } from '~/components/dialogs/envelope-download-dialog';
|
||||
|
||||
import { EnvelopeRendererFileSelector } from '../envelope-editor/envelope-file-selector';
|
||||
|
||||
const EnvelopeGenericPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-editor/envelope-generic-page-renderer'),
|
||||
);
|
||||
import EnvelopeGenericPageRenderer from '../envelope-editor/envelope-generic-page-renderer';
|
||||
|
||||
export type DocumentCertificateQRViewProps = {
|
||||
documentId: number;
|
||||
@ -123,7 +120,7 @@ export const DocumentCertificateQRView = ({
|
||||
<div className="flex w-full flex-col justify-between gap-4 md:flex-row md:items-end">
|
||||
<div className="space-y-1">
|
||||
<h1 className="text-xl font-medium">{title}</h1>
|
||||
<div className="flex flex-col gap-0.5 text-sm text-muted-foreground">
|
||||
<div className="text-muted-foreground flex flex-col gap-0.5 text-sm">
|
||||
<p>
|
||||
<Trans>{recipientCount} recipients</Trans>
|
||||
</p>
|
||||
@ -149,7 +146,7 @@ export const DocumentCertificateQRView = ({
|
||||
</div>
|
||||
|
||||
<div className="mt-12 w-full">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={envelopeItems[0].id}
|
||||
envelopeItem={envelopeItems[0]}
|
||||
token={token}
|
||||
@ -182,7 +179,7 @@ const DocumentCertificateQrV2 = ({
|
||||
<div className="flex w-full flex-col justify-between gap-4 md:flex-row md:items-end">
|
||||
<div className="space-y-1">
|
||||
<h1 className="text-xl font-medium">{title}</h1>
|
||||
<div className="flex flex-col gap-0.5 text-sm text-muted-foreground">
|
||||
<div className="text-muted-foreground flex flex-col gap-0.5 text-sm">
|
||||
<p>
|
||||
<Trans>{recipientCount} recipients</Trans>
|
||||
</p>
|
||||
|
||||
@ -27,7 +27,7 @@ import { AddSubjectFormPartial } from '@documenso/ui/primitives/document-flow/ad
|
||||
import type { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
|
||||
import { DocumentFlowFormContainer } from '@documenso/ui/primitives/document-flow/document-flow-root';
|
||||
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { Stepper } from '@documenso/ui/primitives/stepper';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
@ -440,7 +440,7 @@ export const DocumentEditForm = ({
|
||||
gradient
|
||||
>
|
||||
<CardContent className="p-2">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={document.envelopeItems[0].id}
|
||||
envelopeItem={document.envelopeItems[0]}
|
||||
token={undefined}
|
||||
|
||||
@ -174,18 +174,12 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
* Initialize the Konva page canvas and all fields and interactions.
|
||||
*/
|
||||
const createPageCanvas = (currentStage: Konva.Stage, currentPageLayer: Konva.Layer) => {
|
||||
// Initialize snap guides layer
|
||||
// snapGuideLayer.current = initializeSnapGuides(stage.current);
|
||||
|
||||
// Add transformer for resizing and rotating.
|
||||
interactiveTransformer.current = createInteractiveTransformer(currentStage, currentPageLayer);
|
||||
|
||||
// Render the fields.
|
||||
for (const field of localPageFields) {
|
||||
renderFieldOnLayer(field);
|
||||
}
|
||||
|
||||
// Handle stage click to deselect.
|
||||
currentStage.on('mousedown', (e) => {
|
||||
removePendingField();
|
||||
|
||||
@ -270,7 +264,6 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
let y2: number;
|
||||
|
||||
currentStage.on('mousedown touchstart', (e) => {
|
||||
// do nothing if we mousedown on any shape
|
||||
if (e.target !== currentStage) {
|
||||
return;
|
||||
}
|
||||
@ -296,7 +289,6 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
});
|
||||
|
||||
currentStage.on('mousemove touchmove', () => {
|
||||
// do nothing if we didn't start selection
|
||||
if (!selectionRectangle.visible()) {
|
||||
return;
|
||||
}
|
||||
@ -321,7 +313,6 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
});
|
||||
|
||||
currentStage.on('mouseup touchend', () => {
|
||||
// do nothing if we didn't start selection
|
||||
if (!selectionRectangle.visible()) {
|
||||
return;
|
||||
}
|
||||
@ -375,34 +366,25 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
return;
|
||||
}
|
||||
|
||||
// If empty area clicked, remove all selections
|
||||
if (e.target === stage.current) {
|
||||
setSelectedFields([]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Do nothing if field not clicked, or if field is not editable
|
||||
if (!e.target.hasName('field-group') || e.target.draggable() === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// do we pressed shift or ctrl?
|
||||
const metaPressed = e.evt.shiftKey || e.evt.ctrlKey || e.evt.metaKey;
|
||||
const isSelected = transformer.nodes().indexOf(e.target) >= 0;
|
||||
|
||||
if (!metaPressed && !isSelected) {
|
||||
// if no key pressed and the node is not selected
|
||||
// select just one
|
||||
setSelectedFields([e.target]);
|
||||
} else if (metaPressed && isSelected) {
|
||||
// if we pressed keys and node was selected
|
||||
// we need to remove it from selection:
|
||||
const nodes = transformer.nodes().slice(); // use slice to have new copy of array
|
||||
// remove node from array
|
||||
const nodes = transformer.nodes().slice();
|
||||
nodes.splice(nodes.indexOf(e.target), 1);
|
||||
setSelectedFields(nodes);
|
||||
} else if (metaPressed && !isSelected) {
|
||||
// add the node into selection
|
||||
const nodes = transformer.nodes().concat([e.target]);
|
||||
setSelectedFields(nodes);
|
||||
}
|
||||
@ -429,12 +411,10 @@ export default function EnvelopeEditorFieldsPageRenderer() {
|
||||
}
|
||||
});
|
||||
|
||||
// If it exists, rerender.
|
||||
localPageFields.forEach((field) => {
|
||||
renderFieldOnLayer(field);
|
||||
});
|
||||
|
||||
// Rerender the transformer
|
||||
interactiveTransformer.current?.forceUpdate();
|
||||
|
||||
pageLayer.current.batchDraw();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { lazy, useEffect, useMemo } from 'react';
|
||||
import { lazy, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import type { MessageDescriptor } from '@lingui/core';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { msg, plural } from '@lingui/core/macro';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { FieldType, RecipientRole } from '@prisma/client';
|
||||
import { FileTextIcon } from 'lucide-react';
|
||||
@ -11,6 +11,7 @@ import { match } from 'ts-pattern';
|
||||
|
||||
import { useCurrentEnvelopeEditor } from '@documenso/lib/client-only/providers/envelope-editor-provider';
|
||||
import { useCurrentEnvelopeRender } from '@documenso/lib/client-only/providers/envelope-render-provider';
|
||||
import type { TDetectedFormField } from '@documenso/lib/types/document-analysis';
|
||||
import type {
|
||||
TCheckboxFieldMeta,
|
||||
TDateFieldMeta,
|
||||
@ -24,12 +25,14 @@ import type {
|
||||
TSignatureFieldMeta,
|
||||
TTextFieldMeta,
|
||||
} from '@documenso/lib/types/field-meta';
|
||||
import { FIELD_META_DEFAULT_VALUES } from '@documenso/lib/types/field-meta';
|
||||
import { canRecipientFieldsBeModified } from '@documenso/lib/utils/recipients';
|
||||
import { AnimateGenericFadeInOut } from '@documenso/ui/components/animate/animate-generic-fade-in-out';
|
||||
import PDFViewerKonvaLazy from '@documenso/ui/components/pdf-viewer/pdf-viewer-konva-lazy';
|
||||
import { Alert, AlertDescription, AlertTitle } from '@documenso/ui/primitives/alert';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import { Separator } from '@documenso/ui/primitives/separator';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
import { EditorFieldCheckboxForm } from '~/components/forms/editor/editor-field-checkbox-form';
|
||||
import { EditorFieldDateForm } from '~/components/forms/editor/editor-field-date-form';
|
||||
@ -47,9 +50,54 @@ import { EnvelopeRendererFileSelector } from './envelope-file-selector';
|
||||
import { EnvelopeRecipientSelector } from './envelope-recipient-selector';
|
||||
|
||||
const EnvelopeEditorFieldsPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-editor/envelope-editor-fields-page-renderer'),
|
||||
async () => import('./envelope-editor-fields-page-renderer'),
|
||||
);
|
||||
|
||||
const detectFormFieldsInDocument = async (params: {
|
||||
envelopeId: string;
|
||||
onProgress: (current: number, total: number) => void;
|
||||
}): Promise<{
|
||||
fieldsPerPage: Map<number, TDetectedFormField[]>;
|
||||
errors: Map<number, Error>;
|
||||
}> => {
|
||||
const { envelopeId, onProgress } = params;
|
||||
const fieldsPerPage = new Map<number, TDetectedFormField[]>();
|
||||
const errors = new Map<number, Error>();
|
||||
|
||||
try {
|
||||
onProgress(0, 1);
|
||||
|
||||
const response = await fetch('/api/ai/detect-fields', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ envelopeId }),
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
throw new Error(`Field detection failed: ${response.statusText} - ${errorText}`);
|
||||
}
|
||||
|
||||
const detectedFields: TDetectedFormField[] = await response.json();
|
||||
|
||||
for (const field of detectedFields) {
|
||||
if (!fieldsPerPage.has(field.pageNumber)) {
|
||||
fieldsPerPage.set(field.pageNumber, []);
|
||||
}
|
||||
fieldsPerPage.get(field.pageNumber)!.push(field);
|
||||
}
|
||||
|
||||
onProgress(1, 1);
|
||||
} catch (error) {
|
||||
errors.set(0, error instanceof Error ? error : new Error(String(error)));
|
||||
}
|
||||
|
||||
return { fieldsPerPage, errors };
|
||||
};
|
||||
|
||||
const FieldSettingsTypeTranslations: Record<FieldType, MessageDescriptor> = {
|
||||
[FieldType.SIGNATURE]: msg`Signature Settings`,
|
||||
[FieldType.FREE_SIGNATURE]: msg`Free Signature Settings`,
|
||||
@ -72,6 +120,14 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
const { currentEnvelopeItem } = useCurrentEnvelopeRender();
|
||||
|
||||
const { t } = useLingui();
|
||||
const { toast } = useToast();
|
||||
|
||||
const [isDetectingFields, setIsAutoAddingFields] = useState(false);
|
||||
const [processingProgress, setProcessingProgress] = useState<{
|
||||
current: number;
|
||||
total: number;
|
||||
} | null>(null);
|
||||
const [hasAutoPlacedFields, setHasAutoPlacedFields] = useState(false);
|
||||
|
||||
const selectedField = useMemo(
|
||||
() => structuredClone(editorFields.selectedField),
|
||||
@ -85,20 +141,13 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
|
||||
const isMetaSame = isDeepEqual(selectedField.fieldMeta, fieldMeta);
|
||||
|
||||
// Todo: Envelopes - Clean up console logs.
|
||||
if (!isMetaSame) {
|
||||
console.log('TRIGGER UPDATE');
|
||||
editorFields.updateFieldByFormId(selectedField.formId, {
|
||||
fieldMeta,
|
||||
});
|
||||
} else {
|
||||
console.log('DATA IS SAME, NO UPDATE');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the selected recipient to the first recipient in the envelope.
|
||||
*/
|
||||
useEffect(() => {
|
||||
const firstSelectableRecipient = envelope.recipients.find(
|
||||
(recipient) =>
|
||||
@ -108,10 +157,128 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
editorFields.setSelectedRecipient(firstSelectableRecipient?.id ?? null);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasAutoPlacedFields || !currentEnvelopeItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
const storageKey = `autoPlaceFields_${envelope.id}`;
|
||||
const storedData = sessionStorage.getItem(storageKey);
|
||||
|
||||
if (!storedData) {
|
||||
return;
|
||||
}
|
||||
|
||||
sessionStorage.removeItem(storageKey);
|
||||
setHasAutoPlacedFields(true);
|
||||
|
||||
try {
|
||||
const { fields: detectedFields, recipientCount } = JSON.parse(storedData) as {
|
||||
fields: TDetectedFormField[];
|
||||
recipientCount: number;
|
||||
};
|
||||
|
||||
let totalAdded = 0;
|
||||
|
||||
const fieldsPerPage = new Map<number, TDetectedFormField[]>();
|
||||
for (const field of detectedFields) {
|
||||
if (!fieldsPerPage.has(field.pageNumber)) {
|
||||
fieldsPerPage.set(field.pageNumber, []);
|
||||
}
|
||||
fieldsPerPage.get(field.pageNumber)!.push(field);
|
||||
}
|
||||
|
||||
for (const [pageNumber, fields] of fieldsPerPage.entries()) {
|
||||
for (const detected of fields) {
|
||||
const { ymin, xmin, ymax, xmax } = detected.boundingBox;
|
||||
const positionX = (xmin / 1000) * 100;
|
||||
const positionY = (ymin / 1000) * 100;
|
||||
const width = ((xmax - xmin) / 1000) * 100;
|
||||
const height = ((ymax - ymin) / 1000) * 100;
|
||||
|
||||
const fieldType = detected.label as FieldType;
|
||||
const resolvedRecipientId =
|
||||
envelope.recipients.find((recipient) => recipient.id === detected.recipientId)?.id ??
|
||||
editorFields.selectedRecipient?.id ??
|
||||
envelope.recipients[0]?.id;
|
||||
|
||||
if (!resolvedRecipientId) {
|
||||
console.warn('Skipping detected field because no recipient could be resolved', {
|
||||
detectedRecipientId: detected.recipientId,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
editorFields.addField({
|
||||
envelopeItemId: currentEnvelopeItem.id,
|
||||
page: pageNumber,
|
||||
type: fieldType,
|
||||
positionX,
|
||||
positionY,
|
||||
width,
|
||||
height,
|
||||
recipientId: resolvedRecipientId,
|
||||
fieldMeta: structuredClone(FIELD_META_DEFAULT_VALUES[fieldType]),
|
||||
});
|
||||
totalAdded++;
|
||||
} catch (error) {
|
||||
console.error(`Failed to add field on page ${pageNumber}:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (totalAdded > 0) {
|
||||
toast({
|
||||
title: t`Recipients and fields added`,
|
||||
description: t`Added ${recipientCount} ${plural(recipientCount, {
|
||||
one: 'recipient',
|
||||
other: 'recipients',
|
||||
})} and ${totalAdded} ${plural(totalAdded, { one: 'field', other: 'fields' })}`,
|
||||
duration: 5000,
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
title: t`Recipients added`,
|
||||
description: t`Added ${recipientCount} ${plural(recipientCount, {
|
||||
one: 'recipient',
|
||||
other: 'recipients',
|
||||
})}. No fields were detected in the document.`,
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to auto-place fields:', error);
|
||||
toast({
|
||||
title: t`Field placement failed`,
|
||||
description: t`Failed to automatically place fields. You can add them manually.`,
|
||||
variant: 'destructive',
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
}, [
|
||||
currentEnvelopeItem,
|
||||
envelope.id,
|
||||
envelope.recipients,
|
||||
editorFields,
|
||||
hasAutoPlacedFields,
|
||||
t,
|
||||
toast,
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className="relative flex h-full">
|
||||
<div className="flex w-full flex-col overflow-y-auto">
|
||||
<div className="relative flex w-full flex-col overflow-y-auto">
|
||||
{/* Horizontal envelope item selector */}
|
||||
{isDetectingFields && (
|
||||
<>
|
||||
<div className="edge-glow edge-glow-top pointer-events-none fixed left-0 right-0 top-0 z-20 h-32" />
|
||||
<div className="edge-glow edge-glow-right pointer-events-none fixed bottom-0 right-0 top-0 z-20 w-32" />
|
||||
<div className="edge-glow edge-glow-bottom pointer-events-none fixed bottom-0 left-0 right-0 z-20 h-32" />
|
||||
<div className="edge-glow edge-glow-left pointer-events-none fixed bottom-0 left-0 top-0 z-20 w-32" />
|
||||
</>
|
||||
)}
|
||||
|
||||
<EnvelopeRendererFileSelector fields={editorFields.localFields} />
|
||||
|
||||
{/* Document View */}
|
||||
@ -119,7 +286,7 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
{envelope.recipients.length === 0 && (
|
||||
<Alert
|
||||
variant="neutral"
|
||||
className="mb-4 flex max-w-[800px] flex-row items-center justify-between space-y-0 rounded-sm border border-border bg-background"
|
||||
className="border-border bg-background mb-4 flex max-w-[800px] flex-row items-center justify-between space-y-0 rounded-sm border"
|
||||
>
|
||||
<div className="flex flex-col gap-1">
|
||||
<AlertTitle>
|
||||
@ -145,11 +312,11 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-32">
|
||||
<FileTextIcon className="h-10 w-10 text-muted-foreground" />
|
||||
<p className="mt-1 text-sm text-foreground">
|
||||
<FileTextIcon className="text-muted-foreground h-10 w-10" />
|
||||
<p className="text-foreground mt-1 text-sm">
|
||||
<Trans>No documents found</Trans>
|
||||
</p>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-1 text-sm">
|
||||
<Trans>Please upload a document to continue</Trans>
|
||||
</p>
|
||||
</div>
|
||||
@ -159,10 +326,10 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
|
||||
{/* Right Section - Form Fields Panel */}
|
||||
{currentEnvelopeItem && envelope.recipients.length > 0 && (
|
||||
<div className="sticky top-0 h-full w-80 flex-shrink-0 overflow-y-auto border-l border-border bg-background py-4">
|
||||
<div className="bg-background border-border sticky top-0 h-full w-80 flex-shrink-0 overflow-y-auto border-l py-4">
|
||||
{/* Recipient selector section. */}
|
||||
<section className="px-4">
|
||||
<h3 className="mb-2 text-sm font-semibold text-foreground">
|
||||
<h3 className="text-foreground mb-2 text-sm font-semibold">
|
||||
<Trans>Selected Recipient</Trans>
|
||||
</h3>
|
||||
|
||||
@ -194,7 +361,7 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
|
||||
{/* Add fields section. */}
|
||||
<section className="px-4">
|
||||
<h3 className="mb-2 text-sm font-semibold text-foreground">
|
||||
<h3 className="text-foreground mb-2 text-sm font-semibold">
|
||||
<Trans>Add Fields</Trans>
|
||||
</h3>
|
||||
|
||||
@ -202,6 +369,129 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
selectedRecipientId={editorFields.selectedRecipient?.id ?? null}
|
||||
selectedEnvelopeItemId={currentEnvelopeItem?.id ?? null}
|
||||
/>
|
||||
|
||||
<Button
|
||||
className="mt-4 w-full"
|
||||
variant="outline"
|
||||
disabled={isDetectingFields}
|
||||
onClick={async () => {
|
||||
setIsAutoAddingFields(true);
|
||||
setProcessingProgress(null);
|
||||
|
||||
try {
|
||||
if (!currentEnvelopeItem) {
|
||||
toast({
|
||||
title: t`No document selected`,
|
||||
description: t`No document selected. Please reload the page and try again.`,
|
||||
variant: 'destructive',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentEnvelopeItem.documentDataId) {
|
||||
toast({
|
||||
title: t`Document data missing`,
|
||||
description: t`Document data not found. Please try reloading the page.`,
|
||||
variant: 'destructive',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { fieldsPerPage, errors } = await detectFormFieldsInDocument({
|
||||
envelopeId: envelope.id,
|
||||
onProgress: (current, total) => {
|
||||
setProcessingProgress({ current, total });
|
||||
},
|
||||
});
|
||||
|
||||
let totalAdded = 0;
|
||||
for (const [pageNumber, detectedFields] of fieldsPerPage.entries()) {
|
||||
for (const detected of detectedFields) {
|
||||
const { ymin, xmin, ymax, xmax } = detected.boundingBox;
|
||||
const positionX = (xmin / 1000) * 100;
|
||||
const positionY = (ymin / 1000) * 100;
|
||||
const width = ((xmax - xmin) / 1000) * 100;
|
||||
const height = ((ymax - ymin) / 1000) * 100;
|
||||
|
||||
const fieldType = detected.label as FieldType;
|
||||
const resolvedRecipientId =
|
||||
envelope.recipients.find(
|
||||
(recipient) => recipient.id === detected.recipientId,
|
||||
)?.id ??
|
||||
editorFields.selectedRecipient?.id ??
|
||||
envelope.recipients[0]?.id;
|
||||
|
||||
if (!resolvedRecipientId) {
|
||||
console.warn(
|
||||
'Skipping detected field because no recipient could be resolved',
|
||||
{
|
||||
detectedRecipientId: detected.recipientId,
|
||||
},
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
editorFields.addField({
|
||||
envelopeItemId: currentEnvelopeItem.id,
|
||||
page: pageNumber,
|
||||
type: fieldType,
|
||||
positionX,
|
||||
positionY,
|
||||
width,
|
||||
height,
|
||||
recipientId: resolvedRecipientId,
|
||||
fieldMeta: structuredClone(FIELD_META_DEFAULT_VALUES[fieldType]),
|
||||
});
|
||||
totalAdded++;
|
||||
} catch (error) {
|
||||
console.error(`Failed to add field on page ${pageNumber}:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const successfulPages = fieldsPerPage.size;
|
||||
const failedPages = errors.size;
|
||||
|
||||
if (totalAdded > 0) {
|
||||
let description = t`Added ${totalAdded} fields`;
|
||||
if (fieldsPerPage.size > 1) {
|
||||
description = t`Added ${totalAdded} fields across ${successfulPages} pages`;
|
||||
}
|
||||
if (failedPages > 0) {
|
||||
description = t`Added ${totalAdded} fields across ${successfulPages} pages. ${failedPages} pages failed.`;
|
||||
}
|
||||
|
||||
toast({
|
||||
title: t`Fields added`,
|
||||
description,
|
||||
});
|
||||
} else if (failedPages > 0) {
|
||||
toast({
|
||||
title: t`Field detection failed`,
|
||||
description: t`Failed to detect fields on ${failedPages} pages. Please try again.`,
|
||||
variant: 'destructive',
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
title: t`No fields detected`,
|
||||
description: t`No fields were detected in the document`,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: t`Processing error`,
|
||||
description: t`An unexpected error occurred while processing pages.`,
|
||||
variant: 'destructive',
|
||||
});
|
||||
} finally {
|
||||
setIsAutoAddingFields(false);
|
||||
setProcessingProgress(null);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isDetectingFields ? <Trans>Processing...</Trans> : <Trans>Auto add fields</Trans>}
|
||||
</Button>
|
||||
</section>
|
||||
|
||||
{/* Field details section. */}
|
||||
@ -213,25 +503,25 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
{searchParams.get('devmode') && (
|
||||
<>
|
||||
<div className="px-4">
|
||||
<h3 className="mb-3 text-sm font-semibold text-foreground">
|
||||
<h3 className="text-foreground mb-3 text-sm font-semibold">
|
||||
<Trans>Developer Mode</Trans>
|
||||
</h3>
|
||||
|
||||
<div className="space-y-2 rounded-md border border-border bg-muted/50 p-3 text-sm text-foreground">
|
||||
<div className="bg-muted/50 border-border text-foreground space-y-2 rounded-md border p-3 text-sm">
|
||||
<p>
|
||||
<span className="min-w-12 text-muted-foreground">Pos X: </span>
|
||||
<span className="text-muted-foreground min-w-12">Pos X: </span>
|
||||
{selectedField.positionX.toFixed(2)}
|
||||
</p>
|
||||
<p>
|
||||
<span className="min-w-12 text-muted-foreground">Pos Y: </span>
|
||||
<span className="text-muted-foreground min-w-12">Pos Y: </span>
|
||||
{selectedField.positionY.toFixed(2)}
|
||||
</p>
|
||||
<p>
|
||||
<span className="min-w-12 text-muted-foreground">Width: </span>
|
||||
<span className="text-muted-foreground min-w-12">Width: </span>
|
||||
{selectedField.width.toFixed(2)}
|
||||
</p>
|
||||
<p>
|
||||
<span className="min-w-12 text-muted-foreground">Height: </span>
|
||||
<span className="text-muted-foreground min-w-12">Height: </span>
|
||||
{selectedField.height.toFixed(2)}
|
||||
</p>
|
||||
</div>
|
||||
@ -241,7 +531,7 @@ export const EnvelopeEditorFieldsPage = () => {
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="px-4 [&_label]:text-xs [&_label]:text-foreground/70">
|
||||
<div className="[&_label]:text-foreground/70 px-4 [&_label]:text-xs">
|
||||
<h3 className="text-sm font-semibold">
|
||||
{t(FieldSettingsTypeTranslations[selectedField.type])}
|
||||
</h3>
|
||||
|
||||
@ -23,9 +23,7 @@ import { Separator } from '@documenso/ui/primitives/separator';
|
||||
|
||||
import { EnvelopeRendererFileSelector } from './envelope-file-selector';
|
||||
|
||||
const EnvelopeGenericPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-editor/envelope-generic-page-renderer'),
|
||||
);
|
||||
const EnvelopeGenericPageRenderer = lazy(async () => import('./envelope-generic-page-renderer'));
|
||||
|
||||
// Todo: Envelopes - Dynamically import faker
|
||||
export const EnvelopeEditorPreviewPage = () => {
|
||||
@ -234,11 +232,11 @@ export const EnvelopeEditorPreviewPage = () => {
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center py-32">
|
||||
<FileTextIcon className="h-10 w-10 text-muted-foreground" />
|
||||
<p className="mt-1 text-sm text-foreground">
|
||||
<FileTextIcon className="text-muted-foreground h-10 w-10" />
|
||||
<p className="text-foreground mt-1 text-sm">
|
||||
<Trans>No documents found</Trans>
|
||||
</p>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-1 text-sm">
|
||||
<Trans>Please upload a document to continue</Trans>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
|
||||
import type { DropResult } from '@hello-pangea/dnd';
|
||||
import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { DocumentStatus } from '@prisma/client';
|
||||
import { FileWarningIcon, GripVerticalIcon, Loader2 } from 'lucide-react';
|
||||
import { X } from 'lucide-react';
|
||||
import { FileWarningIcon, GripVerticalIcon, Loader2, X } from 'lucide-react';
|
||||
import { ErrorCode as DropzoneErrorCode, type FileRejection } from 'react-dropzone';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
@ -174,7 +173,6 @@ export const EnvelopeEditorUploadPage = () => {
|
||||
fields: envelope.fields.filter((field) => field.envelopeItemId !== envelopeItemId),
|
||||
});
|
||||
|
||||
// Reset editor fields.
|
||||
editorFields.resetForm(fieldsWithoutDeletedItem);
|
||||
};
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ export default function EnvelopeSignerPageRenderer() {
|
||||
|
||||
const handleFieldGroupClick = (e: KonvaEventObject<Event>) => {
|
||||
const currentTarget = e.currentTarget as Konva.Group;
|
||||
const target = e.target as Konva.Shape;
|
||||
const target = e.target;
|
||||
|
||||
const { width: fieldWidth, height: fieldHeight } = fieldGroup.getClientRect();
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { type ReactNode, useState } from 'react';
|
||||
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { plural } from '@lingui/core/macro';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { EnvelopeType } from '@prisma/client';
|
||||
import { Loader } from 'lucide-react';
|
||||
import {
|
||||
@ -27,7 +27,13 @@ import type { TCreateEnvelopePayload } from '@documenso/trpc/server/envelope-rou
|
||||
import { cn } from '@documenso/ui/lib/utils';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
import { RecipientDetectionPromptDialog } from '~/components/dialogs/recipient-detection-prompt-dialog';
|
||||
import { useCurrentTeam } from '~/providers/team';
|
||||
import {
|
||||
type RecipientForCreation,
|
||||
detectRecipientsInDocument,
|
||||
ensureRecipientEmails,
|
||||
} from '~/utils/detect-document-recipients';
|
||||
|
||||
export interface EnvelopeDropZoneWrapperProps {
|
||||
children: ReactNode;
|
||||
@ -52,6 +58,10 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
const organisation = useCurrentOrganisation();
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [showExtractionPrompt, setShowExtractionPrompt] = useState(false);
|
||||
const [uploadedDocumentId, setUploadedDocumentId] = useState<string | null>(null);
|
||||
const [pendingRecipients, setPendingRecipients] = useState<RecipientForCreation[] | null>(null);
|
||||
const [shouldNavigateAfterPromptClose, setShouldNavigateAfterPromptClose] = useState(true);
|
||||
|
||||
const userTimezone =
|
||||
TIME_ZONES.find((timezone) => timezone === Intl.DateTimeFormat().resolvedOptions().timeZone) ??
|
||||
@ -60,6 +70,7 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
const { quota, remaining, refreshLimits, maximumEnvelopeItemCount } = useLimits();
|
||||
|
||||
const { mutateAsync: createEnvelope } = trpc.envelope.create.useMutation();
|
||||
const { mutateAsync: createRecipients } = trpc.envelope.recipient.createMany.useMutation();
|
||||
|
||||
const isUploadDisabled = remaining.documents === 0 || !user.emailVerified;
|
||||
|
||||
@ -108,14 +119,15 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
documentId: id,
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
const pathPrefix =
|
||||
type === EnvelopeType.DOCUMENT
|
||||
? formatDocumentsPath(team.url)
|
||||
: formatTemplatesPath(team.url);
|
||||
|
||||
setUploadedDocumentId(id);
|
||||
setPendingRecipients(null);
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(true);
|
||||
} else {
|
||||
const pathPrefix = formatTemplatesPath(team.url);
|
||||
await navigate(`${pathPrefix}/${id}/edit`);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
@ -132,7 +144,7 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
.otherwise(() => t`An error occurred during upload.`);
|
||||
|
||||
toast({
|
||||
title: t`Error`,
|
||||
title: t`Upload failed`,
|
||||
description: errorMessage,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
@ -161,7 +173,6 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
return;
|
||||
}
|
||||
|
||||
// Since users can only upload only one file (no multi-upload), we only handle the first file rejection
|
||||
const { file, errors } = fileRejections[0];
|
||||
|
||||
if (!errors.length) {
|
||||
@ -201,6 +212,116 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
variant: 'destructive',
|
||||
});
|
||||
};
|
||||
|
||||
const navigateToEnvelopeEditor = () => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pathPrefix = formatDocumentsPath(team.url);
|
||||
void navigate(`${pathPrefix}/${uploadedDocumentId}/edit`);
|
||||
};
|
||||
|
||||
const handleStartRecipientDetection = async () => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const recipients = await detectRecipientsInDocument(uploadedDocumentId);
|
||||
|
||||
if (recipients.length === 0) {
|
||||
toast({
|
||||
title: t`No recipients detected`,
|
||||
description: t`You can add recipients manually in the editor`,
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(false);
|
||||
navigateToEnvelopeEditor();
|
||||
return;
|
||||
}
|
||||
|
||||
const recipientsWithEmails = ensureRecipientEmails(recipients, uploadedDocumentId);
|
||||
|
||||
setPendingRecipients(recipientsWithEmails);
|
||||
setShouldNavigateAfterPromptClose(false);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error && error.message === 'NO_RECIPIENTS_DETECTED')) {
|
||||
const parsedError = AppError.parseError(error);
|
||||
|
||||
toast({
|
||||
title: t`Failed to detect recipients`,
|
||||
description: parsedError.userMessage || t`You can add recipients manually in the editor`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const handleSkipRecipientDetection = () => {
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(false);
|
||||
navigateToEnvelopeEditor();
|
||||
};
|
||||
|
||||
const handleRecipientsConfirm = async (recipientsToCreate: RecipientForCreation[]) => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await createRecipients({
|
||||
envelopeId: uploadedDocumentId,
|
||||
data: recipientsToCreate,
|
||||
});
|
||||
|
||||
toast({
|
||||
title: t`Recipients added`,
|
||||
description: t`Successfully detected ${recipientsToCreate.length} ${plural(
|
||||
recipientsToCreate.length,
|
||||
{
|
||||
one: 'recipient',
|
||||
other: 'recipients',
|
||||
},
|
||||
)}`,
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
setShowExtractionPrompt(false);
|
||||
setPendingRecipients(null);
|
||||
navigateToEnvelopeEditor();
|
||||
} catch (error) {
|
||||
const parsedError = AppError.parseError(error);
|
||||
|
||||
toast({
|
||||
title: t`Failed to add recipients`,
|
||||
description: parsedError.userMessage || t`Please review the recipients and try again`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const handlePromptDialogOpenChange = (open: boolean) => {
|
||||
setShowExtractionPrompt(open);
|
||||
|
||||
if (open) {
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!open && shouldNavigateAfterPromptClose) {
|
||||
navigateToEnvelopeEditor();
|
||||
}
|
||||
};
|
||||
|
||||
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
||||
accept: {
|
||||
'application/pdf': ['.pdf'],
|
||||
@ -267,6 +388,15 @@ export const EnvelopeDropZoneWrapper = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<RecipientDetectionPromptDialog
|
||||
open={showExtractionPrompt}
|
||||
onOpenChange={handlePromptDialogOpenChange}
|
||||
onAccept={handleStartRecipientDetection}
|
||||
onSkip={handleSkipRecipientDetection}
|
||||
recipients={pendingRecipients}
|
||||
onRecipientsSubmit={handleRecipientsConfirm}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { msg, plural } from '@lingui/core/macro';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { EnvelopeType } from '@prisma/client';
|
||||
@ -27,7 +27,14 @@ import {
|
||||
} from '@documenso/ui/primitives/tooltip';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
import { RecipientDetectionPromptDialog } from '~/components/dialogs/recipient-detection-prompt-dialog';
|
||||
import { useCurrentTeam } from '~/providers/team';
|
||||
import { detectFieldsInDocument } from '~/utils/detect-document-fields';
|
||||
import {
|
||||
type RecipientForCreation,
|
||||
detectRecipientsInDocument,
|
||||
ensureRecipientEmails,
|
||||
} from '~/utils/detect-document-recipients';
|
||||
|
||||
export type EnvelopeUploadButtonProps = {
|
||||
className?: string;
|
||||
@ -35,9 +42,6 @@ export type EnvelopeUploadButtonProps = {
|
||||
folderId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Upload an envelope
|
||||
*/
|
||||
export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUploadButtonProps) => {
|
||||
const { t } = useLingui();
|
||||
const { toast } = useToast();
|
||||
@ -55,8 +59,14 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
|
||||
const { quota, remaining, refreshLimits, maximumEnvelopeItemCount } = useLimits();
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [showExtractionPrompt, setShowExtractionPrompt] = useState(false);
|
||||
const [uploadedDocumentId, setUploadedDocumentId] = useState<string | null>(null);
|
||||
const [pendingRecipients, setPendingRecipients] = useState<RecipientForCreation[] | null>(null);
|
||||
const [shouldNavigateAfterPromptClose, setShouldNavigateAfterPromptClose] = useState(true);
|
||||
const [isAutoAddingFields, setIsAutoAddingFields] = useState(false);
|
||||
|
||||
const { mutateAsync: createEnvelope } = trpc.envelope.create.useMutation();
|
||||
const { mutateAsync: createRecipients } = trpc.envelope.recipient.createMany.useMutation();
|
||||
|
||||
const disabledMessage = useMemo(() => {
|
||||
if (organisation.subscription && remaining.documents === 0) {
|
||||
@ -108,16 +118,26 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
|
||||
? formatDocumentsPath(team.url)
|
||||
: formatTemplatesPath(team.url);
|
||||
|
||||
if (type === EnvelopeType.DOCUMENT) {
|
||||
setUploadedDocumentId(id);
|
||||
setPendingRecipients(null);
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(true);
|
||||
|
||||
toast({
|
||||
title: t`Document uploaded`,
|
||||
description: t`Your document has been uploaded successfully.`,
|
||||
duration: 5000,
|
||||
});
|
||||
} else {
|
||||
await navigate(`${pathPrefix}/${id}/edit`);
|
||||
|
||||
toast({
|
||||
title: type === EnvelopeType.DOCUMENT ? t`Document uploaded` : t`Template uploaded`,
|
||||
description:
|
||||
type === EnvelopeType.DOCUMENT
|
||||
? t`Your document has been uploaded successfully.`
|
||||
: t`Your template has been uploaded successfully.`,
|
||||
title: t`Template uploaded`,
|
||||
description: t`Your template has been uploaded successfully.`,
|
||||
duration: 5000,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
@ -136,7 +156,7 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
|
||||
.otherwise(() => t`An error occurred while uploading your document.`);
|
||||
|
||||
toast({
|
||||
title: t`Error`,
|
||||
title: t`Upload failed`,
|
||||
description: errorMessage,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
@ -169,6 +189,181 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
|
||||
});
|
||||
};
|
||||
|
||||
const navigateToEnvelopeEditor = () => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pathPrefix = formatDocumentsPath(team.url);
|
||||
void navigate(`${pathPrefix}/${uploadedDocumentId}/edit`);
|
||||
};
|
||||
|
||||
const handleStartRecipientDetection = async () => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const recipients = await detectRecipientsInDocument(uploadedDocumentId);
|
||||
|
||||
if (recipients.length === 0) {
|
||||
toast({
|
||||
title: t`No recipients detected`,
|
||||
description: t`You can add recipients manually in the editor`,
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(false);
|
||||
navigateToEnvelopeEditor();
|
||||
return;
|
||||
}
|
||||
|
||||
const recipientsWithEmails = ensureRecipientEmails(recipients, uploadedDocumentId);
|
||||
|
||||
setPendingRecipients(recipientsWithEmails);
|
||||
setShouldNavigateAfterPromptClose(false);
|
||||
} catch (err) {
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
// Only show toast if this wasn't a "no recipients found" case
|
||||
if (error.code !== 'NO_RECIPIENTS_DETECTED') {
|
||||
toast({
|
||||
title: t`Failed to analyze recipients`,
|
||||
description: error.userMessage || t`You can add recipients manually in the editor`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const handleSkipRecipientDetection = () => {
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
setShowExtractionPrompt(false);
|
||||
navigateToEnvelopeEditor();
|
||||
};
|
||||
|
||||
const handleRecipientsConfirm = async (recipientsToCreate: RecipientForCreation[]) => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await createRecipients({
|
||||
envelopeId: uploadedDocumentId,
|
||||
data: recipientsToCreate,
|
||||
});
|
||||
|
||||
toast({
|
||||
title: t`Recipients added`,
|
||||
description: t`Successfully detected ${recipientsToCreate.length} ${plural(
|
||||
recipientsToCreate.length,
|
||||
{
|
||||
one: 'recipient',
|
||||
other: 'recipients',
|
||||
},
|
||||
)}`,
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
setShowExtractionPrompt(false);
|
||||
setPendingRecipients(null);
|
||||
navigateToEnvelopeEditor();
|
||||
} catch (err) {
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
toast({
|
||||
title: t`Failed to add recipients`,
|
||||
description: error.userMessage || t`Please review the recipients and try again`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
|
||||
// Error is handled, dialog stays open for retry
|
||||
}
|
||||
};
|
||||
|
||||
const handleAutoAddFields = async (recipientsToCreate: RecipientForCreation[]) => {
|
||||
if (!uploadedDocumentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
setIsAutoAddingFields(true);
|
||||
|
||||
try {
|
||||
await createRecipients({
|
||||
envelopeId: uploadedDocumentId,
|
||||
data: recipientsToCreate,
|
||||
});
|
||||
|
||||
let detectedFields;
|
||||
try {
|
||||
detectedFields = await detectFieldsInDocument(uploadedDocumentId);
|
||||
} catch (error) {
|
||||
console.error('Field detection failed:', error);
|
||||
|
||||
toast({
|
||||
title: t`Field detection failed`,
|
||||
description: t`Recipients added successfully, but field detection encountered an error. You can add fields manually.`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
|
||||
setShowExtractionPrompt(false);
|
||||
setPendingRecipients(null);
|
||||
setIsAutoAddingFields(false);
|
||||
|
||||
const pathPrefix = formatDocumentsPath(team.url);
|
||||
void navigate(`${pathPrefix}/${uploadedDocumentId}/edit?step=addFields`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (detectedFields.length > 0) {
|
||||
sessionStorage.setItem(
|
||||
`autoPlaceFields_${uploadedDocumentId}`,
|
||||
JSON.stringify({
|
||||
fields: detectedFields,
|
||||
recipientCount: recipientsToCreate.length,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
setShowExtractionPrompt(false);
|
||||
setPendingRecipients(null);
|
||||
setIsAutoAddingFields(false);
|
||||
|
||||
const pathPrefix = formatDocumentsPath(team.url);
|
||||
void navigate(`${pathPrefix}/${uploadedDocumentId}/edit?step=addFields`);
|
||||
} catch (err) {
|
||||
const error = AppError.parseError(err);
|
||||
|
||||
toast({
|
||||
title: t`Failed to add recipients`,
|
||||
description: error.userMessage || t`Please try again`,
|
||||
variant: 'destructive',
|
||||
duration: 7500,
|
||||
});
|
||||
|
||||
setIsAutoAddingFields(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handlePromptDialogOpenChange = (open: boolean) => {
|
||||
setShowExtractionPrompt(open);
|
||||
|
||||
if (open) {
|
||||
setShouldNavigateAfterPromptClose(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!open && shouldNavigateAfterPromptClose) {
|
||||
navigateToEnvelopeEditor();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={cn('relative', className)}>
|
||||
<TooltipProvider>
|
||||
@ -201,6 +396,17 @@ export const EnvelopeUploadButton = ({ className, type, folderId }: EnvelopeUplo
|
||||
)}
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
<RecipientDetectionPromptDialog
|
||||
open={showExtractionPrompt}
|
||||
onOpenChange={handlePromptDialogOpenChange}
|
||||
onAccept={handleStartRecipientDetection}
|
||||
onSkip={handleSkipRecipientDetection}
|
||||
recipients={pendingRecipients}
|
||||
onRecipientsSubmit={handleRecipientsConfirm}
|
||||
onAutoAddFields={handleAutoAddFields}
|
||||
isProcessingRecipients={isAutoAddingFields}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@ import { cn } from '@documenso/ui/lib/utils';
|
||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||
import { DocumentFlowFormContainer } from '@documenso/ui/primitives/document-flow/document-flow-root';
|
||||
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { Stepper } from '@documenso/ui/primitives/stepper';
|
||||
import { AddTemplateFieldsFormPartial } from '@documenso/ui/primitives/template-flow/add-template-fields';
|
||||
import type { TAddTemplateFieldsFormSchema } from '@documenso/ui/primitives/template-flow/add-template-fields.types';
|
||||
@ -312,7 +312,7 @@ export const TemplateEditForm = ({
|
||||
gradient
|
||||
>
|
||||
<CardContent className="p-2">
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
key={template.envelopeItems[0].id}
|
||||
envelopeItem={template.envelopeItems[0]}
|
||||
token={undefined}
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import Plausible from 'plausible-tracker';
|
||||
import {
|
||||
Links,
|
||||
Meta,
|
||||
@ -14,7 +17,7 @@ import { PreventFlashOnWrongTheme, ThemeProvider, useTheme } from 'remix-themes'
|
||||
import { getOptionalSession } from '@documenso/auth/server/lib/utils/get-session';
|
||||
import { SessionProvider } from '@documenso/lib/client-only/providers/session';
|
||||
import { APP_I18N_OPTIONS, type SupportedLanguageCodes } from '@documenso/lib/constants/i18n';
|
||||
import { createPublicEnv } from '@documenso/lib/utils/env';
|
||||
import { createPublicEnv, env } from '@documenso/lib/utils/env';
|
||||
import { extractLocaleData } from '@documenso/lib/utils/i18n';
|
||||
import { TrpcProvider } from '@documenso/trpc/react';
|
||||
import { getOrganisationSession } from '@documenso/trpc/server/organisation-router/get-organisation-session';
|
||||
@ -28,6 +31,11 @@ import { langCookie } from './storage/lang-cookie.server';
|
||||
import { themeSessionResolver } from './storage/theme-session.server';
|
||||
import { appMetaTags } from './utils/meta';
|
||||
|
||||
const { trackPageview } = Plausible({
|
||||
domain: 'documenso.com',
|
||||
trackLocalhost: false,
|
||||
});
|
||||
|
||||
export const links: Route.LinksFunction = () => [{ rel: 'stylesheet', href: stylesheet }];
|
||||
|
||||
export function meta() {
|
||||
@ -84,6 +92,12 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (env('NODE_ENV') === 'production') {
|
||||
trackPageview();
|
||||
}
|
||||
}, [location.pathname]);
|
||||
|
||||
return (
|
||||
<ThemeProvider specifiedTheme={theme} themeAction="/api/theme">
|
||||
<LayoutContent>{children}</LayoutContent>
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import { lazy } from 'react';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { Plural, Trans, useLingui } from '@lingui/react/macro';
|
||||
import { DocumentStatus } from '@prisma/client';
|
||||
@ -21,7 +19,7 @@ import { cn } from '@documenso/ui/lib/utils';
|
||||
import { Badge } from '@documenso/ui/primitives/badge';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { Spinner } from '@documenso/ui/primitives/spinner';
|
||||
|
||||
import { DocumentPageViewButton } from '~/components/general/document/document-page-view-button';
|
||||
@ -35,16 +33,13 @@ import {
|
||||
FRIENDLY_STATUS_MAP,
|
||||
} from '~/components/general/document/document-status';
|
||||
import { EnvelopeRendererFileSelector } from '~/components/general/envelope-editor/envelope-file-selector';
|
||||
import EnvelopeGenericPageRenderer from '~/components/general/envelope-editor/envelope-generic-page-renderer';
|
||||
import { GenericErrorLayout } from '~/components/general/generic-error-layout';
|
||||
import { StackAvatarsWithTooltip } from '~/components/general/stack-avatars-with-tooltip';
|
||||
import { useCurrentTeam } from '~/providers/team';
|
||||
|
||||
import type { Route } from './+types/documents.$id._index';
|
||||
|
||||
const EnvelopeGenericPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-editor/envelope-generic-page-renderer'),
|
||||
);
|
||||
|
||||
export default function DocumentPage({ params }: Route.ComponentProps) {
|
||||
const { t } = useLingui();
|
||||
const { user } = useSession();
|
||||
@ -61,7 +56,7 @@ export default function DocumentPage({ params }: Route.ComponentProps) {
|
||||
|
||||
if (isLoadingEnvelope) {
|
||||
return (
|
||||
<div className="flex w-screen flex-col items-center justify-center gap-2 py-64 text-foreground">
|
||||
<div className="text-foreground flex w-screen flex-col items-center justify-center gap-2 py-64">
|
||||
<Spinner />
|
||||
<Trans>Loading</Trans>
|
||||
</div>
|
||||
@ -122,7 +117,7 @@ export default function DocumentPage({ params }: Route.ComponentProps) {
|
||||
/>
|
||||
|
||||
{envelope.recipients.length > 0 && (
|
||||
<div className="flex items-center text-muted-foreground">
|
||||
<div className="text-muted-foreground flex items-center">
|
||||
<Users2 className="mr-2 h-5 w-5" />
|
||||
|
||||
<StackAvatarsWithTooltip
|
||||
@ -193,7 +188,7 @@ export default function DocumentPage({ params }: Route.ComponentProps) {
|
||||
/>
|
||||
)}
|
||||
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
envelopeItem={envelope.envelopeItems[0]}
|
||||
token={undefined}
|
||||
key={envelope.envelopeItems[0].id}
|
||||
@ -207,16 +202,16 @@ export default function DocumentPage({ params }: Route.ComponentProps) {
|
||||
className={cn('col-span-12 lg:col-span-6 xl:col-span-5', isMultiEnvelopeItem && 'mt-20')}
|
||||
>
|
||||
<div className="space-y-6">
|
||||
<section className="flex flex-col rounded-xl border border-border bg-widget pb-4 pt-6">
|
||||
<section className="border-border bg-widget flex flex-col rounded-xl border pb-4 pt-6">
|
||||
<div className="flex flex-row items-center justify-between px-4">
|
||||
<h3 className="text-2xl font-semibold text-foreground">
|
||||
<h3 className="text-foreground text-2xl font-semibold">
|
||||
{t(FRIENDLY_STATUS_MAP[envelope.status].labelExtended)}
|
||||
</h3>
|
||||
|
||||
<DocumentPageViewDropdown envelope={envelope} />
|
||||
</div>
|
||||
|
||||
<p className="mt-2 px-4 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 px-4 text-sm">
|
||||
{match(envelope.status)
|
||||
.with(DocumentStatus.COMPLETED, () => (
|
||||
<Trans>This document has been signed by all recipients</Trans>
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import { lazy } from 'react';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { Trans, useLingui } from '@lingui/react/macro';
|
||||
import { DocumentSigningOrder, SigningStatus } from '@prisma/client';
|
||||
@ -16,13 +14,14 @@ import PDFViewerKonvaLazy from '@documenso/ui/components/pdf-viewer/pdf-viewer-k
|
||||
import { cn } from '@documenso/ui/lib/utils';
|
||||
import { Button } from '@documenso/ui/primitives/button';
|
||||
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
||||
import { PDFViewerLazy } from '@documenso/ui/primitives/pdf-viewer/lazy';
|
||||
import { PDFViewer } from '@documenso/ui/primitives/pdf-viewer';
|
||||
import { Spinner } from '@documenso/ui/primitives/spinner';
|
||||
|
||||
import { TemplateBulkSendDialog } from '~/components/dialogs/template-bulk-send-dialog';
|
||||
import { TemplateDirectLinkDialog } from '~/components/dialogs/template-direct-link-dialog';
|
||||
import { TemplateUseDialog } from '~/components/dialogs/template-use-dialog';
|
||||
import { EnvelopeRendererFileSelector } from '~/components/general/envelope-editor/envelope-file-selector';
|
||||
import EnvelopeGenericPageRenderer from '~/components/general/envelope-editor/envelope-generic-page-renderer';
|
||||
import { GenericErrorLayout } from '~/components/general/generic-error-layout';
|
||||
import { TemplateDirectLinkBadge } from '~/components/general/template/template-direct-link-badge';
|
||||
import { TemplatePageViewDocumentsTable } from '~/components/general/template/template-page-view-documents-table';
|
||||
@ -35,10 +34,6 @@ import { useCurrentTeam } from '~/providers/team';
|
||||
|
||||
import type { Route } from './+types/templates.$id._index';
|
||||
|
||||
const EnvelopeGenericPageRenderer = lazy(
|
||||
async () => import('~/components/general/envelope-editor/envelope-generic-page-renderer'),
|
||||
);
|
||||
|
||||
export default function TemplatePage({ params }: Route.ComponentProps) {
|
||||
const { t } = useLingui();
|
||||
const { user } = useSession();
|
||||
@ -56,7 +51,7 @@ export default function TemplatePage({ params }: Route.ComponentProps) {
|
||||
|
||||
if (isLoadingEnvelope) {
|
||||
return (
|
||||
<div className="flex w-screen flex-col items-center justify-center gap-2 py-64 text-foreground">
|
||||
<div className="text-foreground flex w-screen flex-col items-center justify-center gap-2 py-64">
|
||||
<Spinner />
|
||||
<Trans>Loading</Trans>
|
||||
</div>
|
||||
@ -210,7 +205,7 @@ export default function TemplatePage({ params }: Route.ComponentProps) {
|
||||
documentMeta={mockedDocumentMeta}
|
||||
/>
|
||||
|
||||
<PDFViewerLazy
|
||||
<PDFViewer
|
||||
envelopeItem={envelope.envelopeItems[0]}
|
||||
token={undefined}
|
||||
version="signed"
|
||||
@ -224,9 +219,9 @@ export default function TemplatePage({ params }: Route.ComponentProps) {
|
||||
className={cn('col-span-12 lg:col-span-6 xl:col-span-5', isMultiEnvelopeItem && 'mt-20')}
|
||||
>
|
||||
<div className="space-y-6">
|
||||
<section className="flex flex-col rounded-xl border border-border bg-widget pb-4 pt-6">
|
||||
<section className="border-border bg-widget flex flex-col rounded-xl border pb-4 pt-6">
|
||||
<div className="flex flex-row items-center justify-between px-4">
|
||||
<h3 className="text-2xl font-semibold text-foreground">
|
||||
<h3 className="text-foreground text-2xl font-semibold">
|
||||
<Trans>Template</Trans>
|
||||
</h3>
|
||||
|
||||
@ -244,7 +239,7 @@ export default function TemplatePage({ params }: Route.ComponentProps) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="mt-2 px-4 text-sm text-muted-foreground">
|
||||
<p className="text-muted-foreground mt-2 px-4 text-sm">
|
||||
<Trans>Manage and view template</Trans>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { useLingui } from '@lingui/react';
|
||||
import { Trans } from '@lingui/react/macro';
|
||||
import { DocumentStatus, FieldType, RecipientRole } from '@prisma/client';
|
||||
import { CheckCircle2, Clock8, DownloadIcon, Loader2 } from 'lucide-react';
|
||||
import { Link } from 'react-router';
|
||||
import { CheckCircle2, Clock8, DownloadIcon } from 'lucide-react';
|
||||
import { Link, useRevalidator } from 'react-router';
|
||||
import { match } from 'ts-pattern';
|
||||
|
||||
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||
@ -16,7 +18,7 @@ import { getRecipientSignatures } from '@documenso/lib/server-only/recipient/get
|
||||
import { getUserByEmail } from '@documenso/lib/server-only/user/get-user-by-email';
|
||||
import { isDocumentCompleted } from '@documenso/lib/utils/document';
|
||||
import { env } from '@documenso/lib/utils/env';
|
||||
import { trpc } from '@documenso/trpc/react';
|
||||
import type { Document } from '@documenso/prisma/types/document-legacy-schema';
|
||||
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
|
||||
import { SigningCard3D } from '@documenso/ui/components/signing-card';
|
||||
import { cn } from '@documenso/ui/lib/utils';
|
||||
@ -82,13 +84,6 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
||||
|
||||
const canSignUp = !isExistingUser && env('NEXT_PUBLIC_DISABLE_SIGNUP') !== 'true';
|
||||
|
||||
const canRedirectToFolder =
|
||||
user && document.userId === user.id && document.folderId && document.team?.url;
|
||||
|
||||
const returnToHomePath = canRedirectToFolder
|
||||
? `/t/${document.team.url}/documents/f/${document.folderId}`
|
||||
: '/';
|
||||
|
||||
return {
|
||||
isDocumentAccessValid: true,
|
||||
canSignUp,
|
||||
@ -97,7 +92,6 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
||||
signatures,
|
||||
document,
|
||||
recipient,
|
||||
returnToHomePath,
|
||||
};
|
||||
}
|
||||
|
||||
@ -115,27 +109,8 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
document,
|
||||
recipient,
|
||||
recipientEmail,
|
||||
returnToHomePath,
|
||||
} = loaderData;
|
||||
|
||||
// Poll signing status every few seconds
|
||||
const { data: signingStatusData } = trpc.envelope.signingStatus.useQuery(
|
||||
{
|
||||
token: recipient?.token || '',
|
||||
},
|
||||
{
|
||||
refetchInterval: 3000,
|
||||
initialData: match(document?.status)
|
||||
.with(DocumentStatus.COMPLETED, () => ({ status: 'COMPLETED' }) as const)
|
||||
.with(DocumentStatus.REJECTED, () => ({ status: 'REJECTED' }) as const)
|
||||
.with(DocumentStatus.PENDING, () => ({ status: 'PENDING' }) as const)
|
||||
.otherwise(() => ({ status: 'PENDING' }) as const),
|
||||
},
|
||||
);
|
||||
|
||||
// Use signing status from query if available, otherwise fall back to document status
|
||||
const signingStatus = signingStatusData?.status ?? 'PENDING';
|
||||
|
||||
if (!isDocumentAccessValid) {
|
||||
return <DocumentSigningAuthPageView email={recipientEmail} />;
|
||||
}
|
||||
@ -143,7 +118,7 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'-mx-4 flex flex-col items-center overflow-hidden px-4 pt-16 md:-mx-8 md:px-8 lg:pt-20 xl:pt-28',
|
||||
'-mx-4 flex flex-col items-center overflow-hidden px-4 pt-24 md:-mx-8 md:px-8 lg:pt-36 xl:pt-44',
|
||||
{ 'pt-0 lg:pt-0 xl:pt-0': canSignUp },
|
||||
)}
|
||||
>
|
||||
@ -177,23 +152,15 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
{recipient.role === RecipientRole.APPROVER && <Trans>Document Approved</Trans>}
|
||||
</h2>
|
||||
|
||||
{match({ status: signingStatus, deletedAt: document.deletedAt })
|
||||
.with({ status: 'COMPLETED' }, () => (
|
||||
<div className="mt-4 flex items-center text-center text-documenso-700">
|
||||
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||
<div className="text-documenso-700 mt-4 flex items-center text-center">
|
||||
<CheckCircle2 className="mr-2 h-5 w-5" />
|
||||
<span className="text-sm">
|
||||
<Trans>Everyone has signed</Trans>
|
||||
</span>
|
||||
</div>
|
||||
))
|
||||
.with({ status: 'PROCESSING' }, () => (
|
||||
<div className="mt-4 flex items-center text-center text-orange-600">
|
||||
<Loader2 className="mr-2 h-5 w-5 animate-spin" />
|
||||
<span className="text-sm">
|
||||
<Trans>Processing document</Trans>
|
||||
</span>
|
||||
</div>
|
||||
))
|
||||
.with({ deletedAt: null }, () => (
|
||||
<div className="mt-4 flex items-center text-center text-blue-600">
|
||||
<Clock8 className="mr-2 h-5 w-5" />
|
||||
@ -211,31 +178,23 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
</div>
|
||||
))}
|
||||
|
||||
{match({ status: signingStatus, deletedAt: document.deletedAt })
|
||||
.with({ status: 'COMPLETED' }, () => (
|
||||
<p className="mt-2.5 max-w-[60ch] text-center text-sm font-medium text-muted-foreground/60 md:text-base">
|
||||
{match({ status: document.status, deletedAt: document.deletedAt })
|
||||
.with({ status: DocumentStatus.COMPLETED }, () => (
|
||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||
<Trans>
|
||||
Everyone has signed! You will receive an email copy of the signed document.
|
||||
</Trans>
|
||||
</p>
|
||||
))
|
||||
.with({ status: 'PROCESSING' }, () => (
|
||||
<p className="mt-2.5 max-w-[60ch] text-center text-sm font-medium text-muted-foreground/60 md:text-base">
|
||||
<Trans>
|
||||
All recipients have signed. The document is being processed and you will receive
|
||||
an email copy shortly.
|
||||
Everyone has signed! You will receive an Email copy of the signed document.
|
||||
</Trans>
|
||||
</p>
|
||||
))
|
||||
.with({ deletedAt: null }, () => (
|
||||
<p className="mt-2.5 max-w-[60ch] text-center text-sm font-medium text-muted-foreground/60 md:text-base">
|
||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||
<Trans>
|
||||
You will receive an email copy of the signed document once everyone has signed.
|
||||
You will receive an Email copy of the signed document once everyone has signed.
|
||||
</Trans>
|
||||
</p>
|
||||
))
|
||||
.otherwise(() => (
|
||||
<p className="mt-2.5 max-w-[60ch] text-center text-sm font-medium text-muted-foreground/60 md:text-base">
|
||||
<p className="text-muted-foreground/60 mt-2.5 max-w-[60ch] text-center text-sm font-medium md:text-base">
|
||||
<Trans>
|
||||
This document has been cancelled by the owner and is no longer available for
|
||||
others to sign.
|
||||
@ -243,35 +202,23 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
</p>
|
||||
))}
|
||||
|
||||
<div className="mt-8 flex w-full max-w-xs flex-col items-stretch gap-4 md:w-auto md:max-w-none md:flex-row md:items-center">
|
||||
<DocumentShareButton
|
||||
documentId={document.id}
|
||||
token={recipient.token}
|
||||
className="w-full max-w-none md:flex-1"
|
||||
/>
|
||||
<div className="mt-8 flex w-full max-w-sm items-center justify-center gap-4">
|
||||
<DocumentShareButton documentId={document.id} token={recipient.token} />
|
||||
|
||||
{isDocumentCompleted(document) && (
|
||||
{isDocumentCompleted(document.status) && (
|
||||
<EnvelopeDownloadDialog
|
||||
envelopeId={document.envelopeId}
|
||||
envelopeStatus={document.status}
|
||||
envelopeItems={document.envelopeItems}
|
||||
token={recipient?.token}
|
||||
trigger={
|
||||
<Button type="button" variant="outline" className="flex-1 md:flex-initial">
|
||||
<Button type="button" variant="outline" className="flex-1">
|
||||
<DownloadIcon className="mr-2 h-5 w-5" />
|
||||
<Trans>Download</Trans>
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
{user && (
|
||||
<Button asChild>
|
||||
<Link to={returnToHomePath}>
|
||||
<Trans>Go Back Home</Trans>
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -282,7 +229,7 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
<Trans>Need to sign documents?</Trans>
|
||||
</h2>
|
||||
|
||||
<p className="mt-4 max-w-[55ch] text-center leading-normal text-muted-foreground/60">
|
||||
<p className="text-muted-foreground/60 mt-4 max-w-[55ch] text-center leading-normal">
|
||||
<Trans>
|
||||
Create your account and start using state-of-the-art document signing.
|
||||
</Trans>
|
||||
@ -291,8 +238,41 @@ export default function CompletedSigningPage({ loaderData }: Route.ComponentProp
|
||||
<ClaimAccount defaultName={recipientName} defaultEmail={recipient.email} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{user && (
|
||||
<Link to="/" className="text-documenso-700 hover:text-documenso-600 mt-2">
|
||||
<Trans>Go Back Home</Trans>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PollUntilDocumentCompleted document={document} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export type PollUntilDocumentCompletedProps = {
|
||||
document: Pick<Document, 'id' | 'status' | 'deletedAt'>;
|
||||
};
|
||||
|
||||
export const PollUntilDocumentCompleted = ({ document }: PollUntilDocumentCompletedProps) => {
|
||||
const { revalidate } = useRevalidator();
|
||||
|
||||
useEffect(() => {
|
||||
if (isDocumentCompleted(document.status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (window.document.hasFocus()) {
|
||||
void revalidate();
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [document.status]);
|
||||
|
||||
return <></>;
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@ import sharp from 'sharp';
|
||||
import { getFileServerSide } from '@documenso/lib/universal/upload/get-file.server';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
import type { Route } from './+types/branding.logo.organisation.$orgId';
|
||||
import type { Route } from './+types/branding.logo.team.$teamId';
|
||||
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const organisationId = params.orgId;
|
||||
@ -69,7 +69,7 @@ export async function loader({ params }: Route.LoaderArgs) {
|
||||
})
|
||||
.toBuffer();
|
||||
|
||||
return new Response(Buffer.from(img), {
|
||||
return new Response(img, {
|
||||
headers: {
|
||||
'Content-Type': 'image/png',
|
||||
'Content-Length': img.length.toString(),
|
||||
|
||||
@ -75,7 +75,6 @@ export const loader = async ({ request, params }: Route.LoaderArgs) => {
|
||||
}));
|
||||
|
||||
return {
|
||||
token,
|
||||
document: {
|
||||
...document,
|
||||
fields,
|
||||
@ -87,7 +86,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
||||
const { _ } = useLingui();
|
||||
const { toast } = useToast();
|
||||
|
||||
const { document, token } = useLoaderData<typeof loader>();
|
||||
const { document } = useLoaderData<typeof loader>();
|
||||
|
||||
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
||||
|
||||
@ -322,8 +321,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
||||
|
||||
<ConfigureFieldsView
|
||||
configData={configuration!}
|
||||
presignToken={token}
|
||||
envelopeItem={document.envelopeItems[0]}
|
||||
documentData={document.documentData}
|
||||
defaultValues={fields ?? undefined}
|
||||
onBack={canGoBack ? handleBackToConfig : undefined}
|
||||
onSubmit={handleConfigureFieldsSubmit}
|
||||
|
||||
@ -75,7 +75,6 @@ export const loader = async ({ request, params }: Route.LoaderArgs) => {
|
||||
}));
|
||||
|
||||
return {
|
||||
token,
|
||||
template: {
|
||||
...template,
|
||||
fields,
|
||||
@ -87,7 +86,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
||||
const { _ } = useLingui();
|
||||
const { toast } = useToast();
|
||||
|
||||
const { template, token } = useLoaderData<typeof loader>();
|
||||
const { template } = useLoaderData<typeof loader>();
|
||||
|
||||
const [hasFinishedInit, setHasFinishedInit] = useState(false);
|
||||
|
||||
@ -322,8 +321,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
||||
|
||||
<ConfigureFieldsView
|
||||
configData={configuration!}
|
||||
presignToken={token}
|
||||
envelopeItem={template.envelopeItems[0]}
|
||||
documentData={template.templateDocumentData}
|
||||
defaultValues={fields ?? undefined}
|
||||
onBack={canGoBack ? handleBackToConfig : undefined}
|
||||
onSubmit={handleConfigureFieldsSubmit}
|
||||
|
||||
39
apps/remix/app/utils/detect-document-fields.ts
Normal file
39
apps/remix/app/utils/detect-document-fields.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import type { TDetectedFormField } from '@documenso/lib/types/document-analysis';
|
||||
|
||||
export const detectFieldsInDocument = async (envelopeId: string): Promise<TDetectedFormField[]> => {
|
||||
const response = await fetch('/api/ai/detect-fields', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ envelopeId }),
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
|
||||
console.error('Field detection failed:', {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
error: errorText,
|
||||
});
|
||||
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: `Field detection failed: ${response.statusText}`,
|
||||
userMessage: 'Failed to detect fields in the document. Please try adding fields manually.',
|
||||
});
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!Array.isArray(data)) {
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: 'Invalid response from field detection API - expected array',
|
||||
userMessage: 'Failed to detect fields in the document. Please try again.',
|
||||
});
|
||||
}
|
||||
|
||||
return data;
|
||||
};
|
||||
67
apps/remix/app/utils/detect-document-recipients.ts
Normal file
67
apps/remix/app/utils/detect-document-recipients.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { RecipientRole } from '@prisma/client';
|
||||
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
|
||||
export type SuggestedRecipient = {
|
||||
name: string;
|
||||
email?: string;
|
||||
role: 'SIGNER' | 'APPROVER' | 'CC';
|
||||
signingOrder?: number;
|
||||
};
|
||||
|
||||
export const detectRecipientsInDocument = async (
|
||||
envelopeId: string,
|
||||
): Promise<SuggestedRecipient[]> => {
|
||||
try {
|
||||
const response = await fetch('/api/ai/detect-recipients', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ envelopeId }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: 'Failed to detect recipients',
|
||||
});
|
||||
}
|
||||
|
||||
return (await response.json()) as SuggestedRecipient[];
|
||||
} catch (error) {
|
||||
throw AppError.parseError(error);
|
||||
}
|
||||
};
|
||||
|
||||
export type RecipientForCreation = {
|
||||
name: string;
|
||||
email: string;
|
||||
role: RecipientRole;
|
||||
signingOrder?: number;
|
||||
};
|
||||
|
||||
export const ensureRecipientEmails = (
|
||||
recipients: SuggestedRecipient[],
|
||||
envelopeId: string,
|
||||
): RecipientForCreation[] => {
|
||||
const allowedRoles: RecipientRole[] = [
|
||||
RecipientRole.SIGNER,
|
||||
RecipientRole.APPROVER,
|
||||
RecipientRole.CC,
|
||||
];
|
||||
|
||||
return recipients.map((recipient) => {
|
||||
const email = recipient.email ?? '';
|
||||
|
||||
const candidateRole = recipient.role as RecipientRole;
|
||||
const normalizedRole = allowedRoles.includes(candidateRole)
|
||||
? candidateRole
|
||||
: RecipientRole.SIGNER;
|
||||
|
||||
return {
|
||||
...recipient,
|
||||
email,
|
||||
role: normalizedRole,
|
||||
};
|
||||
});
|
||||
};
|
||||
@ -14,7 +14,9 @@
|
||||
"with:env": "dotenv -e ../../.env -e ../../.env.local --"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cantoo/pdf-lib": "^2.5.3",
|
||||
"@ai-sdk/google": "^2.0.25",
|
||||
"@ai-sdk/react": "^2.0.82",
|
||||
"@cantoo/pdf-lib": "^2.5.2",
|
||||
"@documenso/api": "*",
|
||||
"@documenso/assets": "*",
|
||||
"@documenso/auth": "*",
|
||||
@ -26,86 +28,87 @@
|
||||
"@documenso/ui": "*",
|
||||
"@epic-web/remember": "^1.1.0",
|
||||
"@faker-js/faker": "^10.1.0",
|
||||
"@hono/node-server": "^1.19.6",
|
||||
"@hono/trpc-server": "^0.4.0",
|
||||
"@hono/standard-validator": "^0.2.0",
|
||||
"@hookform/resolvers": "^3",
|
||||
"@lingui/core": "^5.6.0",
|
||||
"@lingui/detect-locale": "^5.6.0",
|
||||
"@lingui/macro": "^5.6.0",
|
||||
"@lingui/react": "^5.6.0",
|
||||
"@hono/node-server": "^1.13.7",
|
||||
"@hono/trpc-server": "^0.3.4",
|
||||
"@hookform/resolvers": "^3.1.0",
|
||||
"@lingui/core": "^5.2.0",
|
||||
"@lingui/detect-locale": "^5.2.0",
|
||||
"@lingui/macro": "^5.2.0",
|
||||
"@lingui/react": "^5.2.0",
|
||||
"@oslojs/crypto": "^1.0.1",
|
||||
"@oslojs/encoding": "^1.1.0",
|
||||
"@react-router/node": "^7.9.6",
|
||||
"@react-router/serve": "^7.9.6",
|
||||
"@react-router/node": "^7.6.0",
|
||||
"@react-router/serve": "^7.6.0",
|
||||
"@simplewebauthn/browser": "^9.0.1",
|
||||
"@simplewebauthn/server": "^9.0.3",
|
||||
"@tanstack/react-query": "5.90.10",
|
||||
"autoprefixer": "^10.4.22",
|
||||
"ai": "^5.0.82",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"colord": "^2.9.3",
|
||||
"content-disposition": "^1.0.1",
|
||||
"framer-motion": "^12.23.24",
|
||||
"hono": "4.10.6",
|
||||
"content-disposition": "^0.5.4",
|
||||
"framer-motion": "^10.12.8",
|
||||
"hono": "4.7.0",
|
||||
"hono-rate-limiter": "^0.4.2",
|
||||
"hono-react-router-adapter": "^0.6.5",
|
||||
"input-otp": "^1.4.2",
|
||||
"isbot": "^5.1.32",
|
||||
"konva": "^10.0.9",
|
||||
"lucide-react": "^0.554.0",
|
||||
"luxon": "^3.7.2",
|
||||
"nanoid": "^5.1.6",
|
||||
"papaparse": "^5.5.3",
|
||||
"posthog-js": "^1.297.2",
|
||||
"posthog-node": "^4.18.0",
|
||||
"hono-react-router-adapter": "^0.6.2",
|
||||
"input-otp": "^1.2.4",
|
||||
"isbot": "^5.1.17",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"konva": "^10.0.2",
|
||||
"lucide-react": "^0.279.0",
|
||||
"luxon": "^3.4.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"plausible-tracker": "^0.3.9",
|
||||
"posthog-js": "^1.245.0",
|
||||
"posthog-node": "^4.17.0",
|
||||
"react": "^18",
|
||||
"react-call": "^1.8.1",
|
||||
"react-call": "^1.7.0",
|
||||
"react-dom": "^18",
|
||||
"react-dropzone": "^14.3.8",
|
||||
"react-hook-form": "^7.66.1",
|
||||
"react-hotkeys-hook": "^4.6.2",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-rnd": "^10.5.2",
|
||||
"react-router": "^7.9.6",
|
||||
"recharts": "^2.15.4",
|
||||
"remeda": "^2.32.0",
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-hook-form": "^7.43.9",
|
||||
"react-hotkeys-hook": "^4.4.1",
|
||||
"react-icons": "^5.4.0",
|
||||
"react-rnd": "^10.4.1",
|
||||
"react-router": "^7.6.0",
|
||||
"recharts": "^2.7.2",
|
||||
"remeda": "^2.17.3",
|
||||
"remix-themes": "^2.0.4",
|
||||
"satori": "^0.18.3",
|
||||
"sharp": "0.34.5",
|
||||
"tailwindcss": "^3.4.18",
|
||||
"ts-pattern": "^5.9.0",
|
||||
"ua-parser-js": "^1.0.41",
|
||||
"satori": "^0.12.1",
|
||||
"sharp": "0.32.6",
|
||||
"skia-canvas": "^3.0.8",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"ts-pattern": "^5.0.5",
|
||||
"ua-parser-js": "^1.0.37",
|
||||
"uqr": "^0.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/preset-react": "^7.28.5",
|
||||
"@babel/preset-typescript": "^7.28.5",
|
||||
"@lingui/babel-plugin-lingui-macro": "^5.6.0",
|
||||
"@lingui/vite-plugin": "^5.6.0",
|
||||
"@react-router/dev": "^7.9.6",
|
||||
"@react-router/remix-routes-option-adapter": "^7.9.6",
|
||||
"@rollup/plugin-babel": "^6.1.0",
|
||||
"@rollup/plugin-commonjs": "^28.0.9",
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@rollup/plugin-typescript": "^12.3.0",
|
||||
"@babel/core": "^7.26.7",
|
||||
"@babel/preset-react": "^7.26.3",
|
||||
"@babel/preset-typescript": "^7.26.0",
|
||||
"@lingui/babel-plugin-lingui-macro": "^5.2.0",
|
||||
"@lingui/vite-plugin": "^5.3.1",
|
||||
"@react-router/dev": "^7.6.0",
|
||||
"@react-router/remix-routes-option-adapter": "^7.6.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^28.0.2",
|
||||
"@rollup/plugin-node-resolve": "^16.0.0",
|
||||
"@rollup/plugin-typescript": "^12.1.2",
|
||||
"@simplewebauthn/types": "^9.0.1",
|
||||
"@types/content-disposition": "^0.5.9",
|
||||
"@types/formidable": "^3.4.6",
|
||||
"@types/luxon": "^3.7.1",
|
||||
"@types/formidable": "^2.0.6",
|
||||
"@types/luxon": "^3.3.1",
|
||||
"@types/node": "^20",
|
||||
"@types/papaparse": "^5.5.0",
|
||||
"@types/react": "18.3.27",
|
||||
"@types/papaparse": "^5.3.15",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@types/ua-parser-js": "^0.7.39",
|
||||
"cross-env": "^10.1.0",
|
||||
"esbuild": "^0.27.0",
|
||||
"remix-flat-routes": "^0.8.5",
|
||||
"rollup": "^4.53.3",
|
||||
"tsx": "^4.20.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild": "^0.25.4",
|
||||
"remix-flat-routes": "^0.8.4",
|
||||
"rollup": "^4.34.5",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "5.6.2",
|
||||
"vite": "^7.2.4",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-babel-macros": "^1.0.6",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
},
|
||||
"version": "2.0.14"
|
||||
"version": "2.0.13"
|
||||
}
|
||||
61
apps/remix/server/api/document-analysis/authorization.ts
Normal file
61
apps/remix/server/api/document-analysis/authorization.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { getTeamById } from '@documenso/lib/server-only/team/get-team';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
import type { DocumentData } from '@documenso/prisma/client';
|
||||
|
||||
/**
|
||||
* Authorize a user's access to an envelope and return its document data.
|
||||
* Checks both direct ownership and team membership.
|
||||
*/
|
||||
export async function authorizeDocumentAccess(
|
||||
envelopeId: string,
|
||||
userId: number,
|
||||
): Promise<DocumentData> {
|
||||
const envelope = await prisma.envelope.findUnique({
|
||||
where: { id: envelopeId },
|
||||
include: {
|
||||
envelopeItems: {
|
||||
include: {
|
||||
documentData: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!envelope || !envelope.envelopeItems || envelope.envelopeItems.length === 0) {
|
||||
throw new AppError(AppErrorCode.NOT_FOUND, {
|
||||
message: `Envelope not found: ${envelopeId}`,
|
||||
userMessage: 'The requested document does not exist.',
|
||||
});
|
||||
}
|
||||
|
||||
const isDirectOwner = envelope.userId === userId;
|
||||
|
||||
let hasTeamAccess = false;
|
||||
if (envelope.teamId) {
|
||||
try {
|
||||
await getTeamById({ teamId: envelope.teamId, userId });
|
||||
hasTeamAccess = true;
|
||||
} catch {
|
||||
hasTeamAccess = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDirectOwner && !hasTeamAccess) {
|
||||
throw new AppError(AppErrorCode.UNAUTHORIZED, {
|
||||
message: `User ${userId} does not have access to envelope ${envelopeId}`,
|
||||
userMessage: 'You do not have permission to access this document.',
|
||||
});
|
||||
}
|
||||
|
||||
const documentData = envelope.envelopeItems[0]?.documentData;
|
||||
|
||||
if (!documentData) {
|
||||
throw new AppError(AppErrorCode.NOT_FOUND, {
|
||||
message: `Document data not found in envelope: ${envelopeId}`,
|
||||
userMessage: 'The requested document does not exist.',
|
||||
});
|
||||
}
|
||||
|
||||
return documentData;
|
||||
}
|
||||
183
apps/remix/server/api/document-analysis/debug-visualizer.ts
Normal file
183
apps/remix/server/api/document-analysis/debug-visualizer.ts
Normal file
@ -0,0 +1,183 @@
|
||||
import { mkdir, writeFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
import { Canvas, Image } from 'skia-canvas';
|
||||
|
||||
import type { TDetectFormFieldsResponse } from './types';
|
||||
|
||||
export type RenderedPage = {
|
||||
image: Buffer;
|
||||
pageNumber: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
|
||||
const GRID_PADDING = { left: 80, top: 20, right: 20, bottom: 40 };
|
||||
const GRID_INTERVAL = 100;
|
||||
const FIELD_COLORS = ['#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF'];
|
||||
|
||||
/**
|
||||
* Saves debug visualizations of detected form fields for development purposes.
|
||||
* Creates annotated images showing field bounding boxes and coordinate grids.
|
||||
*/
|
||||
export async function saveDebugVisualization(
|
||||
renderedPages: RenderedPage[],
|
||||
detectedFields: TDetectFormFieldsResponse,
|
||||
): Promise<void> {
|
||||
const debugDir = join(process.cwd(), '..', '..', 'packages', 'assets', 'ai-previews');
|
||||
await mkdir(debugDir, { recursive: true });
|
||||
|
||||
const timestamp = new Date()
|
||||
.toISOString()
|
||||
.replace(/[-:]/g, '')
|
||||
.replace(/\..+/, '')
|
||||
.replace('T', '_');
|
||||
|
||||
for (const page of renderedPages) {
|
||||
const canvas = createAnnotatedCanvas(page, detectedFields);
|
||||
await saveCanvasToFile(canvas, debugDir, timestamp, page.pageNumber);
|
||||
}
|
||||
}
|
||||
|
||||
function createAnnotatedCanvas(
|
||||
page: RenderedPage,
|
||||
detectedFields: TDetectFormFieldsResponse,
|
||||
): Canvas {
|
||||
const canvas = new Canvas(
|
||||
page.width + GRID_PADDING.left + GRID_PADDING.right,
|
||||
page.height + GRID_PADDING.top + GRID_PADDING.bottom,
|
||||
);
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// Draw the original page image
|
||||
const img = new Image();
|
||||
img.src = page.image;
|
||||
ctx.drawImage(img, GRID_PADDING.left, GRID_PADDING.top);
|
||||
|
||||
// Draw coordinate grid
|
||||
drawCoordinateGrid(ctx, page.width, page.height);
|
||||
|
||||
// Draw field bounding boxes
|
||||
drawFieldBoundingBoxes(ctx, page, detectedFields);
|
||||
|
||||
// Draw axis labels
|
||||
drawAxisLabels(ctx, page.width, page.height);
|
||||
|
||||
return canvas;
|
||||
}
|
||||
|
||||
function drawCoordinateGrid(
|
||||
ctx: ReturnType<Canvas['getContext']>,
|
||||
pageWidth: number,
|
||||
pageHeight: number,
|
||||
): void {
|
||||
ctx.strokeStyle = 'rgba(255, 0, 0, 0.5)';
|
||||
ctx.lineWidth = 1;
|
||||
|
||||
// Draw vertical grid lines
|
||||
for (let i = 0; i <= 1000; i += GRID_INTERVAL) {
|
||||
const x = GRID_PADDING.left + (i / 1000) * pageWidth;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, GRID_PADDING.top);
|
||||
ctx.lineTo(x, pageHeight + GRID_PADDING.top);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// Draw horizontal grid lines
|
||||
for (let i = 0; i <= 1000; i += GRID_INTERVAL) {
|
||||
const y = GRID_PADDING.top + (i / 1000) * pageHeight;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(GRID_PADDING.left, y);
|
||||
ctx.lineTo(pageWidth + GRID_PADDING.left, y);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
function drawFieldBoundingBoxes(
|
||||
ctx: ReturnType<Canvas['getContext']>,
|
||||
page: RenderedPage,
|
||||
detectedFields: TDetectFormFieldsResponse,
|
||||
): void {
|
||||
const pageFields = detectedFields.filter((field) => field.pageNumber === page.pageNumber);
|
||||
|
||||
pageFields.forEach((field, index) => {
|
||||
const { ymin, xmin, ymax, xmax } = field.boundingBox;
|
||||
|
||||
const x = (xmin / 1000) * page.width + GRID_PADDING.left;
|
||||
const y = (ymin / 1000) * page.height + GRID_PADDING.top;
|
||||
const width = ((xmax - xmin) / 1000) * page.width;
|
||||
const height = ((ymax - ymin) / 1000) * page.height;
|
||||
|
||||
const color = FIELD_COLORS[index % FIELD_COLORS.length];
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = 5;
|
||||
ctx.strokeRect(x, y, width, height);
|
||||
|
||||
// Draw field label
|
||||
ctx.fillStyle = color;
|
||||
ctx.font = '20px Arial';
|
||||
ctx.fillText(field.label, x, y - 5);
|
||||
});
|
||||
}
|
||||
|
||||
function drawAxisLabels(
|
||||
ctx: ReturnType<Canvas['getContext']>,
|
||||
pageWidth: number,
|
||||
pageHeight: number,
|
||||
): void {
|
||||
ctx.strokeStyle = '#000000';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.font = '26px Arial';
|
||||
|
||||
// Draw Y-axis
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(GRID_PADDING.left, GRID_PADDING.top);
|
||||
ctx.lineTo(GRID_PADDING.left, pageHeight + GRID_PADDING.top);
|
||||
ctx.stroke();
|
||||
|
||||
// Y-axis labels
|
||||
ctx.textAlign = 'right';
|
||||
ctx.textBaseline = 'middle';
|
||||
for (let i = 0; i <= 1000; i += GRID_INTERVAL) {
|
||||
const y = GRID_PADDING.top + (i / 1000) * pageHeight;
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.fillText(i.toString(), GRID_PADDING.left - 5, y);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(GRID_PADDING.left - 5, y);
|
||||
ctx.lineTo(GRID_PADDING.left, y);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// Draw X-axis
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(GRID_PADDING.left, pageHeight + GRID_PADDING.top);
|
||||
ctx.lineTo(pageWidth + GRID_PADDING.left, pageHeight + GRID_PADDING.top);
|
||||
ctx.stroke();
|
||||
|
||||
// X-axis labels
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
for (let i = 0; i <= 1000; i += GRID_INTERVAL) {
|
||||
const x = GRID_PADDING.left + (i / 1000) * pageWidth;
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.fillText(i.toString(), x, pageHeight + GRID_PADDING.top + 5);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, pageHeight + GRID_PADDING.top);
|
||||
ctx.lineTo(x, pageHeight + GRID_PADDING.top + 5);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
async function saveCanvasToFile(
|
||||
canvas: Canvas,
|
||||
debugDir: string,
|
||||
timestamp: string,
|
||||
pageNumber: number,
|
||||
): Promise<void> {
|
||||
const outputFilename = `detected_form_fields_${timestamp}_page_${pageNumber}.png`;
|
||||
const outputPath = join(debugDir, outputFilename);
|
||||
|
||||
const pngBuffer = await canvas.toBuffer('png');
|
||||
await writeFile(outputPath, new Uint8Array(pngBuffer));
|
||||
}
|
||||
118
apps/remix/server/api/document-analysis/field-detection.ts
Normal file
118
apps/remix/server/api/document-analysis/field-detection.ts
Normal file
@ -0,0 +1,118 @@
|
||||
import { generateObject } from 'ai';
|
||||
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { resizeAndCompressImage } from '@documenso/lib/server-only/image/resize-and-compress-image';
|
||||
|
||||
import { DETECT_OBJECTS_PROMPT } from './prompts';
|
||||
import type { TDetectFormFieldsResponse } from './types';
|
||||
import { ZDetectedFormFieldSchema } from './types';
|
||||
import { buildRecipientDirectory, safeGenerateObject, validateRecipientId } from './utils';
|
||||
|
||||
export type FieldDetectionRecipient = {
|
||||
id: number;
|
||||
name: string | null;
|
||||
email: string | null;
|
||||
role: string;
|
||||
signingOrder: number | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Build the field detection prompt with optional recipient context.
|
||||
*/
|
||||
function buildFieldDetectionPrompt(recipients: FieldDetectionRecipient[]): string {
|
||||
if (recipients.length === 0) {
|
||||
return DETECT_OBJECTS_PROMPT;
|
||||
}
|
||||
|
||||
const directory = buildRecipientDirectory(recipients);
|
||||
|
||||
return `${DETECT_OBJECTS_PROMPT}
|
||||
|
||||
RECIPIENT DIRECTORY:
|
||||
${directory}
|
||||
|
||||
RECIPIENT ASSIGNMENT RULES:
|
||||
1. Every detected field MUST include a "recipientId" taken from the directory above.
|
||||
2. Match printed names, role labels ("Buyer", "Seller"), or instructions near the field to the closest recipient.
|
||||
3. When the document references numbered signers (Signer 1, Signer 2, etc.), align them with signingOrder when provided.
|
||||
4. If a name exactly matches a recipient, always use that recipient's ID.
|
||||
5. When context is ambiguous, distribute fields logically across recipients instead of assigning all fields to one person.
|
||||
6. Never invent new recipients or IDs—only use those in the directory.`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run form field detection on a single page image.
|
||||
*/
|
||||
export async function runFormFieldDetection(
|
||||
imageBuffer: Buffer,
|
||||
pageNumber: number,
|
||||
recipients: FieldDetectionRecipient[],
|
||||
): Promise<TDetectFormFieldsResponse> {
|
||||
const compressedImageBuffer = await resizeAndCompressImage(imageBuffer);
|
||||
const base64Image = compressedImageBuffer.toString('base64');
|
||||
const prompt = buildFieldDetectionPrompt(recipients);
|
||||
|
||||
const detectedFields = await safeGenerateObject(
|
||||
async () =>
|
||||
generateObject({
|
||||
model: 'google/gemini-3-pro-preview',
|
||||
output: 'array',
|
||||
schema: ZDetectedFormFieldSchema,
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content: [
|
||||
{
|
||||
type: 'image',
|
||||
image: `data:image/jpeg;base64,${base64Image}`,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
text: prompt,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
{
|
||||
operation: 'detect form fields',
|
||||
pageNumber,
|
||||
},
|
||||
);
|
||||
|
||||
return validateAndEnrichFields(detectedFields, recipients, pageNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate recipient IDs and add page numbers to detected fields.
|
||||
*/
|
||||
function validateAndEnrichFields(
|
||||
detectedFields: Array<Omit<TDetectFormFieldsResponse[0], 'pageNumber'>>,
|
||||
recipients: FieldDetectionRecipient[],
|
||||
pageNumber: number,
|
||||
): TDetectFormFieldsResponse {
|
||||
const recipientIds = new Set(recipients.map((r) => r.id));
|
||||
const fallbackRecipientId = recipients[0]?.id;
|
||||
|
||||
if (fallbackRecipientId === undefined) {
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: 'Unable to assign recipients because no recipients were provided',
|
||||
userMessage: 'Please add at least one recipient before detecting form fields.',
|
||||
});
|
||||
}
|
||||
|
||||
return detectedFields.map((field) => {
|
||||
const validatedRecipientId = validateRecipientId(
|
||||
field.recipientId,
|
||||
recipientIds,
|
||||
fallbackRecipientId,
|
||||
{ fieldLabel: field.label },
|
||||
);
|
||||
|
||||
return {
|
||||
...field,
|
||||
recipientId: validatedRecipientId,
|
||||
pageNumber,
|
||||
};
|
||||
});
|
||||
}
|
||||
180
apps/remix/server/api/document-analysis/index.ts
Normal file
180
apps/remix/server/api/document-analysis/index.ts
Normal file
@ -0,0 +1,180 @@
|
||||
import { Hono } from 'hono';
|
||||
|
||||
import { getSession } from '@documenso/auth/server/lib/utils/get-session';
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { renderPdfToImage } from '@documenso/lib/server-only/pdf/render-pdf-to-image';
|
||||
import { getFileServerSide } from '@documenso/lib/universal/upload/get-file.server';
|
||||
import { env } from '@documenso/lib/utils/env';
|
||||
import { logger } from '@documenso/lib/utils/logger';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
import type { HonoEnv } from '../../router';
|
||||
import { authorizeDocumentAccess } from './authorization';
|
||||
import { saveDebugVisualization } from './debug-visualizer';
|
||||
import type { FieldDetectionRecipient } from './field-detection';
|
||||
import { runFormFieldDetection } from './field-detection';
|
||||
import { MAX_PAGES_FOR_RECIPIENT_ANALYSIS, analyzePageForRecipients } from './recipient-detection';
|
||||
import type { TAnalyzeRecipientsResponse, TDetectFormFieldsResponse } from './types';
|
||||
import {
|
||||
ZAnalyzeRecipientsRequestSchema,
|
||||
ZDetectFormFieldsRequestSchema,
|
||||
ZDetectFormFieldsResponseSchema,
|
||||
} from './types';
|
||||
import { processPageBatch, sortRecipientsForDetection } from './utils';
|
||||
|
||||
/**
|
||||
* Validates the user has a verified email for AI features.
|
||||
*/
|
||||
async function validateUserForAI(request: Request): Promise<{ userId: number }> {
|
||||
const { user } = await getSession(request);
|
||||
|
||||
if (!user.emailVerified) {
|
||||
throw new AppError(AppErrorCode.UNAUTHORIZED, {
|
||||
message: 'Email verification required',
|
||||
userMessage: 'Please verify your email to use AI features',
|
||||
});
|
||||
}
|
||||
|
||||
return { userId: user.id };
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches recipients for an envelope and validates they exist.
|
||||
*/
|
||||
async function getEnvelopeRecipients(envelopeId: string): Promise<FieldDetectionRecipient[]> {
|
||||
const recipients = await prisma.recipient.findMany({
|
||||
where: { envelopeId },
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
email: true,
|
||||
role: true,
|
||||
signingOrder: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (recipients.length === 0) {
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: `No recipients found for envelope ${envelopeId}`,
|
||||
userMessage: 'Please add at least one recipient before detecting form fields.',
|
||||
});
|
||||
}
|
||||
|
||||
return sortRecipientsForDetection(recipients);
|
||||
}
|
||||
|
||||
export const aiRoute = new Hono<HonoEnv>()
|
||||
.post('/detect-fields', async (c) => {
|
||||
try {
|
||||
const { userId } = await validateUserForAI(c.req.raw);
|
||||
|
||||
const body = await c.req.json();
|
||||
const parsed = ZDetectFormFieldsRequestSchema.safeParse(body);
|
||||
|
||||
if (!parsed.success) {
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: 'Envelope ID is required',
|
||||
userMessage: 'Please provide a valid envelope ID.',
|
||||
});
|
||||
}
|
||||
|
||||
const { envelopeId } = parsed.data;
|
||||
|
||||
const documentData = await authorizeDocumentAccess(envelopeId, userId);
|
||||
const detectionRecipients = await getEnvelopeRecipients(envelopeId);
|
||||
|
||||
const pdfBytes = await getFileServerSide({
|
||||
type: documentData.type,
|
||||
data: documentData.initialData || documentData.data,
|
||||
});
|
||||
|
||||
const renderedPages = await renderPdfToImage(pdfBytes);
|
||||
|
||||
const { results: pageResults } = await processPageBatch(
|
||||
renderedPages,
|
||||
async (page) => runFormFieldDetection(page.image, page.pageNumber, detectionRecipients),
|
||||
{
|
||||
itemName: 'page',
|
||||
getItemIdentifier: (_, index) => renderedPages[index]?.pageNumber ?? index + 1,
|
||||
errorMessage: 'We could not detect fields on some pages. Please try again.',
|
||||
},
|
||||
);
|
||||
|
||||
const detectedFields = pageResults.flat();
|
||||
|
||||
if (env('NEXT_PUBLIC_AI_DEBUG_PREVIEW') === 'true') {
|
||||
await saveDebugVisualization(renderedPages, detectedFields);
|
||||
}
|
||||
|
||||
const validatedResponse = ZDetectFormFieldsResponseSchema.parse(detectedFields);
|
||||
|
||||
return c.json<TDetectFormFieldsResponse>(validatedResponse);
|
||||
} catch (error) {
|
||||
if (error instanceof AppError) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
logger.error('Failed to detect form fields from PDF:', {
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: `Failed to detect form fields from PDF: ${error instanceof Error ? error.message : String(error)}`,
|
||||
userMessage: 'An error occurred while detecting form fields. Please try again.',
|
||||
});
|
||||
}
|
||||
})
|
||||
.post('/detect-recipients', async (c) => {
|
||||
try {
|
||||
const { userId } = await validateUserForAI(c.req.raw);
|
||||
|
||||
const body = await c.req.json();
|
||||
const parsed = ZAnalyzeRecipientsRequestSchema.safeParse(body);
|
||||
|
||||
if (!parsed.success) {
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: 'Envelope ID is required',
|
||||
userMessage: 'Please provide a valid envelope ID.',
|
||||
});
|
||||
}
|
||||
|
||||
const { envelopeId } = parsed.data;
|
||||
|
||||
const documentData = await authorizeDocumentAccess(envelopeId, userId);
|
||||
|
||||
const pdfBytes = await getFileServerSide({
|
||||
type: documentData.type,
|
||||
data: documentData.initialData || documentData.data,
|
||||
});
|
||||
|
||||
const renderedPages = await renderPdfToImage(pdfBytes);
|
||||
const pagesToAnalyze = renderedPages.slice(0, MAX_PAGES_FOR_RECIPIENT_ANALYSIS);
|
||||
|
||||
const { results: pageResults } = await processPageBatch(
|
||||
pagesToAnalyze,
|
||||
async (page) => analyzePageForRecipients(page),
|
||||
{
|
||||
itemName: 'page',
|
||||
getItemIdentifier: (page) => page.pageNumber,
|
||||
errorMessage: 'We could not analyze recipients on some pages. Please try again.',
|
||||
},
|
||||
);
|
||||
|
||||
const allRecipients = pageResults.flat();
|
||||
|
||||
return c.json<TAnalyzeRecipientsResponse>(allRecipients);
|
||||
} catch (error) {
|
||||
if (error instanceof AppError) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
logger.error('Failed to analyze recipients from PDF:', {
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: `Failed to analyze recipients from PDF: ${error instanceof Error ? error.message : String(error)}`,
|
||||
userMessage: 'An error occurred while analyzing recipients. Please try again.',
|
||||
});
|
||||
}
|
||||
});
|
||||
16
apps/remix/server/api/document-analysis/index.types.ts
Normal file
16
apps/remix/server/api/document-analysis/index.types.ts
Normal file
@ -0,0 +1,16 @@
|
||||
// Re-export all types from the module for convenient importing
|
||||
export type {
|
||||
TAnalyzeRecipientsRequest,
|
||||
TAnalyzeRecipientsResponse,
|
||||
TDetectedFormField,
|
||||
TDetectedRecipient,
|
||||
TDetectFormFieldsRequest,
|
||||
TDetectFormFieldsResponse,
|
||||
TGenerateTextRequest,
|
||||
TGenerateTextResponse,
|
||||
TRecipientRole,
|
||||
} from './types';
|
||||
|
||||
export type { FieldDetectionRecipient } from './field-detection';
|
||||
export type { PageWithImage } from './recipient-detection';
|
||||
export type { RenderedPage } from './debug-visualizer';
|
||||
121
apps/remix/server/api/document-analysis/prompts.ts
Normal file
121
apps/remix/server/api/document-analysis/prompts.ts
Normal file
@ -0,0 +1,121 @@
|
||||
export const DETECT_OBJECTS_PROMPT = `You are analyzing a form document image to detect fillable fields for the Documenso document signing platform.
|
||||
|
||||
IMPORTANT RULES:
|
||||
1. Only detect EMPTY/UNFILLED fields (ignore boxes that already contain text or data)
|
||||
2. Analyze nearby text labels to determine the field type
|
||||
3. Return bounding boxes for the fillable area only, NOT the label text
|
||||
4. Each boundingBox must be in the format {ymin, xmin, ymax, xmax} where all coordinates are NORMALIZED to a 0-1000 scale
|
||||
|
||||
CRITICAL: UNDERSTANDING FILLABLE AREAS
|
||||
The "fillable area" is ONLY the empty space where a user will write, type, sign, or check.
|
||||
- ✓ CORRECT: The blank underscore where someone writes their name: "Name: _________" → box ONLY the underscores
|
||||
- ✓ CORRECT: The empty white rectangle inside a box outline → box ONLY the empty space, not any printed text
|
||||
- ✓ CORRECT: The blank space to the right of a label: "Email: [ empty box ]" → box ONLY the empty box, exclude "Email:"
|
||||
- ✗ INCORRECT: Including the word "Signature:" that appears to the left of a signature line
|
||||
- ✗ INCORRECT: Including printed labels, instructions, or descriptive text near the field
|
||||
- ✗ INCORRECT: Extending the box to include text just because it's close to the fillable area
|
||||
|
||||
VISUALIZING THE DISTINCTION:
|
||||
- If there's text (printed words/labels) near an empty box or line, they are SEPARATE elements
|
||||
- The text is a LABEL telling the user what to fill
|
||||
- The empty space is the FILLABLE AREA where they actually write/sign
|
||||
- Your bounding box should capture ONLY the empty space, even if the label is immediately adjacent
|
||||
|
||||
FIELD TYPES TO DETECT:
|
||||
• SIGNATURE - Signature lines, boxes labeled 'Signature', 'Sign here', 'Authorized signature', 'X____'
|
||||
• INITIALS - Small boxes labeled 'Initials', 'Initial here', typically smaller than signature fields
|
||||
• NAME - Boxes labeled 'Name', 'Full name', 'Your name', 'Print name', 'Printed name'
|
||||
• EMAIL - Boxes labeled 'Email', 'Email address', 'E-mail', 'Email:'
|
||||
• DATE - Boxes labeled 'Date', 'Date signed', "Today's date", or showing date format placeholders like 'MM/DD/YYYY', '__/__/____'
|
||||
• CHECKBOX - Empty checkbox squares (☐) with or without labels, typically small square boxes
|
||||
• RADIO - Empty radio button circles (○) in groups, typically circular selection options
|
||||
• NUMBER - Boxes labeled with numeric context: 'Amount', 'Quantity', 'Phone', 'Phone number', 'ZIP', 'ZIP code', 'Age', 'Price', '#'
|
||||
• DROPDOWN - Boxes with dropdown indicators (▼, ↓) or labeled 'Select', 'Choose', 'Please select'
|
||||
• TEXT - Any other empty text input boxes, general input fields, unlabeled boxes, or when field type is uncertain
|
||||
|
||||
DETECTION GUIDELINES:
|
||||
- Read text located near the box (above, to the left, or inside the box boundary) to infer the field type
|
||||
- IMPORTANT: Use the nearby text to CLASSIFY the field type, but DO NOT include that text in the bounding box
|
||||
- If you're uncertain which type fits best, default to TEXT
|
||||
- For checkboxes and radio buttons: Detect each individual box/circle separately, not the label
|
||||
- Signature fields are often longer horizontal lines or larger boxes
|
||||
- Date fields often show format hints or date separators (slashes, dashes)
|
||||
- Look for visual patterns: underscores (____), horizontal lines, box outlines
|
||||
|
||||
BOUNDING BOX PLACEMENT (CRITICAL):
|
||||
- Your coordinates must capture ONLY the empty fillable space (the blank area where input goes)
|
||||
- Once you find the fillable region, LOCK the box to the full boundary of that region (top, bottom, left, right). Do not leave the box floating over just the starting edge.
|
||||
- If the field is defined by a line or a rectangular border, extend xmin/xmax/ymin/ymax across the entire line/border so the box spans the whole writable area end-to-end.
|
||||
- EXCLUDE all printed text labels, even if they are:
|
||||
· Directly to the left of the field (e.g., "Name: _____")
|
||||
· Directly above the field (e.g., "Signature" printed above a line)
|
||||
· Very close to the field with minimal spacing
|
||||
· Inside the same outlined box as the fillable area
|
||||
- The label text helps you IDENTIFY the field type, but must be EXCLUDED from the bounding box
|
||||
- If you detect a label "Email:" followed by a blank box, draw the box around ONLY the blank box, not the word "Email:"
|
||||
- The box should never cover only the leftmost few characters of a long field. For "Signature: ____________", the box must stretch from the first underscore to the last.
|
||||
|
||||
COORDINATE SYSTEM:
|
||||
- {ymin, xmin, ymax, xmax} normalized to 0-1000 scale
|
||||
- Top-left corner: ymin and xmin close to 0
|
||||
- Bottom-right corner: ymax and xmax close to 1000
|
||||
- Coordinates represent positions on a 1000x1000 grid overlaid on the image
|
||||
|
||||
FIELD SIZING STRATEGY FOR LINE-BASED FIELDS:
|
||||
When detecting thin horizontal lines for SIGNATURE, INITIALS, NAME, EMAIL, DATE, TEXT, or NUMBER fields:
|
||||
1. Analyze the visual context around the detected line:
|
||||
- Look at the empty space ABOVE the detected line
|
||||
- Observe the spacing to any text labels, headers, or other form elements above
|
||||
- Assess what would be a reasonable field height to make the field clearly visible when filled
|
||||
2. Expand UPWARD from the detected line to create a usable field:
|
||||
- Keep ymax (bottom) at the detected line position (the line becomes the bottom edge)
|
||||
- Extend ymin (top) upward into the available whitespace
|
||||
- Aim to use 60-80% of the clear whitespace above the line, while being reasonable
|
||||
- The expanded field should provide comfortable space for signing/writing (minimum 30 units tall)
|
||||
3. Apply minimum dimensions: height at least 30 units (3% of 1000-scale), width at least 36 units
|
||||
4. Ensure ymin >= 0 (do not go off-page). If ymin would be negative, clamp to 0
|
||||
5. Do NOT apply this expansion to CHECKBOX, RADIO, or DROPDOWN fields - use detected dimensions for those
|
||||
6. Example: If you detect a signature line at ymax=500 with clear whitespace extending up to y=400:
|
||||
- Available whitespace: 100 units
|
||||
- Use 60-80% of that: 60-80 units
|
||||
- Expanded field: {ymin: 420, xmin: 200, ymax: 500, xmax: 600} (creates 80-unit tall field)
|
||||
- This gives comfortable signing space while respecting the form layout`;
|
||||
|
||||
export const ANALYZE_RECIPIENTS_PROMPT = `You are analyzing a document to identify recipients who need to sign, approve, or receive copies.
|
||||
|
||||
TASK: Extract recipient information from this document.
|
||||
|
||||
RECIPIENT TYPES:
|
||||
- SIGNER: People who must sign the document (look for signature lines, "Signed by:", "Signature:", "X____")
|
||||
- APPROVER: People who must review/approve before signing (look for "Approved by:", "Reviewed by:", "Approval:")
|
||||
- CC: People who receive a copy for information only (look for "CC:", "Copy to:", "For information:")
|
||||
|
||||
EXTRACTION RULES:
|
||||
1. Look for signature lines with names printed above, below, or near them
|
||||
2. Check for explicit labels like "Name:", "Signer:", "Party:", "Recipient:"
|
||||
3. Look for "Approved by:", "Reviewed by:", "CC:" sections
|
||||
4. Extract FULL NAMES as they appear in the document
|
||||
5. If an email address is visible near a name, include it exactly in the "email" field
|
||||
6. If NO email is found, leave the email field empty.
|
||||
7. Assign signing order based on document flow (numbered items, "First signer:", "Second signer:", or top-to-bottom sequence)
|
||||
|
||||
IMPORTANT:
|
||||
- Only extract recipients explicitly mentioned in the document
|
||||
- Default role is SIGNER if unclear (signature lines = SIGNER)
|
||||
- Signing order starts at 1 (first signer = 1, second = 2, etc.)
|
||||
- If no clear ordering, omit signingOrder
|
||||
- Return empty array if absolutely no recipients can be detected
|
||||
- Do NOT invent recipients - only extract what's clearly present
|
||||
- If a signature line exists but no name is associated with it, DO NOT return a recipient with name "<UNKNOWN>". Skip it.
|
||||
|
||||
EXAMPLES:
|
||||
Good:
|
||||
- "Signed: _________ John Doe" → { name: "John Doe", role: "SIGNER", signingOrder: 1 }
|
||||
- "Approved by: Jane Smith (jane@example.com)" → { name: "Jane Smith", email: "jane@example.com", role: "APPROVER" }
|
||||
- "CC: Legal Team" → { name: "Legal Team", role: "CC" }
|
||||
|
||||
Bad:
|
||||
- Extracting the document title as a recipient name
|
||||
- Making up email addresses that aren't in the document
|
||||
- Adding people not mentioned in the document
|
||||
- Using placeholder names like "<UNKNOWN>", "Unknown", "Signer"`;
|
||||
@ -0,0 +1,72 @@
|
||||
import { generateObject } from 'ai';
|
||||
|
||||
import { resizeAndCompressImage } from '@documenso/lib/server-only/image/resize-and-compress-image';
|
||||
import { resolveRecipientEmail } from '@documenso/lib/utils/recipients';
|
||||
|
||||
import { ANALYZE_RECIPIENTS_PROMPT } from './prompts';
|
||||
import type { TDetectedRecipient } from './types';
|
||||
import { ZDetectedRecipientLLMSchema } from './types';
|
||||
import { safeGenerateObject } from './utils';
|
||||
|
||||
// Limit recipient detection to first 3 pages for performance and cost efficiency
|
||||
export const MAX_PAGES_FOR_RECIPIENT_ANALYSIS = 3;
|
||||
|
||||
export type PageWithImage = {
|
||||
image: Buffer;
|
||||
pageNumber: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Analyze a single page for recipient information.
|
||||
*/
|
||||
export async function analyzePageForRecipients(page: PageWithImage): Promise<TDetectedRecipient[]> {
|
||||
const compressedImageBuffer = await resizeAndCompressImage(page.image);
|
||||
const base64Image = compressedImageBuffer.toString('base64');
|
||||
|
||||
const recipients = await safeGenerateObject(
|
||||
async () =>
|
||||
generateObject({
|
||||
model: 'anthropic/claude-haiku-4.5',
|
||||
output: 'array',
|
||||
schema: ZDetectedRecipientLLMSchema,
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
content: [
|
||||
{
|
||||
type: 'image',
|
||||
image: `data:image/jpeg;base64,${base64Image}`,
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
text: ANALYZE_RECIPIENTS_PROMPT,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
{
|
||||
operation: 'analyze recipients',
|
||||
pageNumber: page.pageNumber,
|
||||
},
|
||||
);
|
||||
|
||||
return normalizeRecipients(recipients);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize recipient data by resolving emails and ensuring consistent format.
|
||||
*/
|
||||
function normalizeRecipients(
|
||||
recipients: Array<{
|
||||
name: string;
|
||||
email?: string;
|
||||
role: 'SIGNER' | 'APPROVER' | 'CC';
|
||||
signingOrder?: number;
|
||||
}>,
|
||||
): TDetectedRecipient[] {
|
||||
return recipients.map((recipient) => ({
|
||||
...recipient,
|
||||
email: resolveRecipientEmail(recipient.email),
|
||||
}));
|
||||
}
|
||||
75
apps/remix/server/api/document-analysis/types.ts
Normal file
75
apps/remix/server/api/document-analysis/types.ts
Normal file
@ -0,0 +1,75 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import {
|
||||
type TDetectedFormField,
|
||||
ZDetectedFormFieldSchema,
|
||||
} from '@documenso/lib/types/document-analysis';
|
||||
|
||||
export { ZDetectedFormFieldSchema };
|
||||
|
||||
export const ZGenerateTextRequestSchema = z.object({
|
||||
prompt: z.string().min(1, 'Prompt is required').max(5000, 'Prompt is too long'),
|
||||
});
|
||||
|
||||
export const ZGenerateTextResponseSchema = z.object({
|
||||
text: z.string(),
|
||||
});
|
||||
|
||||
export type TGenerateTextRequest = z.infer<typeof ZGenerateTextRequestSchema>;
|
||||
export type TGenerateTextResponse = z.infer<typeof ZGenerateTextResponseSchema>;
|
||||
|
||||
export const ZDetectFormFieldsRequestSchema = z.object({
|
||||
envelopeId: z.string().min(1, { message: 'Envelope ID is required' }),
|
||||
});
|
||||
|
||||
export const ZDetectFormFieldsResponseSchema = z.array(ZDetectedFormFieldSchema);
|
||||
|
||||
export type TDetectFormFieldsRequest = z.infer<typeof ZDetectFormFieldsRequestSchema>;
|
||||
export type TDetectFormFieldsResponse = z.infer<typeof ZDetectFormFieldsResponseSchema>;
|
||||
export type { TDetectedFormField };
|
||||
|
||||
const ZRecipientRoleEnum = z.enum(['SIGNER', 'APPROVER', 'CC']);
|
||||
|
||||
const recipientFieldShape = {
|
||||
name: z.string().describe('Full name of the recipient'),
|
||||
role: ZRecipientRoleEnum.describe('Recipient role based on document context'),
|
||||
signingOrder: z
|
||||
.number()
|
||||
.int()
|
||||
.positive()
|
||||
.optional()
|
||||
.describe('Sequential signing order if document indicates ordering'),
|
||||
} as const;
|
||||
|
||||
function createRecipientSchema<TSchema extends z.ZodTypeAny>(emailSchema: TSchema) {
|
||||
return z.object({
|
||||
...recipientFieldShape,
|
||||
email: emailSchema,
|
||||
});
|
||||
}
|
||||
|
||||
export const ZDetectedRecipientLLMSchema = createRecipientSchema(
|
||||
z
|
||||
.string()
|
||||
.trim()
|
||||
.max(320)
|
||||
.optional()
|
||||
.describe(
|
||||
'Email address from the document. If missing or invalid, a placeholder will be generated.',
|
||||
),
|
||||
);
|
||||
|
||||
export const ZDetectedRecipientSchema = createRecipientSchema(
|
||||
z.string().email().optional().describe('Email address for the recipient (if found in document).'),
|
||||
);
|
||||
|
||||
export const ZAnalyzeRecipientsRequestSchema = z.object({
|
||||
envelopeId: z.string().min(1, { message: 'Envelope ID is required' }),
|
||||
});
|
||||
|
||||
export const ZAnalyzeRecipientsResponseSchema = z.array(ZDetectedRecipientSchema);
|
||||
|
||||
export type TDetectedRecipient = z.infer<typeof ZDetectedRecipientSchema>;
|
||||
export type TAnalyzeRecipientsRequest = z.infer<typeof ZAnalyzeRecipientsRequestSchema>;
|
||||
export type TAnalyzeRecipientsResponse = z.infer<typeof ZAnalyzeRecipientsResponseSchema>;
|
||||
export type TRecipientRole = z.infer<typeof ZRecipientRoleEnum>;
|
||||
164
apps/remix/server/api/document-analysis/utils.ts
Normal file
164
apps/remix/server/api/document-analysis/utils.ts
Normal file
@ -0,0 +1,164 @@
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { logger } from '@documenso/lib/utils/logger';
|
||||
|
||||
/**
|
||||
* Process an array of items in parallel and handle failures gracefully.
|
||||
* Returns successful results and reports failed items.
|
||||
*/
|
||||
export async function processPageBatch<TInput, TOutput>(
|
||||
items: TInput[],
|
||||
processor: (item: TInput, index: number) => Promise<TOutput>,
|
||||
context: {
|
||||
itemName: string; // e.g., "page", "recipient"
|
||||
getItemIdentifier: (item: TInput, index: number) => number | string; // e.g., pageNumber
|
||||
errorMessage: string; // User-facing error message
|
||||
},
|
||||
): Promise<{
|
||||
results: TOutput[];
|
||||
failedItems: Array<number | string>;
|
||||
}> {
|
||||
const settledResults = await Promise.allSettled(
|
||||
items.map(async (item, index) => processor(item, index)),
|
||||
);
|
||||
|
||||
const results: TOutput[] = [];
|
||||
const failedItems: Array<number | string> = [];
|
||||
|
||||
for (const [index, result] of settledResults.entries()) {
|
||||
if (result.status === 'fulfilled') {
|
||||
results.push(result.value);
|
||||
} else {
|
||||
const identifier = context.getItemIdentifier(items[index]!, index);
|
||||
logger.error(`Failed to process ${context.itemName} ${identifier}:`, {
|
||||
error: result.reason,
|
||||
identifier,
|
||||
});
|
||||
failedItems.push(identifier);
|
||||
}
|
||||
}
|
||||
|
||||
if (failedItems.length > 0) {
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: `Failed to process ${context.itemName}s: ${failedItems.join(', ')}`,
|
||||
userMessage: context.errorMessage,
|
||||
});
|
||||
}
|
||||
|
||||
return { results, failedItems: [] };
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely execute an LLM generation with proper error handling and logging.
|
||||
*/
|
||||
export async function safeGenerateObject<T>(
|
||||
generatorFn: () => Promise<{ object: T }>,
|
||||
context: {
|
||||
operation: string; // e.g., "detect form fields", "analyze recipients"
|
||||
pageNumber?: number;
|
||||
},
|
||||
): Promise<T> {
|
||||
try {
|
||||
const result = await generatorFn();
|
||||
return result.object;
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
const pageContext = context.pageNumber ? ` on page ${context.pageNumber}` : '';
|
||||
|
||||
logger.error(`Failed to ${context.operation}${pageContext}:`, {
|
||||
error: errorMessage,
|
||||
pageNumber: context.pageNumber,
|
||||
});
|
||||
|
||||
throw new AppError(AppErrorCode.UNKNOWN_ERROR, {
|
||||
message: `AI generation failed for ${context.operation}: ${errorMessage}`,
|
||||
userMessage: `Unable to ${context.operation}. Please try again.`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort recipients by role priority and signing order for consistent field assignment.
|
||||
*/
|
||||
export function sortRecipientsForDetection<
|
||||
T extends { role: string; signingOrder: number | null; id: number },
|
||||
>(recipients: T[]): T[] {
|
||||
const ROLE_PRIORITY: Record<string, number> = {
|
||||
SIGNER: 0,
|
||||
APPROVER: 1,
|
||||
CC: 2,
|
||||
};
|
||||
|
||||
return recipients.slice().sort((a, b) => {
|
||||
// 1. Sort by role priority
|
||||
const roleComparison = (ROLE_PRIORITY[a.role] ?? 3) - (ROLE_PRIORITY[b.role] ?? 3);
|
||||
if (roleComparison !== 0) {
|
||||
return roleComparison;
|
||||
}
|
||||
|
||||
// 2. Sort by signing order (null values last)
|
||||
const aOrder = a.signingOrder ?? Number.MAX_SAFE_INTEGER;
|
||||
const bOrder = b.signingOrder ?? Number.MAX_SAFE_INTEGER;
|
||||
if (aOrder !== bOrder) {
|
||||
return aOrder - bOrder;
|
||||
}
|
||||
|
||||
// 3. Sort by ID as final tiebreaker
|
||||
return a.id - b.id;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a recipient directory string for LLM context.
|
||||
*/
|
||||
export function buildRecipientDirectory(
|
||||
recipients: Array<{
|
||||
id: number;
|
||||
name: string | null;
|
||||
email: string | null;
|
||||
role: string;
|
||||
signingOrder: number | null;
|
||||
}>,
|
||||
): string {
|
||||
return recipients
|
||||
.map((recipient, index) => {
|
||||
const name = recipient.name?.trim() || `Recipient ${index + 1}`;
|
||||
const details = [`name: "${name}"`, `role: ${recipient.role}`];
|
||||
|
||||
if (recipient.email) {
|
||||
details.push(`email: ${recipient.email}`);
|
||||
}
|
||||
|
||||
if (typeof recipient.signingOrder === 'number') {
|
||||
details.push(`signingOrder: ${recipient.signingOrder}`);
|
||||
}
|
||||
|
||||
return `ID ${recipient.id} → ${details.join(', ')}`;
|
||||
})
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and correct recipient IDs to ensure they match available recipients.
|
||||
*/
|
||||
export function validateRecipientId(
|
||||
fieldRecipientId: number,
|
||||
availableRecipientIds: Set<number>,
|
||||
fallbackRecipientId: number,
|
||||
context?: { fieldLabel?: string },
|
||||
): number {
|
||||
if (availableRecipientIds.has(fieldRecipientId)) {
|
||||
return fieldRecipientId;
|
||||
}
|
||||
|
||||
logger.error('AI returned invalid recipientId for detected field', {
|
||||
invalidRecipientId: fieldRecipientId,
|
||||
fieldLabel: context?.fieldLabel,
|
||||
availableRecipientIds: Array.from(availableRecipientIds),
|
||||
});
|
||||
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: `AI assigned field "${context?.fieldLabel || 'Unknown'}" to invalid recipient ID ${fieldRecipientId}`,
|
||||
userMessage:
|
||||
'We detected fields assigned to a recipient that does not exist. Please try again.',
|
||||
});
|
||||
}
|
||||
@ -5,7 +5,6 @@ import { Hono } from 'hono';
|
||||
import { getOptionalSession } from '@documenso/auth/server/lib/utils/get-session';
|
||||
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { verifyEmbeddingPresignToken } from '@documenso/lib/server-only/embedding-presign/verify-embedding-presign-token';
|
||||
import { getTeamById } from '@documenso/lib/server-only/team/get-team';
|
||||
import { putNormalizedPdfFileServerSide } from '@documenso/lib/universal/upload/put-file.server';
|
||||
import { getPresignPostUrl } from '@documenso/lib/universal/upload/server-actions';
|
||||
@ -17,7 +16,6 @@ import {
|
||||
type TGetPresignedPostUrlResponse,
|
||||
ZGetEnvelopeItemFileDownloadRequestParamsSchema,
|
||||
ZGetEnvelopeItemFileRequestParamsSchema,
|
||||
ZGetEnvelopeItemFileRequestQuerySchema,
|
||||
ZGetEnvelopeItemFileTokenDownloadRequestParamsSchema,
|
||||
ZGetEnvelopeItemFileTokenRequestParamsSchema,
|
||||
ZGetPresignedPostUrlRequestSchema,
|
||||
@ -70,24 +68,12 @@ export const filesRoute = new Hono<HonoEnv>()
|
||||
.get(
|
||||
'/envelope/:envelopeId/envelopeItem/:envelopeItemId',
|
||||
sValidator('param', ZGetEnvelopeItemFileRequestParamsSchema),
|
||||
sValidator('query', ZGetEnvelopeItemFileRequestQuerySchema),
|
||||
async (c) => {
|
||||
const { envelopeId, envelopeItemId } = c.req.valid('param');
|
||||
const { token } = c.req.query();
|
||||
|
||||
const session = await getOptionalSession(c);
|
||||
|
||||
let userId = session.user?.id;
|
||||
|
||||
if (token) {
|
||||
const presignToken = await verifyEmbeddingPresignToken({
|
||||
token,
|
||||
}).catch(() => undefined);
|
||||
|
||||
userId = presignToken?.userId;
|
||||
}
|
||||
|
||||
if (!userId) {
|
||||
if (!session.user) {
|
||||
return c.json({ error: 'Unauthorized' }, 401);
|
||||
}
|
||||
|
||||
@ -118,7 +104,7 @@ export const filesRoute = new Hono<HonoEnv>()
|
||||
}
|
||||
|
||||
const team = await getTeamById({
|
||||
userId: userId,
|
||||
userId: session.user.id,
|
||||
teamId: envelope.teamId,
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
|
||||
@ -36,14 +36,6 @@ export type TGetEnvelopeItemFileRequestParams = z.infer<
|
||||
typeof ZGetEnvelopeItemFileRequestParamsSchema
|
||||
>;
|
||||
|
||||
export const ZGetEnvelopeItemFileRequestQuerySchema = z.object({
|
||||
token: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TGetEnvelopeItemFileRequestQuery = z.infer<
|
||||
typeof ZGetEnvelopeItemFileRequestQuerySchema
|
||||
>;
|
||||
|
||||
export const ZGetEnvelopeItemFileTokenRequestParamsSchema = z.object({
|
||||
token: z.string().min(1),
|
||||
envelopeItemId: z.string().min(1),
|
||||
|
||||
@ -14,6 +14,7 @@ import { getIpAddress } from '@documenso/lib/universal/get-ip-address';
|
||||
import { logger } from '@documenso/lib/utils/logger';
|
||||
import { openApiDocument } from '@documenso/trpc/server/open-api';
|
||||
|
||||
import { aiRoute } from './api/document-analysis/index';
|
||||
import { downloadRoute } from './api/download/download';
|
||||
import { filesRoute } from './api/files/files';
|
||||
import { type AppContext, appContext } from './context';
|
||||
@ -84,6 +85,9 @@ app.route('/api/auth', auth);
|
||||
// Files route.
|
||||
app.route('/api/files', filesRoute);
|
||||
|
||||
// AI route.
|
||||
app.route('/api/ai', aiRoute);
|
||||
|
||||
// API servers.
|
||||
app.use(`/api/v1/*`, cors());
|
||||
app.route('/api/v1', tsRestHonoApp);
|
||||
|
||||
@ -49,7 +49,7 @@ export default defineConfig({
|
||||
}),
|
||||
],
|
||||
ssr: {
|
||||
noExternal: ['react-dropzone', 'plausible-tracker'],
|
||||
noExternal: ['react-dropzone', 'plausible-tracker', 'pdfjs-dist'],
|
||||
external: [
|
||||
'@node-rs/bcrypt',
|
||||
'@prisma/client',
|
||||
|
||||
769
build.log
769
build.log
@ -1,769 +0,0 @@
|
||||
|
||||
> @documenso/remix@2.0.14 build
|
||||
> ./.bin/build.sh
|
||||
|
||||
[Build]: Extracting and compiling translations
|
||||
|
||||
> @documenso/root@2.0.14 translate
|
||||
> npm run translate:extract && npm run translate:compile
|
||||
|
||||
|
||||
> @documenso/root@2.0.14 translate:extract
|
||||
> lingui extract --clean
|
||||
|
||||
✔ Done in 2s
|
||||
Catalog statistics for packages/lib/translations/{locale}/web:
|
||||
┌─────────────┬─────────────┬─────────┐
|
||||
│ Language │ Total count │ Missing │
|
||||
├─────────────┼─────────────┼─────────┤
|
||||
│ en (source) │ 2311 │ - │
|
||||
│ de │ 2311 │ 23 │
|
||||
│ es │ 2311 │ 23 │
|
||||
│ fr │ 2311 │ 23 │
|
||||
│ it │ 2311 │ 26 │
|
||||
│ ja │ 2311 │ 23 │
|
||||
│ ko │ 2311 │ 23 │
|
||||
│ pl │ 2311 │ 23 │
|
||||
│ pt-BR │ 2311 │ 69 │
|
||||
│ zh │ 2311 │ 23 │
|
||||
└─────────────┴─────────────┴─────────┘
|
||||
|
||||
(Use "npm run translate:extract" to update catalogs with new messages.)
|
||||
(Use "npm run translate:compile" to compile catalogs for production. Alternatively, use bundler plugins: https://lingui.dev/ref/cli#compiling-catalogs-in-ci)
|
||||
|
||||
> @documenso/root@2.0.14 translate:compile
|
||||
> lingui compile
|
||||
|
||||
Compiling message catalogs…
|
||||
Done in 943ms
|
||||
[Build]: Building app
|
||||
|
||||
> @documenso/remix@2.0.14 build:app
|
||||
> npm run typecheck && cross-env NODE_ENV=production react-router build
|
||||
|
||||
|
||||
> @documenso/remix@2.0.14 typecheck
|
||||
> react-router typegen && tsc
|
||||
|
||||
app/components/forms/email-preferences-form.tsx(66,7): error TS2322: Type 'JsonValue' is not assignable to type '{ recipientSigningRequest?: boolean | undefined; recipientRemoved?: boolean | undefined; recipientSigned?: boolean | undefined; documentPending?: boolean | undefined; documentCompleted?: boolean | undefined; documentDeleted?: boolean | undefined; ownerDocumentCompleted?: boolean | undefined; } | null | undefined'.
|
||||
Type 'string' has no properties in common with type '{ recipientSigningRequest?: boolean | undefined; recipientRemoved?: boolean | undefined; recipientSigned?: boolean | undefined; documentPending?: boolean | undefined; documentCompleted?: boolean | undefined; documentDeleted?: boolean | undefined; ownerDocumentCompleted?: boolean | undefined; }'.
|
||||
app/components/forms/email-preferences-form.tsx(81,41): error TS2345: Argument of type '(data: { emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }) => Promise<...>' is not assignable to parameter of type 'SubmitHandler<TFieldValues>'.
|
||||
Types of parameters 'data' and 'data' are incompatible.
|
||||
Type 'TFieldValues' is not assignable to type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }': emailReplyTo, emailId, emailDocumentSettings
|
||||
app/components/forms/email-preferences-form.tsx(88,15): error TS2322: Type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValues>' is not assignable to type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }> ...'.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, TFieldVal...' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }': emailReplyTo, emailId, emailDocumentSettings
|
||||
app/components/forms/email-preferences-form.tsx(129,13): error TS2322: Type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValues>' is not assignable to type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }> ...'.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, TFieldVal...' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }': emailReplyTo, emailId, emailDocumentSettings
|
||||
app/components/forms/email-preferences-form.tsx(179,13): error TS2322: Type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValues>' is not assignable to type 'Control<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }> ...'.
|
||||
Type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, TFieldValu...' is not assignable to type 'Resolver<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, TFieldVal...' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }, { ...; }>...'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ emailReplyTo: string | null; emailId: string | null; emailDocumentSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null; }': emailReplyTo, emailId, emailDocumentSettings
|
||||
app/components/forms/subscription-claim-form.tsx(43,7): error TS2322: Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; } | undefined'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; } | undefined'.
|
||||
app/components/forms/subscription-claim-form.tsx(49,41): error TS2345: Argument of type '(data: { name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }) => Promise<...>' is not assignable to parameter of type 'SubmitHandler<TFieldValues>'.
|
||||
Types of parameters 'data' and 'data' are incompatible.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/forms/subscription-claim-form.tsx(52,13): error TS2322: Type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues> | undefined' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }> | undefined'.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, TFieldValues> | Promise<...>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/forms/subscription-claim-form.tsx(68,13): error TS2322: Type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues> | undefined' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }> | undefined'.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, TFieldValues> | Promise<...>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/forms/subscription-claim-form.tsx(92,13): error TS2322: Type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues> | undefined' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }> | undefined'.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, TFieldValues> | Promise<...>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/forms/subscription-claim-form.tsx(116,13): error TS2322: Type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues> | undefined' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }> | undefined'.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, TFieldValues> | Promise<...>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/forms/subscription-claim-form.tsx(148,19): error TS2322: Type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Control<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
The types of '_options.resolver' are incompatible between these types.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues> | undefined' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }> | undefined'.
|
||||
Type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, TFieldValues>' is not assignable to type 'Resolver<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, any, { ...; }>'.
|
||||
Type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, TFieldValues> | Promise<...>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverResult<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }, { ...; }> | Promise<...>'.
|
||||
Type 'ResolverSuccess<TFieldValues>' is not assignable to type 'ResolverSuccess<{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }>'.
|
||||
Type 'TFieldValues' is not assignable to type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Type 'FieldValues' is missing the following properties from type '{ name: string; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; ... 7 more ...; allowEnvelopes?: boolean | undefined; }; }': name, teamCount, memberCount, envelopeItemCount, flags
|
||||
app/components/general/document-signing/document-signing-field-container.tsx(136,28): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
app/components/general/document-signing/document-signing-field-container.tsx(178,28): error TS2339: Property 'label' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'label' does not exist on type 'string'.
|
||||
app/components/general/document-signing/document-signing-field-container.tsx(190,32): error TS2339: Property 'label' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'label' does not exist on type 'string'.
|
||||
app/components/general/envelope-editor/envelope-generic-page-renderer.tsx(50,5): error TS2322: Type '{ inserted: boolean; customText: string; recipient: Pick<{ id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: JsonValue; ... 7 more ...; sendStatus: SendStatus; }, "id" | ... 2 more ... | "signingStatus">; ... 11 more ...; envelopeItemId: string; }[]' is not assignable to type 'GenericLocalField[]'.
|
||||
Type '{ inserted: boolean; customText: string; recipient: Pick<{ id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: JsonValue | null; ... 7 more ...; sendStatus: $Enums.SendStatus; }, "id" | ... 2 more ... | "signingStatus">; ... 11 more ...; envelopeItemI...' is not assignable to type 'GenericLocalField'.
|
||||
Type '{ inserted: boolean; customText: string; recipient: Pick<{ id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: JsonValue | null; ... 7 more ...; sendStatus: $Enums.SendStatus; }, "id" | ... 2 more ... | "signingStatus">; ... 11 more ...; envelopeItemI...' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
app/components/general/envelope-editor/envelope-generic-page-renderer.tsx(74,22): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
app/components/general/envelope-signing/envelope-signer-page-renderer.tsx(181,69): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
app/routes/_authenticated+/t.$teamUrl+/documents.$id.legacy_editor.tsx(137,9): error TS2322: Type '{ folder: null; envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 31 more ...; documentMetaId: string; }' is not assignable to type '{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; templateId?: number | ... 1 more ... | undefined; }'.
|
||||
The types of 'documentMeta.emailSettings' are incompatible between these types.
|
||||
Type 'JsonValue' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | null'.
|
||||
Type 'string' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; }'.
|
||||
app/routes/_authenticated+/t.$teamUrl+/templates.$id.legacy_editor.tsx(109,9): error TS2322: Type '{ folder: null; envelopeId: string; type: $Enums.TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 29 more ...; documentMetaId: string; }' is not assignable to type '{ type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateMeta: { ...; }; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: null; templateId: number; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: null; templateId: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
app/routes/_internal+/[__htmltopdf]+/certificate.tsx(98,20): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/_internal+/[__htmltopdf]+/certificate.tsx(98,44): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
app/routes/_recipient+/d.$token+/_index.tsx(211,15): error TS2322: Type '{ readonly folder: null; readonly id: number; readonly envelopeId: string; readonly type: $Enums.TemplateType; readonly visibility: $Enums.DocumentVisibility; readonly externalId: string | null; ... 15 more ...; readonly envelopeItems: { ...; }[]; }' is not assignable to type 'Omit<{ type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateMeta: { ...; }; }, "user">'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ templateId: number; documentId: null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ templateId: number; documentId: null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
app/routes/_unauthenticated+/o.$orgUrl.signin.tsx(76,6): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/_unauthenticated+/o.$orgUrl.signin.tsx(76,43): error TS2339: Property 'authenticationPortal' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'authenticationPortal' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(45,39): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(45,63): error TS2339: Property 'embedSigningWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigningWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(46,25): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(46,49): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(51,32): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(51,56): error TS2339: Property 'embedSigning' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigning' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(161,39): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(161,63): error TS2339: Property 'embedSigningWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigningWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(162,25): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(162,49): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(164,32): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/direct.$token.tsx(164,56): error TS2339: Property 'embedSigning' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigning' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(64,39): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(64,63): error TS2339: Property 'embedSigningWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigningWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(65,25): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(65,49): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(70,32): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(70,56): error TS2339: Property 'embedSigning' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigning' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(197,39): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(197,63): error TS2339: Property 'embedSigningWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigningWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(198,25): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(198,49): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(200,32): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/_v0+/sign.$token.tsx(200,56): error TS2339: Property 'embedSigning' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigning' does not exist on type 'string'.
|
||||
app/routes/embed+/v1+/authoring+/_layout.tsx(35,37): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/v1+/authoring+/_layout.tsx(35,61): error TS2339: Property 'embedAuthoringWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedAuthoringWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/v1+/authoring+/document.edit.$id.tsx(112,88): error TS2345: Argument of type '() => { title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: $Enums.DocumentDistributionMethod; emailSettings: string | ... 4 more ... | JsonArray; ... 6 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' is not assignable to parameter of type '{ meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers: { .....'.
|
||||
Type '() => { title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: $Enums.DocumentDistributionMethod; emailSettings: string | ... 4 more ... | JsonArray; ... 6 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' is not assignable to type '() => { meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers...'.
|
||||
Call signature return types '{ title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: DocumentDistributionMethod; ... 7 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' and '{ meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers: { .....' are incompatible.
|
||||
The types of 'meta.emailSettings' are incompatible between these types.
|
||||
Type 'string | number | boolean | { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | JsonObject | JsonArray' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; }'.
|
||||
Type 'string' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; }'.
|
||||
app/routes/embed+/v1+/authoring+/document.edit.$id.tsx(144,75): error TS2345: Argument of type '() => { fields: { nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' is not assignable to parameter of type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | (() => { ...; } | null) | null'.
|
||||
Type '() => { fields: { nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' is not assignable to type '() => { fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | null'.
|
||||
Call signature return types '{ fields: { nativeId: number; formId: string; type: FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' and '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | null' are incompatible.
|
||||
The types of 'fields' are incompatible between these types.
|
||||
Type '{ nativeId: number; formId: string; type: FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; pageHeight: number; ... 7 more ...; nativeId?: number | undefined; }[]'.
|
||||
Type '{ nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; pageHeight: number; ... 7 more ...; nativeId?: number | undefined; }'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'string | number | boolean | JsonObject | JsonArray | undefined' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | undefined'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | undefined'.
|
||||
app/routes/embed+/v1+/authoring+/template.edit.$id.tsx(112,88): error TS2345: Argument of type '() => { title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: $Enums.DocumentDistributionMethod; emailSettings: string | ... 4 more ... | JsonArray; ... 6 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' is not assignable to parameter of type '{ meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers: { .....'.
|
||||
Type '() => { title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: $Enums.DocumentDistributionMethod; emailSettings: string | ... 4 more ... | JsonArray; ... 6 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' is not assignable to type '() => { meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers...'.
|
||||
Call signature return types '{ title: string; documentData: undefined; meta: { subject: string | undefined; message: string | undefined; distributionMethod: DocumentDistributionMethod; ... 7 more ...; redirectUrl: string | undefined; }; signers: { ...; }[]; }' and '{ meta: { timezone: string; signingOrder: "PARALLEL" | "SEQUENTIAL"; distributionMethod: "EMAIL" | "NONE"; emailSettings: { recipientSigningRequest: boolean; recipientRemoved: boolean; ... 4 more ...; ownerDocumentCompleted: boolean; }; ... 7 more ...; externalId?: string | undefined; }; title: string; signers: { .....' are incompatible.
|
||||
The types of 'meta.emailSettings' are incompatible between these types.
|
||||
Type 'string | number | boolean | { recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; } | JsonObject | JsonArray' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; }'.
|
||||
Type 'string' is not assignable to type '{ recipientSigningRequest: boolean; recipientRemoved: boolean; recipientSigned: boolean; documentPending: boolean; documentCompleted: boolean; documentDeleted: boolean; ownerDocumentCompleted: boolean; }'.
|
||||
app/routes/embed+/v1+/authoring+/template.edit.$id.tsx(144,75): error TS2345: Argument of type '() => { fields: { nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' is not assignable to parameter of type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | (() => { ...; } | null) | null'.
|
||||
Type '() => { fields: { nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' is not assignable to type '() => { fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | null'.
|
||||
Call signature return types '{ fields: { nativeId: number; formId: string; type: FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]; }' and '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; ... 8 more ...; nativeId?: number | undefined; }[]; } | null' are incompatible.
|
||||
The types of 'fields' are incompatible between these types.
|
||||
Type '{ nativeId: number; formId: string; type: FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; pageHeight: number; ... 7 more ...; nativeId?: number | undefined; }[]'.
|
||||
Type '{ nativeId: number; formId: string; type: $Enums.FieldType; signerEmail: string; inserted: boolean; recipientId: number; pageNumber: number; pageX: number; pageY: number; pageWidth: number; pageHeight: number; fieldMeta: string | ... 4 more ... | undefined; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; recipientId: number; pageWidth: number; pageHeight: number; ... 7 more ...; nativeId?: number | undefined; }'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'string | number | boolean | JsonObject | JsonArray | undefined' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | undefined'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | undefined'.
|
||||
app/routes/embed+/v1+/multisign+/_index.tsx(56,31): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/v1+/multisign+/_index.tsx(56,55): error TS2339: Property 'embedSigningWhiteLabel' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedSigningWhiteLabel' does not exist on type 'string'.
|
||||
app/routes/embed+/v1+/multisign+/_index.tsx(57,25): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
app/routes/embed+/v1+/multisign+/_index.tsx(57,49): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
../../packages/api/v1/implementation.ts(488,3): error TS2322: Type '(args: { body: { globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; title: string; type?: "PUBLIC" | "PRIVATE" | undefined; ... 6 more ...; attachments?: { ...; }[] | undefined; }; headers: { ...; }; }, { request }: B) => Promise<...>' is not assignable to type 'AppRouteImplementationOrOptions<{ method: "POST"; body: ZodObject<{ title: ZodString; folderId: ZodOptional<ZodString>; externalId: ZodOptional<ZodNullable<ZodString>>; ... 7 more ...; attachments: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; summary: "Create a new template and get a presigned URL"...'.
|
||||
Type '(args: { body: { globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; title: string; type?: "PUBLIC" | "PRIVATE" | undefined; ... 6 more ...; attachments?: { ...; }[] | undefined; }; headers: { ...; }; }, { request }: B) => Promise<...>' is not assignable to type 'AppRouteImplementation<{ method: "POST"; body: ZodObject<{ title: ZodString; folderId: ZodOptional<ZodString>; externalId: ZodOptional<ZodNullable<ZodString>>; ... 7 more ...; attachments: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; summary: "Create a new template and get a presigned URL"; path: "...'.
|
||||
Type 'Promise<{ status: 500; body: { message: string; uploadUrl?: undefined; template?: undefined; }; } | { status: 400; body: { message: string; uploadUrl?: undefined; template?: undefined; }; } | { status: 200; body: { ...; }; } | { ...; } | { ...; }>' is not assignable to type 'Promise<Prettify<AppRouteResponses<{ method: "POST"; body: ZodObject<{ title: ZodString; folderId: ZodOptional<ZodString>; externalId: ZodOptional<ZodNullable<ZodString>>; ... 7 more ...; attachments: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; summary: "Create a new template and get a presigned U...'.
|
||||
Type '{ status: 500; body: { message: string; uploadUrl?: undefined; template?: undefined; }; } | { status: 400; body: { message: string; uploadUrl?: undefined; template?: undefined; }; } | { status: 200; body: { ...; }; } | { ...; } | { ...; }' is not assignable to type 'Prettify<AppRouteResponses<{ method: "POST"; body: ZodObject<{ title: ZodString; folderId: ZodOptional<ZodString>; externalId: ZodOptional<ZodNullable<ZodString>>; ... 7 more ...; attachments: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; summary: "Create a new template and get a presigned URL"; pat...'.
|
||||
Type '{ status: 200; body: { uploadUrl: string; template: { envelopeId: string; type: $Enums.TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; message?: u...' is not assignable to type 'Prettify<AppRouteResponses<{ method: "POST"; body: ZodObject<{ title: ZodString; folderId: ZodOptional<ZodString>; externalId: ZodOptional<ZodNullable<ZodString>>; ... 7 more ...; attachments: ZodOptional<...>; }, "strip", ZodTypeAny, { ...; }, { ...; }>; summary: "Create a new template and get a presigned URL"; pat...'.
|
||||
Type '{ status: 200; body: { uploadUrl: string; template: { envelopeId: string; type: $Enums.TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; message?: u...' is not assignable to type '{ status: 200; body: { template: { type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { ...; } | null; ... 15 more ...; templateDocumentDataId?: string | undefined; }; uploadUrl: string; }; }'.
|
||||
The types of 'body.template.fields' are incompatible between these types.
|
||||
Type '{ documentId: null; templateId: number; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: null; templateId: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/auth/server/lib/utils/organisation-portal.ts(50,6): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/auth/server/lib/utils/organisation-portal.ts(50,43): error TS2339: Property 'authenticationPortal' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'authenticationPortal' does not exist on type 'string'.
|
||||
../../packages/ee/server-only/limits/server.ts(83,7): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/ee/server-only/limits/server.ts(83,44): error TS2339: Property 'unlimitedDocuments' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'unlimitedDocuments' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(170,7): error TS18047: 'claims.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(170,20): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(221,7): error TS18047: 'claims.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(221,20): error TS2339: Property 'hidePoweredBy' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'hidePoweredBy' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(235,8): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/email/get-email-context.ts(235,45): error TS2339: Property 'emailDomains' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'emailDomains' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/envelope/create-envelope.ts(216,6): error TS18047: 'team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/envelope/create-envelope.ts(216,48): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/envelope/get-envelope-for-direct-template-signing.ts(144,5): error TS2322: Type '{ documentMeta: { id: string; language: string; message: string | null; subject: string | null; timezone: string | null; dateFormat: string | null; redirectUrl: string | null; signingOrder: DocumentSigningOrder; ... 7 more ...; emailId: string | null; }; ... 4 more ...; directLink: { ...; } | null; } & { ...; }' is not assignable to type '{ type: "DOCUMENT" | "TEMPLATE"; id: string; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { language: string; timezone: string | null; dateFormat: string | null; ... 6 more ...; distributionMethod: "EMAIL" | "NONE"; }; ... 12 more ...; recipients: { ...; }[]; }'.
|
||||
Types of property 'authOptions' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; }'.
|
||||
../../packages/lib/server-only/envelope/get-envelope-for-direct-template-signing.ts(148,7): error TS2322: Type '({ signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; } & { type: FieldType; ... 12 more ...; inserted: boolean; })[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; ...'.
|
||||
Type '{ signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; } & { type: FieldType; ... 12 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/lib/server-only/envelope/get-envelope-for-recipient-signing.ts(284,5): error TS2322: Type '{ documentMeta: { id: string; language: string; message: string | null; subject: string | null; timezone: string | null; dateFormat: string | null; redirectUrl: string | null; signingOrder: DocumentSigningOrder; ... 7 more ...; emailId: string | null; }; team: { ...; }; user: { ...; }; envelopeItems: { ...; }[]; rec...' is not assignable to type '{ type: "DOCUMENT" | "TEMPLATE"; id: string; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { language: string; timezone: string | null; dateFormat: string | null; ... 6 more ...; distributionMethod: "EMAIL" | "NONE"; }; ... 12 more ...; recipients: { ...; }[]; }'.
|
||||
Types of property 'authOptions' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; }'.
|
||||
../../packages/lib/server-only/envelope/get-envelope-for-recipient-signing.ts(285,5): error TS2322: Type '{ fields: ({ signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; } & { type: FieldType; ... 12 more ...; inserted: boolean; })[]; } & { ...; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 13 more ...; signature?: { ...; } | ... 1 more ... | undefined; }[]; ... 10 more ...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '({ signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; } & { type: FieldType; ... 12 more ...; inserted: boolean; })[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; ...'.
|
||||
Type '{ signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; } & { type: FieldType; ... 12 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/lib/server-only/envelope/update-envelope.ts(119,42): error TS18047: 'envelope.team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/envelope/update-envelope.ts(119,93): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(212,24): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(217,42): error TS2589: Type instantiation is excessively deep and possibly infinite.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(223,24): error TS2339: Property 'filter' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'filter' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(223,32): error TS7006: Parameter 'v' implicitly has an 'any' type.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(223,54): error TS7006: Parameter 'v' implicitly has an 'any' type.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(226,70): error TS2339: Property 'find' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'find' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/field/sign-field-with-token.ts(226,76): error TS7006: Parameter 'v' implicitly has an 'any' type.
|
||||
../../packages/lib/server-only/field/update-envelope-fields.ts(102,77): error TS2339: Property 'type' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'type' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/organisation/create-organisation.ts(64,7): error TS2322: Type '{ id: string; typedSignatureEnabled: boolean; uploadSignatureEnabled: boolean; drawSignatureEnabled: boolean; emailReplyTo: string | null; emailId: string | null; documentVisibility: $Enums.DocumentVisibility; ... 10 more ...; brandingCompanyDetails: string; }' is not assignable to type '(Without<OrganisationGlobalSettingsCreateInput, OrganisationGlobalSettingsUncheckedCreateInput> & OrganisationGlobalSettingsUncheckedCreateInput) | (Without<...> & OrganisationGlobalSettingsCreateInput)'.
|
||||
Type '{ id: string; typedSignatureEnabled: boolean; uploadSignatureEnabled: boolean; drawSignatureEnabled: boolean; emailReplyTo: string | null; emailId: string | null; documentVisibility: $Enums.DocumentVisibility; ... 10 more ...; brandingCompanyDetails: string; }' is not assignable to type 'Without<OrganisationGlobalSettingsCreateInput, OrganisationGlobalSettingsUncheckedCreateInput> & OrganisationGlobalSettingsUncheckedCreateInput'.
|
||||
Type '{ id: string; typedSignatureEnabled: boolean; uploadSignatureEnabled: boolean; drawSignatureEnabled: boolean; emailReplyTo: string | null; emailId: string | null; documentVisibility: $Enums.DocumentVisibility; ... 10 more ...; brandingCompanyDetails: string; }' is not assignable to type 'OrganisationGlobalSettingsUncheckedCreateInput'.
|
||||
Types of property 'emailDocumentSettings' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type 'JsonNull | InputJsonValue'.
|
||||
Type 'null' is not assignable to type 'JsonNull | InputJsonValue'.
|
||||
../../packages/lib/server-only/organisation/create-organisation.ts(206,7): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/server-only/pdf/insert-field-in-pdf-v2.ts(41,7): error TS2322: Type '{ width: number; height: number; positionX: number; positionY: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 8 more ...; renderId: string; }' is not assignable to type 'FieldToRender'.
|
||||
Type '{ width: number; height: number; positionX: number; positionY: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 8 more ...; renderId: string; }' is not assignable to type '{ renderId: string; width: number; height: number; positionX: number; positionY: number; fieldMeta?: { type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | u...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 10 more ... | undefined'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 10 more ... | undefined'.
|
||||
../../packages/lib/server-only/recipient/create-envelope-recipients.ts(80,36): error TS18047: 'envelope.team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/recipient/create-envelope-recipients.ts(80,87): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/recipient/set-document-recipients.ts(109,36): error TS18047: 'envelope.team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/recipient/set-document-recipients.ts(109,87): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/recipient/set-template-recipients.ts(73,36): error TS18047: 'envelope.team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/recipient/set-template-recipients.ts(73,87): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/recipient/update-envelope-recipients.ts(88,36): error TS18047: 'envelope.team.organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/lib/server-only/recipient/update-envelope-recipients.ts(88,87): error TS2339: Property 'cfr21' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'cfr21' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/team/create-team.ts(138,11): error TS2322: Type '{ id: string; typedSignatureEnabled: boolean | null; uploadSignatureEnabled: boolean | null; drawSignatureEnabled: boolean | null; emailReplyTo: string | null; emailId: string | null; ... 11 more ...; brandingCompanyDetails: string | null; }' is not assignable to type '(Without<TeamGlobalSettingsCreateInput, TeamGlobalSettingsUncheckedCreateInput> & TeamGlobalSettingsUncheckedCreateInput) | (Without<...> & TeamGlobalSettingsCreateInput)'.
|
||||
Type '{ id: string; typedSignatureEnabled: boolean | null; uploadSignatureEnabled: boolean | null; drawSignatureEnabled: boolean | null; emailReplyTo: string | null; emailId: string | null; ... 11 more ...; brandingCompanyDetails: string | null; }' is not assignable to type 'Without<TeamGlobalSettingsCreateInput, TeamGlobalSettingsUncheckedCreateInput> & TeamGlobalSettingsUncheckedCreateInput'.
|
||||
Type '{ id: string; typedSignatureEnabled: boolean | null; uploadSignatureEnabled: boolean | null; drawSignatureEnabled: boolean | null; emailReplyTo: string | null; emailId: string | null; ... 11 more ...; brandingCompanyDetails: string | null; }' is not assignable to type 'TeamGlobalSettingsUncheckedCreateInput'.
|
||||
Types of property 'emailDocumentSettings' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type 'NullableJsonNullValueInput | InputJsonValue | undefined'.
|
||||
Type 'null' is not assignable to type 'NullableJsonNullValueInput | InputJsonValue | undefined'.
|
||||
../../packages/lib/server-only/template/create-document-from-direct-template.ts(661,59): error TS2339: Property 'actionAuth' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'actionAuth' does not exist on type 'string'.
|
||||
../../packages/lib/server-only/template/create-document-from-template.ts(150,9): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/server-only/template/create-document-from-template.ts(167,9): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/server-only/template/create-document-from-template.ts(208,9): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/server-only/template/create-document-from-template.ts(253,9): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/server-only/template/create-document-from-template.ts(283,9): error TS2698: Spread types may only be created from object types.
|
||||
../../packages/lib/utils/document.ts(85,5): error TS2322: Type 'JsonValue' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; }'.
|
||||
../../packages/lib/utils/document.ts(86,5): error TS2322: Type 'JsonValue' is not assignable to type 'Record<string, string | number | boolean> | null'.
|
||||
Type 'string' is not assignable to type 'Record<string, string | number | boolean>'.
|
||||
../../packages/lib/utils/document.ts(125,5): error TS2322: Type 'JsonValue' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; }'.
|
||||
../../packages/lib/utils/document.ts(126,5): error TS2322: Type 'JsonValue' is not assignable to type 'Record<string, string | number | boolean> | null'.
|
||||
Type 'string' is not assignable to type 'Record<string, string | number | boolean>'.
|
||||
../../packages/lib/utils/document.ts(146,5): error TS2322: Type '{ documentId: number | null; templateId: number | null; id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: JsonValue; ... 7 more ...; sendStatus: SendStatus; }[]' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: { accessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; actionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD" | "EXPLICIT_NONE")[]; } | null; ... 9 more ...; templateId?: number | ... 1 more...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: JsonValue | null; ... 7 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; envelopeId: string; authOptions: { accessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; actionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD" | "EXPLICIT_NONE")[]; } | null; ... 9 more ...; templateId?: number | ... 1 more...'.
|
||||
Types of property 'authOptions' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ accessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; actionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD" | "EXPLICIT_NONE")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ accessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; actionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD" | "EXPLICIT_NONE")[]; }'.
|
||||
../../packages/lib/utils/templates.ts(61,5): error TS2322: Type 'JsonValue' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; } | null'.
|
||||
Type 'string' is not assignable to type '{ globalAccessAuth: ("ACCOUNT" | "TWO_FACTOR_AUTH")[]; globalActionAuth: ("ACCOUNT" | "PASSKEY" | "TWO_FACTOR_AUTH" | "PASSWORD")[]; }'.
|
||||
../../packages/trpc/server/admin-router/find-subscription-claims.ts(17,10): error TS2345: Argument of type '({ input }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: SessionUser; session: { id: string; createdAt: Date; updatedAt: Date; userId: number; ipAddress: string | null; userAgent: string | null; sessionToken: string; expiresAt: Date; }; ... 4 more ...; res: Response; }, { ...; }>) => Promise<...>' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: SessionUser; session: { id: string; createdAt: Date; updatedAt: Date; userId: number; ipAddress: string | null; userAgent: string | null; sessionToken: string; expiresAt: Date; }; ... 4 more ...; res: Response; }, { ...; }, { ...; }, unknown>'.
|
||||
Type 'Promise<{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }>' is not assignable to type 'MaybePromise<{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }[]; count: number; perPage: number; curr...'.
|
||||
Type 'Promise<{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }>' is not assignable to type 'Promise<{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }[]; count: number; perPage: number; currentPa...'.
|
||||
Type '{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: Prisma.JsonValue; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }' is not assignable to type '{ data: { id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }[]; count: number; perPage: number; currentPage: numb...'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }[]' is not assignable to type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }[]'.
|
||||
Type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }' is not assignable to type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Types of property 'flags' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
../../packages/trpc/server/admin-router/find-subscription-claims.ts(70,5): error TS2322: Type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }[]' is not assignable to type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }[]'.
|
||||
Type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: JsonValue; }' is not assignable to type '{ id: string; name: string; createdAt: Date; updatedAt: Date; locked: boolean; teamCount: number; memberCount: number; envelopeItemCount: number; flags: { allowCustomBranding?: boolean | undefined; ... 9 more ...; allowEnvelopes?: boolean | undefined; }; }'.
|
||||
Types of property 'flags' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
../../packages/trpc/server/admin-router/get-admin-organisation.ts(13,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: SessionUser; session: { id: string; createdAt: Date; updatedAt: Date; userId: number; ipAddress: string | null; userAgent: string | null; sessionToken: string; expiresAt: Date; }; ... 4 more ...; res: Response; }, { ...; }>) => Promise<...>' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: SessionUser; session: { id: string; createdAt: Date; updatedAt: Date; userId: number; ipAddress: string | null; userAgent: string | null; sessionToken: string; expiresAt: Date; }; ... 4 more ...; res: Response; }, { ...; }, { ...; }, unknown>'.
|
||||
Type 'Promise<{ subscription: { id: number; status: SubscriptionStatus; priceId: string; createdAt: Date; updatedAt: Date; customerId: string; organisationId: string; planId: string; periodEnd: Date | null; cancelAtPeriodEnd: boolean; } | null; organisationClaim: { ...; }; organisationGlobalSettings: { ...; }; members: ({...' is not assignable to type 'MaybePromise<{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }>'.
|
||||
Type 'Promise<{ subscription: { id: number; status: SubscriptionStatus; priceId: string; createdAt: Date; updatedAt: Date; customerId: string; organisationId: string; planId: string; periodEnd: Date | null; cancelAtPeriodEnd: boolean; } | null; organisationClaim: { ...; }; organisationGlobalSettings: { ...; }; members: ({...' is not assignable to type 'Promise<{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }>'.
|
||||
Type '{ subscription: { id: number; status: SubscriptionStatus; priceId: string; createdAt: Date; updatedAt: Date; customerId: string; organisationId: string; planId: string; periodEnd: Date | null; cancelAtPeriodEnd: boolean; } | null; organisationClaim: { ...; }; organisationGlobalSettings: { ...; }; members: ({ ...; } ...' is not assignable to type '{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }'.
|
||||
The types of 'organisationClaim.flags' are incompatible between these types.
|
||||
Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
../../packages/trpc/server/admin-router/update-subscription-claim.ts(30,49): error TS2345: Argument of type 'JsonValue' is not assignable to parameter of type 'Partial<{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }>'.
|
||||
Type 'null' is not assignable to type 'Partial<{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }>'.
|
||||
../../packages/trpc/server/document-router/attachment/find-attachments.ts(24,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }>' is not assignable to type 'MaybePromise<{ data: { data: string; type: "link"; id: string; label: string; }[]; }>'.
|
||||
Type 'Promise<{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }>' is not assignable to type 'Promise<{ data: { data: string; type: "link"; id: string; label: string; }[]; }>'.
|
||||
Type '{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }' is not assignable to type '{ data: { data: string; type: "link"; id: string; label: string; }[]; }'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]' is not assignable to type '{ data: string; type: "link"; id: string; label: string; }[]'.
|
||||
Type '{ data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }' is not assignable to type '{ data: string; type: "link"; id: string; label: string; }'.
|
||||
Types of property 'type' are incompatible.
|
||||
Type 'string' is not assignable to type '"link"'.
|
||||
../../packages/trpc/server/document-router/create-document-temporary.ts(28,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ document: { envelopeId: string; documentDataId: string; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; folder: { ...; } | null; uploadUrl: string; }>' is not assignable to type 'MaybePromise<{ document: { id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; ... 15 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }; uploadUr...'.
|
||||
Type 'Promise<{ document: { envelopeId: string; documentDataId: string; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; folder: { ...; } | null; uploadUrl: string; }>' is not assignable to type 'Promise<{ document: { id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; ... 15 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }; uploadUrl: st...'.
|
||||
Type '{ document: { envelopeId: string; documentDataId: string; documentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; folder: { ...; } | null; uploadUrl: string; }' is not assignable to type '{ document: { id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; ... 15 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }; uploadUrl: string; }'.
|
||||
The types of 'document.fields' are incompatible between these types.
|
||||
Type '{ documentId: number; templateId: null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number; templateId: null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/document-router/get-document.ts(14,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; id: number; ... 31 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined;...'.
|
||||
Type 'Promise<{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; id: number; ... 31 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type '{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 32 more ...; documentMetaId: string; }' is not assignable to type '{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number; templateId: null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number; templateId: null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/document-router/update-document.ts(18,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ id: number; envelopeId: string; type: EnvelopeType; source: DocumentSource; status: DocumentStatus; createdAt: Date; updatedAt: Date; ... 18 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; updatedAt: Date; userId: number; ... 13 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type 'Promise<{ id: number; envelopeId: string; type: EnvelopeType; source: DocumentSource; status: DocumentStatus; createdAt: Date; updatedAt: Date; ... 18 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; updatedAt: Date; userId: number; ... 13 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type '{ id: number; envelopeId: string; type: $Enums.EnvelopeType; source: $Enums.DocumentSource; status: $Enums.DocumentStatus; ... 20 more ...; documentMetaId: string; }' is not assignable to type '{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; updatedAt: Date; userId: number; ... 13 more ...; documentDataId?: string | undefined; }'.
|
||||
Types of property 'formValues' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type 'Record<string, string | number | boolean> | null'.
|
||||
Type 'string' is not assignable to type 'Record<string, string | number | boolean>'.
|
||||
../../packages/trpc/server/embedding-router/create-embedding-presign-token.ts(47,14): error TS18047: 'organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/trpc/server/embedding-router/create-embedding-presign-token.ts(47,38): error TS2339: Property 'embedAuthoring' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'embedAuthoring' does not exist on type 'string'.
|
||||
../../packages/trpc/server/embedding-router/get-multi-sign-document.ts(17,10): error TS2345: Argument of type '({ input, ctx: { metadata } }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: null; session: null; metadata: ApiRequestMetadata; teamId: number | undefined; logger: Logger<...>; req: Request; res: Response; } | { ...; }, { ...; }>) => Promise<...>' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: null; session: null; metadata: ApiRequestMetadata; teamId: number | undefined; logger: Logger<...>; req: Request; res: Response; } | { ...; }, { ...; }, { ...; }, unknown>'.
|
||||
Type 'Promise<{ folder: null; fields: { recipient: { documentId: number; templateId: null; fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 14 more ...; sendStatus: SendStatus; }; ... 16 more ...; inserted: boolean; }[]; ... 3...' is not assignable to type 'MaybePromise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 10 more ...; emailSettings?: unknown; } | null; ... 19 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type 'Promise<{ folder: null; fields: { recipient: { documentId: number; templateId: null; fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 14 more ...; sendStatus: SendStatus; }; ... 16 more ...; inserted: boolean; }[]; ... 3...' is not assignable to type 'Promise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 10 more ...; emailSettings?: unknown; } | null; ... 19 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type '{ folder: null; fields: { recipient: { documentId: number; templateId: null; fields: { type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 14 more ...; sendStatus: $Enums.SendStatus; }; ... 16 more ...; inserted: boolean; }[]; ... 31 more ...; documentMetaId:...' is not assignable to type '{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 10 more ...; emailSettings?: unknown; } | null; ... 19 more ...; documentDataId?: string | undefined; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ recipient: { documentId: number; templateId: null; fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 14 more ...; sendStatus: SendStatus; }; ... 16 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; ... 12 mor...'.
|
||||
Type '{ recipient: { documentId: number; templateId: null; fields: { type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }[]; ... 14 more ...; sendStatus: $Enums.SendStatus; }; ... 16 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; signature: { id: number; recipientId: number; fieldId: number; created: Date; signatureImageAsBase64: string | null; typedSignature: string | null; } | null; ... 12 mor...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/enterprise-router/create-organisation-email-domain.ts(50,10): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/trpc/server/enterprise-router/create-organisation-email-domain.ts(50,47): error TS2339: Property 'emailDomains' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'emailDomains' does not exist on type 'string'.
|
||||
../../packages/trpc/server/enterprise-router/get-organisation-authentication-portal.ts(67,8): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/trpc/server/enterprise-router/get-organisation-authentication-portal.ts(67,45): error TS2339: Property 'authenticationPortal' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'authenticationPortal' does not exist on type 'string'.
|
||||
../../packages/trpc/server/enterprise-router/update-organisation-authentication-portal.ts(50,10): error TS18047: 'organisation.organisationClaim.flags' is possibly 'null'.
|
||||
../../packages/trpc/server/enterprise-router/update-organisation-authentication-portal.ts(50,47): error TS2339: Property 'authenticationPortal' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'authenticationPortal' does not exist on type 'string'.
|
||||
../../packages/trpc/server/envelope-router/attachment/find-attachments.ts(16,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }>' is not assignable to type 'MaybePromise<{ data: { data: string; type: "link"; id: string; label: string; }[]; }>'.
|
||||
Type 'Promise<{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }>' is not assignable to type 'Promise<{ data: { data: string; type: "link"; id: string; label: string; }[]; }>'.
|
||||
Type '{ data: { data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]; }' is not assignable to type '{ data: { data: string; type: "link"; id: string; label: string; }[]; }'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }[]' is not assignable to type '{ data: string; type: "link"; id: string; label: string; }[]'.
|
||||
Type '{ data: string; type: string; id: string; label: string; createdAt: Date; updatedAt: Date; envelopeId: string; }' is not assignable to type '{ data: string; type: "link"; id: string; label: string; }'.
|
||||
Types of property 'type' are incompatible.
|
||||
Type 'string' is not assignable to type '"link"'.
|
||||
../../packages/trpc/server/envelope-router/envelope-fields/create-envelope-fields.ts(14,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ data: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templat...'.
|
||||
Type 'Promise<{ data: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?:...'.
|
||||
Type '{ data: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/envelope-fields/get-envelope-field.ts(14,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; inserted: boole...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; inserted: boolean; }>'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/envelope-fields/update-envelope-fields.ts(14,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ data: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templat...'.
|
||||
Type 'Promise<{ data: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?:...'.
|
||||
Type '{ data: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ data: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/envelope-recipients/get-envelope-recipient.ts(16,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }[]; } & { ...; }>' is not assignable to type 'MaybePromise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ...'.
|
||||
Type 'Promise<{ fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }[]; } & { ...; }>' is not assignable to type 'Promise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 9...'.
|
||||
Type '{ fields: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }[]; } & { ...; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 9 more .....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/get-envelope.ts(14,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ user: { id: number; name: string; email: string; }; documentMeta: { id: string; language: string; message: string | null; subject: string | null; timezone: string | null; dateFormat: string | null; ... 9 more ...; emailId: string | null; }; ... 30 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; ... 14 more ...; emailSettings?: unknown; }; ... 23 more ...; authOptions?: unknown; }>'.
|
||||
Type 'Promise<{ user: { id: number; name: string; email: string; }; documentMeta: { id: string; language: string; message: string | null; subject: string | null; timezone: string | null; dateFormat: string | null; ... 9 more ...; emailId: string | null; }; ... 30 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; ... 14 more ...; emailSettings?: unknown; }; ... 23 more ...; authOptions?: unknown; }>'.
|
||||
Type '{ user: { id: number; name: string; email: string; }; documentMeta: { id: string; language: string; message: string | null; subject: string | null; timezone: string | null; dateFormat: string | null; ... 9 more ...; emailId: string | null; }; ... 30 more ...; documentMetaId: string; }' is not assignable to type '{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; ... 14 more ...; emailSettings?: unknown; }; ... 23 more ...; authOptions?: unknown; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; ...'.
|
||||
Type '{ type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 10 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/sign-envelope-field.ts(22,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: null; session: null; metadata: ApiRequestMetadata; teamId: number | undefined; logger: Logger<...>; req: Request; res: Response; } | { ...; }, { ...; }>) => Promise<...>' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: null; session: null; metadata: ApiRequestMetadata; teamId: number | undefined; logger: Logger<...>; req: Request; res: Response; } | { ...; }, { ...; }, { ...; }, unknown>'.
|
||||
Type 'Promise<{ signedField: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }; }>' is not assignable to type 'MaybePromise<{ signedField: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; ...'.
|
||||
Type 'Promise<{ signedField: { type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; recipientId: number; ... 5 more ...; inserted: boolean; }; }>' is not assignable to type 'Promise<{ signedField: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; signa...'.
|
||||
Type '{ signedField: { type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }; }' is not assignable to type '{ signedField: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 11 more ...; signature?: {...'.
|
||||
The types of 'signedField.fieldMeta' are incompatible between these types.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/envelope-router/sign-envelope-field.ts(123,26): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
../../packages/trpc/server/envelope-router/update-envelope.ts(14,13): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ type: EnvelopeType; id: string; source: DocumentSource; status: DocumentStatus; createdAt: Date; updatedAt: Date; userId: number; ... 17 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; ... 15 more ...; authOptions?: unknown; }>'.
|
||||
Type 'Promise<{ type: EnvelopeType; id: string; source: DocumentSource; status: DocumentStatus; createdAt: Date; updatedAt: Date; userId: number; ... 17 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; ... 15 more ...; authOptions?: unknown; }>'.
|
||||
Type '{ type: EnvelopeType; id: string; source: DocumentSource; status: DocumentStatus; createdAt: Date; updatedAt: Date; userId: number; ... 17 more ...; documentMetaId: string; }' is not assignable to type '{ type: "DOCUMENT" | "TEMPLATE"; id: string; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; createdAt: Date; ... 15 more ...; authOptions?: unknown; }'.
|
||||
Types of property 'formValues' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type 'Record<string, string | number | boolean> | null'.
|
||||
Type 'string' is not assignable to type 'Record<string, string | number | boolean>'.
|
||||
../../packages/trpc/server/field-router/router.ts(61,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(94,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(140,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(182,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(222,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(285,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; ... 9 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; ... 9 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ formId: string | undefined; documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(333,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(380,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(413,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(455,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'MaybePromise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: nu...'.
|
||||
Type 'Promise<{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }>' is not assignable to type 'Promise<{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: number ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(495,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/field-router/router.ts(557,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; ... 9 more ...; inserted: boolean; }[]; }>' is not assignable to type 'MaybePromise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templ...'.
|
||||
Type 'Promise<{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; ... 9 more ...; inserted: boolean; }[]; }>' is not assignable to type 'Promise<{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId...'.
|
||||
Type '{ fields: { formId: string | undefined; documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; }' is not assignable to type '{ fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; ... 5 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; templateId?: numbe...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ formId: string | undefined; documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ formId: string | undefined; documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/organisation-router/get-organisation-session.ts(69,3): error TS2322: Type '{ teams: { currentTeamRole: TeamMemberRole; teamGroups: ({ organisationGroup: { type: OrganisationGroupType; id: string; name: string | null; organisationRole: OrganisationMemberRole; organisationId: string; }; } & { ...; })[]; ... 6 more ...; teamGlobalSettingsId: string; }[]; ... 15 more ...; organisationAuthentic...' is not assignable to type '{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 5 more ...; currentOrganisationRole: "ADMIN" | ... 1 more ... | "MEMBER"; }[]'.
|
||||
Type '{ teams: { currentTeamRole: TeamMemberRole; teamGroups: ({ organisationGroup: { type: $Enums.OrganisationGroupType; id: string; name: string | null; organisationRole: $Enums.OrganisationMemberRole; organisationId: string; }; } & { ...; })[]; ... 6 more ...; teamGlobalSettingsId: string; }[]; ... 15 more ...; organis...' is not assignable to type '{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 5 more ...; currentOrganisationRole: "ADMIN" | ... 1 more ... | "MEMBER"; }'.
|
||||
The types of 'organisationClaim.flags' are incompatible between these types.
|
||||
Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
../../packages/trpc/server/organisation-router/get-organisation.ts(14,10): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ teams: { id: number; name: string; url: string; createdAt: Date; avatarImageId: string | null; organisationId: string; teamGlobalSettingsId: string; }[]; subscription: { id: number; status: SubscriptionStatus; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 14 more ...; organisationAuthentication...' is not assignable to type 'MaybePromise<{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }>'.
|
||||
Type 'Promise<{ teams: { id: number; name: string; url: string; createdAt: Date; avatarImageId: string | null; organisationId: string; teamGlobalSettingsId: string; }[]; subscription: { id: number; status: SubscriptionStatus; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 14 more ...; organisationAuthentication...' is not assignable to type 'Promise<{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }>'.
|
||||
Type '{ teams: { id: number; name: string; url: string; createdAt: Date; avatarImageId: string | null; organisationId: string; teamGlobalSettingsId: string; }[]; subscription: { id: number; status: $Enums.SubscriptionStatus; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 14 more ...; organisationAuthenticationP...' is not assignable to type '{ type: "PERSONAL" | "ORGANISATION"; id: string; name: string; url: string; createdAt: Date; updatedAt: Date; subscription: { id: number; status: "ACTIVE" | "PAST_DUE" | "INACTIVE"; ... 7 more ...; cancelAtPeriodEnd: boolean; } | null; ... 6 more ...; teams: { ...; }[]; }'.
|
||||
The types of 'organisationClaim.flags' are incompatible between these types.
|
||||
Type 'JsonValue' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
Type 'null' is not assignable to type '{ allowCustomBranding?: boolean | undefined; hidePoweredBy?: boolean | undefined; unlimitedDocuments?: boolean | undefined; emailDomains?: boolean | undefined; embedAuthoring?: boolean | undefined; ... 5 more ...; allowEnvelopes?: boolean | undefined; }'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(65,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: SendStatus; }>' is not assignable to type 'MaybePromise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: SendStatus; }>' is not assignable to type 'Promise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 1...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(174,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }>' is not assignable to type 'MaybePromise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }>' is not assignable to type 'Promise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 1...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(213,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ recipients: { fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]; }>' is not assignable to type 'MaybePromise<{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...'.
|
||||
Type 'Promise<{ recipients: { fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]; }>' is not assignable to type 'Promise<{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...; ...'.
|
||||
Type '{ recipients: { fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }[]; }' is not assignable to type '{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...; authOpti...'.
|
||||
Types of property 'recipients' are incompatible.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(320,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: SendStatus; }>' is not assignable to type 'MaybePromise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: SendStatus; }>' is not assignable to type 'Promise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 1...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 17 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(429,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }>' is not assignable to type 'MaybePromise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ...'.
|
||||
Type 'Promise<{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }>' is not assignable to type 'Promise<{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 1...'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/recipient-router/router.ts(468,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ recipients: { fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]; }>' is not assignable to type 'MaybePromise<{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...'.
|
||||
Type 'Promise<{ recipients: { fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]; }>' is not assignable to type 'Promise<{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...; ...'.
|
||||
Type '{ recipients: { fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }[]; }' is not assignable to type '{ recipients: { id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | ... 4 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ...; authOpti...'.
|
||||
Types of property 'recipients' are incompatible.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: SendStatus; }[]' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Type '{ fields: { documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; ... 10 more ...; inserted: boolean; }[]; ... 16 more ...; sendStatus: $Enums.SendStatus; }' is not assignable to type '{ id: number; name: string; token: string; email: string; signingOrder: number | null; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 11 more ....'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/template-router/router.ts(74,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ data: { id: number; envelopeId: string; type: TemplateType; visibility: DocumentVisibility; externalId: string | null; title: string; userId: number; ... 12 more ...; directLink: { ...; } | null; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }>' is not assignable to type 'MaybePromise<{ data: { type: "PUBLIC" | "PRIVATE"; id: number; team: { id: number; url: string; } | null; createdAt: Date; updatedAt: Date; userId: number; fields: { type: "EMAIL" | "SIGNATURE" | ... 8 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 13 more ...; tem...'.
|
||||
Type 'Promise<{ data: { id: number; envelopeId: string; type: TemplateType; visibility: DocumentVisibility; externalId: string | null; title: string; userId: number; ... 12 more ...; directLink: { ...; } | null; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }>' is not assignable to type 'Promise<{ data: { type: "PUBLIC" | "PRIVATE"; id: number; team: { id: number; url: string; } | null; createdAt: Date; updatedAt: Date; userId: number; fields: { type: "EMAIL" | "SIGNATURE" | ... 8 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 13 more ...; template...'.
|
||||
Type '{ data: { id: number; envelopeId: string; type: $Enums.TemplateType; visibility: $Enums.DocumentVisibility; externalId: string | null; title: string; userId: number; teamId: number; ... 11 more ...; directLink: { ...; } | null; }[]; count: number; currentPage: number; perPage: number; totalPages: number; }' is not assignable to type '{ data: { type: "PUBLIC" | "PRIVATE"; id: number; team: { id: number; url: string; } | null; createdAt: Date; updatedAt: Date; userId: number; fields: { type: "EMAIL" | "SIGNATURE" | ... 8 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 13 more ...; templateDocument...'.
|
||||
Types of property 'data' are incompatible.
|
||||
Type '{ id: number; envelopeId: string; type: TemplateType; visibility: DocumentVisibility; externalId: string | null; title: string; userId: number; teamId: number; ... 11 more ...; directLink: { ...; } | null; }[]' is not assignable to type '{ type: "PUBLIC" | "PRIVATE"; id: number; team: { id: number; url: string; } | null; createdAt: Date; updatedAt: Date; userId: number; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | ... 7 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 13 more ...; templ...'.
|
||||
Type '{ id: number; envelopeId: string; type: $Enums.TemplateType; visibility: $Enums.DocumentVisibility; externalId: string | null; title: string; userId: number; teamId: number; ... 11 more ...; directLink: { ...; } | null; }' is not assignable to type '{ type: "PUBLIC" | "PRIVATE"; id: number; team: { id: number; url: string; } | null; createdAt: Date; updatedAt: Date; userId: number; fields: { type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | ... 7 more ... | "DROPDOWN"; ... 14 more ...; templateId?: number | ... 1 more ... | undefined; }[]; ... 13 more ...; templ...'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; ... 7 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number | null; templateId: number | null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; ... 9 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/template-router/router.ts(137,12): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ envelopeId: string; type: TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string | undefined;...'.
|
||||
Type 'Promise<{ envelopeId: string; type: TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string | undefined; }>'.
|
||||
Type '{ envelopeId: string; type: $Enums.TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }' is not assignable to type '{ type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string | undefined; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: null; templateId: number; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: null; templateId: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/template-router/router.ts(253,15): error TS2345: Argument of type '({ input, ctx }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ template: { envelopeId: string; type: TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; uploadUrl: string; }>' is not assignable to type 'MaybePromise<{ template: { type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string ...'.
|
||||
Type 'Promise<{ template: { envelopeId: string; type: TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; uploadUrl: string; }>' is not assignable to type 'Promise<{ template: { type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string | und...'.
|
||||
Type '{ template: { envelopeId: string; type: $Enums.TemplateType; templateDocumentDataId: string; templateDocumentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 30 more ...; documentMetaId: string; }; uploadUrl: string; }' is not assignable to type '{ template: { type: "PUBLIC" | "PRIVATE"; id: number; createdAt: Date; updatedAt: Date; userId: number; user: { id: number; name: string | null; email: string; }; folder: { type: "DOCUMENT" | "TEMPLATE"; ... 8 more ...; parentId: string | null; } | null; ... 15 more ...; templateDocumentDataId?: string | undefined; ...'.
|
||||
The types of 'template.fields' are incompatible between these types.
|
||||
Type '{ documentId: null; templateId: number; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: null; templateId: number; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/trpc/server/template-router/router.ts(453,15): error TS2345: Argument of type '({ ctx, input }: ProcedureResolverOptions<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "ap...' is not assignable to parameter of type 'ProcedureResolver<TrpcContext, TrpcRouteMeta, { user: { id: number; name: string | null; email: string; disabled: boolean; }; session: null; metadata: { auditUser: { id: null; email: null; name: string; } | { ...; }; auth: "api"; requestMetadata: { ...; }; source: "app" | ... 1 more ... | "apiV2"; }; teamId: number;...'.
|
||||
Type 'Promise<{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; id: number; ... 31 more ...; documentMetaId: string; }>' is not assignable to type 'MaybePromise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined;...'.
|
||||
Type 'Promise<{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: DocumentDataType; id: string; initialData: string; }; id: number; ... 31 more ...; documentMetaId: string; }>' is not assignable to type 'Promise<{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }>'.
|
||||
Type '{ envelopeId: string; internalVersion: number; documentData: { envelopeItemId: string; data: string; type: $Enums.DocumentDataType; id: string; initialData: string; }; ... 32 more ...; documentMetaId: string; }' is not assignable to type '{ id: number; source: "DOCUMENT" | "TEMPLATE" | "TEMPLATE_DIRECT_LINK"; status: "DRAFT" | "PENDING" | "COMPLETED" | "REJECTED"; documentMeta: { id: string; language: string; message: string | null; ... 14 more ...; documentId?: number | undefined; }; ... 20 more ...; documentDataId?: string | undefined; }'.
|
||||
Types of property 'fields' are incompatible.
|
||||
Type '{ documentId: number; templateId: null; type: FieldType; id: number; fieldMeta: JsonValue; envelopeId: string; secondaryId: string; width: Decimal; height: Decimal; ... 6 more ...; inserted: boolean; }[]' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Type '{ documentId: number; templateId: null; type: $Enums.FieldType; id: number; fieldMeta: JsonValue | null; envelopeId: string; secondaryId: string; ... 8 more ...; inserted: boolean; }' is not assignable to type '{ type: "EMAIL" | "SIGNATURE" | "FREE_SIGNATURE" | "INITIALS" | "NAME" | "DATE" | "TEXT" | "NUMBER" | "RADIO" | "CHECKBOX" | "DROPDOWN"; id: number; fieldMeta: { type: "initials"; label?: string | undefined; ... 4 more ...; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null; ... 12 more ...; ...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 9 more ... | null'.
|
||||
../../packages/ui/components/document/document-read-only-fields.tsx(181,29): error TS2322: Type 'DocumentField' is not assignable to type '{ inserted?: boolean | undefined; customText?: string | undefined; type: FieldType; fieldMeta?: { type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefi...'.
|
||||
Types of property 'fieldMeta' are incompatible.
|
||||
Type 'JsonValue' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 10 more ... | undefined'.
|
||||
Type 'string' is not assignable to type '{ type: "initials"; label?: string | undefined; placeholder?: string | undefined; required?: boolean | undefined; readOnly?: boolean | undefined; fontSize?: number | undefined; textAlign?: "left" | ... 2 more ... | undefined; } | ... 10 more ... | undefined'.
|
||||
../../packages/ui/components/document/envelope-recipient-field-tooltip.tsx(162,33): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
../../packages/ui/components/document/envelope-recipient-field-tooltip.tsx(169,32): error TS2339: Property 'readOnly' does not exist on type 'string | number | boolean | JsonObject | JsonArray'.
|
||||
Property 'readOnly' does not exist on type 'string'.
|
||||
npm error Lifecycle script `typecheck` failed with error:
|
||||
npm error code 2
|
||||
npm error path /Users/lucas/dev/documenso/apps/remix
|
||||
npm error workspace @documenso/remix@2.0.14
|
||||
npm error location /Users/lucas/dev/documenso/apps/remix
|
||||
npm error command failed
|
||||
npm error command sh -c react-router typegen && tsc
|
||||
npm error Lifecycle script `build:app` failed with error:
|
||||
npm error code 2
|
||||
npm error path /Users/lucas/dev/documenso/apps/remix
|
||||
npm error workspace @documenso/remix@2.0.14
|
||||
npm error location /Users/lucas/dev/documenso/apps/remix
|
||||
npm error command failed
|
||||
npm error command sh -c npm run typecheck && cross-env NODE_ENV=production react-router build
|
||||
npm error Lifecycle script `build` failed with error:
|
||||
npm error code 2
|
||||
npm error path /Users/lucas/dev/documenso/apps/remix
|
||||
npm error workspace @documenso/remix@2.0.14
|
||||
npm error location /Users/lucas/dev/documenso/apps/remix
|
||||
npm error command failed
|
||||
npm error command sh -c ./.bin/build.sh
|
||||
@ -61,7 +61,6 @@ services:
|
||||
- NEXT_PUBLIC_DISABLE_SIGNUP=${NEXT_PUBLIC_DISABLE_SIGNUP}
|
||||
- NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH=${NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH:-/opt/documenso/cert.p12}
|
||||
- NEXT_PRIVATE_SIGNING_PASSPHRASE=${NEXT_PRIVATE_SIGNING_PASSPHRASE}
|
||||
- NEXT_PUBLIC_USE_INTERNAL_URL_BROWSERLESS=${NEXT_PUBLIC_USE_INTERNAL_URL_BROWSERLESS}
|
||||
ports:
|
||||
- ${PORT:-3000}:${PORT:-3000}
|
||||
volumes:
|
||||
|
||||
31217
package-lock.json
generated
31217
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
75
package.json
75
package.json
@ -1,11 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@documenso/root",
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"version": "2.0.14",
|
||||
"version": "2.0.13",
|
||||
"scripts": {
|
||||
"build": "turbo run build",
|
||||
"dev": "turbo run dev --filter=@documenso/remix",
|
||||
@ -46,56 +41,60 @@
|
||||
"node": ">=22.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^20.1.0",
|
||||
"@commitlint/config-conventional": "^20.0.0",
|
||||
"@lingui/cli": "^5.6.0",
|
||||
"@prisma/client": "^6.19.0",
|
||||
"@trpc/client": "11.7.1",
|
||||
"@trpc/react-query": "11.7.1",
|
||||
"@trpc/server": "11.7.1",
|
||||
"@commitlint/cli": "^17.7.1",
|
||||
"@commitlint/config-conventional": "^17.7.0",
|
||||
"@lingui/cli": "^5.2.0",
|
||||
"@prisma/client": "^6.18.0",
|
||||
"@trpc/client": "11.7.0",
|
||||
"@trpc/react-query": "11.7.0",
|
||||
"@trpc/server": "11.7.0",
|
||||
"@ts-rest/core": "^3.52.1",
|
||||
"@ts-rest/open-api": "^3.52.1",
|
||||
"@ts-rest/serverless": "^3.52.1",
|
||||
"dotenv": "^17.2.3",
|
||||
"dotenv-cli": "^11.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"nanoid": "^5.1.6",
|
||||
"nodemailer": "^7.0.10",
|
||||
"pdfjs-dist": "5.4.296",
|
||||
"pino": "^9.14.0",
|
||||
"pino-pretty": "^13.1.2",
|
||||
"playwright": "1.56.1",
|
||||
"prettier": "^3.6.2",
|
||||
"prisma": "^6.19.0",
|
||||
"dotenv": "^16.5.0",
|
||||
"dotenv-cli": "^8.0.0",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-custom": "*",
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.2.2",
|
||||
"nodemailer": "^6.10.1",
|
||||
"playwright": "1.52.0",
|
||||
"prettier": "^3.3.3",
|
||||
"prisma": "^6.18.0",
|
||||
"prisma-extension-kysely": "^3.0.0",
|
||||
"prisma-json-types-generator": "^3.6.2",
|
||||
"prisma-kysely": "^2.2.1",
|
||||
"rimraf": "^6.1.2",
|
||||
"prisma-kysely": "^1.8.0",
|
||||
"rimraf": "^5.0.1",
|
||||
"superjson": "^2.2.5",
|
||||
"syncpack": "^14.0.0-alpha.27",
|
||||
"trpc-to-openapi": "2.4.0",
|
||||
"turbo": "^1.13.4",
|
||||
"vite": "^7.2.4",
|
||||
"turbo": "^1.9.3",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-static-copy": "^3.1.4",
|
||||
"zod-openapi": "^4.2.4",
|
||||
"zod-prisma-types": "3.3.5"
|
||||
},
|
||||
"name": "@documenso/root",
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"@documenso/pdf-sign": "^0.1.0",
|
||||
"@documenso/prisma": "*",
|
||||
"@lingui/conf": "^5.6.0",
|
||||
"@lingui/core": "^5.6.0",
|
||||
"inngest-cli": "^1.13.7",
|
||||
"luxon": "^3.7.2",
|
||||
"@documenso/prisma": "^0.0.0",
|
||||
"@lingui/conf": "^5.2.0",
|
||||
"@lingui/core": "^5.2.0",
|
||||
"ai": "^5.0.82",
|
||||
"inngest-cli": "^0.29.1",
|
||||
"luxon": "^3.5.0",
|
||||
"mupdf": "^1.0.0",
|
||||
"react": "^18",
|
||||
"typescript": "5.6.2",
|
||||
"zod": "^3.25.76"
|
||||
},
|
||||
"overrides": {
|
||||
"pdfjs-dist": "5.4.296",
|
||||
"typescript": "5.6.2",
|
||||
"zod": "^3.25.76"
|
||||
},
|
||||
"trigger.dev": {
|
||||
"endpointId": "documenso-app"
|
||||
}
|
||||
}
|
||||
@ -17,13 +17,14 @@
|
||||
"dependencies": {
|
||||
"@documenso/lib": "*",
|
||||
"@documenso/prisma": "*",
|
||||
"@ts-rest/core": "^3.52.1",
|
||||
"@ts-rest/open-api": "^3.52.1",
|
||||
"@ts-rest/serverless": "^3.52.1",
|
||||
"@ts-rest/core": "^3.52.0",
|
||||
"@ts-rest/open-api": "^3.52.0",
|
||||
"@ts-rest/serverless": "^3.52.0",
|
||||
"@types/swagger-ui-react": "^5.18.0",
|
||||
"luxon": "^3.7.2",
|
||||
"luxon": "^3.4.0",
|
||||
"superjson": "^2.2.5",
|
||||
"ts-pattern": "^5.9.0",
|
||||
"swagger-ui-react": "^5.21.0",
|
||||
"ts-pattern": "^5.0.5",
|
||||
"zod": "^3.25.76"
|
||||
}
|
||||
}
|
||||
@ -232,19 +232,19 @@ test('[DOCUMENT_FLOW]: should be able to create a document with multiple recipie
|
||||
|
||||
await page.getByLabel('Email').nth(1).fill('user2@example.com');
|
||||
await page.getByLabel('Name').nth(1).fill('User 2');
|
||||
await page.getByRole('combobox').nth(1).click();
|
||||
await page.locator('button[role="combobox"]').nth(1).click();
|
||||
await page.getByLabel('Receives copy').click();
|
||||
await page.getByRole('button', { name: 'Add Signer' }).click();
|
||||
|
||||
await page.getByLabel('Email').nth(2).fill('user3@example.com');
|
||||
await page.getByLabel('Name').nth(2).fill('User 3');
|
||||
await page.getByRole('combobox').nth(2).click();
|
||||
await page.locator('button[role="combobox"]').nth(2).click();
|
||||
await page.getByLabel('Needs to approve').click();
|
||||
await page.getByRole('button', { name: 'Add Signer' }).click();
|
||||
|
||||
await page.getByLabel('Email').nth(3).fill('user4@example.com');
|
||||
await page.getByLabel('Name').nth(3).fill('User 4');
|
||||
await page.getByRole('combobox').nth(3).click();
|
||||
await page.locator('button[role="combobox"]').nth(3).click();
|
||||
await page.getByLabel('Needs to view').click();
|
||||
|
||||
await page.getByRole('button', { name: 'Continue' }).click();
|
||||
@ -252,8 +252,8 @@ test('[DOCUMENT_FLOW]: should be able to create a document with multiple recipie
|
||||
// Add fields
|
||||
await expect(page.getByRole('heading', { name: 'Add Fields' })).toBeVisible();
|
||||
|
||||
await page.getByRole('combobox').first().click();
|
||||
await page.getByRole('option', { name: 'User 1 (user1@example.com)' }).click();
|
||||
await page.locator('button[role="combobox"]').nth(0).click();
|
||||
await page.getByTitle('User 1 (user1@example.com)').click();
|
||||
|
||||
await page.getByRole('button', { name: 'Signature' }).click();
|
||||
await page.locator('canvas').click({
|
||||
@ -271,8 +271,8 @@ test('[DOCUMENT_FLOW]: should be able to create a document with multiple recipie
|
||||
},
|
||||
});
|
||||
|
||||
await page.getByRole('combobox').first().click();
|
||||
await page.getByRole('option', { name: 'User 3 (user3@example.com)' }).click();
|
||||
await page.locator('button[role="combobox"]').nth(0).click();
|
||||
await page.getByTitle('User 3 (user3@example.com)').click();
|
||||
|
||||
await page.getByRole('button', { name: 'Signature' }).click();
|
||||
await page.locator('canvas').click({
|
||||
@ -574,7 +574,6 @@ test('[DOCUMENT_FLOW]: should be able to create and sign a document with 3 recip
|
||||
if (i > 1) {
|
||||
await page.getByText(`User ${i} (user${i}@example.com)`).click();
|
||||
}
|
||||
|
||||
await page.getByRole('button', { name: 'Signature' }).click();
|
||||
await page.locator('canvas').click({
|
||||
position: {
|
||||
|
||||
@ -85,18 +85,16 @@ test('[DOCUMENTS]: deleting a completed document should not remove it from recip
|
||||
// Open document action menu.
|
||||
await page
|
||||
.locator('tr', { hasText: 'Document 1 - Completed' })
|
||||
.getByTestId('document-table-action-btn')
|
||||
.getByRole('cell', { name: 'Download' })
|
||||
.getByRole('button')
|
||||
.nth(1)
|
||||
.click();
|
||||
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// delete document
|
||||
await page.getByRole('menuitem', { name: 'Delete' }).click();
|
||||
await page.getByPlaceholder("Type 'delete' to confirm").fill('delete');
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Completed/ })).not.toBeVisible();
|
||||
|
||||
await apiSignout({ page });
|
||||
@ -128,20 +126,13 @@ test('[DOCUMENTS]: deleting a pending document should remove it from recipients'
|
||||
});
|
||||
|
||||
// Open document action menu.
|
||||
await page
|
||||
.locator('tr', { hasText: 'Document 1 - Pending' })
|
||||
.getByTestId('document-table-action-btn')
|
||||
.click();
|
||||
|
||||
await page.waitForTimeout(200);
|
||||
await page.locator('tr', { hasText: 'Document 1 - Pending' }).getByRole('button').nth(1).click();
|
||||
|
||||
// delete document
|
||||
await page.getByRole('menuitem', { name: 'Delete' }).click();
|
||||
await page.getByPlaceholder("Type 'delete' to confirm").fill('delete');
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Pending/ })).not.toBeVisible();
|
||||
|
||||
// signout
|
||||
@ -174,15 +165,11 @@ test('[DOCUMENTS]: deleting draft documents should permanently remove it', async
|
||||
.getByTestId('document-table-action-btn')
|
||||
.click();
|
||||
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// delete document
|
||||
await page.getByRole('menuitem', { name: 'Delete' }).click();
|
||||
await expect(page.getByPlaceholder("Type 'delete' to confirm")).not.toBeVisible();
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Draft/ })).not.toBeVisible();
|
||||
|
||||
// Check document counts.
|
||||
@ -208,15 +195,11 @@ test('[DOCUMENTS]: deleting pending documents should permanently remove it', asy
|
||||
.getByTestId('document-table-action-btn')
|
||||
.click();
|
||||
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// Delete document.
|
||||
await page.getByRole('menuitem', { name: 'Delete' }).click();
|
||||
await page.getByPlaceholder("Type 'delete' to confirm").fill('delete');
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Pending/ })).not.toBeVisible();
|
||||
|
||||
// Check document counts.
|
||||
@ -244,15 +227,11 @@ test('[DOCUMENTS]: deleting completed documents as an owner should hide it from
|
||||
.getByTestId('document-table-action-btn')
|
||||
.click();
|
||||
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// Delete document.
|
||||
await page.getByRole('menuitem', { name: 'Delete' }).click();
|
||||
await page.getByPlaceholder("Type 'delete' to confirm").fill('delete');
|
||||
await page.getByRole('button', { name: 'Delete' }).click();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
|
||||
// Check document counts.
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Completed/ })).not.toBeVisible();
|
||||
await checkDocumentTabCount(page, 'Inbox', 0);
|
||||
@ -324,8 +303,7 @@ test('[DOCUMENTS]: deleting documents as a recipient should only hide it for the
|
||||
await page.getByRole('menuitem', { name: 'Hide' }).waitFor({ state: 'visible' });
|
||||
await page.getByRole('menuitem', { name: 'Hide' }).click({ force: true });
|
||||
await page.getByRole('button', { name: 'Hide' }).click({ force: true });
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
// Check document counts.
|
||||
await expect(page.getByRole('row', { name: /Document 1 - Completed/ })).not.toBeVisible();
|
||||
|
||||
@ -1,30 +1,46 @@
|
||||
import { createCanvas } from '@napi-rs/canvas';
|
||||
// sort-imports-ignore
|
||||
|
||||
// ---- PATCH pdfjs-dist's canvas require BEFORE importing it ----
|
||||
import Module from 'module';
|
||||
import { Canvas, Image } from 'skia-canvas';
|
||||
|
||||
// Intercept require('canvas') and return skia-canvas equivalents
|
||||
const originalRequire = Module.prototype.require;
|
||||
Module.prototype.require = function (path: string) {
|
||||
if (path === 'canvas') {
|
||||
return {
|
||||
createCanvas: (width: number, height: number) => new Canvas(width, height),
|
||||
Image, // needed by pdfjs-dist
|
||||
};
|
||||
}
|
||||
// eslint-disable-next-line prefer-rest-params, @typescript-eslint/consistent-type-assertions
|
||||
return originalRequire.apply(this, arguments as unknown as [string]);
|
||||
};
|
||||
|
||||
import pixelMatch from 'pixelmatch';
|
||||
import { PNG } from 'pngjs';
|
||||
import type { TestInfo } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { DocumentStatus, EnvelopeType } from '@prisma/client';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.mjs';
|
||||
import pixelMatch from 'pixelmatch';
|
||||
import { PNG } from 'pngjs';
|
||||
|
||||
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.js';
|
||||
import { getEnvelopeItemPdfUrl } from '@documenso/lib/utils/envelope-download';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
import { seedAlignmentTestDocument } from '@documenso/prisma/seed/initial-seed';
|
||||
import { seedUser } from '@documenso/prisma/seed/users';
|
||||
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from '../../../lib/constants/app';
|
||||
import { isBase64Image } from '../../../lib/constants/signatures';
|
||||
import { createApiToken } from '../../../lib/server-only/public-api/create-api-token';
|
||||
import { RecipientRole } from '../../../prisma/generated/types';
|
||||
import { apiSignin } from '../fixtures/authentication';
|
||||
import type {
|
||||
TCreateEnvelopePayload,
|
||||
TCreateEnvelopeResponse,
|
||||
} from '../../../trpc/server/envelope-router/create-envelope.types';
|
||||
import type { TDistributeEnvelopeRequest } from '../../../trpc/server/envelope-router/distribute-envelope.types';
|
||||
import { ALIGNMENT_TEST_FIELDS } from '../../constants/field-alignment-pdf';
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from '../../../lib/constants/app';
|
||||
import { createApiToken } from '../../../lib/server-only/public-api/create-api-token';
|
||||
import { RecipientRole } from '../../../prisma/generated/types';
|
||||
import { FIELD_META_TEST_FIELDS } from '../../constants/field-meta-pdf';
|
||||
import { apiSignin } from '../fixtures/authentication';
|
||||
import { ALIGNMENT_TEST_FIELDS } from '../../constants/field-alignment-pdf';
|
||||
import type { TDistributeEnvelopeRequest } from '../../../trpc/server/envelope-router/distribute-envelope.types';
|
||||
import { isBase64Image } from '../../../lib/constants/signatures';
|
||||
|
||||
const WEBAPP_BASE_URL = NEXT_PUBLIC_WEBAPP_URL();
|
||||
const baseUrl = `${WEBAPP_BASE_URL}/api/v2`;
|
||||
@ -390,20 +406,15 @@ async function renderPdfToImage(pdfBytes: Uint8Array) {
|
||||
|
||||
const viewport = page.getViewport({ scale });
|
||||
|
||||
const canvas = createCanvas(viewport.width, viewport.height);
|
||||
const canvasContext = canvas.getContext('2d');
|
||||
canvasContext.imageSmoothingEnabled = false;
|
||||
const virtualCanvas = new Canvas(viewport.width, viewport.height);
|
||||
const context = virtualCanvas.getContext('2d');
|
||||
context.imageSmoothingEnabled = false;
|
||||
|
||||
await page.render({
|
||||
// @ts-expect-error @napi-rs/canvas satisfies runtime requirements for pdfjs
|
||||
canvas,
|
||||
// @ts-expect-error @napi-rs/canvas satisfies runtime requirements for pdfjs
|
||||
canvasContext,
|
||||
viewport,
|
||||
}).promise;
|
||||
// @ts-expect-error skia-canvas context satisfies runtime requirements for pdfjs
|
||||
await page.render({ canvasContext: context, viewport }).promise;
|
||||
|
||||
return {
|
||||
image: await canvas.encode('png'),
|
||||
image: await virtualCanvas.toBuffer('png'),
|
||||
|
||||
// Rounded down because the certificate page somehow gives dimensions with decimals
|
||||
width: Math.floor(viewport.width),
|
||||
|
||||
@ -57,9 +57,6 @@ test.describe('Signing Certificate Tests', () => {
|
||||
}
|
||||
|
||||
await page.getByRole('button', { name: 'Complete' }).click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByRole('button', { name: 'Sign' }).click({ force: true });
|
||||
await page.waitForURL(`/sign/${recipient.token}/complete`);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user