November: Procrastination Month

npm

Does your artifact manager get in the way? Join us on Oct. 8 at 10am PT, to discuss how npm can help.Sign up »

faux-api-client

1.0.9 • Public • Published

faux-api-client

NodeJS/Typescript Client for PFSense Faux-API

Pre-requisite

How to use

First npm install --save faux-api-client

Then, in your project:

import {FauxApiClient, IFauxApiResponse} from 'faux-api-client';
 
const fauxApiClient = new FauxApiClient(
    '<PFSense Server IP Address>',
    '<PF Sense Key>',
    '<PF Sense Secret>'
);
 
fauxApiClient.getConfiguration()
    .then((success: IFauxApiResponse) => {
        console.log('#################################################');
        console.log('#                SUCCESS                        #');
        console.log('#################################################');
        console.log(JSON.stringify(success));
    })
    .catch((error: Error) => {
        console.log('#################################################');
        console.log('#                 ERROR                         #');
        console.log('#################################################');
        console.log(JSON.stringify(error));
    });

Available commands

public async aliasUpdateUrlTables(): Promise<IFauxApiResponse>;
public async callFunction(functionName: string, ...args: any[]): Promise<IFauxApiResponse>;
public async gatewayStatus(): Promise<IFauxApiResponse>;
public async getBackupConfiguration(): Promise<IFauxApiResponse>;
public async getBackupConfigurationList(): Promise<IFauxApiResponse>;
public async getConfiguration(): Promise<IFauxApiResponse>;
public async getRule(ruleNumber: number): Promise<IFauxApiResponse>;
public async interfaceStatistics(interfaceName: string): Promise<IFauxApiResponse>;
public async patchConfiguration(configuration: any): Promise<IFauxApiResponse>;
public async rebootSystem(): Promise<IFauxApiResponse>;
public async reloadConfiguration(): Promise<IFauxApiResponse>;
public async restoreConfiguration(configurationFilePath: string): Promise<IFauxApiResponse>;
public async sendEvent(event: any): Promise<IFauxApiResponse>;
public async setConfiguration(configuration: any): Promise<IFauxApiResponse>;
public async systemStatistics(): Promise<IFauxApiResponse>;

install

npm i faux-api-client

Downloadsweekly downloads

100

version

1.0.9

license

LGPL-3.0-or-later

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability