UNPKG

flexmonster-mongo-connector

Version:

Custom data source API implementation for MongoDB

45 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.APISchema = void 0; class APISchema { constructor(mapOfSchemaValueObjects = new Map(), sorted = false) { this._mapOfSchemaValueObjects = null; this._sorted = false; this._filters = { "any": { "members": true, "query": true, "valueQuery": false }, "advanced": true }; this._mapOfSchemaValueObjects = mapOfSchemaValueObjects; this._sorted = sorted; } get fields() { return this._mapOfSchemaValueObjects; } set fields(mapOfSchemaValueObjects) { this._mapOfSchemaValueObjects = mapOfSchemaValueObjects; } get sorted() { return this._sorted; } set sorted(sorted) { this._sorted = sorted; } toJSON() { let obj = {}; let schemaObjects = []; let values = this._mapOfSchemaValueObjects.values(); for (let value of values) { schemaObjects.push(value.toObject()); } obj["fields"] = schemaObjects; obj["sorted"] = this._sorted; obj["filters"] = this._filters; return obj; } } exports.APISchema = APISchema; //# sourceMappingURL=APISchema.js.map