Skip to content
NodeJS/Typescript Client for PFSense Faux-API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
karma.conf.js
package-lock.json
package.json
tsconfig.json
webpack.config.js

README.md

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>;
You can’t perform that action at this time.