@spfn/core 0.3.0-beta.28 → 0.3.0-beta.29
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/dist/codegen/index.d.ts +65 -2
- package/dist/codegen/index.js +160 -15
- package/dist/codegen/index.js.map +1 -1
- package/dist/contract/index.d.ts +1 -1
- package/dist/{error-TsUIjp_x.d.ts → error-CIZlYJlL.d.ts} +1 -1
- package/dist/ops/index.d.ts +3 -3
- package/dist/ops/index.js +15 -5
- package/dist/ops/index.js.map +1 -1
- package/dist/route/index.d.ts +2 -2
- package/dist/route/index.js +15 -5
- package/dist/route/index.js.map +1 -1
- package/dist/{router-4YoIy5fN.d.ts → router-C57y-vz1.d.ts} +12 -0
- package/dist/server/index.js +15 -5
- package/dist/server/index.js.map +1 -1
- package/dist/state/index.js +8 -3
- package/dist/state/index.js.map +1 -1
- package/dist/surface/index.d.ts +3 -3
- package/dist/surface/index.js +15 -5
- package/dist/surface/index.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen/README.md +89 -2
- package/src/state/README.md +67 -0
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as EventRouterDef } from '../router-CX5uVjmU.js';
|
|
2
|
-
import { R as Router } from '../router-
|
|
2
|
+
import { R as Router } from '../router-C57y-vz1.js';
|
|
3
3
|
import { C as ContractDocument, a as ContractViolation, b as ContractOperation, c as ContractSnapshot } from '../types-5Rl11_Nb.js';
|
|
4
4
|
export { d as CompatibilityPolicy, e as ContractEvent, f as ContractEvents, g as ContractRequest, h as ContractViolationKind, J as JsonSchema } from '../types-5Rl11_Nb.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { R as RouteDef, f as RouteBuilder } from './route-builder-DRW-MSCJ.js';
|
|
2
2
|
import { J as JsonSchema } from './types-5Rl11_Nb.js';
|
|
3
|
-
import { R as Router } from './router-
|
|
3
|
+
import { R as Router } from './router-C57y-vz1.js';
|
|
4
4
|
import { RouteEffect, HttpMethod } from './route/types.js';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/ops/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono';
|
|
2
2
|
import { a as NamedMiddleware } from '../define-middleware-CVKgqo8S.js';
|
|
3
3
|
import { R as RouteDef } from '../route-builder-DRW-MSCJ.js';
|
|
4
|
-
import { R as Router } from '../router-
|
|
5
|
-
import { S as SurfaceEffect, a as SurfaceModuleCommand, b as SurfaceModule, c as SurfaceRouteBuilder, d as SurfaceCommand, e as SurfaceManifest, f as SurfaceModuleDescriptor } from '../error-
|
|
6
|
-
export { g as OpsRouterError } from '../error-
|
|
4
|
+
import { R as Router } from '../router-C57y-vz1.js';
|
|
5
|
+
import { S as SurfaceEffect, a as SurfaceModuleCommand, b as SurfaceModule, c as SurfaceRouteBuilder, d as SurfaceCommand, e as SurfaceManifest, f as SurfaceModuleDescriptor } from '../error-CIZlYJlL.js';
|
|
6
|
+
export { g as OpsRouterError } from '../error-CIZlYJlL.js';
|
|
7
7
|
import '@sinclair/typebox';
|
|
8
8
|
import 'hono/utils/http-status';
|
|
9
9
|
import '../route/types.js';
|
package/dist/ops/index.js
CHANGED
|
@@ -318,7 +318,7 @@ var route = {
|
|
|
318
318
|
|
|
319
319
|
// src/route/router.ts
|
|
320
320
|
function createRouterInstance(state) {
|
|
321
|
-
|
|
321
|
+
const router = {
|
|
322
322
|
routes: state.routes,
|
|
323
323
|
_routes: state.routes,
|
|
324
324
|
_packageRouters: state.packageRouters,
|
|
@@ -333,19 +333,29 @@ function createRouterInstance(state) {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
assertDistinctSurfaces(newPackageRouters);
|
|
336
|
-
return createRouterInstance({ ...state, packageRouters: newPackageRouters });
|
|
336
|
+
return carryMarkers(router, createRouterInstance({ ...state, packageRouters: newPackageRouters }));
|
|
337
337
|
},
|
|
338
338
|
use(middlewares) {
|
|
339
|
-
return createRouterInstance({
|
|
339
|
+
return carryMarkers(router, createRouterInstance({
|
|
340
340
|
...state,
|
|
341
341
|
globalMiddlewares: [...state.globalMiddlewares, ...middlewares]
|
|
342
|
-
});
|
|
342
|
+
}));
|
|
343
343
|
},
|
|
344
344
|
contractVersion(version) {
|
|
345
345
|
assertContractVersion(version);
|
|
346
|
-
return createRouterInstance({ ...state, contractVersion: version });
|
|
346
|
+
return carryMarkers(router, createRouterInstance({ ...state, contractVersion: version }));
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
|
+
return router;
|
|
350
|
+
}
|
|
351
|
+
var MARKERS = ["_surfaceNamespace", "_stateManifest"];
|
|
352
|
+
function carryMarkers(from, to) {
|
|
353
|
+
for (const marker of MARKERS) {
|
|
354
|
+
if (from[marker] !== void 0) {
|
|
355
|
+
Object.defineProperty(to, marker, { value: from[marker], enumerable: false });
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return to;
|
|
349
359
|
}
|
|
350
360
|
function assertContractVersion(version) {
|
|
351
361
|
if (!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)*$/.test(version)) {
|