remult 3.0.0-next.3 → 3.0.0-next.4

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.
@@ -4,11 +4,11 @@ import { getHtml } from './get-remult-admin-html.js';
4
4
  import { getValueList } from '../src/remult3/RepositoryImplementation.js';
5
5
  import { InputTypes } from '../inputTypes.js';
6
6
  export default function remultAdminHtml(options) {
7
- const { rootPath, head } = options;
7
+ const { rootPath, head, requireAuthToken, withLiveQuery } = options;
8
8
  return getHtml()
9
9
  .replace('<!--PLACE_HERE_HEAD-->', head)
10
10
  .replace('<!--PLACE_HERE_BODY-->', `<script>
11
- window.optionsFromServer = ${JSON.stringify({ rootPath })}
11
+ window.optionsFromServer = ${JSON.stringify({ rootPath, requireAuthToken, withLiveQuery })}
12
12
  </script>`);
13
13
  }
14
14
  export function buildEntityInfo(options) {
@@ -216,13 +216,22 @@ export class RemultServerImplementation {
216
216
  }
217
217
  else {
218
218
  let head = '<title>Admin</title>';
219
+ let requireAuthToken = false;
220
+ let withLiveQuery = true;
219
221
  if (isOfType(this.options.admin, 'allow') &&
220
222
  this.options.admin.customHtmlHead) {
221
223
  head = this.options.admin.customHtmlHead(remult);
224
+ requireAuthToken =
225
+ this.options.admin.requireAuthToken ?? false;
226
+ if (this.options.admin.withLiveQuery === false) {
227
+ withLiveQuery = false;
228
+ }
222
229
  }
223
230
  origResponse.send(remultAdminHtml({
224
231
  rootPath: this.options.rootPath ?? '/api',
225
232
  head,
233
+ requireAuthToken,
234
+ withLiveQuery,
226
235
  }));
227
236
  }
228
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remult",
3
- "version": "3.0.0-next.3",
3
+ "version": "3.0.0-next.4",
4
4
  "description": "A CRUD framework for full-stack TypeScript",
5
5
  "homepage": "https://remult.dev",
6
6
  "repository": {