@alpinesoft/railjet
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -19,2 +19,5 @@ import Method from "./Methods"; | ||
type: Types.Type; | ||
default?: any; | ||
description?: string; | ||
validate?: (value: any) => boolean; | ||
} | ||
@@ -24,2 +27,5 @@ interface HeaderDescription { | ||
type: Types.Type; | ||
default?: any; | ||
description?: string; | ||
validate?: (value: any) => boolean; | ||
} | ||
@@ -26,0 +32,0 @@ declare class Action { |
import Action from "./Action"; | ||
interface AppOpts { | ||
cors?: boolean; | ||
} | ||
declare class App { | ||
cors: boolean; | ||
actions: Action[]; | ||
constructor(); | ||
constructor(opts?: AppOpts); | ||
registerAction(action: Action): void; | ||
@@ -6,0 +10,0 @@ registerActions(actions: Action[]): void; |
@@ -11,3 +11,4 @@ "use strict"; | ||
class App { | ||
constructor() { | ||
constructor(opts) { | ||
this.cors = opts.cors || false; | ||
this.actions = []; | ||
@@ -14,0 +15,0 @@ this._handleRequest = this._handleRequest.bind(this); |
@@ -11,2 +11,3 @@ declare class Type { | ||
declare const Integer: Type; | ||
export { Type, String, Boolean, Number, Integer }; | ||
declare const UUID: Type; | ||
export { Type, String, Boolean, Number, Integer, UUID }; |
@@ -21,1 +21,3 @@ "use strict"; | ||
exports.Integer = Integer; | ||
const UUID = new Type("uuid"); | ||
exports.UUID = UUID; |
{ | ||
"name": "@alpinesoft/railjet", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Lightweight Node.js library to build advanced JSON APIs.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -21,2 +21,5 @@ import Method from "./Methods"; | ||
type: Types.Type; | ||
default?: any; | ||
description?: string; | ||
validate?: (value: any) => boolean; | ||
} | ||
@@ -27,2 +30,5 @@ | ||
type: Types.Type; | ||
default?: any; | ||
description?: string; | ||
validate?: (value: any) => boolean; | ||
} | ||
@@ -29,0 +35,0 @@ |
@@ -9,7 +9,15 @@ import http from "http"; | ||
interface AppOpts { | ||
cors?: boolean; | ||
} | ||
class App { | ||
cors: boolean; | ||
actions: Action[]; | ||
constructor() { | ||
constructor(opts?: AppOpts) { | ||
this.cors = opts.cors || false; | ||
this.actions = []; | ||
@@ -16,0 +24,0 @@ |
@@ -20,2 +20,3 @@ class Type { | ||
const Integer = new Type("integer"); | ||
const UUID = new Type("uuid"); | ||
@@ -27,3 +28,4 @@ export { | ||
Number, | ||
Integer | ||
Integer, | ||
UUID | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41243
1044