@wepublish/api
Version:
API core for we.publish.
165 lines (164 loc) • 6.12 kB
TypeScript
import { Prisma, PrismaClient } from '@prisma/client';
import { Context } from '../../context';
export declare const deletePoll: (pollId: string, authenticate: Context['authenticate'], poll: PrismaClient['poll']) => Prisma.Prisma__PollClient<{
answers: ({
_count: {
poll: number;
votes: number;
externalVotes: number;
};
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answer: string;
pollId: string;
}, unknown> & {})[];
externalVoteSources: ({
voteAmounts: (import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answerId: string;
sourceId: string;
amount: number;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
pollId: string;
source: string;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
opensAt: Date;
closedAt: Date;
question: string;
infoText: Prisma.JsonValue;
}, unknown> & {}, never, import("@prisma/client/runtime/library").DefaultArgs>;
export declare const createPoll: (input: Pick<Prisma.PollUncheckedCreateInput, 'question' | 'opensAt' | 'closedAt' | 'infoText'>, authenticate: Context['authenticate'], poll: PrismaClient['poll']) => Prisma.Prisma__PollClient<{
answers: (import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answer: string;
pollId: string;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
opensAt: Date;
closedAt: Date;
question: string;
infoText: Prisma.JsonValue;
}, unknown> & {}, never, import("@prisma/client/runtime/library").DefaultArgs>;
type UpdatePollPollInput = Pick<Prisma.PollUncheckedCreateInput, 'question' | 'opensAt' | 'closedAt' | 'infoText'>;
type UpdatePollAnswer = {
id: string;
answer: string;
};
type UpdatePollExternalVoteAmount = {
id: string;
amount: number;
};
type UpdatePollExternalVoteSource = {
id: string;
source: string;
voteAmounts: UpdatePollExternalVoteAmount[] | undefined;
};
export declare const updatePoll: (pollId: string, pollInput: UpdatePollPollInput, answers: UpdatePollAnswer[] | undefined, externalVoteSources: UpdatePollExternalVoteSource[] | undefined, authenticate: Context['authenticate'], poll: PrismaClient['poll']) => Prisma.Prisma__PollClient<{
answers: ({
_count: {
poll: number;
votes: number;
externalVotes: number;
};
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answer: string;
pollId: string;
}, unknown> & {})[];
externalVoteSources: ({
voteAmounts: (import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answerId: string;
sourceId: string;
amount: number;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
pollId: string;
source: string;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
opensAt: Date;
closedAt: Date;
question: string;
infoText: Prisma.JsonValue;
}, unknown> & {}, never, import("@prisma/client/runtime/library").DefaultArgs>;
export declare const createPollAnswer: (pollId: string, answer: string, authenticate: Context['authenticate'], pollExternalVoteSource: PrismaClient['pollExternalVoteSource'], pollAnswer: PrismaClient['pollAnswer']) => Promise<import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answer: string;
pollId: string;
}, unknown> & {}>;
export declare const deletePollAnswer: (answerId: string, authenticate: Context['authenticate'], pollAnswer: PrismaClient['pollAnswer']) => Promise<{
_count: {
poll: number;
votes: number;
externalVotes: number;
};
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answer: string;
pollId: string;
}, unknown> & {}>;
export declare const createPollExternalVoteSource: (pollId: string, voteSource: string, authenticate: Context['authenticate'], pollAnswer: PrismaClient['pollAnswer'], pollExternalVoteSource: PrismaClient['pollExternalVoteSource']) => Promise<{
voteAmounts: (import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answerId: string;
sourceId: string;
amount: number;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
pollId: string;
source: string;
}, unknown> & {}>;
export declare const deletePollExternalVoteSource: (sourceId: string, authenticate: Context['authenticate'], pollExternalVoteSource: PrismaClient['pollExternalVoteSource']) => Prisma.Prisma__PollExternalVoteSourceClient<{
voteAmounts: (import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
answerId: string;
sourceId: string;
amount: number;
}, unknown> & {})[];
} & import("@prisma/client/runtime/library").GetResult<{
id: string;
createdAt: Date;
modifiedAt: Date;
pollId: string;
source: string;
}, unknown> & {}, never, import("@prisma/client/runtime/library").DefaultArgs>;
export {};