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.
- package/README.md +2 -2
- package/esm/remult-express.js +3 -1
- package/esm/remult-fastify.js +3 -1
- package/esm/remult-hapi.js +3 -1
- package/esm/remult-hono.js +3 -1
- package/esm/remult-next.js +2 -1
- package/esm/remult-nuxt.js +2 -1
- package/esm/remult-solid-start.js +2 -1
- package/esm/remult-sveltekit.js +2 -1
- package/esm/server/get-remult-admin-html.js +1 -1
- package/esm/src/context.js +4 -2
- package/package.json +1 -1
- package/remult-express.d.ts +4 -3
- package/remult-express.js +5 -2
- package/remult-fastify.d.ts +2 -1
- package/remult-fastify.js +5 -2
- package/remult-hapi.d.ts +2 -1
- package/remult-hapi.js +5 -2
- package/remult-hono.d.ts +2 -1
- package/remult-hono.js +5 -2
- package/remult-next.d.ts +2 -1
- package/remult-next.js +4 -2
- package/remult-nuxt.d.ts +2 -1
- package/remult-nuxt.js +4 -2
- package/remult-solid-start.d.ts +2 -1
- package/remult-solid-start.js +4 -2
- package/remult-sveltekit.d.ts +2 -1
- package/remult-sveltekit.js +4 -2
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-api-server.d.ts +1 -1
- package/src/context.js +5 -2
- package/src/entity.d.ts +13 -0
package/esm/src/context.js
CHANGED
|
@@ -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 =
|
|
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,
|
|
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
package/remult-express.d.ts
CHANGED
|
@@ -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
|
|
3
|
+
export declare function remultApi(options?: RemultServerOptions<express.Request> & {
|
|
4
4
|
bodyParser?: boolean;
|
|
5
5
|
bodySizeLimit?: string;
|
|
6
|
-
}):
|
|
7
|
-
export type
|
|
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 =
|
|
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
|
|
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;
|
package/remult-fastify.d.ts
CHANGED
|
@@ -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
|
|
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 =
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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;
|
package/remult-solid-start.d.ts
CHANGED
|
@@ -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
|
|
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 {};
|
package/remult-solid-start.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.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
|
|
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;
|
package/remult-sveltekit.d.ts
CHANGED
|
@@ -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
|
|
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;
|
package/remult-sveltekit.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.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
|
|
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;
|