move openapi out of src dir
Adapted from #3579 by @gorkem-bwl. The openapi/registry, helpers, and per-resource routes/* files are largely their work; this commit relocates the directory out of src/ so the build-time generator code is not emitted into dist/, and shifts spec generation from runtime to a build step. Co-authored-by: gorkem-bwl <gorkem.cetin@bluewavelabs.ca>
This commit is contained in:
1 parent
28baeaf218
commit
3f9019f34c
22 files changed
+11259
-3944
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { registry } from "../registry.js";
|
||||
import { bearer, json, okJsonNoData, okUnknown, standardErrors } from "../helpers.js";
|
||||
import { updateAppSettingsBodyValidation } from "@/validation/settingsValidation.js";
|
||||
import { sendTestEmailBodyValidation } from "@/validation/notificationValidation.js";
|
||||
|
||||
const tags = ["settings"];
|
||||
|
||||
registry.registerPath({
|
||||
method: "get",
|
||||
path: "/settings",
|
||||
tags,
|
||||
summary: "Get application settings",
|
||||
security: bearer,
|
||||
responses: { "200": okUnknown, ...standardErrors },
|
||||
});
|
||||
|
||||
registry.registerPath({
|
||||
method: "patch",
|
||||
path: "/settings",
|
||||
tags,
|
||||
summary: "Update application settings (admin/superadmin)",
|
||||
security: bearer,
|
||||
request: { body: { content: json(updateAppSettingsBodyValidation) } },
|
||||
responses: { "200": okUnknown, ...standardErrors },
|
||||
});
|
||||
|
||||
registry.registerPath({
|
||||
method: "post",
|
||||
path: "/settings/test-email",
|
||||
tags,
|
||||
summary: "Send a test email using current SMTP settings (admin/superadmin)",
|
||||
security: bearer,
|
||||
request: { body: { content: json(sendTestEmailBodyValidation) } },
|
||||
responses: { "200": okJsonNoData(), ...standardErrors },
|
||||
});
|
||||
Reference in new issue
Block a user