@kanjijs/testing 0.2.0-beta.13 → 0.2.0-beta.15

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.
@@ -0,0 +1,20 @@
1
+ import { type Constructor, Container, type ValidatorAdapter } from "@kanjijs/core";
2
+ import { Hono } from "hono";
3
+ import { cors } from "hono/cors";
4
+ import { logger } from "hono/logger";
5
+ import { secureHeaders } from "hono/secure-headers";
6
+ export interface KanjijsAdapterOptions {
7
+ validator?: ValidatorAdapter;
8
+ globalPrefix?: string;
9
+ cors?: boolean | Parameters<typeof cors>[0];
10
+ helmet?: boolean | Parameters<typeof secureHeaders>[0];
11
+ logger?: boolean | Parameters<typeof logger>[0];
12
+ }
13
+ export declare class KanjijsAdapter {
14
+ static create(rootModule: Constructor, optionsOrValidator?: ValidatorAdapter | KanjijsAdapterOptions): {
15
+ app: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
16
+ container: Container;
17
+ };
18
+ private static findControllers;
19
+ private static registerController;
20
+ }
@@ -0,0 +1,11 @@
1
+ import { type ExceptionFilter } from "@kanjijs/core";
2
+ import type { Context } from "hono";
3
+ export declare class KanjijsExceptionFilter implements ExceptionFilter {
4
+ catch(exception: unknown, c: Context): Response & import("hono").TypedResponse<{
5
+ statusCode: number;
6
+ message: string;
7
+ error: string;
8
+ timestamp: string;
9
+ requestId: import("hono/utils/types").JSONValue;
10
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">;
11
+ }
@@ -0,0 +1 @@
1
+ export * from "./adapter";
@@ -0,0 +1,7 @@
1
+ import type { ContractSpec, ValidatorAdapter } from "@kanjijs/contracts";
2
+ import type { Context, Next } from "hono";
3
+ export declare function createValidationMiddleware(spec: ContractSpec, validator: ValidatorAdapter): (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{
4
+ error: string;
5
+ message: string;
6
+ issues: import("hono/utils/types").JSONValue[];
7
+ }, 400, "json">) | undefined>;
@@ -0,0 +1,17 @@
1
+ import { type ModuleMetadata, type Token } from "@kanjijs/core";
2
+ export declare class Test {
3
+ static createTestingModule(metadata: ModuleMetadata): TestingModuleBuilder;
4
+ }
5
+ export declare class TestingModuleBuilder {
6
+ private metadata;
7
+ private overrides;
8
+ constructor(metadata: ModuleMetadata);
9
+ overrideProvider<T>(token: Token<T>): {
10
+ useValue: (value: T) => TestingModuleBuilder;
11
+ };
12
+ compile(): Promise<{
13
+ app: import("hono").Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
14
+ get: <T>(token: Token<T>) => T;
15
+ close: () => void;
16
+ }>;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanjijs/testing",
3
- "version": "0.2.0-beta.13",
3
+ "version": "0.2.0-beta.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "build": "bun build src/index.ts --outdir dist --target bun && tsc --emitDeclarationOnly --declaration --outDir dist"
14
14
  },
15
15
  "dependencies": {
16
- "@kanjijs/core": "^0.2.0-beta.13",
17
- "@kanjijs/platform-hono": "^0.2.0-beta.13",
16
+ "@kanjijs/core": "^0.2.0-beta.15",
17
+ "@kanjijs/platform-hono": "^0.2.0-beta.15",
18
18
  "hono": "^4.0.0"
19
19
  }
20
20
  }