UNPKG

zcatalyst-integ-cliq

Version:

Node.js SDK for integrating Zoho Catalyst with Zoho Cliq

69 lines (68 loc) 1.79 kB
import FormValue from './form-value.js'; export default class FormInput { newFormValue(label, value) { return new FormValue(label, value); } addOption(...formValue) { if (this.options === undefined) { this.options = formValue; return this.options.length; } return this.options.push(...formValue); } newPhoneNumberFilter(country_code) { return new PhoneNumberFilter(country_code); } newDateFilter(from, to, allowed_days) { return new DateFilter(from, to, allowed_days); } /** * @deprecated - Misspelled function name * * Use {@link newBoundary} instead. */ newBoundry(latitude, longitude, radius) { // eslint-disable-next-line no-console console.warn('Deprecated function - newBoundry'); return new Boundry(latitude, longitude, radius); } newBoundary(latitude, longitude, radius) { return new Boundary(latitude, longitude, radius); } } class PhoneNumberFilter { constructor(country_code) { this.country_code = country_code; } } class DateFilter { constructor(from, to, allowed_days) { this.from = from; this.to = to; this.allowed_days = allowed_days; } } export class FormError { constructor() { this.type = 'form_error'; } } /** * @deprecated - class name misspelled * * Use {@link Boundary} instead. */ class Boundry { constructor(latitude, longitude, radius) { this.latitude = latitude; this.longitude = longitude; this.radius = radius; } } class Boundary { constructor(latitude, longitude, radius) { this.latitude = latitude; this.longitude = longitude; this.radius = radius; } }