remult 0.24.0-exp.5 → 0.24.0

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.
@@ -1,5 +1,5 @@
1
- import { readBody } from 'h3';
2
- import { createRemultServer, } from './server/index.js';
1
+ import { readBody, setResponseStatus } from 'h3';
2
+ import { createRemultServer } from './server/index.js';
3
3
  export function remultNuxt(options) {
4
4
  const result = createRemultServer(options, {
5
5
  buildGenericRequestInfo: (event) => {
@@ -36,14 +36,16 @@ export function remultNuxt(options) {
36
36
  });
37
37
  }
38
38
  if (r) {
39
+ if (r.statusCode !== 200)
40
+ setResponseStatus(event, r.statusCode);
39
41
  return r.data;
40
42
  }
41
43
  };
42
44
  return Object.assign(handler, {
43
45
  getRemult: (req) => result.getRemult(req),
44
46
  openApiDoc: (options) => result.openApiDoc(options),
45
- withRemult(event, what) {
46
- return result.withRemultAsync(event, what);
47
+ withRemult(request, what) {
48
+ return result.withRemultAsync(request, what);
47
49
  },
48
50
  });
49
51
  }
@@ -13,7 +13,7 @@ export {};
13
13
  //p1 - V - dbname to metadata consider making dbname in the field metadata options - non optional, so it'll be clear that it always have value - something like require the specific key - or move it to the metadata field
14
14
  //p1 - V - getEntityRefClone What I would like is to make a copy of the item (without getting it from the server again)
15
15
  //p1 - V find one i had a question about find first's different syntax from find that confused a user
16
-
16
+ //p1 - https://dexie.org/
17
17
  rename V - withremultpromise to that withRemultAsync
18
18
  expose live query storage in remult
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.24.0-exp.5",
3
+ "version": "0.24.0",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
package/remult-nuxt.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { H3Event } from 'h3';
2
- import { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
2
+ import type { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
3
3
  export declare function remultNuxt(options: RemultServerOptions<H3Event>): RemultNuxtServer;
4
4
  export type RemultNuxtServer = RemultServerCore<H3Event> & ((event: H3Event) => Promise<any>) & {
5
5
  withRemult: RemultServer<H3Event>['withRemultAsync'];
package/remult-nuxt.js CHANGED
@@ -57,6 +57,8 @@ function remultNuxt(options) {
57
57
  _a.label = 3;
58
58
  case 3:
59
59
  if (r) {
60
+ if (r.statusCode !== 200)
61
+ (0, h3_1.setResponseStatus)(event, r.statusCode);
60
62
  return [2 /*return*/, r.data];
61
63
  }
62
64
  return [2 /*return*/];
@@ -66,8 +68,8 @@ function remultNuxt(options) {
66
68
  return Object.assign(handler, {
67
69
  getRemult: function (req) { return result.getRemult(req); },
68
70
  openApiDoc: function (options) { return result.openApiDoc(options); },
69
- withRemult: function (event, what) {
70
- return result.withRemultAsync(event, what);
71
+ withRemult: function (request, what) {
72
+ return result.withRemultAsync(request, what);
71
73
  },
72
74
  });
73
75
  }
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  //p1 - V - dbname to metadata consider making dbname in the field metadata options - non optional, so it'll be clear that it always have value - something like require the specific key - or move it to the metadata field
15
15
  //p1 - V - getEntityRefClone What I would like is to make a copy of the item (without getting it from the server again)
16
16
  //p1 - V find one i had a question about find first's different syntax from find that confused a user
17
-
17
+ //p1 - https://dexie.org/
18
18
  rename V - withremultpromise to that withRemultAsync
19
19
  expose live query storage in remult
20
20