Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plumier

Package Overview
Dependencies
Maintainers
1
Versions
652
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plumier - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6-canary.3

10

lib/application.js

@@ -6,3 +6,3 @@ "use strict";

const core_1 = require("@plumier/core");
const koa_1 = tslib_1.__importDefault(require("koa"));
const koa_1 = (0, tslib_1.__importDefault)(require("koa"));
const path_1 = require("path");

@@ -35,3 +35,3 @@ class Plumier {

set(config) {
if (core_1.hasKeyOf(config, "setup")) {
if ((0, core_1.hasKeyOf)(config, "setup")) {
config.setup(this);

@@ -51,3 +51,3 @@ this.config.facilities.push(config);

if (this.config.rootDir === "__UNSET__")
this.config.rootDir = path_1.dirname(require.main.filename);
this.config.rootDir = (0, path_1.dirname)(require.main.filename);
//pre initialize

@@ -68,6 +68,6 @@ for (const facility of this.config.facilities) {

if (this.config.mode === "debug") {
core_1.printAnalysis(core_1.analyzeRoutes(routes, this.config));
(0, core_1.printAnalysis)((0, core_1.analyzeRoutes)(routes, this.config));
}
const actionRoutes = routes.filter((x) => x.kind === "ActionRoute");
this.koa.use(core_1.router(actionRoutes, this.config));
this.koa.use((0, core_1.router)(actionRoutes, this.config));
this.koa.proxy = this.config.trustProxyHeader;

@@ -74,0 +74,0 @@ return this.koa;

@@ -5,8 +5,8 @@ "use strict";

const tslib_1 = require("tslib");
const cors_1 = tslib_1.__importDefault(require("@koa/cors"));
const cors_1 = (0, tslib_1.__importDefault)(require("@koa/cors"));
const core_1 = require("@plumier/core");
const generic_controller_1 = require("@plumier/generic-controller");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
const koa_body_1 = tslib_1.__importDefault(require("koa-body"));
const qs_1 = tslib_1.__importDefault(require("qs"));
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
const koa_body_1 = (0, tslib_1.__importDefault)(require("koa-body"));
const qs_1 = (0, tslib_1.__importDefault)(require("qs"));
function createQuery(queryString, extra) {

@@ -52,4 +52,4 @@ const parsed = qs_1.default.parse(queryString);

const { controller } = app.config;
const controllers = await core_1.generateRoutes(controller, Object.assign(Object.assign({}, app.config), this.opt));
const generics = await generic_controller_1.generateGenericControllerRoutes(controller, Object.assign(Object.assign({}, app.config), this.opt));
const controllers = await (0, core_1.generateRoutes)(controller, Object.assign(Object.assign({}, app.config), this.opt));
const generics = await (0, generic_controller_1.generateGenericControllerRoutes)(controller, Object.assign(Object.assign({}, app.config), this.opt));
return [...controllers, ...generics];

@@ -60,11 +60,11 @@ }

const option = Object.assign({}, this.opt);
if ((_a = option.forceHttps) !== null && _a !== void 0 ? _a : core_1.toBoolean(process.env.PLUM_FORCE_HTTPS || "__none")) {
if ((_a = option.forceHttps) !== null && _a !== void 0 ? _a : (0, core_1.toBoolean)(process.env.PLUM_FORCE_HTTPS || "__none")) {
app.use(new ForceHttpsMiddleware());
}
app.koa.use(koa_body_1.default(option.bodyParser));
app.koa.use((0, koa_body_1.default)(option.bodyParser));
if (typeof option.cors !== "boolean" && option.cors) {
app.koa.use(cors_1.default(option.cors));
app.koa.use((0, cors_1.default)(option.cors));
}
else if (option.cors) {
app.koa.use(cors_1.default());
app.koa.use((0, cors_1.default)());
}

@@ -163,4 +163,4 @@ if (option.dependencyResolver)

const controller = this.option.controller;
const controllers = await core_1.generateRoutes(controller, Object.assign(Object.assign({}, app.config), this.option));
const generics = await generic_controller_1.generateGenericControllerRoutes(controller, Object.assign(Object.assign({}, app.config), this.option));
const controllers = await (0, core_1.generateRoutes)(controller, Object.assign(Object.assign({}, app.config), this.option));
const generics = await (0, generic_controller_1.generateGenericControllerRoutes)(controller, Object.assign(Object.assign({}, app.config), this.option));
return [...controllers, ...generics];

@@ -167,0 +167,0 @@ }

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperty(exports, "ControllerBuilder", { enumerable: true, get: function () { return generic_controller_1.ControllerBuilder; } });
tslib_1.__exportStar(require("./facility"), exports);
(0, tslib_1.__exportStar)(require("./facility"), exports);
var query_parser_1 = require("@plumier/query-parser");

@@ -42,0 +42,0 @@ Object.defineProperty(exports, "filterParser", { enumerable: true, get: function () { return query_parser_1.filterParser; } });

@@ -5,5 +5,5 @@ "use strict";

const core_1 = require("@plumier/core");
const bytes_1 = tslib_1.__importDefault(require("bytes"));
const bytes_1 = (0, tslib_1.__importDefault)(require("bytes"));
function validateSize(opt, val, msg) {
const expected = (typeof opt === "string") ? bytes_1.default(opt) : opt;
const expected = (typeof opt === "string") ? (0, bytes_1.default)(opt) : opt;
if (val > expected)

@@ -10,0 +10,0 @@ return msg !== null && msg !== void 0 ? msg : "File size exceed the limit allowed";

{
"name": "plumier",
"version": "1.0.5",
"version": "1.0.6-canary.3+b235819",
"description": "Delightful Node.js Rest Framework",

@@ -22,8 +22,8 @@ "main": "lib/index.js",

"@koa/cors": "^3.1.0",
"@plumier/core": "^1.0.5",
"@plumier/generic-controller": "^1.0.5",
"@types/bytes": "^3.1.0",
"@types/koa": "^2.13.3",
"@types/koa__cors": "^3.0.2",
"@types/qs": "^6.9.6",
"@plumier/core": "1.0.6-canary.3+b235819",
"@plumier/generic-controller": "1.0.6-canary.3+b235819",
"@types/bytes": "^3.1.1",
"@types/koa": "^2.13.4",
"@types/koa__cors": "^3.0.3",
"@types/qs": "^6.9.7",
"bytes": "^3.1.0",

@@ -47,3 +47,3 @@ "koa": "^2.13.1",

},
"gitHead": "5f6d204483657909bac31851522176b2b500e583"
"gitHead": "b2358195477eaafb0654e92c8605bc1ecf7a8350"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc