remult 2.7.25 → 2.7.26-next.0

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.
@@ -203,9 +203,9 @@ export class RemultServerImplementation {
203
203
  doWork: undefined,
204
204
  }, r);
205
205
  if (this.options.admin !== undefined && this.options.admin !== false) {
206
- const admin = (is_entities_metadata) => this.process(async (remult, req, res, orig, origResponse) => {
206
+ const admin = () => this.process(async (remult, req, res, orig, origResponse) => {
207
207
  if (remult.isAllowed(this.options.admin)) {
208
- if (is_entities_metadata) {
208
+ if (orig.params.id === '__entities-metadata') {
209
209
  res.success(buildEntityInfo({
210
210
  remult,
211
211
  entities: this.options.entities ?? [],
@@ -222,10 +222,9 @@ export class RemultServerImplementation {
222
222
  else
223
223
  res.notFound();
224
224
  });
225
- r.route(this.options.rootPath + '/admin/__entities-metadata').get(admin(true));
226
- r.route(this.options.rootPath + '/admin/:id').get(admin(false));
227
- r.route(this.options.rootPath + '/admin/').get(admin(false));
228
- r.route(this.options.rootPath + '/admin').get(admin(false));
225
+ r.route(this.options.rootPath + '/admin/:id').get(admin());
226
+ r.route(this.options.rootPath + '/admin/').get(admin());
227
+ r.route(this.options.rootPath + '/admin').get(admin());
229
228
  }
230
229
  r.route(this.options.rootPath + '/me').get(this.process(async (remult, req, res) => res.success(remult.user ?? null)));
231
230
  if (this.options.subscriptionServer instanceof SseSubscriptionServer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "2.7.25",
3
+ "version": "2.7.26-next.0",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {
@@ -362,12 +362,12 @@ var RemultServerImplementation = /** @class */ (function () {
362
362
  doWork: undefined,
363
363
  }, r);
364
364
  if (this.options.admin !== undefined && this.options.admin !== false) {
365
- var admin = function (is_entities_metadata) {
365
+ var admin = function () {
366
366
  return _this.process(function (remult, req, res, orig, origResponse) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
367
367
  var _a;
368
368
  return tslib_1.__generator(this, function (_b) {
369
369
  if (remult.isAllowed(this.options.admin)) {
370
- if (is_entities_metadata) {
370
+ if (orig.params.id === '__entities-metadata') {
371
371
  res.success((0, remult_admin_js_1.buildEntityInfo)({
372
372
  remult: remult,
373
373
  entities: (_a = this.options.entities) !== null && _a !== void 0 ? _a : [],
@@ -387,10 +387,9 @@ var RemultServerImplementation = /** @class */ (function () {
387
387
  });
388
388
  }); });
389
389
  };
390
- r.route(this.options.rootPath + '/admin/__entities-metadata').get(admin(true));
391
- r.route(this.options.rootPath + '/admin/:id').get(admin(false));
392
- r.route(this.options.rootPath + '/admin/').get(admin(false));
393
- r.route(this.options.rootPath + '/admin').get(admin(false));
390
+ r.route(this.options.rootPath + '/admin/:id').get(admin());
391
+ r.route(this.options.rootPath + '/admin/').get(admin());
392
+ r.route(this.options.rootPath + '/admin').get(admin());
394
393
  }
395
394
  r.route(this.options.rootPath + '/me').get(this.process(function (remult, req, res) { return tslib_1.__awaiter(_this, void 0, void 0, function () { var _a; return tslib_1.__generator(this, function (_b) {
396
395
  return [2 /*return*/, res.success((_a = remult.user) !== null && _a !== void 0 ? _a : null)];