2.0.2 • Published 1 year ago

@simple-dealer/autofill-puppeteer-client v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Description

Client library to connect to Simple Dealer's Autofill from the web

Pre-Requisites

Installation

Add this as a dependency to your project using npm with

$ npm i @simple-dealer/autofill-puppeteer-client

or using Yarn with

$ yarn add @simple-dealer/autofill-puppeteer-client

Usage

Connect to autofill client

import {
  createDownloadAutofillDaemon,
  errors,
  createHandleAutofillS3,
  createHandleAutofillWs,
  listenToDaemon
} from '@simple-dealer/autofill-puppeteer-client'

const s3 = {
  accessKeyId: '',
  secretAccessKey: '',
  region: ''
};

const { connected } = listenToDaemon()
const autoFillClient = connected ? createHandleAutofillWs() : createHandleAutofillS3({ s3 })
const downloadAutofillDaemon = createDownloadAutofillDaemon()

Autofill lender

try {
  await autoFillClient({
    lenders,
    mainApplicant,
    coApplicant,
    deal,
    userInformation,
    type: 'lender'
  })
  alert('Autofill started')
} catch (e) {
  if (equals(e, errors.DaemonNotInstalledError)) downloadAutofillDaemon()
  if (equals(e, errors.AutofillUnknownError)) alert('Unknown error occurred')
}

Autofill OFAC

try {
  await autoFillClient({
    mainApplicant,
    type: 'ofac'
  })
  alert('Autofill started')
} catch (e) {
  if (equals(e, errors.DaemonNotInstalledError)) downloadAutofillDaemon()
  if (equals(e, errors.AutofillUnknownError)) alert('Unknown error occurred')
}

Test Lender

try {
  await autoFillClient({
    lenders: [
      {
        "exists": true,
        "platform": "sheffield",
        "name": "sheffield",
        "credentials": {
          "username": "",
          "password": ""
        }
      }
    ],
    type: 'test'
  })
  alert('Autofill started')
} catch (e) {
  if (equals(e, errors.DaemonNotInstalledError)) downloadAutofillDaemon()
  if (equals(e, errors.AutofillUnknownError)) alert('Unknown error occurred')
}

Get detailed parameters - here

2.0.2

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.4-alpha

2 years ago

1.0.0

2 years ago

1.1.1-alpha

2 years ago

1.1.2-alpha

2 years ago

1.1.0-alpha

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.8

2 years ago

0.2.3

3 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.2.2

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago