1 files changed, 74 insertions, 0 deletions
diff --git a/src/api/RouteDescription.js b/src/api/RouteDescription.js
new file mode 100644
index 0000000..6ca426b
--- /dev/null
+++ b/src/api/RouteDescription.js
@@ -0,0 +1,74 @@
+export class RouteDescription {
+ path;
+ /**
+ * @type {RouteMethodList}
+ */
+ methods;
+
+ /**
+ * @param data {RouteDescription}
+ */
+ constructor(data) {
+ for (const key of Object.keys(data)) {
+ this[key] = data[key];
+ }
+ }
+}
+
+export class RouteMethodList {
+ /**
+ * @type {RouteMethod}
+ */
+ get;
+ /**
+ * @type {RouteMethod}
+ */
+ post;
+ /**
+ * @type {RouteMethod}
+ */
+ put;
+ /**
+ * @type {RouteMethod}
+ */
+ delete;
+ /**
+ * @type {RouteMethod}
+ */
+ patch;
+
+ /**
+ * @param data {RouteMethodList}
+ */
+ constructor(data) {
+ for (const key of Object.keys(data)) {
+ this[key] = data[key];
+ }
+ }
+}
+
+export class RouteMethod {
+ /**
+ * @type {Array<Promise>}
+ */
+ middlewares = [];
+ /**
+ * @type {Promise}
+ */
+ method;
+
+ description;
+
+ exampleBody;
+
+ /**
+ * @param data {RouteMethod}
+ */
+ constructor(data) {
+ for (const key of Object.keys(data)) {
+ this[key] = data[key];
+ }
+
+ if (!Array.isArray(this.middlewares)) this.middlewares = [];
+ }
+}
|