1.0.5 • Published 2 years ago

wehelp-url-generator v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Description

Function to help generate valid url for surveys on Wehelp

Installation

npm i wehelp-url-generator

Usage

JavaScript

const wehelpGenerator = require('wehelp-url-generator');

TypeScript

import * as wehelpGenerator from 'wehelp-url-generator';

Example minimum data required

const wehelpGenerator = require('wehelp-url-generator');

const data = {
    code: 'xx', //change to valid code
    experience_id: null,
    experience_date: '2023-11-21 10:00:00',
    company_unit_code: 'xxxx',
    person: {
        name: 'xxxx',
        internal_code: 'xxxx',
        type: 'CUSTOMER',//CUSTOMER,COLLABORATOR
        company_unit_code: 'xxx'
    }
};
const encryptKey = 'xxx'; // change to valid encryptKey
const url = wehelpGenerator.generateUrl(data, encryptKey);

Example full data

const wehelpGenerator = require('wehelp-url-generator');

const data = {
    code: 'xx', //change to valid code
    experience_id: null,
    experience_date: '2023-11-10 10:00:00',
    company_unit_code: 'xxxx', 
    person: {
        name: 'xxxx',
        internal_code: 'xxxx',
        type: 'CUSTOMER',//CUSTOMER,COLLABORATOR
        company_unit_code: 'xxxxx',
        created_at: '2022-10-10',
        date_of_birth: '1988-07-06',
        language: 'PORTUGUESE',//PORTUGUESE,ENGLISH,SPANISH
        email: 'xxxx@email.com',
        phone: 'xxxxxxxx',
    },
    cf: {
        1: 'xxx', // id:value
        2: 'xx',
    },
};
const encryptKey = 'xxx'; // change to valid encryptKey
const url = wehelpGenerator.generateUrl(data, encryptKey);

Additional Information

If your company uses a unique code such as email or phone, you must enter these fields in your person object

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago