@cripty2001/utils 0.0.212 → 0.0.213

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.
@@ -23,7 +23,7 @@ export type AppserverModule<ISchema extends TSchema = TSchema, O extends Appserv
23
23
  };
24
24
  export declare class AppserverDispatcher {
25
25
  private registry;
26
- register(action: string, mod: AppserverModule): void;
26
+ register<ISchema extends TSchema, O extends AppserverData, I extends Static<ISchema> & AppserverData = Static<ISchema> & AppserverData>(action: string, mod: AppserverModule<ISchema, O, I>): void;
27
27
  autoload(base: string): Promise<void>;
28
28
  bind(app: express.Express, path: string): void;
29
29
  private dispatch;
package/llms/appserver.md CHANGED
@@ -94,6 +94,9 @@ The autoloader checks `mod.default.handler` (must be a function) and `mod.defaul
94
94
  - Always `Type.Object({ ... })` at the top level, even for empty inputs (`Type.Object({})`). Never a bare string, number, or array at the top.
95
95
  - Export the schema constant so clients can import it.
96
96
  - The handler's `input` parameter is typed automatically from the schema. Do not annotate it manually.
97
+ - Internally the input type is modeled as `Static<typeof schema> & AppserverData`:
98
+ - `Static<typeof schema>` gives you the TypeScript type derived from the TypeBox schema.
99
+ - `& AppserverData` ensures that whatever the schema describes is also representable on the wire (msgpack-safe / JSON-like: primitives, arrays, objects, `Uint8Array`, `null`).
97
100
  - Validation runs before the handler. Invalid input returns `422` with TypeBox errors. Your handler never sees malformed data. Validate semantics only (e.g. "does this ID exist") — not shape.
98
101
 
99
102
  ### Output — inferred, no schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.212",
3
+ "version": "0.0.213",
4
4
  "description": "Internal Set of utils. If you need them use them, otherwise go to the next package ;)",
5
5
  "homepage": "https://github.com/cripty2001/utils#readme",
6
6
  "bugs": {
@@ -116,4 +116,4 @@
116
116
  "require": "./dist/react-ui/index.js"
117
117
  }
118
118
  }
119
- }
119
+ }