Skip to content
Snippets Groups Projects
Select Git revision
  • 519be23b8b6575cbd018740e9afa7ad656a6c84c
  • master default protected
  • 1.31
  • 4.24.3
  • 4.24.2
  • 4.24.1
  • 4.24.0
  • 4.23.6
  • 4.23.5
  • 4.23.4
  • 4.23.3
  • 4.23.2
  • 4.23.1
  • 4.23.0
  • 4.22.3
  • 4.22.2
  • 4.22.1
  • 4.22.0
  • 4.21.0
  • 4.20.1
  • 4.20.0
  • 4.19.0
  • 4.18.0
23 results

Monster.Constraints.AbstractConstraint.html

Blame
  • restapi.mjs 6.41 KiB
    /**
     * Copyright schukai GmbH and contributors 2022. All Rights Reserved.
     * Node module: @schukai/monster
     * This file is licensed under the AGPLv3 License.
     * License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
     */
    
    import {internalSymbol, instanceSymbol} from "../../../constants.mjs";
    import {isObject} from "../../../types/is.mjs";
    import {Server} from "../server.mjs";
    import {Pathfinder} from "../../pathfinder.mjs";
    import {Pipe} from "../../pipe.mjs";
    import {WriteError} from "./restapi/writeerror.mjs";
    
    export {RestAPI}
    
    /**
     * The RestAPI is a class that enables a REST API server.
     *
     * @externalExample ../../../../example/data/datasource/server/restapi.mjs
     * @license AGPLv3
     * @since 1.22.0
     * @copyright schukai GmbH
     * @memberOf Monster.Data.Datasource.Server
     * @summary The RestAPI is a class that binds a REST API server.
     */
    class RestAPI extends Server {
    
        /**
         *
         * @param {Object} [options] options contains definitions for the datasource.
         */
        constructor(options) {
            super();
    
            if (isObject(options)) {
                this.setOptions(options);
            }
    
        }
    
        /**
         * This method is called by the `instanceof` operator.
         * @returns {symbol}
         * @since 2.1.0
         */
        static get [instanceSymbol]() {
            return Symbol.for("@schukai/monster/data/datasource/server/restapi");
        }
    
        /**
         * @property {Object} write={} Options
         * @property {Object} write.init={} An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request|Request constructor}
         * @property {string} write.init.method=POST
         * @property {Object} write.init.headers Object containing any custom headers that you want to apply to the request.
         * @property {string} write.acceptedStatus=[200,201]
         * @property {string} write.url URL
         * @property {Object} write.mapping the mapping is applied before writing.
         * @property {String} write.mapping.transformer Transformer to select the appropriate entries
         * @property {Monster.Data.Datasource~exampleCallback[]} write.mapping.callback with the help of the callback, the structures can be adjusted before writing.
         * @property {Object} write.report
         * @property {String} write.report.path Path to validations
         * @property {Object} write.sheathing
         * @property {Object} write.sheathing.object Object to be wrapped
         * @property {string} write.sheathing.path Path to the data
         * @property {Object} read={} Options
         * @property {Object} read.init={} An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request|Request constructor}
         * @property {string} read.init.method=GET
         * @property {string} read.acceptedStatus=[200]
         * @property {string} read.url URL