
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@cerios/afas-filter-builder
Advanced tools
A TypeScript library for building filters and query parameters for AFAS GetConnectors. This library provides a fluent API to construct filters, sorting, and pagination for AFAS API requests.
EqualTo, Contains, NotEqualTo, etc.skip and take parameters.Install the library using npm:
npm install afas-filter-builder
import { AfasFilter } from "afas-filter-builder";
import { Operator } from "afas-filter-builder/src/operator";
import { OrderBy } from "afas-filter-builder/src/order-by";
type ExampleType = {
id: number;
name: string | null;
isActive: boolean;
};
const filter = AfasFilter.create<ExampleType>()
.skip(10)
.take(20)
.addFilter("id", 123, Operator.EqualTo)
.addFilter("name", "test", Operator.Contains)
.addOrderBy("id", OrderBy.Ascending)
.buildURLSearchParams();
console.log(filter.toString());
// Output: skip=10&take=20&filterfieldids=id,name&filtervalues=123,test&operatortypes=1,6&orderbyfieldids=id
AfasFilter.create<T>()Creates a new instance of AfasFilter for the specified type T.
.skip(skip: number): thisSets the number of records to skip.
.take(take: number): thisSets the number of records to take.
.addFilter<K extends keyof T>(field: K, value: T[K], operator: Operator = Operator.EqualTo): thisAdds a filter for the specified field, value, and operator.
field: The field to filter on.value: The value to filter by.operator: The operator to use (default is EqualTo)..addOrderBy<K extends keyof T>(field: K, order: OrderBy): thisAdds a sorting order for the specified field.
field: The field to sort by.order: The sorting order (OrderBy.Ascending or OrderBy.Descending)..buildURLSearchParams(): URLSearchParamsBuilds and returns the query parameters as a URLSearchParams object.
The following operators are available in the Operator enum:
EqualToGreaterThanOrEqualToLessThanOrEqualToGreaterThenLessThenContainsNotEqualToIsEmptyIsNotEmptyStartsWithDoesntContainDoesntStartWithEndsWithDoesntEndWithQuickFilterThe OrderBy enum provides the following options:
OrderBy.AscendingOrderBy.Descendingconst filter = AfasFilter.create<ExampleType>()
.addFilter("isActive", true, Operator.EqualTo)
.addFilter("name", null, Operator.IsEmpty)
.addOrderBy("name", OrderBy.Descending)
.buildURLSearchParams();
console.log(filter.toString());
// Output: filterfieldids=isActive,name&filtervalues=true,null&operatortypes=1,8&orderbyfieldids=-name
This project uses Jest for testing. To run the tests, use:
npm test
This project is licensed under the MIT License.
FAQs
Get connector filter builder for AFAS
The npm package @cerios/afas-filter-builder receives a total of 3 weekly downloads. As such, @cerios/afas-filter-builder popularity was classified as not popular.
We found that @cerios/afas-filter-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.