rlz-engine 1.0.47 → 1.0.49

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.
@@ -10,9 +10,25 @@ function makeReg(pluginName, endpoint) {
10
10
  reg(app, opts) {
11
11
  app.post(`/rpc/${pluginName}_${this.name}_v${this.v}`, {
12
12
  schema: {
13
- body: this.bodySchema.toJSONSchema({ target: 'draft-07' }),
13
+ body: this.bodySchema.toJSONSchema({
14
+ target: 'draft-07',
15
+ // TODO: remove when https://github.com/colinhacks/zod/issues/5491 get resolved
16
+ override(ctx) {
17
+ if (ctx.path.at(-2) === 'allOf' && ctx.jsonSchema.type === 'object') {
18
+ delete ctx.jsonSchema.additionalProperties;
19
+ }
20
+ }
21
+ }),
14
22
  response: {
15
- 200: this.respSchema.toJSONSchema({ target: 'draft-07' })
23
+ 200: this.respSchema.toJSONSchema({
24
+ target: 'draft-07',
25
+ // TODO: remove when https://github.com/colinhacks/zod/issues/5491 get resolved
26
+ override(ctx) {
27
+ if (ctx.path.at(-2) === 'allOf' && ctx.jsonSchema.type === 'object') {
28
+ delete ctx.jsonSchema.additionalProperties;
29
+ }
30
+ }
31
+ })
16
32
  }
17
33
  }
18
34
  }, endpoint.anonimous === true
@@ -30,7 +46,7 @@ function makeReg(pluginName, endpoint) {
30
46
  const user = await endpoint.auth(userId, password, opts);
31
47
  const body = req.body;
32
48
  const respBody = await endpoint.action(user, body, opts);
33
- resp.send(respBody);
49
+ await resp.send(respBody);
34
50
  });
35
51
  }
36
52
  };
@@ -66,6 +66,9 @@ export async function runServer({ production, domain, certDir, staticDir, secure
66
66
  httpsServer.all('/api/*', async () => {
67
67
  return httpErrors.notFound();
68
68
  });
69
+ httpsServer.all('/rpc/*', async () => {
70
+ return httpErrors.notFound();
71
+ });
69
72
  addStaticEndpoints(httpsServer, staticDir);
70
73
  await httpsServer.listen({ port: securePort ?? 443, host: '::' });
71
74
  L.info('runServer done');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlz-engine",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Deps and tools for my style of development",
5
5
  "scripts": {
6
6
  "build": "tsc",