remult 2.7.34 → 3.0.0-next.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 +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/buildRestDataProvider.js +2 -26
- package/esm/src/context.js +4 -2
- package/esm/src/data-providers/rest-data-provider-using-fetch.js +78 -0
- package/esm/src/data-providers/rest-data-provider.js +1 -78
- package/esm/src/data-providers/retry.js +25 -0
- package/esm/src/filter/entityDbName.js +18 -0
- package/esm/src/filter/fieldDbName.js +40 -0
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +2 -58
- package/esm/src/remult3/RepositoryImplementation.js +2 -1
- package/esm/src/validators.js +1 -1
- 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/buildRestDataProvider.d.ts +0 -1
- package/src/buildRestDataProvider.js +6 -46
- package/src/context.js +5 -2
- package/src/data-providers/rest-data-provider-using-fetch.d.ts +13 -0
- package/src/data-providers/rest-data-provider-using-fetch.js +119 -0
- package/src/data-providers/rest-data-provider.d.ts +0 -12
- package/src/data-providers/rest-data-provider.js +1 -115
- package/src/data-providers/retry.d.ts +1 -0
- package/src/data-providers/retry.js +44 -0
- package/src/entity.d.ts +13 -0
- package/src/filter/entityDbName.d.ts +2 -0
- package/src/filter/entityDbName.js +32 -0
- package/src/filter/fieldDbName.d.ts +3 -0
- package/src/filter/fieldDbName.js +58 -0
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +0 -2
- package/src/filter/filter-consumer-bridge-to-sql-request.js +4 -86
- package/src/remult3/RepositoryImplementation.js +4 -3
- package/src/validators.js +2 -2
package/README.md
CHANGED
|
@@ -97,14 +97,14 @@ _Example:_
|
|
|
97
97
|
// backend/index.ts
|
|
98
98
|
|
|
99
99
|
import express from 'express'
|
|
100
|
-
import {
|
|
100
|
+
import { remultApi } from 'remult/remult-express' // adapters for: Fastify,Next.js, Nuxt, SvelteKit, SolidStart, Nest, more...
|
|
101
101
|
import { createPostgresDataProvider } from 'remult/postgres' // supported: PostgreSQL, MySQL, SQLite, MongoDB, MSSQL and Oracle
|
|
102
102
|
import { Product } from '../shared/product'
|
|
103
103
|
|
|
104
104
|
const app = express()
|
|
105
105
|
|
|
106
106
|
app.use(
|
|
107
|
-
|
|
107
|
+
remultApi({
|
|
108
108
|
entities: [Product],
|
|
109
109
|
dataProvider: createPostgresDataProvider({
|
|
110
110
|
connectionString: 'postgres://user:password@host:5432/database"',
|
package/esm/remult-express.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as express from 'express';
|
|
2
2
|
import { createRemultServer } from './server/index.js';
|
|
3
|
-
export function
|
|
3
|
+
export function remultApi(options) {
|
|
4
4
|
let app = express.Router();
|
|
5
5
|
if (!options) {
|
|
6
6
|
options = {};
|
|
@@ -24,3 +24,5 @@ export function remultExpress(options) {
|
|
|
24
24
|
withRemultAsync: (req, what) => server.withRemultAsync(req, what),
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
+
// @deprecated use remultApi instead
|
|
28
|
+
export const remultExpress = remultApi;
|
package/esm/remult-fastify.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRemultServer } from './server/index.js';
|
|
2
|
-
export function
|
|
2
|
+
export function remultApi(options) {
|
|
3
3
|
function fastifyHandler(handler) {
|
|
4
4
|
const response = (req, res) => {
|
|
5
5
|
const myRes = {
|
|
@@ -69,3 +69,5 @@ export function remultFastify(options) {
|
|
|
69
69
|
withRemult: (req, what) => api.withRemultAsync(req, what),
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
// @deprecated use remultApi instead
|
|
73
|
+
export const remultFastify = remultApi;
|
package/esm/remult-hapi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRemultServer, } from './server/index.js';
|
|
2
2
|
import { PassThrough } from 'stream';
|
|
3
|
-
export function
|
|
3
|
+
export function remultApi(options) {
|
|
4
4
|
const api = createRemultServer(options, {
|
|
5
5
|
buildGenericRequestInfo: (req) => ({
|
|
6
6
|
method: req.method,
|
|
@@ -112,3 +112,5 @@ export function remultHapi(options) {
|
|
|
112
112
|
withRemult: (req, what) => api.withRemultAsync(req, what),
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
+
// @deprecated use remultApi instead
|
|
116
|
+
export const remultHapi = remultApi;
|
package/esm/remult-hono.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
2
|
import { streamSSE } from 'hono/streaming';
|
|
3
3
|
import { createRemultServer, } from './server/index.js';
|
|
4
|
-
export function
|
|
4
|
+
export function remultApi(options) {
|
|
5
5
|
let app = new Hono();
|
|
6
6
|
const api = createRemultServer(options, {
|
|
7
7
|
buildGenericRequestInfo: (c) => {
|
|
@@ -102,3 +102,5 @@ export function remultHono(options) {
|
|
|
102
102
|
withRemult: async (c, what) => api.withRemultAsync(c, what),
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
+
// @deprecated use remultApi instead
|
|
106
|
+
export const remultHono = remultApi;
|
package/esm/remult-next.js
CHANGED
|
@@ -37,7 +37,7 @@ export function remultNext(options) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
const encoder = new TextEncoder();
|
|
40
|
-
export function
|
|
40
|
+
export function remultApi(options) {
|
|
41
41
|
let result = createRemultServer(options, {
|
|
42
42
|
getRequestBody: (req) => req.json(),
|
|
43
43
|
buildGenericRequestInfo: (req) => ({
|
|
@@ -121,3 +121,4 @@ export function remultNextApp(options) {
|
|
|
121
121
|
withRemult: (what) => result.withRemultAsync({}, what),
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
+
export const remultNextApp = remultApi;
|
package/esm/remult-nuxt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readBody, setResponseStatus } from 'h3';
|
|
2
2
|
import { createRemultServer } from './server/index.js';
|
|
3
|
-
export function
|
|
3
|
+
export function remultApi(options) {
|
|
4
4
|
const result = createRemultServer(options, {
|
|
5
5
|
buildGenericRequestInfo: (event) => {
|
|
6
6
|
return {
|
|
@@ -52,3 +52,4 @@ export function remultNuxt(options) {
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
export const remultNuxt = remultApi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getRequestEvent } from 'solid-js/web';
|
|
2
2
|
import { createRemultServer } from './server/index.js';
|
|
3
|
-
export function
|
|
3
|
+
export function remultApi(options) {
|
|
4
4
|
let result = createRemultServer(options, {
|
|
5
5
|
buildGenericRequestInfo: (event) => ({
|
|
6
6
|
url: event.request.url,
|
|
@@ -95,3 +95,4 @@ export function remultSolidStart(options) {
|
|
|
95
95
|
DELETE: serverHandler,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
export const remultSolidStart = remultApi;
|
package/esm/remult-sveltekit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRemultServer } from './server/index.js';
|
|
2
|
-
export function
|
|
2
|
+
export function remultApi(options) {
|
|
3
3
|
let result = createRemultServer(options, {
|
|
4
4
|
buildGenericRequestInfo: (event) => ({
|
|
5
5
|
url: event.request.url,
|
|
@@ -86,3 +86,4 @@ export function remultSveltekit(options) {
|
|
|
86
86
|
DELETE: serverHandler,
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
+
export const remultSveltekit = remultApi;
|