remult 0.26.12-next.1 → 0.26.12-next.3

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.
@@ -118,6 +118,6 @@ export function remultNextApp(options) {
118
118
  POST: handler,
119
119
  PUT: handler,
120
120
  DELETE: handler,
121
- withRemult: (what, disableInitUserAndRequest) => result.withRemultAsync(disableInitUserAndRequest ? undefined : {}, what),
121
+ withRemult: (what) => result.withRemultAsync({}, what),
122
122
  };
123
123
  }
@@ -86,8 +86,8 @@ export function remultSolidStart(options) {
86
86
  return Object.assign(handler, {
87
87
  getRemult: (req) => result.getRemult(req),
88
88
  openApiDoc: (options) => result.openApiDoc(options),
89
- async withRemult(what, disableInitUserAndRequest) {
90
- return result.withRemultAsync(disableInitUserAndRequest ? undefined : await getRequestEvent(), what);
89
+ async withRemult(what) {
90
+ return result.withRemultAsync(await getRequestEvent(), what);
91
91
  },
92
92
  GET: serverHandler,
93
93
  PUT: serverHandler,
@@ -25,6 +25,7 @@ if ((typeof process !== 'undefined' &&
25
25
  process.env['IGNORE_GLOBAL_REMULT_IN_TESTS']) ||
26
26
  typeof globalThis[remultStaticKey] === 'undefined') {
27
27
  globalThis[remultStaticKey] = x;
28
+ x.remultFactory = () => defaultFactory();
28
29
  }
29
30
  else {
30
31
  x = globalThis[remultStaticKey];
@@ -39,4 +40,3 @@ export function defaultFactory() {
39
40
  export function resetFactory() {
40
41
  remultStatic.remultFactory = () => defaultFactory();
41
42
  }
42
- resetFactory();
@@ -1,11 +1,10 @@
1
1
  export const flags = {
2
2
  error500RetryCount: 4,
3
3
  };
4
+ //y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
5
+ //p1 - review starter and examples and separate remult * auth from the routes
6
+ //p1 - https://github.com/remult/remult/discussions/438
4
7
  //y1 - live query with count #436
5
- //y1 - https://github.com/remult/remult/discussions/438
6
- //p1 - discuss next auth withRemult paradox
7
- //p1 - maybe the default withRemult should by default use the data provider set by the remultExpress
8
- //p1 - withRemult to support the full range of data provider.
9
8
  //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
10
9
  //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
11
10
  //y1 TODO - readonly key: keyof MembersOnly<entityType> & string
@@ -24,7 +23,6 @@ const result = await repo.batch(x=>({
24
23
  count:x.count()
25
24
  }))
26
25
  */
27
- //p1 - consider in json storage, to store the json without spaces
28
26
  //p1 - consider upsert (where,set)
29
27
  //y1 - wait a second to close stream -see pr
30
28
  //p1 - Consider enforcing serial operations on JSON database to prevent data loss
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "0.26.12-next.1",
3
+ "version": "0.26.12-next.3",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
package/remult-next.d.ts CHANGED
@@ -22,5 +22,5 @@ export type RemultNextAppServer = RemultServerCore<Request> & {
22
22
  PUT: (req: Request) => Promise<Response>;
23
23
  POST: (req: Request) => Promise<Response>;
24
24
  DELETE: (req: Request) => Promise<Response>;
25
- withRemult<T>(what: () => Promise<T>, disableInitUserAndRequest?: boolean): Promise<T>;
25
+ withRemult<T>(what: () => Promise<T>): Promise<T>;
26
26
  };
package/remult-next.js CHANGED
@@ -174,9 +174,7 @@ function remultNextApp(options) {
174
174
  POST: handler,
175
175
  PUT: handler,
176
176
  DELETE: handler,
177
- withRemult: function (what, disableInitUserAndRequest) {
178
- return result.withRemultAsync(disableInitUserAndRequest ? undefined : {}, what);
179
- },
177
+ withRemult: function (what) { return result.withRemultAsync({}, what); },
180
178
  };
181
179
  }
182
180
  exports.remultNextApp = remultNextApp;
@@ -3,7 +3,7 @@ import type { RemultServerCore, RemultServerOptions } from './server/index.js';
3
3
  export declare function remultSolidStart(options: RemultServerOptions<RequestEvent>): RemultSolidStartServer;
4
4
  type RequestHandler = (event: RequestEvent) => Promise<Response>;
5
5
  export type RemultSolidStartServer = RemultServerCore<RequestEvent> & {
6
- withRemult<T>(what: () => Promise<T>, disableInitUserAndRequest?: boolean): Promise<T>;
6
+ withRemult<T>(what: () => Promise<T>): Promise<T>;
7
7
  GET: RequestHandler;
8
8
  PUT: RequestHandler;
9
9
  POST: RequestHandler;
@@ -112,21 +112,15 @@ function remultSolidStart(options) {
112
112
  return Object.assign(handler, {
113
113
  getRemult: function (req) { return result.getRemult(req); },
114
114
  openApiDoc: function (options) { return result.openApiDoc(options); },
115
- withRemult: function (what, disableInitUserAndRequest) {
115
+ withRemult: function (what) {
116
116
  return tslib_1.__awaiter(this, void 0, void 0, function () {
117
- var _a, _b, _c;
118
- return tslib_1.__generator(this, function (_d) {
119
- switch (_d.label) {
117
+ var _a, _b;
118
+ return tslib_1.__generator(this, function (_c) {
119
+ switch (_c.label) {
120
120
  case 0:
121
121
  _b = (_a = result).withRemultAsync;
122
- if (!disableInitUserAndRequest) return [3 /*break*/, 1];
123
- _c = undefined;
124
- return [3 /*break*/, 3];
125
- case 1: return [4 /*yield*/, (0, web_1.getRequestEvent)()];
126
- case 2:
127
- _c = _d.sent();
128
- _d.label = 3;
129
- case 3: return [2 /*return*/, _b.apply(_a, [_c, what])];
122
+ return [4 /*yield*/, (0, web_1.getRequestEvent)()];
123
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent(), what])];
130
124
  }
131
125
  });
132
126
  });
@@ -28,6 +28,7 @@ if ((typeof process !== 'undefined' &&
28
28
  process.env['IGNORE_GLOBAL_REMULT_IN_TESTS']) ||
29
29
  typeof globalThis[remultStaticKey] === 'undefined') {
30
30
  globalThis[remultStaticKey] = x;
31
+ x.remultFactory = function () { return defaultFactory(); };
31
32
  }
32
33
  else {
33
34
  x = globalThis[remultStaticKey];
@@ -44,4 +45,3 @@ function resetFactory() {
44
45
  exports.remultStatic.remultFactory = function () { return defaultFactory(); };
45
46
  }
46
47
  exports.resetFactory = resetFactory;
47
- resetFactory();
@@ -4,11 +4,10 @@ exports.flags = void 0;
4
4
  exports.flags = {
5
5
  error500RetryCount: 4,
6
6
  };
7
+ //y1 TODO - discuss next auth withRemult paradox - the gift that keeps on giving - it's doing something crazy there!!
8
+ //p1 - review starter and examples and separate remult * auth from the routes
9
+ //p1 - https://github.com/remult/remult/discussions/438
7
10
  //y1 - live query with count #436
8
- //y1 - https://github.com/remult/remult/discussions/438
9
- //p1 - discuss next auth withRemult paradox
10
- //p1 - maybe the default withRemult should by default use the data provider set by the remultExpress
11
- //p1 - withRemult to support the full range of data provider.
12
11
  //y1 TODO - In the esm version of our tutorial - the imports are automatically .ts and not .js in react and not in vue
13
12
  //y1 TODO - consider id to also support keyof (id:['company','index']) - had problem with | (keyof Partial<entityType>)[] & `entity`
14
13
  //y1 TODO - readonly key: keyof MembersOnly<entityType> & string
@@ -27,7 +26,6 @@ const result = await repo.batch(x=>({
27
26
  count:x.count()
28
27
  }))
29
28
  */
30
- //p1 - consider in json storage, to store the json without spaces
31
29
  //p1 - consider upsert (where,set)
32
30
  //y1 - wait a second to close stream -see pr
33
31
  //p1 - Consider enforcing serial operations on JSON database to prevent data loss