@eyettea/zeta-backend 0.0.1-rc.3 → 0.0.1-rc.5
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/dist/types/api/index.d.ts +2 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +4 -4
- package/dist/types/app.d.ts +485 -270
- package/dist/types/app.d.ts.map +1 -1
- package/dist/types/lib/errors.d.ts +86 -3
- package/dist/types/lib/errors.d.ts.map +1 -1
- package/dist/types/routes/compute.d.ts +38 -17
- package/dist/types/routes/compute.d.ts.map +1 -1
- package/dist/types/routes/ohlcv.d.ts +19 -9
- package/dist/types/routes/ohlcv.d.ts.map +1 -1
- package/dist/types/routes/pools.d.ts +174 -66
- package/dist/types/routes/pools.d.ts.map +1 -1
- package/dist/types/routes/response.d.ts +63 -16
- package/dist/types/routes/response.d.ts.map +1 -1
- package/package.json +11 -4
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
id: string;
|
|
3
|
-
success: true;
|
|
4
|
-
data: T;
|
|
5
|
-
}
|
|
6
|
-
export interface ErrorApiResponse {
|
|
7
|
-
id: string;
|
|
8
|
-
success: false;
|
|
9
|
-
msg: string;
|
|
10
|
-
}
|
|
11
|
-
export interface PaginatedApiResponse<T> extends SuccessApiResponse<T> {
|
|
12
|
-
id: string;
|
|
13
|
-
success: true;
|
|
1
|
+
export interface PaginatedApiResponse<T> extends Response {
|
|
14
2
|
data: T & {
|
|
15
3
|
meta: {
|
|
16
4
|
page: number;
|
|
@@ -19,8 +7,67 @@ export interface PaginatedApiResponse<T> extends SuccessApiResponse<T> {
|
|
|
19
7
|
};
|
|
20
8
|
};
|
|
21
9
|
}
|
|
22
|
-
export type ApiResponse<T> = SuccessApiResponse<T> | ErrorApiResponse;
|
|
23
10
|
export declare function handlePaginatedSuccess<T>(data: T, page: number, pageSize: number, totalPages: number): PaginatedApiResponse<T>;
|
|
24
|
-
export declare function handleSuccess<T>(data: T):
|
|
25
|
-
export declare function
|
|
11
|
+
export declare function handleSuccess<T>(data: T): T;
|
|
12
|
+
export declare function badRequest(message: string): never;
|
|
13
|
+
export declare function notFound(subject: string): never;
|
|
14
|
+
export declare function internalServerError(error: unknown): never;
|
|
15
|
+
export declare const DefaultErrorResponseSchemas: {
|
|
16
|
+
400: import("zod").ZodObject<{
|
|
17
|
+
message: import("zod").ZodString;
|
|
18
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
19
|
+
} & {
|
|
20
|
+
error: import("zod").ZodLiteral<"Bad request">;
|
|
21
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
22
|
+
message: string;
|
|
23
|
+
error: "Bad request";
|
|
24
|
+
details?: Record<string, unknown> | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
message: string;
|
|
27
|
+
error: "Bad request";
|
|
28
|
+
details?: Record<string, unknown> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
404: import("zod").ZodObject<{
|
|
31
|
+
message: import("zod").ZodString;
|
|
32
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
33
|
+
} & {
|
|
34
|
+
error: import("zod").ZodLiteral<"Resource not found">;
|
|
35
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
36
|
+
message: string;
|
|
37
|
+
error: "Resource not found";
|
|
38
|
+
details?: Record<string, unknown> | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
message: string;
|
|
41
|
+
error: "Resource not found";
|
|
42
|
+
details?: Record<string, unknown> | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
422: import("zod").ZodObject<{
|
|
45
|
+
message: import("zod").ZodString;
|
|
46
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
47
|
+
} & {
|
|
48
|
+
error: import("zod").ZodLiteral<"Validation error">;
|
|
49
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
50
|
+
message: string;
|
|
51
|
+
error: "Validation error";
|
|
52
|
+
details?: Record<string, unknown> | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
message: string;
|
|
55
|
+
error: "Validation error";
|
|
56
|
+
details?: Record<string, unknown> | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
500: import("zod").ZodObject<{
|
|
59
|
+
message: import("zod").ZodString;
|
|
60
|
+
details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
61
|
+
} & {
|
|
62
|
+
error: import("zod").ZodLiteral<"Internal server error">;
|
|
63
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
64
|
+
message: string;
|
|
65
|
+
error: "Internal server error";
|
|
66
|
+
details?: Record<string, unknown> | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
message: string;
|
|
69
|
+
error: "Internal server error";
|
|
70
|
+
details?: Record<string, unknown> | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
26
73
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/routes/response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/routes/response.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB,CAAC,CAAC,CAAE,SAAQ,QAAQ;IACvD,IAAI,EAAE,CAAC,GAAG;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAA;YACZ,QAAQ,EAAE,MAAM,CAAA;YAChB,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;KACF,CAAA;CACF;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAAC,CAAC,CAAC,CAYzB;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAK3C;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAEjD;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE/C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAwBzD;AAGD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eyettea/zeta-backend",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.5",
|
|
4
|
+
"engines": {
|
|
5
|
+
"bun": ">=1.3.0 < 1.4.0"
|
|
6
|
+
},
|
|
4
7
|
"scripts": {
|
|
5
8
|
"dev": "bun run --watch src/index.ts",
|
|
6
9
|
"build": "bun build src/index.ts --outdir dist --target=node",
|
|
@@ -24,25 +27,29 @@
|
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"@elysiajs/cors": "^1.
|
|
28
|
-
"@elysiajs/
|
|
30
|
+
"@elysiajs/cors": "^1.4.0",
|
|
31
|
+
"@elysiajs/openapi": "^1.4.11",
|
|
29
32
|
"@h0ngcha0/typescript-sdk": "0.0.1-rc.4",
|
|
30
33
|
"@sinclair/typebox": "^0.34.41",
|
|
31
34
|
"dotenv": "^17.0.0",
|
|
32
|
-
"elysia": "^1.3.5",
|
|
33
35
|
"postgres": "^3.4.7",
|
|
34
36
|
"zod": "^3.25.67"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
39
|
+
"@elysiajs/eden": "1.4.5",
|
|
37
40
|
"@types/node": "^20.19.2",
|
|
38
41
|
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
39
42
|
"@typescript-eslint/parser": "^6.17.0",
|
|
40
43
|
"bun-types": "^1.2.17",
|
|
44
|
+
"elysia": "1.4.19",
|
|
41
45
|
"eslint": "^8.56.0",
|
|
42
46
|
"eslint-config-prettier": "^9.1.0",
|
|
43
47
|
"eslint-plugin-prettier": "^5.1.3",
|
|
44
48
|
"prettier": "^3.2.5",
|
|
45
49
|
"tsc-alias": "^1.8.16",
|
|
46
50
|
"typescript": "^5.3.3"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"elysia": "1.4.19"
|
|
47
54
|
}
|
|
48
55
|
}
|