added script forms

This commit is contained in:
moulichand16
2026-03-27 10:53:20 +05:30
parent d3331e56c0
commit e912b982df
7 changed files with 248 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import axios from 'axios';
import type { LeadNode, LeadActivityNode, CreateCallInput, CreateLeadActivityInput, UpdateLeadInput } from './platform.types';
import type { LeadNode, LeadActivityNode, CreateCallInput, CreateLeadActivityInput, CreateLeadInput, UpdateLeadInput } from './platform.types';
@Injectable()
export class PlatformGraphqlService {
@@ -120,6 +120,16 @@ export class PlatformGraphqlService {
return data.createLeadActivity;
}
async createLead(input: CreateLeadInput): Promise<{ id: string }> {
const data = await this.query<{ createLead: { id: string } }>(
`mutation CreateLead($data: LeadCreateInput!) {
createLead(data: $data) { id }
}`,
{ data: input },
);
return data.createLead;
}
// --- Token passthrough versions (for user-driven requests) ---
async findLeadByPhoneWithToken(phone: string, authHeader: string): Promise<LeadNode | null> {