@guren/server 1.0.0-rc.9 → 1.0.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.
- package/dist/{Application-DtWDHXr1.d.ts → Application-BnsyCKXY.d.ts} +79 -8
- package/dist/AuthManager-SfhCNkAU.d.ts +79 -0
- package/dist/{BroadcastManager-AkIWUGJo.d.ts → BroadcastManager-CGWl9rUO.d.ts} +5 -0
- package/dist/{ConsoleKernel-CqCVrdZs.d.ts → ConsoleKernel-BDtBETjm.d.ts} +1 -1
- package/dist/{Gate-CNkBYf8m.d.ts → Gate-CynjZCtS.d.ts} +5 -0
- package/dist/{I18nManager-Dtgzsf5n.d.ts → I18nManager-BiSoczfV.d.ts} +6 -1
- package/dist/McpServiceProvider-JW6PDVMD.js +7 -0
- package/dist/api-token-BSSCLlFW.d.ts +541 -0
- package/dist/auth/index.d.ts +9 -327
- package/dist/auth/index.js +59 -6684
- package/dist/authorization/index.d.ts +2 -2
- package/dist/authorization/index.js +19 -604
- package/dist/broadcasting/index.d.ts +2 -2
- package/dist/broadcasting/index.js +12 -895
- package/dist/cache/index.js +8 -809
- package/dist/chunk-2T6JN4VR.js +1563 -0
- package/dist/chunk-44F7JQ7I.js +950 -0
- package/dist/chunk-74HTZG3V.js +331 -0
- package/dist/chunk-A3ISJVEV.js +598 -0
- package/dist/chunk-CSDKWLFD.js +652 -0
- package/dist/chunk-CSRQTEQA.js +839 -0
- package/dist/chunk-DAQKYKLH.js +182 -0
- package/dist/chunk-EDRGAM6G.js +647 -0
- package/dist/chunk-EGU5KB7V.js +818 -0
- package/dist/chunk-H32L2NE3.js +372 -0
- package/dist/chunk-HKQSAFSN.js +837 -0
- package/dist/chunk-IOTWFHZU.js +558 -0
- package/dist/chunk-ONSDE37A.js +125 -0
- package/dist/chunk-QQKTH5KX.js +114 -0
- package/dist/chunk-R2TCP7D7.js +409 -0
- package/dist/chunk-SIP34GBE.js +380 -0
- package/dist/chunk-THSX7OOR.js +454 -0
- package/dist/chunk-UY3AZSYL.js +14 -0
- package/dist/chunk-VT5KRDPH.js +134 -0
- package/dist/chunk-VXXZIXAP.js +255 -0
- package/dist/chunk-WJJ5CTNI.js +907 -0
- package/dist/chunk-WVY45EIW.js +359 -0
- package/dist/chunk-ZRBLZY3M.js +462 -0
- package/dist/client-CKXJLsTe.d.ts +232 -0
- package/dist/email-verification-CAeArjui.d.ts +327 -0
- package/dist/encryption/index.js +48 -556
- package/dist/errors-JOOPDDQ6.js +34 -0
- package/dist/events/index.js +14 -316
- package/dist/health/index.js +12 -367
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +14 -583
- package/dist/index.d.ts +37 -239
- package/dist/index.js +2873 -19166
- package/dist/lambda/index.d.ts +9 -7
- package/dist/lambda/index.js +4 -9
- package/dist/logging/index.js +12 -545
- package/dist/mail/index.d.ts +29 -1
- package/dist/mail/index.js +15 -684
- package/dist/mcp/index.d.ts +7 -5
- package/dist/mcp/index.js +5 -378
- package/dist/notifications/index.d.ts +8 -6
- package/dist/notifications/index.js +13 -730
- package/dist/queue/index.d.ts +37 -7
- package/dist/queue/index.js +22 -940
- package/dist/redis/index.d.ts +366 -0
- package/dist/redis/index.js +597 -0
- package/dist/runtime/index.d.ts +8 -6
- package/dist/runtime/index.js +26 -244
- package/dist/scheduling/index.js +14 -822
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +6 -824
- package/package.json +15 -7
- package/dist/api-token-JOif2CtG.d.ts +0 -1792
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// src/http/dev-banner.ts
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import figlet from "figlet";
|
|
4
|
+
import standard from "figlet/importable-fonts/Standard.js";
|
|
5
|
+
|
|
6
|
+
// package.json
|
|
7
|
+
var package_default = {
|
|
8
|
+
name: "@guren/server",
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
type: "module",
|
|
11
|
+
license: "MIT",
|
|
12
|
+
repository: {
|
|
13
|
+
type: "git",
|
|
14
|
+
url: "https://github.com/gurenjs/guren",
|
|
15
|
+
directory: "packages/server"
|
|
16
|
+
},
|
|
17
|
+
homepage: "https://github.com/gurenjs/guren#readme",
|
|
18
|
+
bugs: {
|
|
19
|
+
url: "https://github.com/gurenjs/guren/issues"
|
|
20
|
+
},
|
|
21
|
+
publishConfig: {
|
|
22
|
+
access: "public"
|
|
23
|
+
},
|
|
24
|
+
files: [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
main: "dist/index.js",
|
|
28
|
+
types: "dist/index.d.ts",
|
|
29
|
+
exports: {
|
|
30
|
+
".": {
|
|
31
|
+
types: "./dist/index.d.ts",
|
|
32
|
+
default: "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./auth": {
|
|
35
|
+
types: "./dist/auth/index.d.ts",
|
|
36
|
+
default: "./dist/auth/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./authorization": {
|
|
39
|
+
types: "./dist/authorization/index.d.ts",
|
|
40
|
+
default: "./dist/authorization/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./broadcasting": {
|
|
43
|
+
types: "./dist/broadcasting/index.d.ts",
|
|
44
|
+
default: "./dist/broadcasting/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./cache": {
|
|
47
|
+
types: "./dist/cache/index.d.ts",
|
|
48
|
+
default: "./dist/cache/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./encryption": {
|
|
51
|
+
types: "./dist/encryption/index.d.ts",
|
|
52
|
+
default: "./dist/encryption/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./events": {
|
|
55
|
+
types: "./dist/events/index.d.ts",
|
|
56
|
+
default: "./dist/events/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./health": {
|
|
59
|
+
types: "./dist/health/index.d.ts",
|
|
60
|
+
default: "./dist/health/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./i18n": {
|
|
63
|
+
types: "./dist/i18n/index.d.ts",
|
|
64
|
+
default: "./dist/i18n/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./logging": {
|
|
67
|
+
types: "./dist/logging/index.d.ts",
|
|
68
|
+
default: "./dist/logging/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./mail": {
|
|
71
|
+
types: "./dist/mail/index.d.ts",
|
|
72
|
+
default: "./dist/mail/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./notifications": {
|
|
75
|
+
types: "./dist/notifications/index.d.ts",
|
|
76
|
+
default: "./dist/notifications/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./queue": {
|
|
79
|
+
types: "./dist/queue/index.d.ts",
|
|
80
|
+
default: "./dist/queue/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./runtime": {
|
|
83
|
+
types: "./dist/runtime/index.d.ts",
|
|
84
|
+
default: "./dist/runtime/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./scheduling": {
|
|
87
|
+
types: "./dist/scheduling/index.d.ts",
|
|
88
|
+
default: "./dist/scheduling/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./storage": {
|
|
91
|
+
types: "./dist/storage/index.d.ts",
|
|
92
|
+
default: "./dist/storage/index.js"
|
|
93
|
+
},
|
|
94
|
+
"./vite": {
|
|
95
|
+
types: "./dist/vite/index.d.ts",
|
|
96
|
+
default: "./dist/vite/index.js"
|
|
97
|
+
},
|
|
98
|
+
"./mcp": {
|
|
99
|
+
types: "./dist/mcp/index.d.ts",
|
|
100
|
+
default: "./dist/mcp/index.js"
|
|
101
|
+
},
|
|
102
|
+
"./lambda": {
|
|
103
|
+
types: "./dist/lambda/index.d.ts",
|
|
104
|
+
default: "./dist/lambda/index.js"
|
|
105
|
+
},
|
|
106
|
+
"./redis": {
|
|
107
|
+
types: "./dist/redis/index.d.ts",
|
|
108
|
+
default: "./dist/redis/index.js"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
scripts: {
|
|
112
|
+
build: "NODE_OPTIONS='--max-old-space-size=8192' tsup",
|
|
113
|
+
dev: "bun --watch src/index.ts",
|
|
114
|
+
typecheck: "tsc --noEmit",
|
|
115
|
+
test: "bun test"
|
|
116
|
+
},
|
|
117
|
+
dependencies: {
|
|
118
|
+
"@guren/orm": "^1.0.0",
|
|
119
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
120
|
+
chalk: "^5.3.0",
|
|
121
|
+
consola: "^3.4.2",
|
|
122
|
+
figlet: "^1.7.0",
|
|
123
|
+
hono: "^4.12.29",
|
|
124
|
+
ioredis: "^5.11.1",
|
|
125
|
+
nodemailer: "^9.0.1"
|
|
126
|
+
},
|
|
127
|
+
peerDependencies: {
|
|
128
|
+
"@aws-sdk/client-s3": "^3.0.0",
|
|
129
|
+
"@aws-sdk/client-sqs": "^3.0.0",
|
|
130
|
+
"@aws-sdk/s3-request-presigner": "^3.0.0",
|
|
131
|
+
vite: ">=7.0.0",
|
|
132
|
+
"@guren/inertia-client": "^1.0.0"
|
|
133
|
+
},
|
|
134
|
+
peerDependenciesMeta: {
|
|
135
|
+
"@aws-sdk/client-s3": {
|
|
136
|
+
optional: true
|
|
137
|
+
},
|
|
138
|
+
"@aws-sdk/client-sqs": {
|
|
139
|
+
optional: true
|
|
140
|
+
},
|
|
141
|
+
"@aws-sdk/s3-request-presigner": {
|
|
142
|
+
optional: true
|
|
143
|
+
},
|
|
144
|
+
"@guren/inertia-client": {
|
|
145
|
+
optional: true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
devDependencies: {
|
|
149
|
+
"@types/ioredis": "^5.0.0",
|
|
150
|
+
"@types/node": "^20.14.10",
|
|
151
|
+
"@types/nodemailer": "^8.0.1",
|
|
152
|
+
tsup: "^8.5.0",
|
|
153
|
+
typescript: "^5.4.0",
|
|
154
|
+
vite: "^8.0.0"
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/http/dev-banner.ts
|
|
159
|
+
figlet.parseFont("Standard", standard);
|
|
160
|
+
function generateAsciiArt(text) {
|
|
161
|
+
try {
|
|
162
|
+
const rendered = figlet.textSync(text, {
|
|
163
|
+
font: "Standard",
|
|
164
|
+
horizontalLayout: "default",
|
|
165
|
+
verticalLayout: "default"
|
|
166
|
+
});
|
|
167
|
+
return rendered;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
console.error("Failed to generate FIGlet banner, falling back to plain text:", error);
|
|
170
|
+
return text.toUpperCase();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
var GUREN_ASCII_ART = chalk.redBright.bold(generateAsciiArt("GUREN"));
|
|
174
|
+
var GUREN_VERSION = package_default.version;
|
|
175
|
+
function logDevServerBanner({
|
|
176
|
+
hostname,
|
|
177
|
+
port,
|
|
178
|
+
assetsUrl = "http://localhost:5173"
|
|
179
|
+
}) {
|
|
180
|
+
const localUrl = `http://localhost:${port}`;
|
|
181
|
+
const boundUrl = `http://${hostname}:${port}`;
|
|
182
|
+
const boundLabel = hostname === "0.0.0.0" || hostname === "::" ? " (all interfaces)" : "";
|
|
183
|
+
const header = [
|
|
184
|
+
GUREN_ASCII_ART,
|
|
185
|
+
chalk.magentaBright.bold(
|
|
186
|
+
`Guren v${GUREN_VERSION} ignites \u2014 burning bright like a crimson lotus.`
|
|
187
|
+
),
|
|
188
|
+
""
|
|
189
|
+
];
|
|
190
|
+
const detail = (label, value) => `${chalk.magentaBright(" \u2022")} ${chalk.bold(label.padEnd(14))}: ${chalk.cyanBright(value)}`;
|
|
191
|
+
const banner = [
|
|
192
|
+
...header,
|
|
193
|
+
detail("App URL", localUrl),
|
|
194
|
+
detail("Bound address", `${boundUrl}${boundLabel}`),
|
|
195
|
+
detail("Asset server", `${assetsUrl} (Vite)`),
|
|
196
|
+
"",
|
|
197
|
+
chalk.yellowBright("Press Ctrl+C to douse the flames."),
|
|
198
|
+
""
|
|
199
|
+
].join("\n");
|
|
200
|
+
console.log(banner);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/http/vite-dev-server.ts
|
|
204
|
+
async function startViteDevServer(options = {}) {
|
|
205
|
+
const { root = process.cwd(), config = {}, host = true, port } = options;
|
|
206
|
+
const { createServer } = await import("vite");
|
|
207
|
+
const mergedConfig = {
|
|
208
|
+
clearScreen: false,
|
|
209
|
+
...config,
|
|
210
|
+
root: config.root ?? root,
|
|
211
|
+
server: {
|
|
212
|
+
host,
|
|
213
|
+
port,
|
|
214
|
+
...config.server ?? {}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const server = await createServer(mergedConfig);
|
|
218
|
+
await server.listen();
|
|
219
|
+
const resolved = server.resolvedUrls;
|
|
220
|
+
const localUrls = resolved?.local?.length ? resolved.local : [`http://${typeof host === "string" ? host : "localhost"}:${server.config.server.port ?? port ?? 5173}`];
|
|
221
|
+
const networkUrls = resolved?.network ?? [];
|
|
222
|
+
return {
|
|
223
|
+
server,
|
|
224
|
+
localUrl: localUrls[0],
|
|
225
|
+
networkUrls
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// src/support/import-map.ts
|
|
230
|
+
function parseImportMap(value, options = {}) {
|
|
231
|
+
if (!value) {
|
|
232
|
+
return {};
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const parsed = JSON.parse(value);
|
|
236
|
+
const result = {};
|
|
237
|
+
for (const [key, entry] of Object.entries(parsed)) {
|
|
238
|
+
if (typeof entry === "string" && entry.length > 0) {
|
|
239
|
+
result[key] = entry;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return result;
|
|
243
|
+
} catch (error) {
|
|
244
|
+
const label = options.context ?? "import map";
|
|
245
|
+
console.warn(`Failed to parse ${label}. Expected JSON object.`, error);
|
|
246
|
+
return {};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export {
|
|
251
|
+
GUREN_ASCII_ART,
|
|
252
|
+
logDevServerBanner,
|
|
253
|
+
startViteDevServer,
|
|
254
|
+
parseImportMap
|
|
255
|
+
};
|