@nanobpm/urban 0.61.0 → 0.62.0
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.
|
@@ -336,3 +336,18 @@ export interface EngineClient {
|
|
|
336
336
|
/** Tear down all connections. */
|
|
337
337
|
close(): Promise<void>;
|
|
338
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* The names of every method on {@link EngineClient} — the single *runtime* source of
|
|
341
|
+
* truth for the interface's surface. It is compile-time-pinned to `keyof EngineClient`
|
|
342
|
+
* in both directions (see the two assertions below): the `satisfies` rejects a stray or
|
|
343
|
+
* misspelled name, and the exhaustiveness assertion rejects an *omitted* one, so adding,
|
|
344
|
+
* renaming, or removing an `EngineClient` method that this list does not mirror fails
|
|
345
|
+
* `npm run typecheck`.
|
|
346
|
+
*
|
|
347
|
+
* A fake/adapter (e.g. `@nanobpm/urban-testkit`'s `WasmEngineClient`) can iterate this
|
|
348
|
+
* list to assert at *runtime* that it implements the full surface — catching the
|
|
349
|
+
* "the SDK grew a method the test double lags" seam-lag class (issue #341: `openUserTasks`,
|
|
350
|
+
* and `getForm` before it) that a purely structural `implements EngineClient` check no
|
|
351
|
+
* longer catches once the fake is published/compiled against an older `@nanobpm/urban`.
|
|
352
|
+
*/
|
|
353
|
+
export declare const ENGINE_CLIENT_METHODS: readonly ["deployResources", "createInstance", "cancelInstance", "publishMessage", "searchUserTasks", "openUserTasks", "getForm", "completeUserTask", "searchProcessInstances", "registerWorker", "close"];
|
|
@@ -42,3 +42,31 @@ export function presentFormIdentifier(value) {
|
|
|
42
42
|
const trimmed = value?.trim();
|
|
43
43
|
return trimmed ? trimmed : undefined;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The names of every method on {@link EngineClient} — the single *runtime* source of
|
|
47
|
+
* truth for the interface's surface. It is compile-time-pinned to `keyof EngineClient`
|
|
48
|
+
* in both directions (see the two assertions below): the `satisfies` rejects a stray or
|
|
49
|
+
* misspelled name, and the exhaustiveness assertion rejects an *omitted* one, so adding,
|
|
50
|
+
* renaming, or removing an `EngineClient` method that this list does not mirror fails
|
|
51
|
+
* `npm run typecheck`.
|
|
52
|
+
*
|
|
53
|
+
* A fake/adapter (e.g. `@nanobpm/urban-testkit`'s `WasmEngineClient`) can iterate this
|
|
54
|
+
* list to assert at *runtime* that it implements the full surface — catching the
|
|
55
|
+
* "the SDK grew a method the test double lags" seam-lag class (issue #341: `openUserTasks`,
|
|
56
|
+
* and `getForm` before it) that a purely structural `implements EngineClient` check no
|
|
57
|
+
* longer catches once the fake is published/compiled against an older `@nanobpm/urban`.
|
|
58
|
+
*/
|
|
59
|
+
export const ENGINE_CLIENT_METHODS = [
|
|
60
|
+
"deployResources",
|
|
61
|
+
"createInstance",
|
|
62
|
+
"cancelInstance",
|
|
63
|
+
"publishMessage",
|
|
64
|
+
"searchUserTasks",
|
|
65
|
+
"openUserTasks",
|
|
66
|
+
"getForm",
|
|
67
|
+
"completeUserTask",
|
|
68
|
+
"searchProcessInstances",
|
|
69
|
+
"registerWorker",
|
|
70
|
+
"close",
|
|
71
|
+
];
|
|
72
|
+
const _engineClientMethodsAreExhaustive = true;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type { AppApi, Mounted, RuntimeContext } from "./core/context.ts";
|
|
|
14
14
|
export { createLogger } from "./core/logger.ts";
|
|
15
15
|
export type { Logger, LogLevel, LogFields, LogSink } from "./core/logger.ts";
|
|
16
16
|
export { BpmnError, isBpmnError } from "./core/host.ts";
|
|
17
|
+
export { ENGINE_CLIENT_METHODS } from "./core/host.ts";
|
|
17
18
|
export { adaptConnectorHandler, mountConnectors, resolveInstalledConnectors, } from "./core/modules/connectors.ts";
|
|
18
19
|
export type { ConnectorsHandle } from "./core/modules/connectors.ts";
|
|
19
20
|
export { DataLayer, TypeRepo } from "./core/modules/datasource.ts";
|
package/dist/runtime/index.js
CHANGED
|
@@ -18,6 +18,10 @@ export { createLogger } from "./core/logger.js";
|
|
|
18
18
|
// BPMN error contract: a handler throws `BpmnError(code)` to raise a modelled
|
|
19
19
|
// error routed to an error boundary (ADR 0050), instead of a retryable failure.
|
|
20
20
|
export { BpmnError, isBpmnError } from "./core/host.js";
|
|
21
|
+
// The runtime source of truth for the `EngineClient` method surface (issue #341): a test
|
|
22
|
+
// double / adapter iterates it to prove at runtime that it implements the full interface,
|
|
23
|
+
// catching the "fake lags the SDK" seam-lag class categorically.
|
|
24
|
+
export { ENGINE_CLIENT_METHODS } from "./core/host.js";
|
|
21
25
|
// Connector packs (ADR 0050, in-process port)
|
|
22
26
|
export { adaptConnectorHandler, mountConnectors, resolveInstalledConnectors, } from "./core/modules/connectors.js";
|
|
23
27
|
// Data layer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/urban",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Urban: build and run code-first apps on Nano — runtime, derivation toolkit, and CLI in one. Author durable processes with @nanobpm/workflow (defineFlow), a typed datasource, forms, triggers and surfaces from a nano.app.json manifest, on Node or Deno.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/src/runtime/core/host.ts
CHANGED
|
@@ -359,3 +359,39 @@ export interface EngineClient {
|
|
|
359
359
|
/** Tear down all connections. */
|
|
360
360
|
close(): Promise<void>;
|
|
361
361
|
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* The names of every method on {@link EngineClient} — the single *runtime* source of
|
|
365
|
+
* truth for the interface's surface. It is compile-time-pinned to `keyof EngineClient`
|
|
366
|
+
* in both directions (see the two assertions below): the `satisfies` rejects a stray or
|
|
367
|
+
* misspelled name, and the exhaustiveness assertion rejects an *omitted* one, so adding,
|
|
368
|
+
* renaming, or removing an `EngineClient` method that this list does not mirror fails
|
|
369
|
+
* `npm run typecheck`.
|
|
370
|
+
*
|
|
371
|
+
* A fake/adapter (e.g. `@nanobpm/urban-testkit`'s `WasmEngineClient`) can iterate this
|
|
372
|
+
* list to assert at *runtime* that it implements the full surface — catching the
|
|
373
|
+
* "the SDK grew a method the test double lags" seam-lag class (issue #341: `openUserTasks`,
|
|
374
|
+
* and `getForm` before it) that a purely structural `implements EngineClient` check no
|
|
375
|
+
* longer catches once the fake is published/compiled against an older `@nanobpm/urban`.
|
|
376
|
+
*/
|
|
377
|
+
export const ENGINE_CLIENT_METHODS = [
|
|
378
|
+
"deployResources",
|
|
379
|
+
"createInstance",
|
|
380
|
+
"cancelInstance",
|
|
381
|
+
"publishMessage",
|
|
382
|
+
"searchUserTasks",
|
|
383
|
+
"openUserTasks",
|
|
384
|
+
"getForm",
|
|
385
|
+
"completeUserTask",
|
|
386
|
+
"searchProcessInstances",
|
|
387
|
+
"registerWorker",
|
|
388
|
+
"close",
|
|
389
|
+
] as const satisfies readonly (keyof EngineClient)[];
|
|
390
|
+
|
|
391
|
+
// Compile-time exhaustiveness: every `EngineClient` method must appear in
|
|
392
|
+
// `ENGINE_CLIENT_METHODS`. If one is omitted, `Exclude<...>` is a non-`never` union of
|
|
393
|
+
// the missing keys, so this type resolves to `never` and the `true` assignment fails to
|
|
394
|
+
// compile — the twin of the `satisfies` above, together pinning the list to
|
|
395
|
+
// `keyof EngineClient` exactly (No Drift Surfaces).
|
|
396
|
+
type MissingEngineClientMethods = Exclude<keyof EngineClient, (typeof ENGINE_CLIENT_METHODS)[number]>;
|
|
397
|
+
const _engineClientMethodsAreExhaustive: [MissingEngineClientMethods] extends [never] ? true : never = true;
|
package/src/runtime/index.ts
CHANGED
|
@@ -118,6 +118,10 @@ export type { Logger, LogLevel, LogFields, LogSink } from "./core/logger.ts";
|
|
|
118
118
|
// BPMN error contract: a handler throws `BpmnError(code)` to raise a modelled
|
|
119
119
|
// error routed to an error boundary (ADR 0050), instead of a retryable failure.
|
|
120
120
|
export { BpmnError, isBpmnError } from "./core/host.ts";
|
|
121
|
+
// The runtime source of truth for the `EngineClient` method surface (issue #341): a test
|
|
122
|
+
// double / adapter iterates it to prove at runtime that it implements the full interface,
|
|
123
|
+
// catching the "fake lags the SDK" seam-lag class categorically.
|
|
124
|
+
export { ENGINE_CLIENT_METHODS } from "./core/host.ts";
|
|
121
125
|
|
|
122
126
|
// Connector packs (ADR 0050, in-process port)
|
|
123
127
|
export {
|