alado 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -354,7 +354,6 @@ transformProperty(propertyTransformer: (value:any) => any | Promise<any>)
354
354
 
355
355
  ```
356
356
 
357
-
358
357
  ### `validateProperty`
359
358
 
360
359
  ```ts
@@ -1,7 +1,10 @@
1
+ export type ResponseError = {
2
+ message: string;
3
+ };
1
4
  export interface Response<T> {
2
5
  title?: string;
3
6
  description?: string;
4
7
  statusCode: number;
5
8
  headers?: Record<string, string>;
6
- body?: T;
9
+ body?: T | ResponseError;
7
10
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Context, ContextRequest, RequestAuthentication, Request, Response, PropertyDefinition, PropertyDocumentation, PropertyDefinitionSchema, FilePropertyDefinition, } from './dto';
2
2
  export { AladoServerOptions, ContextOptions, CorsOptions, OpenApiDoc } from './options';
3
3
  export { HttpMethod, httpStatus, ContentType } from './constants';
4
- export { initializeApplication, defineRequest, defineResponse, fileUploadProperty, documentProperty, validateProperty, withAuth, get, del, head, patch, post, put, } from './decorators';
4
+ export { initializeApplication, defineRequest, defineResponse, fileUploadProperty, documentProperty, validateProperty, transformProperty, withAuth, get, del, head, patch, post, put, } from './decorators';
5
5
  export { AladoServer } from './alado-server';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AladoServer = exports.put = exports.post = exports.patch = exports.head = exports.del = exports.get = exports.withAuth = exports.validateProperty = exports.documentProperty = exports.fileUploadProperty = exports.defineResponse = exports.defineRequest = exports.initializeApplication = exports.ContentType = exports.httpStatus = exports.HttpMethod = void 0;
3
+ exports.AladoServer = exports.put = exports.post = exports.patch = exports.head = exports.del = exports.get = exports.withAuth = exports.transformProperty = exports.validateProperty = exports.documentProperty = exports.fileUploadProperty = exports.defineResponse = exports.defineRequest = exports.initializeApplication = exports.ContentType = exports.httpStatus = exports.HttpMethod = void 0;
4
4
  var _const_1 = require("./constants");
5
5
  Object.defineProperty(exports, "HttpMethod", { enumerable: true, get: function () { return _const_1.HttpMethod; } });
6
6
  Object.defineProperty(exports, "httpStatus", { enumerable: true, get: function () { return _const_1.httpStatus; } });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "defineResponse", { enumerable: true, get: functi
12
12
  Object.defineProperty(exports, "fileUploadProperty", { enumerable: true, get: function () { return _decorator_1.fileUploadProperty; } });
13
13
  Object.defineProperty(exports, "documentProperty", { enumerable: true, get: function () { return _decorator_1.documentProperty; } });
14
14
  Object.defineProperty(exports, "validateProperty", { enumerable: true, get: function () { return _decorator_1.validateProperty; } });
15
+ Object.defineProperty(exports, "transformProperty", { enumerable: true, get: function () { return _decorator_1.transformProperty; } });
15
16
  Object.defineProperty(exports, "withAuth", { enumerable: true, get: function () { return _decorator_1.withAuth; } });
16
17
  Object.defineProperty(exports, "get", { enumerable: true, get: function () { return _decorator_1.get; } });
17
18
  Object.defineProperty(exports, "del", { enumerable: true, get: function () { return _decorator_1.del; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAYA,iCAA6D;AAApD,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,qGAAA,WAAW,OAAA;AAC5C,yCAcoB;AAblB,mHAAA,qBAAqB,OAAA;AACrB,2GAAA,aAAa,OAAA;AACb,4GAAA,cAAc,OAAA;AACd,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,8GAAA,gBAAgB,OAAA;AAChB,sGAAA,QAAQ,OAAA;AACR,iGAAA,GAAG,OAAA;AACH,iGAAA,GAAG,OAAA;AACH,kGAAA,IAAI,OAAA;AACJ,mGAAA,KAAK,OAAA;AACL,kGAAA,IAAI,OAAA;AACJ,iGAAA,GAAG,OAAA;AAEL,iCAAqC;AAA5B,qGAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAYA,iCAA6D;AAApD,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,qGAAA,WAAW,OAAA;AAC5C,yCAeoB;AAdlB,mHAAA,qBAAqB,OAAA;AACrB,2GAAA,aAAa,OAAA;AACb,4GAAA,cAAc,OAAA;AACd,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,8GAAA,gBAAgB,OAAA;AAChB,+GAAA,iBAAiB,OAAA;AACjB,sGAAA,QAAQ,OAAA;AACR,iGAAA,GAAG,OAAA;AACH,iGAAA,GAAG,OAAA;AACH,kGAAA,IAAI,OAAA;AACJ,mGAAA,KAAK,OAAA;AACL,kGAAA,IAAI,OAAA;AACJ,iGAAA,GAAG,OAAA;AAEL,iCAAqC;AAA5B,qGAAA,WAAW,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alado",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Extremely fast, lightweight, robust framework for HTTP applications written in Node.js",
5
5
  "keywords": [
6
6
  "HTTP",