remult 2.7.34 → 3.0.0-next.1

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.
@@ -64,14 +64,16 @@ export class Remult {
64
64
  * @param dataProvider - an optional alternative data provider to use. Useful for writing to offline storage or an alternative data provider
65
65
  */
66
66
  repo = (entity, dataProvider) => {
67
+ const info = createOldEntity(entity, this);
67
68
  if (dataProvider === undefined)
68
- dataProvider = this.dataProvider;
69
+ dataProvider =
70
+ info?.options?.dataProvider?.(this.dataProvider) ?? this.dataProvider;
69
71
  let dpCache = this.repCache.get(dataProvider);
70
72
  if (!dpCache)
71
73
  this.repCache.set(dataProvider, (dpCache = new Map()));
72
74
  let r = dpCache.get(entity);
73
75
  if (!r) {
74
- dpCache.set(entity, (r = new RepositoryImplementation(entity, this, dataProvider, createOldEntity(entity, this))));
76
+ dpCache.set(entity, (r = new RepositoryImplementation(entity, this, dataProvider, info)));
75
77
  verifyFieldRelationInfo(r, this, dataProvider);
76
78
  }
77
79
  return r;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "2.7.34",
3
+ "version": "3.0.0-next.1",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -1,9 +1,10 @@
1
1
  import * as express from 'express';
2
2
  import type { RemultServer, RemultServerCore, RemultServerOptions } from './server/remult-api-server.js';
3
- export declare function remultExpress(options?: RemultServerOptions<express.Request> & {
3
+ export declare function remultApi(options?: RemultServerOptions<express.Request> & {
4
4
  bodyParser?: boolean;
5
5
  bodySizeLimit?: string;
6
- }): RemultExpressServer;
7
- export type RemultExpressServer = express.RequestHandler & RemultServerCore<express.Request> & {
6
+ }): remultApiServer;
7
+ export type remultApiServer = express.RequestHandler & RemultServerCore<express.Request> & {
8
8
  withRemult: (req: express.Request, res: express.Response, next: VoidFunction) => void;
9
9
  } & Pick<RemultServer<express.Request>, 'withRemultAsync'>;
10
+ export declare const remultExpress: typeof remultApi;
package/remult-express.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultExpress = remultExpress;
3
+ exports.remultExpress = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var express = tslib_1.__importStar(require("express"));
6
7
  var index_js_1 = require("./server/index.js");
7
- function remultExpress(options) {
8
+ function remultApi(options) {
8
9
  var _this = this;
9
10
  var app = express.Router();
10
11
  if (!options) {
@@ -33,3 +34,5 @@ function remultExpress(options) {
33
34
  },
34
35
  });
35
36
  }
37
+ // @deprecated use remultApi instead
38
+ exports.remultExpress = remultApi;
@@ -1,6 +1,7 @@
1
1
  import type { FastifyPluginCallback, FastifyRequest } from 'fastify';
2
2
  import type { RemultServerCore, RemultServerOptions, RemultServer } from './server/remult-api-server.js';
3
- export declare function remultFastify(options: RemultServerOptions<FastifyRequest>): RemultFastifyServer;
3
+ export declare function remultApi(options: RemultServerOptions<FastifyRequest>): RemultFastifyServer;
4
4
  export type RemultFastifyServer = FastifyPluginCallback & RemultServerCore<FastifyRequest> & {
5
5
  withRemult: RemultServer<FastifyRequest>['withRemultAsync'];
6
6
  };
7
+ export declare const remultFastify: typeof remultApi;
package/remult-fastify.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultFastify = remultFastify;
3
+ exports.remultFastify = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var index_js_1 = require("./server/index.js");
6
- function remultFastify(options) {
7
+ function remultApi(options) {
7
8
  var _this = this;
8
9
  function fastifyHandler(handler) {
9
10
  var response = function (req, res) {
@@ -81,3 +82,5 @@ function remultFastify(options) {
81
82
  },
82
83
  });
83
84
  }
85
+ // @deprecated use remultApi instead
86
+ exports.remultFastify = remultApi;
package/remult-hapi.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Request, Plugin } from '@hapi/hapi';
2
2
  import { type RemultServerCore, type RemultServerOptions, type RemultServer } from './server/index.js';
3
- export declare function remultHapi(options: RemultServerOptions<Request>): RemultHapiServer;
3
+ export declare function remultApi(options: RemultServerOptions<Request>): RemultHapiServer;
4
4
  export type RemultHapiServer = Plugin<any, any> & RemultServerCore<Request> & {
5
5
  withRemult: RemultServer<Request>['withRemultAsync'];
6
6
  };
7
+ export declare const remultHapi: typeof remultApi;
package/remult-hapi.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultHapi = remultHapi;
3
+ exports.remultHapi = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var index_js_1 = require("./server/index.js");
6
7
  var stream_1 = require("stream");
7
- function remultHapi(options) {
8
+ function remultApi(options) {
8
9
  var _this = this;
9
10
  var api = (0, index_js_1.createRemultServer)(options, {
10
11
  buildGenericRequestInfo: function (req) { return ({
@@ -125,3 +126,5 @@ function remultHapi(options) {
125
126
  },
126
127
  });
127
128
  }
129
+ // @deprecated use remultApi instead
130
+ exports.remultHapi = remultApi;
package/remult-hono.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { type Context, type Env, Hono } from 'hono';
2
2
  import type { BlankInput } from 'hono/types';
3
3
  import { type RemultServerOptions, type RemultServerCore } from './server/index.js';
4
- export declare function remultHono(options: RemultServerOptions<Context<Env, '', BlankInput>>): RemultHonoServer;
4
+ export declare function remultApi(options: RemultServerOptions<Context<Env, '', BlankInput>>): RemultHonoServer;
5
5
  export type RemultHonoServer = Hono & RemultServerCore<Context<Env, '', BlankInput>> & {
6
6
  withRemult: <T>(c: Context<Env, '', BlankInput>, what: () => Promise<T>) => Promise<T>;
7
7
  };
8
+ export declare const remultHono: typeof remultApi;
package/remult-hono.js CHANGED
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultHono = remultHono;
3
+ exports.remultHono = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var hono_1 = require("hono");
6
7
  var streaming_1 = require("hono/streaming");
7
8
  var index_js_1 = require("./server/index.js");
8
- function remultHono(options) {
9
+ function remultApi(options) {
9
10
  var _this = this;
10
11
  var app = new hono_1.Hono();
11
12
  var api = (0, index_js_1.createRemultServer)(options, {
@@ -113,3 +114,5 @@ function remultHono(options) {
113
114
  }); }); },
114
115
  });
115
116
  }
117
+ // @deprecated use remultApi instead
118
+ exports.remultHono = remultApi;
package/remult-next.d.ts CHANGED
@@ -15,7 +15,7 @@ export type RemultNextServer = RemultServerCore<NextApiRequest> & NextApiHandler
15
15
  */
16
16
  handle<T>(handler: NextApiHandler<T>): NextApiHandler<T>;
17
17
  };
18
- export declare function remultNextApp(options?: RemultServerOptions<Request>): RemultNextAppServer;
18
+ export declare function remultApi(options?: RemultServerOptions<Request>): RemultNextAppServer;
19
19
  export type RemultNextAppServer = RemultServerCore<Request> & {
20
20
  GET: (req: Request) => Promise<Response | undefined>;
21
21
  PUT: (req: Request) => Promise<Response | undefined>;
@@ -23,3 +23,4 @@ export type RemultNextAppServer = RemultServerCore<Request> & {
23
23
  DELETE: (req: Request) => Promise<Response | undefined>;
24
24
  withRemult<T>(what: () => Promise<T>): Promise<T>;
25
25
  };
26
+ export declare const remultNextApp: typeof remultApi;
package/remult-next.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.remultNextApp = void 0;
3
4
  exports.remultNext = remultNext;
4
- exports.remultNextApp = remultNextApp;
5
+ exports.remultApi = remultApi;
5
6
  var tslib_1 = require("tslib");
6
7
  var index_js_1 = require("./server/index.js");
7
8
  function remultNext(options) {
@@ -78,7 +79,7 @@ function remultNext(options) {
78
79
  });
79
80
  }
80
81
  var encoder = new TextEncoder();
81
- function remultNextApp(options) {
82
+ function remultApi(options) {
82
83
  var _this = this;
83
84
  var result = (0, index_js_1.createRemultServer)(options, {
84
85
  getRequestBody: function (req) { return req.json(); },
@@ -183,3 +184,4 @@ function remultNextApp(options) {
183
184
  },
184
185
  };
185
186
  }
187
+ exports.remultNextApp = remultApi;
package/remult-nuxt.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { H3Event } from 'h3';
2
2
  import type { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
3
- export declare function remultNuxt(options: RemultServerOptions<H3Event>): RemultNuxtServer;
3
+ export declare function remultApi(options: RemultServerOptions<H3Event>): RemultNuxtServer;
4
4
  export type RemultNuxtServer = RemultServerCore<H3Event> & ((event: H3Event) => Promise<any>) & {
5
5
  withRemult: RemultServer<H3Event>['withRemultAsync'];
6
6
  };
7
+ export declare const remultNuxt: typeof remultApi;
package/remult-nuxt.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultNuxt = remultNuxt;
3
+ exports.remultNuxt = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var h3_1 = require("h3");
6
7
  var index_js_1 = require("./server/index.js");
7
- function remultNuxt(options) {
8
+ function remultApi(options) {
8
9
  var _this = this;
9
10
  var result = (0, index_js_1.createRemultServer)(options, {
10
11
  buildGenericRequestInfo: function (event) {
@@ -76,3 +77,4 @@ function remultNuxt(options) {
76
77
  },
77
78
  });
78
79
  }
80
+ exports.remultNuxt = remultApi;
@@ -1,6 +1,6 @@
1
1
  import { type RequestEvent } from 'solid-js/web';
2
2
  import type { RemultServerCore, RemultServerOptions } from './server/index.js';
3
- export declare function remultSolidStart(options: RemultServerOptions<RequestEvent>): RemultSolidStartServer;
3
+ export declare function remultApi(options: RemultServerOptions<RequestEvent>): RemultSolidStartServer;
4
4
  type RequestHandler = (event: RequestEvent) => Promise<Response>;
5
5
  export type RemultSolidStartServer = RemultServerCore<RequestEvent> & {
6
6
  withRemult<T>(what: () => Promise<T>): Promise<T>;
@@ -9,4 +9,5 @@ export type RemultSolidStartServer = RemultServerCore<RequestEvent> & {
9
9
  POST: RequestHandler;
10
10
  DELETE: RequestHandler;
11
11
  };
12
+ export declare const remultSolidStart: typeof remultApi;
12
13
  export {};
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultSolidStart = remultSolidStart;
3
+ exports.remultSolidStart = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var web_1 = require("solid-js/web");
6
7
  var index_js_1 = require("./server/index.js");
7
- function remultSolidStart(options) {
8
+ function remultApi(options) {
8
9
  var _this = this;
9
10
  var result = (0, index_js_1.createRemultServer)(options, {
10
11
  buildGenericRequestInfo: function (event) { return ({
@@ -131,3 +132,4 @@ function remultSolidStart(options) {
131
132
  DELETE: serverHandler,
132
133
  });
133
134
  }
135
+ exports.remultSolidStart = remultApi;
@@ -1,6 +1,6 @@
1
1
  import type { Handle, RequestEvent, RequestHandler } from '@sveltejs/kit';
2
2
  import type { RemultServerCore, RemultServerOptions, RemultServer } from './server/index.js';
3
- export declare function remultSveltekit(options: RemultServerOptions<RequestEvent>): RemultSveltekitServer;
3
+ export declare function remultApi(options: RemultServerOptions<RequestEvent>): RemultSveltekitServer;
4
4
  export type RemultSveltekitServer = RemultServerCore<RequestEvent> & Handle & {
5
5
  withRemult: RemultServer<RequestEvent>['withRemultAsync'];
6
6
  GET: RequestHandler;
@@ -8,3 +8,4 @@ export type RemultSveltekitServer = RemultServerCore<RequestEvent> & Handle & {
8
8
  POST: RequestHandler;
9
9
  DELETE: RequestHandler;
10
10
  };
11
+ export declare const remultSveltekit: typeof remultApi;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remultSveltekit = remultSveltekit;
3
+ exports.remultSveltekit = void 0;
4
+ exports.remultApi = remultApi;
4
5
  var tslib_1 = require("tslib");
5
6
  var index_js_1 = require("./server/index.js");
6
- function remultSveltekit(options) {
7
+ function remultApi(options) {
7
8
  var _this = this;
8
9
  var result = (0, index_js_1.createRemultServer)(options, {
9
10
  buildGenericRequestInfo: function (event) { return ({
@@ -119,3 +120,4 @@ function remultSveltekit(options) {
119
120
  DELETE: serverHandler,
120
121
  });
121
122
  }
123
+ exports.remultSveltekit = remultApi;