mirror of
https://github.com/documenso/documenso.git
synced 2025-11-21 20:21:38 +10:00
wip: what if user ids were strings instead of numbers
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 ({
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -25,7 +25,7 @@ export type CreateDocumentMetaOptions = {
|
||||
distributionMethod?: DocumentDistributionMethod;
|
||||
typedSignatureEnabled?: boolean;
|
||||
language?: SupportedLanguageCodes;
|
||||
userId: number;
|
||||
userId: string;
|
||||
requestMetadata: RequestMetadata;
|
||||
};
|
||||
|
||||
|
||||
@ -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>;
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -7,7 +7,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
|
||||
|
||||
export interface DuplicateDocumentOptions {
|
||||
documentId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -14,7 +14,7 @@ import { getDocumentWhereInput } from './get-document-by-id';
|
||||
|
||||
export type GetDocumentWithDetailsByIdOptions = {
|
||||
documentId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ type GetTeamCountsOption = {
|
||||
teamEmail?: string;
|
||||
senderIds?: number[];
|
||||
currentUserEmail: string;
|
||||
userId: number;
|
||||
userId: string;
|
||||
createdAt: Prisma.DocumentWhereInput['createdAt'];
|
||||
currentTeamMemberRole?: TeamMemberRole;
|
||||
search?: string;
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -11,7 +11,7 @@ import { createDocumentAuditLogData } from '../../utils/document-audit-logs';
|
||||
export type MoveDocumentToTeamOptions = {
|
||||
documentId: number;
|
||||
teamId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
requestMetadata?: RequestMetadata;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -8,7 +8,7 @@ import { DocumentVisibility, TeamMemberRole } from '@documenso/prisma/client';
|
||||
|
||||
export type SearchDocumentsWithKeywordOptions = {
|
||||
query: string;
|
||||
userId: number;
|
||||
userId: string;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -7,7 +7,7 @@ import { prisma } from '@documenso/prisma';
|
||||
export type UpdateDocumentOptions = {
|
||||
documentId: number;
|
||||
data: Prisma.DocumentUpdateInput;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -14,7 +14,7 @@ type TimeConstants = typeof timeConstants & {
|
||||
};
|
||||
|
||||
type CreateApiTokenInput = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
tokenName: string;
|
||||
expiresIn: string | null;
|
||||
|
||||
@ -3,7 +3,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
|
||||
|
||||
export type DeleteTokenByIdOptions = {
|
||||
id: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { prisma } from '@documenso/prisma';
|
||||
import { TeamMemberRole } from '@documenso/prisma/client';
|
||||
|
||||
export type GetUserTokensOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId: number;
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type GetUserTokensOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const getUserTokens = async ({ userId }: GetUserTokensOptions) => {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -7,7 +7,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
|
||||
export type GetRecipientByIdOptions = {
|
||||
recipientId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
||||
|
||||
export interface GetRecipientsForDocumentOptions {
|
||||
documentId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { prisma } from '@documenso/prisma';
|
||||
|
||||
export interface GetRecipientsForTemplateOptions {
|
||||
templateId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export const getRecipientsForTemplate = async ({
|
||||
|
||||
@ -34,7 +34,7 @@ import { renderEmailWithI18N } from '../../utils/render-email-with-i18n';
|
||||
import { teamGlobalSettingsToBranding } from '../../utils/team-global-settings-to-branding';
|
||||
|
||||
export interface SetRecipientsForDocumentOptions {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
documentId: number;
|
||||
recipients: RecipientData[];
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -20,7 +20,7 @@ export type UpdateRecipientOptions = {
|
||||
role?: RecipientRole;
|
||||
signingOrder?: number | null;
|
||||
actionAuth?: TRecipientActionAuthTypes | null;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
requestMetadata?: RequestMetadata;
|
||||
};
|
||||
|
||||
@ -11,7 +11,7 @@ export type CreateSharingIdOptions =
|
||||
}
|
||||
| {
|
||||
documentId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const createOrGetShareLink = async ({ documentId, ...options }: CreateSharingIdOptions) => {
|
||||
|
||||
@ -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 ({
|
||||
|
||||
@ -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 ({
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type GetSubscriptionsByUserIdOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const getSubscriptionsByUserId = async ({ userId }: GetSubscriptionsByUserIdOptions) => {
|
||||
|
||||
@ -6,7 +6,7 @@ import { TeamMemberInviteStatus } from '@documenso/prisma/client';
|
||||
import { jobs } from '../../jobs/client';
|
||||
|
||||
export type AcceptTeamInvitationOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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';
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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'];
|
||||
|
||||
@ -16,7 +16,7 @@ export type CreateTeamOptions = {
|
||||
/**
|
||||
* ID of the user creating the Team.
|
||||
*/
|
||||
userId: number;
|
||||
userId: string;
|
||||
|
||||
/**
|
||||
* Name of the team to display.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type DeclineTeamInvitationOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type DeleteTeamPendingOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
pendingTeamId: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ export const getTeamById = async ({
|
||||
};
|
||||
|
||||
export type GetTeamByUrlOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamUrl: string;
|
||||
};
|
||||
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type UpdatePublicProfileOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId: number;
|
||||
data: {
|
||||
bio?: string;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -46,7 +46,7 @@ type FinalRecipient = Pick<
|
||||
export type CreateDocumentFromTemplateOptions = {
|
||||
templateId: number;
|
||||
externalId?: string | null;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
recipients: {
|
||||
id: number;
|
||||
|
||||
@ -15,7 +15,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
|
||||
export type CreateTemplateDirectLinkOptions = {
|
||||
templateId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
directRecipientId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
|
||||
export type DeleteTemplateDirectLinkOptions = {
|
||||
templateId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const deleteTemplateDirectLink = async ({
|
||||
|
||||
@ -4,7 +4,7 @@ import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type DeleteTemplateOptions = {
|
||||
id: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { TemplateSchema } from '@documenso/prisma/generated/zod';
|
||||
import type { TDuplicateTemplateMutationSchema } from '@documenso/trpc/server/template-router/schema';
|
||||
|
||||
export type DuplicateTemplateOptions = TDuplicateTemplateMutationSchema & {
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const ZDuplicateTemplateResponseSchema = TemplateSchema;
|
||||
|
||||
@ -15,7 +15,7 @@ import {
|
||||
import { type FindResultResponse, ZFindResultResponse } from '../../types/search-params';
|
||||
|
||||
export type FindTemplatesOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
type?: Template['type'];
|
||||
page?: number;
|
||||
|
||||
@ -16,7 +16,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
|
||||
export type GetTemplateByIdOptions = {
|
||||
id: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
export type MoveTemplateToTeamOptions = {
|
||||
templateId: number;
|
||||
teamId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const ZMoveTemplateToTeamResponseSchema = TemplateSchema;
|
||||
|
||||
@ -9,7 +9,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
|
||||
export type ToggleTemplateDirectLinkOptions = {
|
||||
templateId: number;
|
||||
userId: number;
|
||||
userId: string;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import type { TDocumentAccessAuthTypes, TDocumentActionAuthTypes } from '../../t
|
||||
import { createDocumentAuthOptions, extractDocumentAuthMethods } from '../../utils/document-auth';
|
||||
|
||||
export type UpdateTemplateSettingsOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
teamId?: number;
|
||||
templateId: number;
|
||||
data: {
|
||||
|
||||
@ -4,7 +4,7 @@ import type { UserSecurityAuditLog, UserSecurityAuditLogType } from '@documenso/
|
||||
import type { FindResultResponse } from '../../types/search-params';
|
||||
|
||||
export type FindUserSecurityAuditLogsOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
type?: UserSecurityAuditLogType;
|
||||
page?: number;
|
||||
perPage?: number;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
export type GetMostRecentVerificationTokenByUserIdOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export const getMostRecentVerificationTokenByUserId = async ({
|
||||
|
||||
@ -5,7 +5,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
import { updatePublicProfile } from './update-public-profile';
|
||||
|
||||
export type GetUserPublicProfileOptions = {
|
||||
userId: number;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
type GetUserPublicProfileResponse = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user