@danceroutine/tango-adapters-core 0.1.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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RequestContext, BaseUser } from '@danceroutine/tango-resources';
|
|
2
|
+
/**
|
|
3
|
+
* Adapter interface for integrating Tango with a given framework.
|
|
4
|
+
* @template TResponse - The response type.
|
|
5
|
+
* @template THandlerType - The handler type.
|
|
6
|
+
* @template TRequest - The request type.
|
|
7
|
+
*/
|
|
8
|
+
export interface FrameworkAdapter<TResponse = Response, THandlerType = unknown, TRequest = unknown> {
|
|
9
|
+
adapt(handler: (ctx: RequestContext, ...args: unknown[]) => Promise<TResponse>, options?: FrameworkAdapterOptions<TRequest>): THandlerType;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for the framework adapter.
|
|
13
|
+
*/
|
|
14
|
+
export interface FrameworkAdapterOptions<TRequest = unknown> {
|
|
15
|
+
getUser?: (request: TRequest) => Promise<BaseUser | null> | BaseUser | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../adapter-D6a8o0SO.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-D6a8o0SO.js","names":[],"sources":["../src/adapter/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nexport type { FrameworkAdapter, FrameworkAdapterOptions } from './FrameworkAdapter';\n"],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundled exports for Django-style domain drill-down imports, plus curated
|
|
3
|
+
* top-level symbols for TS-native ergonomic imports.
|
|
4
|
+
*/
|
|
5
|
+
export * as adapter from './adapter/index';
|
|
6
|
+
export type { FrameworkAdapter, FrameworkAdapterOptions } from './adapter/index';
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@danceroutine/tango-adapters-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core types and utilities for Tango adapters",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./adapter": {
|
|
14
|
+
"types": "./dist/adapter/index.d.ts",
|
|
15
|
+
"import": "./dist/adapter/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsdown",
|
|
23
|
+
"test": "vitest run --coverage",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"typecheck": "tsc --noEmit"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"tango",
|
|
29
|
+
"adapters",
|
|
30
|
+
"core",
|
|
31
|
+
"adapter"
|
|
32
|
+
],
|
|
33
|
+
"author": "Pedro Del Moral Lopez",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/danceroutine/tango.git",
|
|
38
|
+
"directory": "packages/adapters/core"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@danceroutine/tango-resources": "workspace:*"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^22.9.0",
|
|
45
|
+
"tsdown": "^0.4.0",
|
|
46
|
+
"typescript": "^5.6.3",
|
|
47
|
+
"vitest": "^4.0.6"
|
|
48
|
+
}
|
|
49
|
+
}
|