remult 0.14.14 → 0.14.15

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.
@@ -39,8 +39,9 @@ export interface GenericRequest {
39
39
  params: any;
40
40
  }
41
41
  export interface GenericResponse {
42
- statusCode: number;
43
42
  json(data: any): any;
43
+ statusCode: number;
44
+ end(): any;
44
45
  }
45
46
  export declare type GenericRouter = GenericRequestHandler & {
46
47
  route(path: string): SpecificRoute;
@@ -483,7 +483,7 @@ class ExpressResponseBridgeToDataApiResponse {
483
483
  }
484
484
  sendStatus(status) {
485
485
  this.r.statusCode = status;
486
- this.r.json({});
486
+ this.r.end();
487
487
  }
488
488
  progress(progress) {
489
489
  }
@@ -43,9 +43,7 @@ fit("forbidden", async () => {
43
43
  catch (error) {
44
44
  err = error;
45
45
  }
46
- expect(err).toEqual({
47
- httpStatusCode: 403
48
- });
46
+ expect(err.httpStatusCode).toEqual(403);
49
47
  });
50
48
  fit("test http 404", async () => {
51
49
  const repo = create3Tasks();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.14.14",
3
+ "version": "0.14.15",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
File without changes
@@ -39,8 +39,9 @@ export interface GenericRequest {
39
39
  params: any;
40
40
  }
41
41
  export interface GenericResponse {
42
- statusCode: number;
43
42
  json(data: any): any;
43
+ statusCode: number;
44
+ end(): any;
44
45
  }
45
46
  export declare type GenericRouter = GenericRequestHandler & {
46
47
  route(path: string): SpecificRoute;
@@ -581,7 +581,7 @@ var ExpressResponseBridgeToDataApiResponse = /** @class */ (function () {
581
581
  };
582
582
  ExpressResponseBridgeToDataApiResponse.prototype.sendStatus = function (status) {
583
583
  this.r.statusCode = status;
584
- this.r.json({});
584
+ this.r.end();
585
585
  };
586
586
  ExpressResponseBridgeToDataApiResponse.prototype.progress = function (progress) {
587
587
  };
@@ -96,9 +96,7 @@ fit("forbidden", function () { return tslib_1.__awaiter(void 0, void 0, void 0,
96
96
  err = error_2;
97
97
  return [3 /*break*/, 4];
98
98
  case 4:
99
- expect(err).toEqual({
100
- httpStatusCode: 403
101
- });
99
+ expect(err.httpStatusCode).toEqual(403);
102
100
  return [2 /*return*/];
103
101
  }
104
102
  });
@@ -1,2 +0,0 @@
1
- import { FieldMetadata } from '../src/column-interfaces';
2
- export declare function postgresColumnSyntax(x: FieldMetadata, dbName: string): string;
@@ -1,30 +0,0 @@
1
- import { ValueConverters } from '../valueConverters';
2
- export function postgresColumnSyntax(x, dbName) {
3
- let result = dbName;
4
- if (x.valueType == Number) {
5
- if (!x.valueConverter.fieldTypeInDb)
6
- result += " numeric" + (x.allowNull ? "" : " default 0 not null");
7
- else
8
- result += " " + x.valueConverter.fieldTypeInDb + (x.allowNull ? "" : " default 0 not null");
9
- }
10
- else if (x.valueType == Date) {
11
- if (!x.valueConverter.fieldTypeInDb)
12
- if (x.valueConverter == ValueConverters.DateOnly)
13
- result += " date";
14
- else
15
- result += " timestamp";
16
- else
17
- result += " " + x.valueConverter.fieldTypeInDb;
18
- }
19
- else if (x.valueType == Boolean)
20
- result += " boolean" + (x.allowNull ? "" : " default false not null");
21
- else if (x.valueConverter.fieldTypeInDb) {
22
- result += " " + x.valueConverter.fieldTypeInDb;
23
- if (!x.allowNull && x.valueConverter.fieldTypeInDb == 'integer') {
24
- result += " default 0 not null";
25
- }
26
- }
27
- else
28
- result += " varchar" + (x.allowNull ? "" : " default '' not null");
29
- return result;
30
- }