create-nexwire 4.0.0 → 4.1.1
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 +5 -4
- package/express/README.md +13 -7
- package/express/package.json +2 -2
- package/express/src/config/session.ts +1 -1
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
- package/express/src/database/migrations/sqlite/meta/_journal.json +1 -1
- package/express/src/database/schema.ts +3 -3
- package/express/src/framework/cache/cache.ts +82 -81
- package/express/src/framework/database/seed.ts +1 -1
- package/express/src/framework/facade.ts +1 -24
- package/express/src/framework/http/app.ts +5 -5
- package/express/src/framework/http/openapi.ts +1 -1
- package/express/src/framework/http/router.ts +3 -18
- package/express/src/framework/http/types.ts +19 -0
- package/express/src/framework/http/validation.ts +18 -18
- package/express/src/framework/maker-cli/middleware/core.mjs +41 -47
- package/express/src/framework/maker-cli/module/core.mjs +920 -684
- package/express/src/framework/maker-cli/module/index.mjs +202 -140
- package/express/src/framework/maker-cli/runtime/core.mjs +1 -2
- package/express/src/framework/maker-cli/stubs/controller/openapi.ts.stub +40 -14
- package/express/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +40 -15
- package/express/src/framework/maker-cli/stubs/controller/plain.ts.stub +42 -16
- package/express/src/framework/maker-cli/stubs/controller/standalone.ts.stub +47 -0
- package/express/src/framework/maker-cli/stubs/facade/name.ts.stub +12 -0
- package/express/src/framework/maker-cli/stubs/helper/name.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/middleware/name.local.ts.stub +15 -0
- package/express/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -8
- package/express/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -8
- package/express/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -8
- package/express/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -50
- package/express/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +11 -11
- package/express/src/framework/maker-cli/stubs/route/api.ts.stub +93 -79
- package/express/src/framework/maker-cli/stubs/route/plain.ts.stub +23 -10
- package/express/src/framework/maker-cli/stubs/route/standalone.api.ts.stub +113 -0
- package/express/src/framework/maker-cli/stubs/route/standalone.plain.ts.stub +37 -0
- package/express/src/framework/maker-cli/stubs/{controller/schema.plain.ts.stub → schema/name.plain.ts.stub} +13 -13
- package/express/src/framework/maker-cli/stubs/{controller/schema.ts.stub → schema/name.ts.stub} +32 -32
- package/express/src/framework/maker-cli/stubs/service/name.plain.ts.stub +67 -0
- package/express/src/framework/maker-cli/stubs/service/name.ts.stub +65 -0
- package/express/src/framework/maker-cli/stubs/type/name.ts.stub +22 -0
- package/express/src/framework/maker-cli/utils/naming.mjs +56 -13
- package/express/src/framework/modules/discover.ts +57 -54
- package/express/src/framework/notification/index.ts +1 -1
- package/express/src/framework/realtime/broadcast.ts +46 -46
- package/express/src/framework/server.ts +2 -1
- package/express/src/framework/session/session.ts +102 -98
- package/express/src/framework/support/mail.ts +48 -48
- package/express/src/framework/support/status-codes.ts +75 -0
- package/express/src/middlewares/auth-middleware.ts +1 -1
- package/express/src/modules/auth/__tests__/forgetpass.test.ts +200 -0
- package/express/src/modules/auth/__tests__/login.test.ts +171 -0
- package/express/src/modules/auth/__tests__/logout.test.ts +60 -0
- package/express/src/modules/auth/__tests__/logoutalldevices.test.ts +49 -0
- package/express/src/modules/auth/__tests__/me.test.ts +91 -0
- package/express/src/modules/auth/__tests__/refreshtoken.test.ts +305 -0
- package/express/src/modules/auth/__tests__/register.test.ts +291 -0
- package/express/src/modules/auth/__tests__/resetpass.test.ts +206 -0
- package/express/src/modules/auth/__tests__/verifyemail.test.ts +183 -0
- package/express/src/modules/auth/controllers/auth.ts +254 -0
- package/express/src/modules/auth/controllers/{role.controller.ts → role.ts} +25 -15
- package/{hono/src/modules/auth/database/models/notifications.ts → express/src/modules/auth/database/models/notification.ts} +1 -1
- package/express/src/modules/auth/database/models/role.ts +1 -1
- package/express/src/modules/auth/database/models/user.ts +1 -1
- package/express/src/modules/auth/facade.ts +12 -0
- package/express/src/modules/auth/{controllers/auth.helpers.ts → helpers/auth.ts} +3 -4
- package/express/src/modules/auth/jobs/registeruser.ts +23 -23
- package/express/src/modules/auth/routes/{api.ts → index.ts} +150 -150
- package/express/src/modules/auth/routes/role.ts +33 -33
- package/{hono/src/modules/auth/controllers/auth.schema.ts → express/src/modules/auth/schemas/auth.ts} +102 -102
- package/express/src/modules/auth/services/forgetpassword.ts +66 -0
- package/express/src/modules/auth/services/login.ts +63 -0
- package/express/src/modules/auth/services/logout.ts +25 -0
- package/express/src/modules/auth/services/logoutalldevices.ts +19 -0
- package/express/src/modules/auth/services/me.ts +31 -0
- package/express/src/modules/auth/services/refreshtoken.ts +110 -0
- package/express/src/modules/auth/services/register.ts +141 -0
- package/express/src/modules/auth/services/resetpassword.ts +69 -0
- package/express/src/modules/auth/services/verifyemail.ts +77 -0
- package/express/src/modules/auth/types/auth.ts +31 -0
- package/express/src/resources/src/assets/images/logo.png +0 -0
- package/express/src/resources/src/pages/auth/forgetPassword.vue +1 -0
- package/express/src/resources/src/pages/auth/login.vue +1 -1
- package/express/src/storage/database/nexwire.sqlite +0 -0
- package/hono/README.md +13 -7
- package/hono/package.json +1 -1
- package/hono/src/config/session.ts +1 -1
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
- package/hono/src/database/migrations/sqlite/meta/_journal.json +1 -1
- package/hono/src/database/schema.ts +3 -3
- package/hono/src/framework/cache/cache.ts +82 -81
- package/hono/src/framework/database/seed.ts +1 -1
- package/hono/src/framework/http/app.ts +5 -5
- package/hono/src/framework/http/validation.ts +21 -21
- package/hono/src/framework/maker-cli/middleware/core.mjs +40 -46
- package/hono/src/framework/maker-cli/module/core.mjs +401 -168
- package/hono/src/framework/maker-cli/module/index.mjs +73 -11
- package/hono/src/framework/maker-cli/stubs/controller/openapi.ts.stub +28 -16
- package/hono/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +28 -17
- package/hono/src/framework/maker-cli/stubs/controller/plain.ts.stub +28 -16
- package/hono/src/framework/maker-cli/stubs/controller/standalone.ts.stub +56 -0
- package/hono/src/framework/maker-cli/stubs/facade/name.ts.stub +12 -0
- package/hono/src/framework/maker-cli/stubs/helper/name.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/middleware/name.local.ts.stub +15 -0
- package/hono/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -8
- package/hono/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -8
- package/hono/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -8
- package/hono/src/framework/maker-cli/stubs/notification/route.api.ts.stub +49 -49
- package/hono/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +11 -11
- package/hono/src/framework/maker-cli/stubs/route/api.ts.stub +93 -79
- package/hono/src/framework/maker-cli/stubs/route/plain.ts.stub +23 -10
- package/hono/src/framework/maker-cli/stubs/route/standalone.api.ts.stub +112 -0
- package/hono/src/framework/maker-cli/stubs/route/standalone.plain.ts.stub +37 -0
- package/hono/src/framework/maker-cli/stubs/{controller/schema.plain.ts.stub → schema/name.plain.ts.stub} +13 -13
- package/hono/src/framework/maker-cli/stubs/{controller/schema.ts.stub → schema/name.ts.stub} +32 -32
- package/hono/src/framework/maker-cli/stubs/service/name.plain.ts.stub +67 -0
- package/hono/src/framework/maker-cli/stubs/service/name.ts.stub +65 -0
- package/hono/src/framework/maker-cli/stubs/type/name.ts.stub +22 -0
- package/hono/src/framework/maker-cli/utils/naming.mjs +56 -13
- package/hono/src/framework/modules/discover.ts +57 -54
- package/hono/src/framework/notification/index.ts +1 -1
- package/hono/src/framework/realtime/broadcast.ts +46 -46
- package/hono/src/framework/server.ts +1 -1
- package/hono/src/framework/session/session.ts +121 -116
- package/hono/src/middlewares/auth-middleware.ts +1 -1
- package/hono/src/modules/auth/__tests__/forgetpass.test.ts +170 -0
- package/hono/src/modules/auth/__tests__/login.test.ts +154 -0
- package/hono/src/modules/auth/__tests__/logout.test.ts +53 -0
- package/hono/src/modules/auth/__tests__/logoutalldevices.test.ts +34 -0
- package/hono/src/modules/auth/__tests__/me.test.ts +87 -0
- package/hono/src/modules/auth/__tests__/refreshtoken.test.ts +305 -0
- package/hono/src/modules/auth/__tests__/register.test.ts +258 -0
- package/hono/src/modules/auth/__tests__/resetpass.test.ts +214 -0
- package/hono/src/modules/auth/__tests__/verifyemail.test.ts +189 -0
- package/hono/src/modules/auth/controllers/auth.ts +238 -0
- package/hono/src/modules/auth/controllers/{role.controller.ts → role.ts} +25 -25
- package/{express/src/modules/auth/database/models/notifications.ts → hono/src/modules/auth/database/models/notification.ts} +1 -1
- package/hono/src/modules/auth/database/models/role.ts +1 -1
- package/hono/src/modules/auth/database/models/user.ts +1 -1
- package/hono/src/modules/auth/facade.ts +12 -0
- package/hono/src/modules/auth/{controllers/auth.helpers.ts → helpers/auth.ts} +5 -6
- package/hono/src/modules/auth/jobs/registeruser.ts +23 -23
- package/hono/src/modules/auth/routes/{api.ts → index.ts} +150 -150
- package/hono/src/modules/auth/routes/role.ts +33 -33
- package/{express/src/modules/auth/controllers/auth.schema.ts → hono/src/modules/auth/schemas/auth.ts} +102 -102
- package/hono/src/modules/auth/services/forgetpassword.ts +58 -0
- package/hono/src/modules/auth/services/login.ts +61 -0
- package/hono/src/modules/auth/services/logout.ts +24 -0
- package/hono/src/modules/auth/services/logoutalldevices.ts +19 -0
- package/hono/src/modules/auth/services/me.ts +31 -0
- package/hono/src/modules/auth/services/refreshtoken.ts +110 -0
- package/hono/src/modules/auth/services/register.ts +132 -0
- package/hono/src/modules/auth/services/resetpassword.ts +69 -0
- package/hono/src/modules/auth/services/verifyemail.ts +77 -0
- package/hono/src/modules/auth/types/auth.ts +31 -0
- package/hono/src/resources/src/assets/images/logo.png +0 -0
- package/hono/src/storage/database/nexwire.sqlite +0 -0
- package/package.json +1 -1
- package/express/src/framework/maker-cli/stubs/example/console.ts.stub +0 -34
- package/express/src/framework/maker-cli/stubs/example/controller.ts.stub +0 -418
- package/express/src/framework/maker-cli/stubs/example/job.ts.stub +0 -75
- package/express/src/framework/maker-cli/stubs/example/route.api.ts.stub +0 -207
- package/express/src/framework/maker-cli/stubs/example/route.plain.ts.stub +0 -18
- package/express/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +0 -42
- package/express/src/framework/maker-cli/stubs/example/schema.ts.stub +0 -42
- package/express/src/modules/auth/controllers/auth.controller.ts +0 -358
- package/hono/src/framework/maker-cli/stubs/example/console.ts.stub +0 -34
- package/hono/src/framework/maker-cli/stubs/example/controller.ts.stub +0 -505
- package/hono/src/framework/maker-cli/stubs/example/job.ts.stub +0 -75
- package/hono/src/framework/maker-cli/stubs/example/route.api.ts.stub +0 -207
- package/hono/src/framework/maker-cli/stubs/example/route.plain.ts.stub +0 -18
- package/hono/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +0 -42
- package/hono/src/framework/maker-cli/stubs/example/schema.ts.stub +0 -42
- package/hono/src/modules/auth/controllers/auth.controller.ts +0 -413
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { createRoute, createRouter, HttpStatusCodes, jsonContent, z } from "@/framework/facade.js";
|
|
2
|
-
import { env } from "@/env.js";
|
|
3
|
-
import { downloadGenerated, downloadGeneratedExcel, downloadGeneratedPdf, fire, fireBroadcast, fireQueued, fireQueuedBroadcast, generateDownload, generateExcelDownload, generatePdfDownload, importExcel, queueCommand, upload } from "@/modules/{{module}}/controllers/{{module}}.controller.js";
|
|
4
|
-
import { DownloadTokenSchema, ExcelDownloadRequestSchema, ExampleEventSchema, PdfGenerateAcceptedSchema, PdfGenerateRequestSchema, QueueCommandRequestSchema, UploadResponseSchema } from "@/modules/{{module}}/controllers/{{module}}.schema.js";
|
|
5
|
-
|
|
6
|
-
const eventRoute = createRoute({
|
|
7
|
-
path: "/event",
|
|
8
|
-
method: "post",
|
|
9
|
-
tags: ["Examples"],
|
|
10
|
-
request: {
|
|
11
|
-
body: jsonContent(ExampleEventSchema, "Examples event payload")
|
|
12
|
-
},
|
|
13
|
-
responses: {
|
|
14
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(z.object({ message: z.string(), data: ExampleEventSchema }), "Event accepted")
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const queueCommandRoute = createRoute({
|
|
19
|
-
path: "/queue/command",
|
|
20
|
-
method: "post",
|
|
21
|
-
tags: ["Examples"],
|
|
22
|
-
request: {
|
|
23
|
-
body: jsonContent(QueueCommandRequestSchema, "Queue command payload")
|
|
24
|
-
},
|
|
25
|
-
responses: {
|
|
26
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(z.object({ message: z.string(), data: QueueCommandRequestSchema }), "Queue command dispatched")
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const queuedEventRoute = createRoute({
|
|
31
|
-
path: "/event/queued",
|
|
32
|
-
method: "post",
|
|
33
|
-
tags: ["Examples"],
|
|
34
|
-
request: {
|
|
35
|
-
body: jsonContent(ExampleEventSchema, "Queued event payload")
|
|
36
|
-
},
|
|
37
|
-
responses: {
|
|
38
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(z.object({ message: z.string(), data: ExampleEventSchema }), "Queued event accepted")
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const queuedBroadcastEventRoute = createRoute({
|
|
43
|
-
path: "/event/queued-broadcast",
|
|
44
|
-
method: "post",
|
|
45
|
-
tags: ["Examples"],
|
|
46
|
-
request: {
|
|
47
|
-
body: jsonContent(ExampleEventSchema, "Queued broadcast event payload")
|
|
48
|
-
},
|
|
49
|
-
responses: {
|
|
50
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(z.object({ message: z.string(), data: ExampleEventSchema }), "Queued broadcast event accepted")
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const broadcastRoute = createRoute({
|
|
55
|
-
path: "/event/broadcast",
|
|
56
|
-
method: "post",
|
|
57
|
-
tags: ["Examples"],
|
|
58
|
-
responses: {
|
|
59
|
-
[HttpStatusCodes.OK]: jsonContent(z.object({
|
|
60
|
-
message: z.string(),
|
|
61
|
-
data: z.object({ message: z.string(), firedAt: z.string() })
|
|
62
|
-
}), "Broadcast event dispatched")
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const uploadRoute = createRoute({
|
|
67
|
-
path: "/upload",
|
|
68
|
-
method: "post",
|
|
69
|
-
tags: ["Examples"],
|
|
70
|
-
request: {
|
|
71
|
-
body: {
|
|
72
|
-
content: {
|
|
73
|
-
"multipart/form-data": {
|
|
74
|
-
schema: z.object({ file: z.any().openapi({ type: "string", format: "binary" }) })
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
responses: {
|
|
80
|
-
[HttpStatusCodes.OK]: {
|
|
81
|
-
description: "File uploaded",
|
|
82
|
-
content: { "application/json": { schema: UploadResponseSchema } }
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const importExcelRoute = createRoute({
|
|
88
|
-
path: "/import/excel",
|
|
89
|
-
method: "post",
|
|
90
|
-
tags: ["Examples"],
|
|
91
|
-
request: {
|
|
92
|
-
body: {
|
|
93
|
-
content: {
|
|
94
|
-
"multipart/form-data": {
|
|
95
|
-
schema: z.object({ file: z.any().openapi({ type: "string", format: "binary" }) })
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
responses: {
|
|
101
|
-
[HttpStatusCodes.OK]: jsonContent(z.object({
|
|
102
|
-
message: z.string(),
|
|
103
|
-
data: z.object({
|
|
104
|
-
sheetName: z.string(),
|
|
105
|
-
headers: z.array(z.string()),
|
|
106
|
-
totalRows: z.number(),
|
|
107
|
-
preview: z.array(z.record(z.string(), z.union([z.string(), z.number(), z.null()])))
|
|
108
|
-
})
|
|
109
|
-
}), "Excel import preview")
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
const generateDownloadRoute = createRoute({
|
|
114
|
-
path: "/download/generate",
|
|
115
|
-
method: "post",
|
|
116
|
-
tags: ["Examples"],
|
|
117
|
-
responses: {
|
|
118
|
-
[HttpStatusCodes.OK]: jsonContent(DownloadTokenSchema, "Temporary download token")
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const downloadRoute = createRoute({
|
|
123
|
-
path: "/download/{token}",
|
|
124
|
-
method: "get",
|
|
125
|
-
tags: ["Examples"],
|
|
126
|
-
request: {
|
|
127
|
-
params: z.object({ token: z.string() })
|
|
128
|
-
},
|
|
129
|
-
responses: {
|
|
130
|
-
[HttpStatusCodes.OK]: { description: "Downloads generated file and deletes it" },
|
|
131
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(z.object({ message: z.string() }), "Invalid token")
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
const generateExcelRoute = createRoute({
|
|
136
|
-
path: "/download/excel/generate",
|
|
137
|
-
method: "post",
|
|
138
|
-
tags: ["Examples"],
|
|
139
|
-
request: {
|
|
140
|
-
body: jsonContent(ExcelDownloadRequestSchema, "Excel generation payload")
|
|
141
|
-
},
|
|
142
|
-
responses: {
|
|
143
|
-
[HttpStatusCodes.OK]: jsonContent(DownloadTokenSchema, "Excel temporary download token")
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
const downloadExcelRoute = createRoute({
|
|
148
|
-
path: "/download/excel/{token}",
|
|
149
|
-
method: "get",
|
|
150
|
-
tags: ["Examples"],
|
|
151
|
-
request: {
|
|
152
|
-
params: z.object({ token: z.string() })
|
|
153
|
-
},
|
|
154
|
-
responses: {
|
|
155
|
-
[HttpStatusCodes.OK]: { description: "Downloads generated Excel file and deletes it" },
|
|
156
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(z.object({ message: z.string() }), "Invalid token")
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
const generatePdfRoute = createRoute({
|
|
161
|
-
path: "/download/pdf/generate",
|
|
162
|
-
method: "post",
|
|
163
|
-
tags: ["Examples"],
|
|
164
|
-
request: {
|
|
165
|
-
body: jsonContent(PdfGenerateRequestSchema, "Hybrid PDF generation payload")
|
|
166
|
-
},
|
|
167
|
-
responses: {
|
|
168
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(PdfGenerateAcceptedSchema, "Queued or inline PDF response")
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const downloadPdfRoute = createRoute({
|
|
173
|
-
path: "/download/pdf/{requestId}",
|
|
174
|
-
method: "get",
|
|
175
|
-
tags: ["Examples"],
|
|
176
|
-
request: {
|
|
177
|
-
params: z.object({ requestId: z.string() })
|
|
178
|
-
},
|
|
179
|
-
responses: {
|
|
180
|
-
[HttpStatusCodes.OK]: { description: "Downloads generated PDF" },
|
|
181
|
-
[HttpStatusCodes.ACCEPTED]: jsonContent(z.object({ message: z.string(), state: z.string() }), "Still generating"),
|
|
182
|
-
[HttpStatusCodes.NOT_FOUND]: jsonContent(z.object({ message: z.string() }), "Unknown request")
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
const enabled = env.ENABLE_EXAMPLES;
|
|
187
|
-
const router = createRouter();
|
|
188
|
-
|
|
189
|
-
if (enabled) {
|
|
190
|
-
router
|
|
191
|
-
.api(eventRoute, fire)
|
|
192
|
-
.api(queueCommandRoute, queueCommand)
|
|
193
|
-
.api(queuedEventRoute, fireQueued)
|
|
194
|
-
.api(queuedBroadcastEventRoute, fireQueuedBroadcast)
|
|
195
|
-
.api(broadcastRoute, fireBroadcast)
|
|
196
|
-
.api(uploadRoute, upload)
|
|
197
|
-
.api(importExcelRoute, importExcel)
|
|
198
|
-
.api(generateDownloadRoute, generateDownload)
|
|
199
|
-
.api(downloadRoute, downloadGenerated)
|
|
200
|
-
.api(generateExcelRoute, generateExcelDownload)
|
|
201
|
-
.api(downloadExcelRoute, downloadGeneratedExcel)
|
|
202
|
-
.api(generatePdfRoute, generatePdfDownload)
|
|
203
|
-
.api(downloadPdfRoute, downloadGeneratedPdf);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export default router;
|
|
207
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { group } from "@/framework/facade.js";
|
|
2
|
-
import { downloadGenerated, downloadGeneratedExcel, downloadGeneratedPdf, fire, fireBroadcast, fireQueued, fireQueuedBroadcast, generateDownload, generateExcelDownload, generatePdfDownload, importExcel, queueCommand, upload } from "@/modules/{{module}}/controllers/{{module}}.controller.js";
|
|
3
|
-
|
|
4
|
-
export default group()
|
|
5
|
-
.post("/event", fire)
|
|
6
|
-
.post("/queue/command", queueCommand)
|
|
7
|
-
.post("/event/queued", fireQueued)
|
|
8
|
-
.post("/event/queued-broadcast", fireQueuedBroadcast)
|
|
9
|
-
.post("/event/broadcast", fireBroadcast)
|
|
10
|
-
.post("/upload", upload)
|
|
11
|
-
.post("/import/excel", importExcel)
|
|
12
|
-
.post("/download/generate", generateDownload)
|
|
13
|
-
.get("/download/:token", downloadGenerated)
|
|
14
|
-
.post("/download/excel/generate", generateExcelDownload)
|
|
15
|
-
.get("/download/excel/:token", downloadGeneratedExcel)
|
|
16
|
-
.post("/download/pdf/generate", generatePdfDownload)
|
|
17
|
-
.get("/download/pdf/:requestId", downloadGeneratedPdf);
|
|
18
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "@/framework/facade.js";
|
|
2
|
-
|
|
3
|
-
export const ExampleEventSchema = z.object({
|
|
4
|
-
message: z.string(),
|
|
5
|
-
waitSeconds: z.number().optional()
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const UploadResponseSchema = z.object({
|
|
9
|
-
message: z.string(),
|
|
10
|
-
path: z.string(),
|
|
11
|
-
url: z.string()
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const DownloadTokenSchema = z.object({
|
|
15
|
-
message: z.string(),
|
|
16
|
-
token: z.string(),
|
|
17
|
-
downloadUrl: z.string()
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const ExcelDownloadRequestSchema = z.object({
|
|
21
|
-
title: z.string().min(2).max(100).default("Example Report")
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const QueueCommandRequestSchema = z.object({
|
|
25
|
-
message: z.string(),
|
|
26
|
-
waitSeconds: z.number().optional()
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const PdfGenerateRequestSchema = z.object({
|
|
30
|
-
title: z.string().min(2).max(100).default("Example PDF Report"),
|
|
31
|
-
rows: z.number().int().min(50).max(20000).default(1000),
|
|
32
|
-
chunkSize: z.number().int().min(50).max(1000).default(250)
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const PdfGenerateAcceptedSchema = z.object({
|
|
36
|
-
message: z.string(),
|
|
37
|
-
requestId: z.string(),
|
|
38
|
-
mode: z.enum(["queued", "inline"]),
|
|
39
|
-
statusUrl: z.string(),
|
|
40
|
-
downloadUrl: z.string()
|
|
41
|
-
});
|
|
42
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
export const ExampleEventSchema = z.object({
|
|
4
|
-
message: z.string(),
|
|
5
|
-
waitSeconds: z.number().optional()
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const UploadResponseSchema = z.object({
|
|
9
|
-
message: z.string(),
|
|
10
|
-
path: z.string(),
|
|
11
|
-
url: z.string()
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const DownloadTokenSchema = z.object({
|
|
15
|
-
message: z.string(),
|
|
16
|
-
token: z.string(),
|
|
17
|
-
downloadUrl: z.string()
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export const ExcelDownloadRequestSchema = z.object({
|
|
21
|
-
title: z.string().min(2).max(100).default("Example Report")
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const QueueCommandRequestSchema = z.object({
|
|
25
|
-
message: z.string(),
|
|
26
|
-
waitSeconds: z.number().optional()
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const PdfGenerateRequestSchema = z.object({
|
|
30
|
-
title: z.string().min(2).max(100).default("Example PDF Report"),
|
|
31
|
-
rows: z.number().int().min(50).max(20000).default(1000),
|
|
32
|
-
chunkSize: z.number().int().min(50).max(1000).default(250)
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const PdfGenerateAcceptedSchema = z.object({
|
|
36
|
-
message: z.string(),
|
|
37
|
-
requestId: z.string(),
|
|
38
|
-
mode: z.enum(["queued", "inline"]),
|
|
39
|
-
statusUrl: z.string(),
|
|
40
|
-
downloadUrl: z.string()
|
|
41
|
-
});
|
|
42
|
-
|