@fonderie/adapter-koa 1.0.2 → 1.0.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.
@@ -0,0 +1,45 @@
1
+ <!-- GENERATED — do not edit. Regenerate with: npm run docs:signatures -->
2
+
3
+ # @fonderie/adapter-koa — signatures
4
+
5
+ ## @fonderie/adapter-koa
6
+
7
+ ```ts
8
+ function koaContextToWeb(ctx: KoaContext): Request
9
+
10
+ function webResponseToKoa(webRes: Response, ctx: KoaContext): Promise<void>
11
+
12
+ function bridge(fonderie: FonderieApp): KoaMiddleware<any, any>
13
+
14
+ function adapt(middleware: Middleware): KoaMiddleware<any, any>
15
+
16
+ function withWorkspace(store: IStoreAdapter): KoaMiddleware<any, any>
17
+
18
+ function requirePermission(operation: Operation, permissionKey: string): KoaMiddleware<any, any>
19
+
20
+ function requireFeature(key: string): KoaMiddleware<any, any>
21
+
22
+ function mount(app: Application<DefaultState, DefaultContext>, fonderie: FonderieApp): Application<DefaultState, DefaultContext>
23
+
24
+ const OPERATIONS: { readonly CREATE: "create"; readonly READ: "read"; readonly UPDATE: "update"; readonly DELETE: "delete"; }
25
+
26
+ interface KoaContext {
27
+ request: {
28
+ url: string;
29
+ method: string;
30
+ rawBody?: string;
31
+ headers: Record<string, string | string[] | undefined>;
32
+ };
33
+ response: {
34
+ body: unknown;
35
+ status: number;
36
+ set(key: string, value: string): void;
37
+ };
38
+ req: IncomingMessage;
39
+ state: Record<string, unknown>;
40
+ }
41
+
42
+ type KoaNext = () => Promise<void>;
43
+
44
+ function requireAuth(context: any, next: Next): any
45
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/adapter-koa",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Koa adapter for fonderie-js — bridge(), adapt(), mount() to use fonderie middleware in native Koa routes.",
5
5
  "keywords": [
6
6
  "fonderie-js",
@@ -69,16 +69,17 @@
69
69
  },
70
70
  "files": [
71
71
  "dist",
72
+ "brain",
72
73
  "LICENSE",
73
74
  "README.md"
74
75
  ],
75
76
  "repository": {
76
77
  "type": "git",
77
- "url": "git+https://github.com/fonderie-js/sdk.git",
78
+ "url": "git+https://github.com/fonderiejs/sdk.git",
78
79
  "directory": "packages/adapter-koa"
79
80
  },
80
- "homepage": "https://github.com/fonderie-js/sdk/tree/main/packages/adapter-koa#readme",
81
+ "homepage": "https://github.com/fonderiejs/sdk/tree/main/packages/adapter-koa#readme",
81
82
  "bugs": {
82
- "url": "https://github.com/fonderie-js/sdk/issues"
83
+ "url": "https://github.com/fonderiejs/sdk/issues"
83
84
  }
84
85
  }