create-substrat 0.18.3 → 0.18.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/package.json +1 -1
- package/project-files.js +5 -5
- package/template/src/server.ts +2 -2
- package/template/src/worker.ts +2 -1
package/package.json
CHANGED
package/project-files.js
CHANGED
|
@@ -30,12 +30,12 @@ import { DEV_SERVERS } from './dev-servers.js';
|
|
|
30
30
|
// The runtime packages release together off one version line (the changesets `fixed`
|
|
31
31
|
// group), so one constant is right for all of them. Engines do NOT share a line —
|
|
32
32
|
// each versions on its own, so one pin per engine, deliberately.
|
|
33
|
-
const SUBSTRAT = '^0.
|
|
34
|
-
const ENGINE_WORKORDER = '^0.13.
|
|
35
|
-
const ENGINE_INVOICING = '^0.11.
|
|
33
|
+
const SUBSTRAT = '^0.200.0';
|
|
34
|
+
const ENGINE_WORKORDER = '^0.13.25';
|
|
35
|
+
const ENGINE_INVOICING = '^0.11.84';
|
|
36
36
|
const BOUNDARY_LINT = '^0.9.1';
|
|
37
|
-
const DEV_ISSUER = '^0.9.
|
|
38
|
-
const ATTACHMENT_EXTRACTORS = '^0.2.
|
|
37
|
+
const DEV_ISSUER = '^0.9.2';
|
|
38
|
+
const ATTACHMENT_EXTRACTORS = '^0.2.61';
|
|
39
39
|
|
|
40
40
|
export const TSCONFIG = `${JSON.stringify(
|
|
41
41
|
{
|
package/template/src/server.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { dirname, join } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { serve } from '@hono/node-server';
|
|
5
5
|
import { Hono } from 'hono';
|
|
6
|
-
import { invocationLog } from '@substrat-run/vertical-host';
|
|
6
|
+
import { invocationLog, refuse } from '@substrat-run/vertical-host';
|
|
7
7
|
import type { Context } from 'hono';
|
|
8
8
|
import { HTTPException } from 'hono/http-exception';
|
|
9
9
|
import { platformActorId } from '@substrat-run/contracts';
|
|
@@ -112,7 +112,7 @@ app.on(['GET', 'POST'], '/api/auth/*', (c) => login.handle(c.req.raw));
|
|
|
112
112
|
/** Who is signed in, or 401 — the same question `worker.ts` answers. */
|
|
113
113
|
app.get('/api/me', async (c) => {
|
|
114
114
|
const caller = await login.caller(c.req.raw.headers);
|
|
115
|
-
if (!caller) return c
|
|
115
|
+
if (!caller) return refuse(c, 'unauthenticated', 'unauthorized');
|
|
116
116
|
return c.json({ principal: caller.principal, display: caller.display });
|
|
117
117
|
});
|
|
118
118
|
|
package/template/src/worker.ts
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
readRoutedNode,
|
|
37
37
|
RouterAssertionError,
|
|
38
38
|
invocationLog,
|
|
39
|
+
refuse,
|
|
39
40
|
} from '@substrat-run/vertical-host';
|
|
40
41
|
import { IdentityDO, workerDoor } from '@substrat-run/vertical-host/worker-door';
|
|
41
42
|
// Only from provision.ts, the file `substrat push` reads: so this worker fits any vertical whose
|
|
@@ -245,7 +246,7 @@ mountPlatformSurface<Env>(app, {
|
|
|
245
246
|
|
|
246
247
|
// Unmatched /api/* fails as JSON; everything else gets a pointer, not a UI —
|
|
247
248
|
// this starter ships no SPA (add one and inline it at build time when you do).
|
|
248
|
-
app.all('/api/*', (c) => c
|
|
249
|
+
app.all('/api/*', (c) => refuse(c, 'not_found', `unknown route: ${new URL(c.req.raw.url).pathname}`));
|
|
249
250
|
app.all('*', (c) =>
|
|
250
251
|
c.json({
|
|
251
252
|
service: 'substrat vertical',
|