@galaxy-stack/orbit-common 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,11 @@
1
+ export interface HttpArgumentsHost {
2
+ getRequest<T = any>(): T;
3
+ getResponse<T = any>(): T;
4
+ }
5
+ export interface ExecutionContext {
6
+ getRequest<T = any>(): T;
7
+ getResponse<T = any>(): T;
8
+ getHandler(): Function;
9
+ getClass(): Function;
10
+ switchToHttp(): HttpArgumentsHost;
11
+ }
@@ -0,0 +1,4 @@
1
+ export interface CanActivate {
2
+ canActivate(context: any): boolean | Promise<boolean>;
3
+ }
4
+ export type GuardClass = new (...args: any[]) => CanActivate;
@@ -0,0 +1,3 @@
1
+ export interface Type<T = any> extends Function {
2
+ new (...args: any[]): T;
3
+ }
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@galaxy-stack/orbit-common",
3
+ "version": "0.1.0",
4
+ "description": "Common decorators, pipes, guards, interceptors for Orbit",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "scripts": {
14
+ "build": "bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types",
15
+ "dev": "bun --watch src/index.ts",
16
+ "typecheck": "tsc --noEmit",
17
+ "test": "bun test",
18
+ "build:types": "bash ../../scripts/build-types.sh common"
19
+ },
20
+ "devDependencies": {
21
+ "@types/bun": "latest",
22
+ "typescript": "^5.0.0"
23
+ },
24
+ "license": "MIT",
25
+ "files": [
26
+ "dist",
27
+ "README.md"
28
+ ]
29
+ }