lambder 4.7.1 → 4.7.3
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/core/Lambder.d.ts +1 -1
- package/dist/core/Lambder.js +4 -0
- package/package.json +3 -2
package/dist/core/Lambder.d.ts
CHANGED
|
@@ -275,7 +275,7 @@ export default class Lambder<TSessionData = any, _TContract extends Record<strin
|
|
|
275
275
|
addRoute(condition: RegExp | ConditionFunction | LambderRouteMatcher, actionFn: ActionFunction): this;
|
|
276
276
|
addSessionRoute<TPath extends Path>(condition: TPath, actionFn: (ctx: LambderSessionRenderContext<any, TSessionData, PathParamsOf<TPath>>, resolver: LambderResolver) => MaybePromise<LambderResponse>): this;
|
|
277
277
|
addSessionRoute(condition: RegExp | ConditionFunction | LambderRouteMatcher, actionFn: SessionActionFunction<TSessionData>): this;
|
|
278
|
-
use<_TNewContract extends Record<string, any>>(plugin: (lambder: Lambder<TSessionData, _TContract, any, any, any>) => Lambder<TSessionData, _TNewContract, any, any, any>): Lambder<TSessionData, _TNewContract extends _TContract ? _TNewContract : (_TContract & _TNewContract), _TRateLimitPolicies, _TGuards, _TIdempotencyEnabled, _TSessionGuardsRequired>;
|
|
278
|
+
use<_TNewContract extends Record<string, any>>(plugin: (lambder: Lambder<TSessionData, _TContract, any, any, any, any>) => Lambder<TSessionData, _TNewContract, any, any, any, any>): Lambder<TSessionData, _TNewContract extends _TContract ? _TNewContract : (_TContract & _TNewContract), _TRateLimitPolicies, _TGuards, _TIdempotencyEnabled, _TSessionGuardsRequired>;
|
|
279
279
|
addApi<TName extends string, TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny, const TRateOpt extends LambderRateLimitOption<_TRateLimitPolicies, z.infer<TInput>, false> = never, const TGuardsOpt extends LambderGuardsOption<_TGuards, z.infer<TInput>, false> = never>(name: TName, schema: {
|
|
280
280
|
input: TInput;
|
|
281
281
|
output: TOutput;
|
package/dist/core/Lambder.js
CHANGED
|
@@ -249,6 +249,10 @@ export default class Lambder {
|
|
|
249
249
|
// module may annotate its parameter as the bare Lambder<SessionData> or
|
|
250
250
|
// as the app's narrowed alias, and both must chain. Registration-time
|
|
251
251
|
// assertions still verify every referenced policy/guard name at runtime.
|
|
252
|
+
// Every policy generic must be listed here: one short of the class's
|
|
253
|
+
// parameter list and the missing one silently falls back to its default,
|
|
254
|
+
// which makes an instance carrying the non-default value unassignable to
|
|
255
|
+
// its own plugins (requireSessionApiGuards did exactly that in 4.7.1).
|
|
252
256
|
use(plugin) {
|
|
253
257
|
return plugin(this);
|
|
254
258
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lambder",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
|
-
"
|
|
42
|
+
"typecheck": "tsc -p tsconfig.tests.json",
|
|
43
|
+
"test": "npm run typecheck && vitest run",
|
|
43
44
|
"test:watch": "vitest",
|
|
44
45
|
"build": "tsc",
|
|
45
46
|
"lint": "eslint . --ext .ts,.tsx --fix"
|