create-substrat 0.18.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-substrat",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
4
4
  "description": "Scaffold a Substrat vertical — `npm create substrat <dir>`.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
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.198.0';
34
- const ENGINE_WORKORDER = '^0.13.23';
35
- const ENGINE_INVOICING = '^0.11.82';
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.0';
38
- const ATTACHMENT_EXTRACTORS = '^0.2.59';
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
  {
@@ -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.json({ error: 'unauthorized' }, 401);
115
+ if (!caller) return refuse(c, 'unauthenticated', 'unauthorized');
116
116
  return c.json({ principal: caller.principal, display: caller.display });
117
117
  });
118
118
 
@@ -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
@@ -232,8 +233,10 @@ mountPlatformSurface<Env>(app, {
232
233
  ownerRoleKey: OWNER_ROLE_KEY,
233
234
  ...door.platform,
234
235
  onProvision: async (env, b) => {
235
- await door.platform.onProvision(env, b);
236
+ // The door's answer says whether the owner seat was reserved for an address (#3202); return it.
237
+ const seat = await door.platform.onProvision(env, b);
236
238
  await sweeper(env).noteScope(b.tenantId, b.scopeId);
239
+ return seat;
237
240
  },
238
241
  onDeleteScope: async (env, s, tenantId) => {
239
242
  await door.platform.onDeleteScope(env, s, tenantId);
@@ -243,7 +246,7 @@ mountPlatformSurface<Env>(app, {
243
246
 
244
247
  // Unmatched /api/* fails as JSON; everything else gets a pointer, not a UI —
245
248
  // this starter ships no SPA (add one and inline it at build time when you do).
246
- app.all('/api/*', (c) => c.json({ error: `unknown route: ${new URL(c.req.raw.url).pathname}` }, 404));
249
+ app.all('/api/*', (c) => refuse(c, 'not_found', `unknown route: ${new URL(c.req.raw.url).pathname}`));
247
250
  app.all('*', (c) =>
248
251
  c.json({
249
252
  service: 'substrat vertical',