@digo-labs/backend 0.1.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.
- package/README.md +28 -0
- package/dist/index.d.cts +254 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Prerequisites
|
|
2
|
+
|
|
3
|
+
- [Vercel CLI](https://vercel.com/docs/cli) installed globally
|
|
4
|
+
|
|
5
|
+
# Develop locally:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install
|
|
9
|
+
vc dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
open http://localhost:3000
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
# Build locally:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npm install
|
|
20
|
+
vc build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
# Deploy:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
npm install
|
|
27
|
+
vc deploy
|
|
28
|
+
```
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as hono_types from 'hono/types';
|
|
2
|
+
import { Hono } from 'hono';
|
|
3
|
+
import * as hono_hono_base from 'hono/hono-base';
|
|
4
|
+
import * as hono_utils_http_status from 'hono/utils/http-status';
|
|
5
|
+
import * as hono_utils_types from 'hono/utils/types';
|
|
6
|
+
|
|
7
|
+
declare const dmxRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
8
|
+
"dmx-send": {
|
|
9
|
+
$post: {
|
|
10
|
+
input: {
|
|
11
|
+
json: {
|
|
12
|
+
channel: number;
|
|
13
|
+
value: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
output: {
|
|
17
|
+
success: boolean;
|
|
18
|
+
};
|
|
19
|
+
outputFormat: "json";
|
|
20
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}, "/", "dmx-send">;
|
|
24
|
+
|
|
25
|
+
declare const storageRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
26
|
+
"storage-presign-upload": {
|
|
27
|
+
$post: {
|
|
28
|
+
input: {
|
|
29
|
+
json: {
|
|
30
|
+
bucket: string;
|
|
31
|
+
path: string;
|
|
32
|
+
contentType: string;
|
|
33
|
+
expiresIn?: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
output: {
|
|
37
|
+
url: string;
|
|
38
|
+
expiresAt: number;
|
|
39
|
+
};
|
|
40
|
+
outputFormat: "json";
|
|
41
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
} & {
|
|
45
|
+
"storage-presign-download": {
|
|
46
|
+
$post: {
|
|
47
|
+
input: {
|
|
48
|
+
json: {
|
|
49
|
+
bucket: string;
|
|
50
|
+
path: string;
|
|
51
|
+
expiresIn?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
output: {
|
|
55
|
+
url: string;
|
|
56
|
+
expiresAt: number;
|
|
57
|
+
};
|
|
58
|
+
outputFormat: "json";
|
|
59
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
} & {
|
|
63
|
+
"storage-list": {
|
|
64
|
+
$post: {
|
|
65
|
+
input: {
|
|
66
|
+
json: {
|
|
67
|
+
bucket: string;
|
|
68
|
+
prefix?: string | undefined;
|
|
69
|
+
limit?: number | undefined;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
output: {
|
|
73
|
+
objects: {
|
|
74
|
+
key: string;
|
|
75
|
+
size: number;
|
|
76
|
+
lastModified: string;
|
|
77
|
+
etag?: string | undefined;
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
outputFormat: "json";
|
|
81
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
} & {
|
|
85
|
+
"storage-delete": {
|
|
86
|
+
$post: {
|
|
87
|
+
input: {
|
|
88
|
+
json: {
|
|
89
|
+
bucket: string;
|
|
90
|
+
paths: string[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
output: {
|
|
94
|
+
success: boolean;
|
|
95
|
+
deleted: string[];
|
|
96
|
+
};
|
|
97
|
+
outputFormat: "json";
|
|
98
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}, "/", "storage-delete">;
|
|
102
|
+
|
|
103
|
+
declare const databaseRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
104
|
+
"database-get-all": {
|
|
105
|
+
$post: {
|
|
106
|
+
input: {
|
|
107
|
+
json: {
|
|
108
|
+
table: string;
|
|
109
|
+
limit?: number | undefined;
|
|
110
|
+
offset?: number | undefined;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
output: {
|
|
114
|
+
rows: {
|
|
115
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
outputFormat: "json";
|
|
119
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
} & {
|
|
123
|
+
"database-get": {
|
|
124
|
+
$post: {
|
|
125
|
+
input: {
|
|
126
|
+
json: {
|
|
127
|
+
table: string;
|
|
128
|
+
pk: string;
|
|
129
|
+
value: string | number | boolean | null;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
output: {
|
|
133
|
+
row: {
|
|
134
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
135
|
+
} | null;
|
|
136
|
+
};
|
|
137
|
+
outputFormat: "json";
|
|
138
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
} & {
|
|
142
|
+
"database-get-by": {
|
|
143
|
+
$post: {
|
|
144
|
+
input: {
|
|
145
|
+
json: {
|
|
146
|
+
table: string;
|
|
147
|
+
column: string;
|
|
148
|
+
value: string | number | boolean | null;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
output: {
|
|
152
|
+
rows: {
|
|
153
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
154
|
+
}[];
|
|
155
|
+
};
|
|
156
|
+
outputFormat: "json";
|
|
157
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
} & {
|
|
161
|
+
"database-create": {
|
|
162
|
+
$post: {
|
|
163
|
+
input: {
|
|
164
|
+
json: {
|
|
165
|
+
table: string;
|
|
166
|
+
record: Record<string, unknown>;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
output: {
|
|
170
|
+
row: {
|
|
171
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
outputFormat: "json";
|
|
175
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
} & {
|
|
179
|
+
"database-update": {
|
|
180
|
+
$post: {
|
|
181
|
+
input: {
|
|
182
|
+
json: {
|
|
183
|
+
table: string;
|
|
184
|
+
pk: string;
|
|
185
|
+
value: string | number | boolean | null;
|
|
186
|
+
changes: Record<string, unknown>;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
output: {
|
|
190
|
+
success: boolean;
|
|
191
|
+
};
|
|
192
|
+
outputFormat: "json";
|
|
193
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
} & {
|
|
197
|
+
"database-delete": {
|
|
198
|
+
$post: {
|
|
199
|
+
input: {
|
|
200
|
+
json: {
|
|
201
|
+
table: string;
|
|
202
|
+
pk: string;
|
|
203
|
+
value: string | number | boolean | null;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
output: {
|
|
207
|
+
success: boolean;
|
|
208
|
+
};
|
|
209
|
+
outputFormat: "json";
|
|
210
|
+
status: hono_utils_http_status.ContentfulStatusCode;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
}, "/", "database-delete">;
|
|
214
|
+
|
|
215
|
+
declare const aiRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
216
|
+
text: {
|
|
217
|
+
$post: {
|
|
218
|
+
input: {
|
|
219
|
+
json: {
|
|
220
|
+
messages: {
|
|
221
|
+
role: "user" | "assistant";
|
|
222
|
+
content: string | ({
|
|
223
|
+
type: "text";
|
|
224
|
+
text: string;
|
|
225
|
+
} | {
|
|
226
|
+
type: "image";
|
|
227
|
+
source: {
|
|
228
|
+
base64: string;
|
|
229
|
+
mediaType: string;
|
|
230
|
+
};
|
|
231
|
+
})[];
|
|
232
|
+
}[];
|
|
233
|
+
model?: string | undefined;
|
|
234
|
+
systemPrompt?: string | undefined;
|
|
235
|
+
temperature?: number | undefined;
|
|
236
|
+
maxTokens?: number | undefined;
|
|
237
|
+
stopSequences?: string[] | undefined;
|
|
238
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
output: {};
|
|
242
|
+
outputFormat: string;
|
|
243
|
+
status: hono_utils_http_status.StatusCode;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
}, "/", "text">;
|
|
247
|
+
|
|
248
|
+
declare const app: Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
249
|
+
type DmxRouter = typeof dmxRouter;
|
|
250
|
+
type StorageRouter = typeof storageRouter;
|
|
251
|
+
type DatabaseRouter = typeof databaseRouter;
|
|
252
|
+
type AiRouter = typeof aiRouter;
|
|
253
|
+
|
|
254
|
+
export { type AiRouter, type DatabaseRouter, type DmxRouter, type StorageRouter, app as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@digo-labs/backend",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"types": "./dist/index.d.cts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.cts",
|
|
10
|
+
"import": "./dist/index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/index.d.cts"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"dev": "npx tsx watch src/index.ts",
|
|
23
|
+
"build": "tsup",
|
|
24
|
+
"start": "node ./dist/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@digo-labs/common": "^0.1.5"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@aws-sdk/client-bedrock": "^3.1035.0",
|
|
31
|
+
"@aws-sdk/client-bedrock-runtime": "^3.1035.0",
|
|
32
|
+
"@aws-sdk/client-s3": "^3.1032.0",
|
|
33
|
+
"@aws-sdk/s3-request-presigner": "^3.1032.0",
|
|
34
|
+
"@hono/node-server": "^1.19.14",
|
|
35
|
+
"@hono/zod-validator": "^0.7.6",
|
|
36
|
+
"@types/dmx": "^0.2.3",
|
|
37
|
+
"better-auth": "^1.5.6",
|
|
38
|
+
"dmx": "^0.25.1",
|
|
39
|
+
"dotenv": "^17.2.3",
|
|
40
|
+
"drizzle-orm": "^0.45.2",
|
|
41
|
+
"hono": "^4.9.8",
|
|
42
|
+
"pg": "^8.20.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@digo-labs/dev-dependencies": "*",
|
|
46
|
+
"@types/pg": "^8.20.0",
|
|
47
|
+
"drizzle-kit": "^0.31.10",
|
|
48
|
+
"tsup": "^8.5.0"
|
|
49
|
+
},
|
|
50
|
+
"tsup": {
|
|
51
|
+
"entry": [
|
|
52
|
+
"src/index.ts"
|
|
53
|
+
],
|
|
54
|
+
"dts": true,
|
|
55
|
+
"noExternal": [
|
|
56
|
+
"@digo-labs/common"
|
|
57
|
+
],
|
|
58
|
+
"splitting": false,
|
|
59
|
+
"sourcemap": true,
|
|
60
|
+
"clean": true
|
|
61
|
+
}
|
|
62
|
+
}
|