UNPKG

3.92 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/*************************************************************************
4 *
5 * Troven CONFIDENTIAL
6 * __________________
7 *
8 * (c) 2017-2019 Troven Pty Ltd
9 * All Rights Reserved.
10 *
11 * NOTICE: All information contained herein is, and remains
12 * the property of Troven Pty Ltd and its licensors,
13 * if any. The intellectual and technical concepts contained
14 * herein are proprietary to Troven Pty Ltd
15 * and its suppliers and may be covered by International and Regional Patents,
16 * patents in process, and are protected by trade secret or copyright law.
17 * Dissemination of this information or reproduction of this material
18 * is strictly forbidden unless prior written permission is obtained
19 * from Troven Pty Ltd.
20 */
21const core = require("api-service-core");
22const plugins_1 = require("./plugins");
23var plugins_2 = require("./plugins");
24exports.amqp = plugins_2.amqp;
25exports.cors = plugins_2.cors;
26exports.harden = plugins_2.harden;
27exports.remote_config = plugins_2.remote_config;
28exports.prometheus = plugins_2.prometheus;
29exports.ua = plugins_2.ua;
30exports.render = plugins_2.render;
31exports.webhooks = plugins_2.webhooks;
32const middleware_1 = require("./middleware");
33var middleware_2 = require("./middleware");
34exports.apidocs = middleware_2.apidocs;
35exports.api_config = middleware_2.api_config;
36exports.decrypt = middleware_2.decrypt;
37exports.encrypt = middleware_2.encrypt;
38exports.local_file = middleware_2.local_file;
39exports.redact = middleware_2.redact;
40exports.redirect = middleware_2.redirect;
41exports.static_assets = middleware_2.static_assets;
42var api_service_core_1 = require("api-service-core");
43exports.Chassis = api_service_core_1.Chassis;
44/*
45 Register all our default plugins
46 These can are installed before the server starts listening
47 */
48let default_plugins = function () {
49 this.registerPlugin(new plugins_1.amqp);
50 this.registerPlugin(new plugins_1.cors);
51 this.registerPlugin(new plugins_1.harden);
52 this.registerPlugin(new plugins_1.prometheus);
53 this.registerPlugin(new plugins_1.ua);
54 this.registerPlugin(new plugins_1.render);
55 this.registerPlugin(new plugins_1.remote_config);
56 this.registerPlugin(new plugins_1.webhooks);
57 this.registerPlugin(new core.PipelinePlugin);
58 this.registerPlugin(new core.after);
59 this.registerPlugin(new core.before);
60 this.registerPlugin(new core.graphql);
61 this.registerPlugin(new core.logging);
62 this.registerPlugin(new core.jwt);
63 this.registerPlugin(new core.payload);
64 this.registerPlugin(new core.OpenAPIPlugin);
65};
66/*
67 Register all our middleware plugins
68 These can be attached as chassis:operations to Open API specs
69 */
70let default_middleware = function () {
71 this.registerFn(new core.bower_components);
72 this.registerFn(new core.debug);
73 this.registerFn(new core.DataDict);
74 this.registerFn(new core.echo);
75 this.registerFn(new core.gregarious);
76 this.registerFn(new core.heartbeat);
77 this.registerFn(new core.headers);
78 this.registerFn(new core.mock);
79 this.registerFn(new core.mount);
80 this.registerFn(new core.not_found);
81 this.registerFn(new core.proxy);
82 this.registerFn(new core.request_uuid);
83 this.registerFn(new core.sortby);
84 this.registerFn(new middleware_1.apidocs);
85 this.registerFn(new middleware_1.decrypt);
86 this.registerFn(new middleware_1.encrypt);
87 this.registerFn(new middleware_1.local_file);
88 this.registerFn(new middleware_1.api_config);
89 this.registerFn(new middleware_1.redact);
90 this.registerFn(new middleware_1.redirect);
91 this.registerFn(new middleware_1.static_assets);
92};
93function default_features() {
94 console.log("common-defaults");
95 default_plugins.apply(this);
96 default_middleware.apply(this);
97}
98exports.default_features = default_features;
99//# sourceMappingURL=index.js.map
\No newline at end of file