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.
- package/esm/server/get-remult-admin-html.js +1 -1
- package/esm/server/remult-admin.js +2 -2
- package/esm/server/remult-api-server.js +9 -0
- package/package.json +1 -1
- package/server/get-remult-admin-html.js +1 -1
- package/server/remult-admin.d.ts +2 -0
- package/server/remult-admin.js +2 -2
- package/server/remult-api-server.d.ts +2 -0
- package/server/remult-api-server.js +13 -4
|
@@ -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
|
}
|