Compare commits

...

1 Commits

Author SHA1 Message Date
b685190b1a wip: what if user ids were strings instead of numbers 2025-01-03 16:23:35 +11:00
134 changed files with 775 additions and 246 deletions

View File

@ -10,7 +10,7 @@ import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
import type { Document, Recipient, User } from '@documenso/prisma/client';
export type DocumentPageViewInformationProps = {
userId: number;
userId: string;
document: Document & {
User: Pick<User, 'id' | 'name' | 'email'>;
Recipient: Recipient[];

View File

@ -16,7 +16,7 @@ import { cn } from '@documenso/ui/lib/utils';
export type DocumentPageViewRecentActivityProps = {
documentId: number;
userId: number;
userId: string;
};
export const DocumentPageViewRecentActivity = ({

View File

@ -10,7 +10,7 @@ import { useIsMounted } from '@documenso/lib/client-only/hooks/use-is-mounted';
import type { Template, User } from '@documenso/prisma/client';
export type TemplatePageViewInformationProps = {
userId: number;
userId: string;
template: Template & {
User: Pick<User, 'id' | 'name' | 'email'>;
};

View File

@ -45,7 +45,7 @@ import { useToast } from '@documenso/ui/primitives/use-toast';
export type TransferTeamDialogProps = {
teamId: number;
teamName: string;
ownerUserId: number;
ownerUserId: string;
trigger?: React.ReactNode;
};
@ -98,7 +98,7 @@ export const TransferTeamDialog = ({
try {
await requestTeamOwnershipTransfer({
teamId,
newOwnerUserId: Number.parseInt(newOwnerUserId),
newOwnerUserId,
clearPaymentMethods,
});

View File

@ -34,7 +34,7 @@ import { UpdateTeamMemberDialog } from '../dialogs/update-team-member-dialog';
export type TeamMembersDataTableProps = {
currentUserTeamRole: TeamMemberRole;
teamOwnerUserId: number;
teamOwneruserId: string;
teamId: number;
teamName: string;
};

View File

@ -20,7 +20,7 @@ export type TeamsMemberPageDataTableProps = {
currentUserTeamRole: TeamMemberRole;
teamId: number;
teamName: string;
teamOwnerUserId: number;
teamOwneruserId: string;
};
export const TeamsMemberPageDataTable = ({

View File

@ -24,7 +24,7 @@ import { DocumentHistorySheetChanges } from './document-history-sheet-changes';
export type DocumentHistorySheetProps = {
documentId: number;
userId: number;
userId: string;
isMenuOpen?: boolean;
onMenuOpenChange?: (_value: boolean) => void;
children?: React.ReactNode;

187
package-lock.json generated
View File

@ -15,10 +15,12 @@
"@documenso/pdf-sign": "^0.1.0",
"@documenso/prisma": "^0.0.0",
"@lingui/core": "^4.11.3",
"@prisma/client": "^6.1.0",
"inngest-cli": "^0.29.1",
"luxon": "^3.5.0",
"mupdf": "^1.0.0",
"next-runtime-env": "^3.2.0",
"prisma": "^6.1.0",
"react": "^18",
"zod": "3.24.1"
},
@ -5636,15 +5638,13 @@
}
},
"node_modules/@prisma/client": {
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.4.2.tgz",
"integrity": "sha512-2xsPaz4EaMKj1WS9iW6MlPhmbqtBsXAOeVttSePp8vTFTtvzh2hZbDgswwBdSCgPzmmwF+tLB259QzggvCmJqA==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.1.0.tgz",
"integrity": "sha512-AbQYc5+EJKm1Ydfq3KxwcGiy7wIbm4/QbjCKWWoNROtvy7d6a3gmAGkKjK0iUCzh+rHV8xDhD5Cge8ke/kiy5Q==",
"hasInstallScript": true,
"dependencies": {
"@prisma/engines-version": "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574"
},
"license": "Apache-2.0",
"engines": {
"node": ">=16.13"
"node": ">=18.18"
},
"peerDependencies": {
"prisma": "*"
@ -5676,15 +5676,49 @@
}
},
"node_modules/@prisma/engines": {
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.4.2.tgz",
"integrity": "sha512-fqeucJ3LH0e1eyFdT0zRx+oETLancu5+n4lhiYECyEz6H2RDskPJHJYHkVc0LhkU4Uv7fuEnppKU3nVKNzMh8g==",
"hasInstallScript": true
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.1.0.tgz",
"integrity": "sha512-GnYJbCiep3Vyr1P/415ReYrgJUjP79fBNc1wCo7NP6Eia0CzL2Ot9vK7Infczv3oK7JLrCcawOSAxFxNFsAERQ==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "6.1.0",
"@prisma/engines-version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
"@prisma/fetch-engine": "6.1.0",
"@prisma/get-platform": "6.1.0"
}
},
"node_modules/@prisma/engines-version": {
"version": "5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.4.1-2.ac9d7041ed77bcc8a8dbd2ab6616b39013829574.tgz",
"integrity": "sha512-wvupDL4AA1vf4TQNANg7kR7y98ITqPsk6aacfBxZKtrJKRIsWjURHkZCGcQliHdqCiW/hGreO6d6ZuSv9MhdAA=="
"version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959.tgz",
"integrity": "sha512-PdJqmYM2Fd8K0weOOtQThWylwjsDlTig+8Pcg47/jszMuLL9iLIaygC3cjWJLda69siRW4STlCTMSgOjZzvKPQ==",
"license": "Apache-2.0"
},
"node_modules/@prisma/engines/node_modules/@prisma/debug": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.1.0.tgz",
"integrity": "sha512-0himsvcM4DGBTtvXkd2Tggv6sl2JyUYLzEGXXleFY+7Kp6rZeSS3hiTW9mwtUlXrwYbJP6pwlVNB7jYElrjWUg==",
"license": "Apache-2.0"
},
"node_modules/@prisma/engines/node_modules/@prisma/fetch-engine": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.1.0.tgz",
"integrity": "sha512-asdFi7TvPlEZ8CzSZ/+Du5wZ27q6OJbRSXh+S8ISZguu+S9KtS/gP7NeXceZyb1Jv1SM1S5YfiCv+STDsG6rrg==",
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "6.1.0",
"@prisma/engines-version": "6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959",
"@prisma/get-platform": "6.1.0"
}
},
"node_modules/@prisma/engines/node_modules/@prisma/get-platform": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.1.0.tgz",
"integrity": "sha512-ia8bNjboBoHkmKGGaWtqtlgQOhCi7+f85aOkPJKgNwWvYrT6l78KgojLekE8zMhVk0R9lWcifV0Pf8l3/15V0Q==",
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "6.1.0"
}
},
"node_modules/@prisma/fetch-engine": {
"version": "5.3.1",
@ -20088,14 +20122,6 @@
"node": ">=6"
}
},
"node_modules/kysely": {
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.3.tgz",
"integrity": "sha512-lG03Ru+XyOJFsjH3OMY6R/9U38IjDPfnOfDgO3ynhbDr+Dz8fak+X6L62vqu3iybQnj+lG84OttBuU9KY3L9kA==",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/language-subtag-registry": {
"version": "0.3.22",
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz",
@ -26162,26 +26188,22 @@
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew=="
},
"node_modules/prisma": {
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.4.2.tgz",
"integrity": "sha512-GDMZwZy7mysB2oXU+angQqJ90iaPFdD0rHaZNkn+dio5NRkGLmMqmXs31//tg/qXT3iB0cTQwnGGQNuirhSTZg==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-6.1.0.tgz",
"integrity": "sha512-aFI3Yi+ApUxkwCJJwyQSwpyzUX7YX3ihzuHNHOyv4GJg3X5tQsmRaJEnZ+ZyfHpMtnyahhmXVfbTZ+lS8ZtfKw==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@prisma/engines": "5.4.2"
"@prisma/engines": "6.1.0"
},
"bin": {
"prisma": "build/index.js"
},
"engines": {
"node": ">=16.13"
}
},
"node_modules/prisma-extension-kysely": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/prisma-extension-kysely/-/prisma-extension-kysely-2.1.0.tgz",
"integrity": "sha512-s1hujYjrNzfQc9Z79s93464mkTkkt9ZPqPELDRFe9jEmiIlM/JRXZtqIyyN3FM0GDkN/BDPVtpPtdC52XnjAcQ==",
"peerDependencies": {
"@prisma/client": "latest"
"node": ">=18.18"
},
"optionalDependencies": {
"fsevents": "2.3.3"
}
},
"node_modules/prisma-kysely": {
@ -34070,36 +34092,6 @@
"zod": "^3.20.2"
}
},
"node_modules/zod-prisma-types": {
"version": "3.1.8",
"resolved": "https://registry.npmjs.org/zod-prisma-types/-/zod-prisma-types-3.1.8.tgz",
"integrity": "sha512-5oe0ays3ur4u2GtuUqlhgCraKBcsuMaMI8o7VMV4YAnFeOuVid7K2zGvjI19V0ue9PeNF2ICyVREQVohaQm5dw==",
"dev": true,
"dependencies": {
"@prisma/generator-helper": "^5.14.0",
"code-block-writer": "^12.0.0",
"lodash": "^4.17.21",
"zod": "^3.23.8"
},
"bin": {
"zod-prisma-types": "dist/bin.js"
}
},
"node_modules/zod-prisma-types/node_modules/@prisma/debug": {
"version": "5.22.0",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz",
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==",
"dev": true
},
"node_modules/zod-prisma-types/node_modules/@prisma/generator-helper": {
"version": "5.22.0",
"resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-5.22.0.tgz",
"integrity": "sha512-LwqcBQ5/QsuAaLNQZAIVIAJDJBMjHwMwn16e06IYx/3Okj/xEEfw9IvrqB2cJCl3b2mCBlh3eVH0w9WGmi4aHg==",
"dev": true,
"dependencies": {
"@prisma/debug": "5.22.0"
}
},
"node_modules/zod-to-json-schema": {
"version": "3.24.1",
"resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.1.tgz",
@ -35466,10 +35458,10 @@
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@prisma/client": "5.4.2",
"kysely": "^0.27.3",
"prisma": "5.4.2",
"prisma-extension-kysely": "^2.1.0",
"@prisma/client": "^6.1.0",
"kysely": "^0.27.5",
"prisma": "^6.1.0",
"prisma-extension-kysely": "^3.0.0",
"ts-pattern": "^5.0.6"
},
"devDependencies": {
@ -35478,7 +35470,42 @@
"prisma-kysely": "^1.8.0",
"tsx": "^4.11.0",
"typescript": "5.2.2",
"zod-prisma-types": "^3.1.8"
"zod-prisma-types": "^3.2.1"
}
},
"packages/prisma/node_modules/@prisma/debug": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.1.0.tgz",
"integrity": "sha512-0himsvcM4DGBTtvXkd2Tggv6sl2JyUYLzEGXXleFY+7Kp6rZeSS3hiTW9mwtUlXrwYbJP6pwlVNB7jYElrjWUg==",
"dev": true,
"license": "Apache-2.0"
},
"packages/prisma/node_modules/@prisma/generator-helper": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@prisma/generator-helper/-/generator-helper-6.1.0.tgz",
"integrity": "sha512-drHaTKRmRsz6esHk2dpn7aPoxfttoqkYWSaI7zXsL5YQz73jww1YgJpGbPgOUiblriJAtdT4o7mibMqnf8TOsA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "6.1.0"
}
},
"packages/prisma/node_modules/kysely": {
"version": "0.27.5",
"resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.5.tgz",
"integrity": "sha512-s7hZHcQeSNKpzCkHRm8yA+0JPLjncSWnjb+2TIElwS2JAqYr+Kv3Ess+9KFfJS0C1xcQ1i9NkNHpWwCYpHMWsA==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"packages/prisma/node_modules/prisma-extension-kysely": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/prisma-extension-kysely/-/prisma-extension-kysely-3.0.0.tgz",
"integrity": "sha512-J8gtIINuqsmbucei7PehAiuKvlPEe6SpRNXM6SdG7wXvY2aNxm5RnjnTwWITLTvzM3smarsKfMMfpMcNua82mA==",
"license": "MIT",
"peerDependencies": {
"@prisma/client": "latest"
}
},
"packages/prisma/node_modules/ts-pattern": {
@ -35499,6 +35526,26 @@
"node": ">=14.17"
}
},
"packages/prisma/node_modules/zod-prisma-types": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/zod-prisma-types/-/zod-prisma-types-3.2.1.tgz",
"integrity": "sha512-qsOD8aMVx3Yg9gHctvhTRpavaJizt8xUda6qjwOcH7suvrirXax38tjs0ilKcY7GKbyY57q2rZ+uoSDnzVXpag==",
"dev": true,
"license": "MIT",
"dependencies": {
"@prisma/generator-helper": "^6.0.1",
"code-block-writer": "^12.0.0",
"lodash": "^4.17.21",
"zod": "^3.23.8"
},
"bin": {
"zod-prisma-types": "dist/bin.js"
},
"peerDependencies": {
"@prisma/client": "^4.x.x || ^5.x.x || ^6.x.x",
"prisma": "^4.x.x || ^5.x.x || ^6.x.x"
}
},
"packages/signing": {
"name": "@documenso/signing",
"version": "0.0.0",

View File

@ -70,14 +70,18 @@
"luxon": "^3.5.0",
"mupdf": "^1.0.0",
"next-runtime-env": "^3.2.0",
"@prisma/client": "^6.1.0",
"prisma": "^6.1.0",
"react": "^18",
"zod": "3.24.1"
},
"overrides": {
"next": "14.2.6",
"@prisma/client": "^6.1.0",
"prisma": "^6.1.0",
"zod": "3.24.1"
},
"trigger.dev": {
"endpointId": "documenso-app"
}
}
}

View File

@ -91,7 +91,7 @@ export const getStripeCustomerIdByUser = async (user: User) => {
return await getStripeCustomerByUser(user).then((session) => session.stripeCustomer.id);
};
const syncStripeCustomerSubscriptions = async (userId: number, stripeCustomerId: string) => {
const syncStripeCustomerSubscriptions = async (userId: string, stripeCustomerId: string) => {
const stripeSubscriptions = await stripe.subscriptions.list({
customer: stripeCustomerId,
});

View File

@ -6,7 +6,7 @@ import type { Subscription } from '@documenso/prisma/client';
import { getEnterprisePlanPriceIds } from '../stripe/get-enterprise-plan-prices';
export type IsUserEnterpriseOptions = {
userId: number;
userId: string;
teamId?: number;
};

View File

@ -126,7 +126,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
}
return {
id: Number(user.id),
id: user.id,
email: user.email,
name: user.name,
emailVerified: user.emailVerified?.toISOString() ?? null,
@ -140,7 +140,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
profile(profile) {
return {
id: Number(profile.sub),
id: profile.sub,
name: profile.name || `${profile.given_name} ${profile.family_name}`.trim(),
email: profile.email,
emailVerified: profile.email_verified ? new Date().toISOString() : null,
@ -274,7 +274,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
});
return {
id: Number(user.id),
id: user.id,
email: user.email,
name: user.name,
emailVerified: user.emailVerified?.toISOString() ?? null,
@ -308,7 +308,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
const { userId, email } = parsedCredential;
if (typeof userId !== 'number' || typeof email !== 'string') {
if (typeof userId !== 'string' || typeof email !== 'string') {
throw new AppError(AppErrorCode.INVALID_REQUEST);
}
@ -323,7 +323,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
}
return {
id: Number(user.id),
id: user.id,
email: user.email,
name: user.name,
emailVerified: user.emailVerified?.toISOString() ?? null,
@ -340,7 +340,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
} satisfies JWT;
if (!merged.email || typeof merged.emailVerified !== 'string') {
const userId = Number(merged.id ?? token.sub);
const userId = merged.id ?? token.sub;
const retrieved = await prisma.user.findFirst({
where: {
@ -367,7 +367,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
const user = await prisma.user.update({
where: {
id: Number(merged.id),
id: merged.id,
},
data: {
lastSignedIn: merged.lastSignedIn,
@ -384,7 +384,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
await prisma.user.update({
where: {
id: Number(merged.id),
id: merged.id,
},
data: {
emailVerified: merged.emailVerified,
@ -407,7 +407,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
return {
...session,
user: {
id: Number(token.id),
id: token.id,
name: token.name,
email: token.email,
emailVerified: token.emailVerified ?? null,

View File

@ -9,7 +9,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
import { getAuthenticatorOptions } from '../../utils/authenticator';
type CreatePasskeyAuthenticationOptions = {
userId: number;
userId: string;
/**
* The ID of the passkey to request authentication for.

View File

@ -8,7 +8,7 @@ import { PASSKEY_TIMEOUT } from '../../constants/auth';
import { getAuthenticatorOptions } from '../../utils/authenticator';
type CreatePasskeyRegistrationOptions = {
userId: number;
userId: string;
};
export const createPasskeyRegistrationOptions = async ({

View File

@ -10,7 +10,7 @@ import type { RequestMetadata } from '../../universal/extract-request-metadata';
import { getAuthenticatorOptions } from '../../utils/authenticator';
type CreatePasskeyOptions = {
userId: number;
userId: string;
passkeyName: string;
verificationResponse: RegistrationResponseJSON;
requestMetadata?: RequestMetadata;

View File

@ -4,7 +4,7 @@ import { UserSecurityAuditLogType } from '@documenso/prisma/client';
import type { RequestMetadata } from '../../universal/extract-request-metadata';
export interface DeletePasskeyOptions {
userId: number;
userId: string;
passkeyId: string;
requestMetadata?: RequestMetadata;
}

View File

@ -5,7 +5,7 @@ import { Prisma } from '@documenso/prisma/client';
import type { FindResultResponse } from '../../types/search-params';
export interface FindPasskeysOptions {
userId: number;
userId: string;
query?: string;
page?: number;
perPage?: number;

View File

@ -11,7 +11,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
export interface SendConfirmationEmailProps {
userId: number;
userId: string;
}
export const sendConfirmationEmail = async ({ userId }: SendConfirmationEmailProps) => {

View File

@ -11,7 +11,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
export interface SendForgotPasswordOptions {
userId: number;
userId: string;
}
export const sendForgotPassword = async ({ userId }: SendForgotPasswordOptions) => {

View File

@ -8,7 +8,7 @@ import { NEXT_PUBLIC_WEBAPP_URL } from '../../constants/app';
import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
export interface SendResetPasswordOptions {
userId: number;
userId: string;
}
export const sendResetPassword = async ({ userId }: SendResetPasswordOptions) => {

View File

@ -4,7 +4,7 @@ import { UserSecurityAuditLogType } from '@documenso/prisma/client';
import type { RequestMetadata } from '../../universal/extract-request-metadata';
export interface UpdateAuthenticatorsOptions {
userId: number;
userId: string;
passkeyId: string;
name: string;
requestMetadata?: RequestMetadata;

View File

@ -25,7 +25,7 @@ export type CreateDocumentMetaOptions = {
distributionMethod?: DocumentDistributionMethod;
typedSignatureEnabled?: boolean;
language?: SupportedLanguageCodes;
userId: number;
userId: string;
requestMetadata: RequestMetadata;
};

View File

@ -21,7 +21,7 @@ import { triggerWebhook } from '../webhooks/trigger/trigger-webhook';
export type CreateDocumentOptions = {
title: string;
externalId?: string | null;
userId: number;
userId: string;
teamId?: number;
documentDataId: string;
formValues?: Record<string, string | number | boolean>;

View File

@ -29,7 +29,7 @@ import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-t
export type DeleteDocumentOptions = {
id: number;
userId: number;
userId: string;
teamId?: number;
requestMetadata?: RequestMetadata;
};

View File

@ -7,7 +7,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
export interface DuplicateDocumentOptions {
documentId: number;
userId: number;
userId: string;
teamId?: number;
}

View File

@ -7,7 +7,7 @@ import type { FindResultResponse } from '../../types/search-params';
import { parseDocumentAuditLogData } from '../../utils/document-audit-logs';
export interface FindDocumentAuditLogsOptions {
userId: number;
userId: string;
documentId: number;
page?: number;
perPage?: number;

View File

@ -27,7 +27,7 @@ import { maskRecipientTokensForDocument } from '../../utils/mask-recipient-token
export type PeriodSelectorValue = '' | '7d' | '14d' | '30d';
export type FindDocumentsOptions = {
userId: number;
userId: string;
teamId?: number;
templateId?: number;
source?: DocumentSource;

View File

@ -10,7 +10,7 @@ import { getTeamById } from '../team/get-team';
export type GetDocumentByIdOptions = {
documentId: number;
userId: number;
userId: string;
teamId?: number;
};
@ -58,7 +58,7 @@ export const getDocumentById = async ({ documentId, userId, teamId }: GetDocumen
export type GetDocumentWhereInputOptions = {
documentId: number;
userId: number;
userId: string;
teamId?: number;
/**

View File

@ -14,7 +14,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
export type GetDocumentWithDetailsByIdOptions = {
documentId: number;
userId: number;
userId: string;
teamId?: number;
};

View File

@ -170,7 +170,7 @@ type GetTeamCountsOption = {
teamEmail?: string;
senderIds?: number[];
currentUserEmail: string;
userId: number;
userId: string;
createdAt: Prisma.DocumentWhereInput['createdAt'];
currentTeamMemberRole?: TeamMemberRole;
search?: string;

View File

@ -124,7 +124,7 @@ type VerifyPasskeyOptions = {
/**
* The ID of the user who initiated the request.
*/
userId: number;
userId: string;
/**
* The secondary ID of the verification token.

View File

@ -11,7 +11,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
export type MoveDocumentToTeamOptions = {
documentId: number;
teamId: number;
userId: number;
userId: string;
requestMetadata?: RequestMetadata;
};

View File

@ -26,7 +26,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
export type ResendDocumentOptions = {
documentId: number;
userId: number;
userId: string;
recipients: number[];
teamId?: number;
requestMetadata: RequestMetadata;

View File

@ -8,7 +8,7 @@ import { DocumentVisibility, TeamMemberRole } from '@documenso/prisma/client';
export type SearchDocumentsWithKeywordOptions = {
query: string;
userId: number;
userId: string;
limit?: number;
};

View File

@ -28,7 +28,7 @@ import { triggerWebhook } from '../webhooks/trigger/trigger-webhook';
export type SendDocumentOptions = {
documentId: number;
userId: number;
userId: string;
teamId?: number;
sendEmail?: boolean;
requestMetadata?: RequestMetadata;

View File

@ -18,7 +18,7 @@ import type { TDocumentAccessAuthTypes, TDocumentActionAuthTypes } from '../../t
import { createDocumentAuthOptions, extractDocumentAuthMethods } from '../../utils/document-auth';
export type UpdateDocumentSettingsOptions = {
userId: number;
userId: string;
teamId?: number;
documentId: number;
data: {

View File

@ -7,7 +7,7 @@ import { prisma } from '@documenso/prisma';
export type UpdateDocumentOptions = {
documentId: number;
data: Prisma.DocumentUpdateInput;
userId: number;
userId: string;
teamId?: number;
};

View File

@ -6,7 +6,7 @@ import { createDocumentAuditLogData } from '@documenso/lib/utils/document-audit-
import { prisma } from '@documenso/prisma';
export type UpdateTitleOptions = {
userId: number;
userId: string;
teamId?: number;
documentId: number;
title: string;

View File

@ -16,7 +16,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
export type CreateFieldOptions = {
documentId: number;
userId: number;
userId: string;
teamId?: number;
recipientId: number;
type: FieldType;

View File

@ -7,7 +7,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
export type DeleteFieldOptions = {
fieldId: number;
documentId: number;
userId: number;
userId: string;
teamId?: number;
requestMetadata?: RequestMetadata;
};

View File

@ -6,7 +6,7 @@ import { FieldSchema } from '@documenso/prisma/generated/zod';
import { AppError, AppErrorCode } from '../../errors/app-error';
export type GetFieldByIdOptions = {
userId: number;
userId: string;
teamId?: number;
fieldId: number;
documentId?: number;

View File

@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
export interface GetFieldsForDocumentOptions {
documentId: number;
userId: number;
userId: string;
}
export type DocumentField = Awaited<ReturnType<typeof getFieldsForDocument>>[number];

View File

@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
export interface GetFieldsForTemplateOptions {
templateId: number;
userId: number;
userId: string;
}
export const getFieldsForTemplate = async ({ templateId, userId }: GetFieldsForTemplateOptions) => {

View File

@ -30,7 +30,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
import { canRecipientFieldsBeModified } from '../../utils/recipients';
export interface SetFieldsForDocumentOptions {
userId: number;
userId: string;
documentId: number;
fields: FieldData[];
requestMetadata?: RequestMetadata;

View File

@ -19,7 +19,7 @@ import { FieldType } from '@documenso/prisma/client';
import { FieldSchema } from '@documenso/prisma/generated/zod';
export type SetFieldsForTemplateOptions = {
userId: number;
userId: string;
templateId: number;
fields: {
id?: number | null;

View File

@ -9,7 +9,7 @@ import { createDocumentAuditLogData, diffFieldChanges } from '../../utils/docume
export type UpdateFieldOptions = {
fieldId: number;
documentId: number;
userId: number;
userId: string;
teamId?: number;
recipientId?: number;
type?: FieldType;

View File

@ -6,7 +6,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
import type { RequestMetadata } from '../../universal/extract-request-metadata';
export type SetAvatarImageOptions = {
userId: number;
userId: string;
teamId?: number | null;
bytes?: string | null;
requestMetadata?: RequestMetadata;

View File

@ -14,7 +14,7 @@ type TimeConstants = typeof timeConstants & {
};
type CreateApiTokenInput = {
userId: number;
userId: string;
teamId?: number;
tokenName: string;
expiresIn: string | null;

View File

@ -3,7 +3,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
export type DeleteTokenByIdOptions = {
id: number;
userId: number;
userId: string;
teamId?: number;
};

View File

@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
import { TeamMemberRole } from '@documenso/prisma/client';
export type GetUserTokensOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -1,7 +1,7 @@
import { prisma } from '@documenso/prisma';
export type GetUserTokensOptions = {
userId: number;
userId: string;
};
export const getUserTokens = async ({ userId }: GetUserTokensOptions) => {

View File

@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
export type GetApiTokenByIdOptions = {
id: number;
userId: number;
userId: string;
};
export const getApiTokenById = async ({ id, userId }: GetApiTokenByIdOptions) => {

View File

@ -8,7 +8,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
export type DeleteRecipientOptions = {
documentId: number;
recipientId: number;
userId: number;
userId: string;
teamId?: number;
requestMetadata?: RequestMetadata;
};

View File

@ -7,7 +7,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
export type GetRecipientByIdOptions = {
recipientId: number;
userId: number;
userId: string;
teamId?: number;
};

View File

@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
export interface GetRecipientsForDocumentOptions {
documentId: number;
userId: number;
userId: string;
teamId?: number;
}

View File

@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
export interface GetRecipientsForTemplateOptions {
templateId: number;
userId: number;
userId: string;
}
export const getRecipientsForTemplate = async ({

View File

@ -34,7 +34,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
export interface SetRecipientsForDocumentOptions {
userId: number;
userId: string;
teamId?: number;
documentId: number;
recipients: RecipientData[];

View File

@ -19,7 +19,7 @@ import { nanoid } from '../../universal/id';
import { createRecipientAuthOptions } from '../../utils/document-auth';
export type SetRecipientsForTemplateOptions = {
userId: number;
userId: string;
teamId?: number;
templateId: number;
recipients: {

View File

@ -20,7 +20,7 @@ export type UpdateRecipientOptions = {
role?: RecipientRole;
signingOrder?: number | null;
actionAuth?: TRecipientActionAuthTypes | null;
userId: number;
userId: string;
teamId?: number;
requestMetadata?: RequestMetadata;
};

View File

@ -11,7 +11,7 @@ export type CreateSharingIdOptions =
}
| {
documentId: number;
userId: number;
userId: string;
};
export const createOrGetShareLink = async ({ documentId, ...options }: CreateSharingIdOptions) => {

View File

@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
import type { TSiteSettingSchema } from './schema';
export type UpsertSiteSettingOptions = TSiteSettingSchema & {
userId: number;
userId: string;
};
export const upsertSiteSetting = async ({

View File

@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
import { SubscriptionStatus } from '@documenso/prisma/client';
export type GetActiveSubscriptionsByUserIdOptions = {
userId: number;
userId: string;
};
export const getActiveSubscriptionsByUserId = async ({

View File

@ -3,7 +3,7 @@
import { prisma } from '@documenso/prisma';
export type GetSubscriptionsByUserIdOptions = {
userId: number;
userId: string;
};
export const getSubscriptionsByUserId = async ({ userId }: GetSubscriptionsByUserIdOptions) => {

View File

@ -6,7 +6,7 @@ import { TeamMemberInviteStatus } from '@documenso/prisma/client';
import { jobs } from '../../jobs/client';
export type AcceptTeamInvitationOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -4,7 +4,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '@documenso/lib/constants/teams
import { prisma } from '@documenso/prisma';
export type CreateTeamBillingPortalOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -5,7 +5,7 @@ import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
import { prisma } from '@documenso/prisma';
export type CreateTeamPendingCheckoutSession = {
userId: number;
userId: string;
pendingTeamId: number;
interval: 'monthly' | 'yearly';
};

View File

@ -19,7 +19,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
export type CreateTeamEmailVerificationOptions = {
userId: number;
userId: string;
teamId: number;
data: {
email: string;

View File

@ -20,7 +20,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
export type CreateTeamMemberInvitesOptions = {
userId: number;
userId: string;
userName: string;
teamId: number;
invitations: TCreateTeamMemberInvitesMutationSchema['invitations'];

View File

@ -16,7 +16,7 @@ export type CreateTeamOptions = {
/**
* ID of the user creating the Team.
*/
userId: number;
userId: string;
/**
* Name of the team to display.

View File

@ -1,7 +1,7 @@
import { prisma } from '@documenso/prisma';
export type DeclineTeamInvitationOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -2,7 +2,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '@documenso/lib/constants/teams
import { prisma } from '@documenso/prisma';
export type DeleteTeamEmailVerificationOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -14,7 +14,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
export type DeleteTeamEmailOptions = {
userId: number;
userId: string;
userEmail: string;
teamId: number;
};

View File

@ -6,7 +6,7 @@ export type DeleteTeamMemberInvitationsOptions = {
/**
* The ID of the user who is initiating this action.
*/
userId: number;
userId: string;
/**
* The ID of the team to remove members from.

View File

@ -9,7 +9,7 @@ export type DeleteTeamMembersOptions = {
/**
* The ID of the user who is initiating this action.
*/
userId: number;
userId: string;
/**
* The ID of the team to remove members from.

View File

@ -1,7 +1,7 @@
import { prisma } from '@documenso/prisma';
export type DeleteTeamPendingOptions = {
userId: number;
userId: string;
pendingTeamId: number;
};

View File

@ -6,7 +6,7 @@ export type DeleteTeamTransferRequestOptions = {
/**
* The ID of the user deleting the transfer.
*/
userId: number;
userId: string;
/**
* The ID of the team whose team transfer request should be deleted.

View File

@ -17,7 +17,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
export type DeleteTeamOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -4,7 +4,7 @@ import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
import { prisma } from '@documenso/prisma';
export interface FindTeamInvoicesOptions {
userId: number;
userId: string;
teamId: number;
}

View File

@ -10,7 +10,7 @@ import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '../../constants/teams';
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
export interface FindTeamMemberInvitesOptions {
userId: number;
userId: string;
teamId: number;
query?: string;
page?: number;

View File

@ -10,7 +10,7 @@ import type { FindResultResponse } from '../../types/search-params';
import { ZFindResultResponse } from '../../types/search-params';
export interface FindTeamMembersOptions {
userId: number;
userId: string;
teamId: number;
query?: string;
page?: number;

View File

@ -8,7 +8,7 @@ import { TeamPendingSchema } from '@documenso/prisma/generated/zod';
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
export interface FindTeamsPendingOptions {
userId: number;
userId: string;
query?: string;
page?: number;
perPage?: number;

View File

@ -5,7 +5,7 @@ import { Prisma } from '@documenso/prisma/client';
import type { FindResultResponse } from '../../types/search-params';
export interface FindTeamsOptions {
userId: number;
userId: string;
query?: string;
page?: number;
perPage?: number;

View File

@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
import { TeamMemberSchema, UserSchema } from '@documenso/prisma/generated/zod';
export type GetTeamMembersOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -5,7 +5,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
import { updateTeamPublicProfile } from './update-team-public-profile';
export type GetTeamPublicProfileOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -70,7 +70,7 @@ export const getTeamById = async ({
};
export type GetTeamByUrlOptions = {
userId: number;
userId: string;
teamUrl: string;
};

View File

@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
import { TeamMemberSchema, TeamSchema } from '@documenso/prisma/generated/zod';
export type GetTeamsOptions = {
userId: number;
userId: string;
};
export const ZGetTeamsResponseSchema = TeamSchema.extend({

View File

@ -8,7 +8,7 @@ export type LeaveTeamOptions = {
/**
* The ID of the user who is leaving the team.
*/
userId: number;
userId: string;
/**
* The ID of the team the user is leaving.

View File

@ -16,7 +16,7 @@ export type RequestTeamOwnershipTransferOptions = {
/**
* The ID of the user initiating the transfer.
*/
userId: number;
userId: string;
/**
* The name of the user initiating the transfer.
@ -31,7 +31,7 @@ export type RequestTeamOwnershipTransferOptions = {
/**
* The user ID of the new owner.
*/
newOwnerUserId: number;
newOwneruserId: string;
/**
* Whether to clear any current payment methods attached to the team.

View File

@ -6,7 +6,7 @@ import { prisma } from '@documenso/prisma';
import { sendTeamEmailVerificationEmail } from './create-team-email-verification';
export type ResendTeamMemberInvitationOptions = {
userId: number;
userId: string;
teamId: number;
};

View File

@ -8,7 +8,7 @@ export type ResendTeamMemberInvitationOptions = {
/**
* The ID of the user who is initiating this action.
*/
userId: number;
userId: string;
/**
* The name of the user who is initiating this action.

View File

@ -5,7 +5,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
import { TeamGlobalSettingsSchema } from '@documenso/prisma/generated/zod';
export type UpdateTeamBrandingSettingsOptions = {
userId: number;
userId: string;
teamId: number;
settings: {

View File

@ -8,7 +8,7 @@ import { TeamGlobalSettingsSchema } from '@documenso/prisma/generated/zod';
import type { SupportedLanguageCodes } from '../../constants/i18n';
export type UpdateTeamDocumentSettingsOptions = {
userId: number;
userId: string;
teamId: number;
settings: {

View File

@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
import { TEAM_MEMBER_ROLE_PERMISSIONS_MAP } from '../../constants/teams';
export type UpdateTeamEmailOptions = {
userId: number;
userId: string;
teamId: number;
data: {
name: string;

View File

@ -5,7 +5,7 @@ import { prisma } from '@documenso/prisma';
import type { TeamMemberRole } from '@documenso/prisma/client';
export type UpdateTeamMemberOptions = {
userId: number;
userId: string;
teamId: number;
teamMemberId: number;
data: {

View File

@ -1,7 +1,7 @@
import { prisma } from '@documenso/prisma';
export type UpdatePublicProfileOptions = {
userId: number;
userId: string;
teamId: number;
data: {
bio?: string;

View File

@ -6,7 +6,7 @@ import { prisma } from '@documenso/prisma';
import { Prisma } from '@documenso/prisma/client';
export type UpdateTeamOptions = {
userId: number;
userId: string;
teamId: number;
data: {
name?: string;

View File

@ -4,7 +4,7 @@ import { DocumentSource, type RecipientRole } from '@documenso/prisma/client';
export type CreateDocumentFromTemplateLegacyOptions = {
templateId: number;
userId: number;
userId: string;
teamId?: number;
recipients?: {
name?: string;

View File

@ -46,7 +46,7 @@ type FinalRecipient = Pick<
export type CreateDocumentFromTemplateOptions = {
templateId: number;
externalId?: string | null;
userId: number;
userId: string;
teamId?: number;
recipients: {
id: number;

View File

@ -15,7 +15,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
export type CreateTemplateDirectLinkOptions = {
templateId: number;
userId: number;
userId: string;
directRecipientId?: number;
};

View File

@ -5,7 +5,7 @@ import { TemplateSchema } from '@documenso/prisma/generated/zod';
import type { TCreateTemplateMutationSchema } from '@documenso/trpc/server/template-router/schema';
export type CreateTemplateOptions = TCreateTemplateMutationSchema & {
userId: number;
userId: string;
teamId?: number;
};

Some files were not shown because too many files have changed in this diff Show More