shokupan 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -1632,6 +1632,7 @@ Container.clear();
1632
1632
  - ✅ **Deep Introspection** - Type analysis for enhanced OpenAPI generation
1633
1633
  - ✅ **Controller Mode** - Option for controller-only mode
1634
1634
  - ✅ **Supports Node/Deno** - Shokupan can run on Node.js or Deno
1635
+ - ✅ **OpenAPI Validation** - Built-in [OpenAPI](https://www.openapis.org/) validation
1635
1636
 
1636
1637
  ### Future Features
1637
1638
 
package/dist/cli.cjs CHANGED
@@ -4,7 +4,7 @@ const p = require("@clack/prompts");
4
4
  const fs = require("node:fs");
5
5
  const path = require("node:path");
6
6
  const promises = require("node:timers/promises");
7
- const openapiAnalyzer = require("./openapi-analyzer-CFqgSLNK.cjs");
7
+ const openapiAnalyzer = require("./openapi-analyzer-BN0wFCML.cjs");
8
8
  function _interopNamespaceDefault(e) {
9
9
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
10
  if (e) {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import * as p from "@clack/prompts";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { setTimeout } from "node:timers/promises";
6
- import { analyzeDirectory } from "./openapi-analyzer-cjdGeQ5a.js";
6
+ import { analyzeDirectory } from "./openapi-analyzer-BTExMLX4.js";
7
7
  const templates = {
8
8
  controller: (name) => `import { Controller, Get, Ctx } from 'shokupan';
9
9
  import { ShokupanContext } from 'shokupan';
package/dist/context.d.ts CHANGED
@@ -4,15 +4,24 @@ import { ShokupanResponse } from './response';
4
4
  import { Shokupan } from './shokupan';
5
5
  import { CookieOptions, JSXRenderer } from './types';
6
6
  type HeadersInit = Headers | Record<string, string> | [string, string][];
7
+ export interface HandlerStackItem {
8
+ name: string;
9
+ file: string;
10
+ line: number;
11
+ stateChanges?: Record<string, any>;
12
+ }
7
13
  export declare class ShokupanContext<State extends Record<string, any> = Record<string, any>> {
8
14
  readonly request: ShokupanRequest<any>;
9
15
  readonly server?: Server;
10
16
  readonly app?: Shokupan;
11
- readonly url: URL;
17
+ private _url;
12
18
  params: Record<string, string>;
13
19
  state: State;
20
+ handlerStack: HandlerStackItem[];
14
21
  readonly response: ShokupanResponse;
15
- constructor(request: ShokupanRequest<any>, server?: Server, state?: State, app?: Shokupan);
22
+ _finalResponse?: Response;
23
+ constructor(request: ShokupanRequest<any>, server?: Server, state?: State, app?: Shokupan, enableMiddlewareTracking?: boolean);
24
+ get url(): URL;
16
25
  /**
17
26
  * Base request
18
27
  */
@@ -24,7 +33,7 @@ export declare class ShokupanContext<State extends Record<string, any> = Record<
24
33
  /**
25
34
  * Request path
26
35
  */
27
- get path(): string;
36
+ get path(): any;
28
37
  /**
29
38
  * Request query params
30
39
  */