HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/self/root/home/arjun/projects/buyercall/buyercall/assets/vue/mock/externalWidgetMockAPI.js
import { GET, DELETE, POST } from '../constants';

export default [
  {
    type: GET,
    endpoint: /widget\/[a-zA-Z0-9-]+$/,
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'Widget configurations Fetched Successfully!',
      data: {
        attatchedChannelCount: 2,
        channels: [
          {
            type: 'CHAT',
            value: '35740d68-f46a-4bc6-b144-af4b38e9483d',
          },
          {
            type: 'EMAIL',
            value: '19fade10-cd48-4bd6-95b3-25e1a1d4b08f',
          },
        ],
        created_by: 'Harry Vermaa',
        created_by_agent_id: '8ce3921e-3744-4fbd-af82-bcfe7653389a',
        created_on: '2022-07-13T05:06:08.160380+00:00',
        description: 'Widget One',
        id: 'c179b748-fea6-4da5-92b9-a30826bd9de0',
        isActive: true,
        name: 'Widget One',
        options: {
          agents: [],
          enableNotifications: false,
          inboundConfigs: [
            {
              doingSendMessageAPI: false,
              errorSendMessageAPI: null,
              icon: 'snd-sm',
              leadSubmitButtonName: 'Send Message',
              load: false,
              requiredLeadFields: [
                'FIRST_NAME',
                'LAST_NAME',
                'PHONE_NUMBER',
                'EMAIL_ADDRESS',
                'MESSAGE',
              ],
              subTitle:
                'Please complete all fields below to send us a message.',
              title: 'Message',
              type: 'TEXT_MESSAGE',
            },
            {
              callStatusTimerID: null,
              doingCallStatusAPI: false,
              doingStartCallAPI: false,
              errorCallStatusAPI: null,
              errorStartCallAPI: null,
              icon: 'ph-sml',
              leadSubmitButtonName: 'Call',
              load: false,
              requiredLeadFields: [
                'FIRST_NAME',
                'LAST_NAME',
                'PHONE_NUMBER',
                'EMAIL_ADDRESS',
              ],
              subTitle:
                "We can't wait to talk to you. But first, please take a moment to tell us a bit of yourself.",
              title: 'Call',
              type: 'CALL',
            },
            {
              doingSendEmailAPI: false,
              errorSendEmailAPI: null,
              icon: 'msg-sml',
              leadSubmitButtonName: 'Send Mail',
              load: false,
              requiredLeadFields: [
                'FIRST_NAME',
                'LAST_NAME',
                'PHONE_NUMBER',
                'EMAIL_ADDRESS',
                'MESSAGE',
              ],
              subTitle: 'Please complete all fields below to send us an email.',
              title: 'Email',
              type: 'EMAIL',
            },
            {
              avatarIcon: '',
              avatarName: '',
              chatOptions: ['Opt in', 'Trade'],
              chatWelcomeMessage: 'Hi welcome',
              doingInitializeChatAPI: false,
              errorInitializeChatAPI: null,
              icon: 'chat-sml',
              leadSubmitButtonName: 'Continue',
              load: false,
              requiredLeadFields: [
                'FIRST_NAME',
                'LAST_NAME',
                'PHONE_NUMBER',
                'EMAIL_ADDRESS',
              ],
              subTitle:
                'Please complete all fields below to send us a message.',
              title: 'Chat',
              type: 'CHAT',
            },
          ],
          isRasaEnabled: true,
          isWidgetIcon: true,
          leftAligned: false,
          notifyNone: true,
          screenSubTitle: "Here's a few quick ways to connect with us.",
          screenTitleOne: 'Hi there!',
          screenTitleTwo: 'How can we help you?',
          widgetType: 'widget',
        },
        partnershipAccountname: 'ABC RV & Autos',
        partnershipName: 'AKarsh New LLC',
        partnership_account_id: '83362a94-f6ae-4bf8-a79c-90c45b885f92',
        partnership_id: 'e8ac9b1d-68ea-4c66-94f8-e3b567456d6f',
        updated_by: 'Harry Vermaa',
        updated_by_agent_id: '8ce3921e-3744-4fbd-af82-bcfe7653389a',
        updated_on: '2022-07-13T06:02:41.765541+00:00',
      },
    },
  },
  {
    type: POST,
    endpoint: /widget\/call\/[a-zA-Z0-9-]+$/,
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'Call connection initilzed successfully!',
      data: {
        success: true, //false,true
        callId: 1391,
        // code: 'ERR_NO_AGENTS',
      },
    },
  },
  {
    type: GET,
    endpoint: /widget\/call_status\/[a-zA-Z0-9-]+$/,
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'Call status fetched successfully!',
      data: {
        callConnect: true, //false,true
        // "error": true
      },
    },
  },
  {
    type: POST,
    endpoint: /sms\/send_message\/[a-zA-Z0-9-]+$/,
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'Message send successfully!',
      data: {},
    },
  },
  {
    type: POST,
    endpoint: /widget\/send_mail\/[a-zA-Z0-9-]+$/,
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'Mail send successfully!',
      data: {},
    },
  },
  {
    type: POST,
    endpoint: '/widget/start_chat',
    status: 200,
    response: {
      statusCode: 200,
      success: true,
      message: 'You can now successfully start chat!',
      data: (() => {
        const mockdata = [
          {
            leadId: '34eb6b26-1956-4356-b018-2f10ab8ec55',
            name: 'Contact One',
            email: 'contactone@customer.com',
            phone_number: '2134234324234',
            assigned_agent_id: ['8ce3921e-3744-4fbd-af82-bcfe7653389a'],
          },
          {
            leadId: '34eb6b26-1956-4356-b018-2f10ab567c55',
            name: 'Contact Two',
            email: 'contacttwo@customer.com',
            phone_number: '4567456546546',
            assigned_agent_id: [],
          },
        ];
        const random = Math.floor(Math.random() * mockdata.length);
        return mockdata[random];
      })(),
    },
  },
];