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 CHANGED
@@ -97,14 +97,14 @@ _Example:_
97
97
  // backend/index.ts
98
98
 
99
99
  import express from 'express'
100
- import { remultExpress } from 'remult/remult-express' // adapters for: Fastify,Next.js, Nuxt, SvelteKit, SolidStart, Nest, more...
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
- remultExpress({
107
+ remultApi({
108
108
  entities: [Product],
109
109
  dataProvider: createPostgresDataProvider({
110
110
  connectionString: 'postgres://user:password@host:5432/database"',
@@ -1,6 +1,6 @@
1
1
  import * as express from 'express';
2
2
  import { createRemultServer } from './server/index.js';
3
- export function remultExpress(options) {
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;
@@ -1,5 +1,5 @@
1
1
  import { createRemultServer } from './server/index.js';
2
- export function remultFastify(options) {
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;
@@ -1,6 +1,6 @@
1
1
  import { createRemultServer, } from './server/index.js';
2
2
  import { PassThrough } from 'stream';
3
- export function remultHapi(options) {
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;
@@ -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 remultHono(options) {
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;
@@ -37,7 +37,7 @@ export function remultNext(options) {
37
37
  });
38
38
  }
39
39
  const encoder = new TextEncoder();
40
- export function remultNextApp(options) {
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;
@@ -1,6 +1,6 @@
1
1
  import { readBody, setResponseStatus } from 'h3';
2
2
  import { createRemultServer } from './server/index.js';
3
- export function remultNuxt(options) {
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 remultSolidStart(options) {
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;
@@ -1,5 +1,5 @@
1
1
  import { createRemultServer } from './server/index.js';
2
- export function remultSveltekit(options) {
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;