export type CreateSequenceStepVariantDto = {type: 'Email' | 'LinkedInConnectionRequest' | 'LinkedInMessage' | 'LinkedInInMail' | 'LinkedInViewProfile' | 'LinkedInPostInteration' | 'Custom' | 'CallIntroduction' | 'CallDemo' | 'CallFollowUp' | 'CallReminder' | 'CallOther' | 'WhatsappMessage' | 'WhatsappVoiceMessage' | 'WhatsappVoiceCall', payload: Record, attachmentIds?: Array | undefined, taskNote?: string | undefined, absoluteDays?: number | undefined, assigneeId?: string | undefined, priority?: ('Urgent' | 'High' | 'Normal' | 'Low') | undefined}; export type CreateApiV1SequencesSequenceIdStepsStepIdVariantsArgs = {sequenceId: string, stepId: string, body: CreateSequenceStepVariantDto}; export type CreateApiV1SequencesSequenceIdStepsStepIdVariantsOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add a new variant to an existing step * * POST /v1/sequences/{sequenceId}/steps/{stepId}/variants */ export const createApiV1SequencesSequenceIdStepsStepIdVariants = async (args: CreateApiV1SequencesSequenceIdStepsStepIdVariantsArgs, options: CreateApiV1SequencesSequenceIdStepsStepIdVariantsOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/sequences/${encodeURIComponent(String(args.sequenceId))}/steps/${encodeURIComponent(String(args.stepId))}/variants${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };