gg-express 1.0.90 → 1.0.91
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/GGExpress.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from "express";
|
|
2
2
|
import Express from "express-serve-static-core";
|
|
3
3
|
type Unarray<T> = T extends (infer U)[] ? U : T;
|
|
4
|
-
type
|
|
4
|
+
type InputEnum = readonly string[] | readonly number[];
|
|
5
|
+
type paramType = "number" | "string" | "any" | string[] | number[] | InputEnum;
|
|
5
6
|
interface responseStructure {
|
|
6
7
|
parameter: {
|
|
7
8
|
[key: string]: "number" | "string";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const hotel_model_const_temp: {
|
|
2
|
+
readonly booking: {
|
|
3
|
+
readonly id: "number";
|
|
4
|
+
readonly bookingGroupID: "number";
|
|
5
|
+
readonly checkInDate: "string";
|
|
6
|
+
readonly checkOutDate: "string";
|
|
7
|
+
readonly checkInTime: "string";
|
|
8
|
+
readonly checkOutTime: "string";
|
|
9
|
+
readonly roomRate: "number";
|
|
10
|
+
readonly extraBedRate: "number";
|
|
11
|
+
readonly roomNumber: "string";
|
|
12
|
+
readonly editTime: "string";
|
|
13
|
+
readonly createTime: "string";
|
|
14
|
+
readonly shiftDate: "string";
|
|
15
|
+
readonly shiftName: "string";
|
|
16
|
+
readonly userName: "string";
|
|
17
|
+
readonly bookingStatus: readonly ["ACTIVE", "CLOSE", "CANCEL", "NO_SHOW"];
|
|
18
|
+
readonly is_specificRoom: "number";
|
|
19
|
+
readonly guestCount: "number";
|
|
20
|
+
readonly reasonToCancel: "string";
|
|
21
|
+
readonly note: "string";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hotel_model_const_temp = void 0;
|
|
4
|
+
exports.hotel_model_const_temp = {
|
|
5
|
+
booking: {
|
|
6
|
+
id: "number",
|
|
7
|
+
bookingGroupID: "number",
|
|
8
|
+
checkInDate: "string",
|
|
9
|
+
checkOutDate: "string",
|
|
10
|
+
checkInTime: "string",
|
|
11
|
+
checkOutTime: "string",
|
|
12
|
+
roomRate: "number",
|
|
13
|
+
extraBedRate: "number",
|
|
14
|
+
roomNumber: "string",
|
|
15
|
+
editTime: "string",
|
|
16
|
+
createTime: "string",
|
|
17
|
+
shiftDate: "string",
|
|
18
|
+
shiftName: "string",
|
|
19
|
+
userName: "string",
|
|
20
|
+
bookingStatus: ["ACTIVE", "CLOSE", "CANCEL", "NO_SHOW"],
|
|
21
|
+
is_specificRoom: "number",
|
|
22
|
+
guestCount: "number",
|
|
23
|
+
reasonToCancel: "string",
|
|
24
|
+
note: "string",
|
|
25
|
+
},
|
|
26
|
+
};
|
package/dist/run.test.js
CHANGED
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const GGExpress_1 = __importDefault(require("./GGExpress"));
|
|
16
16
|
const express_1 = __importDefault(require("express"));
|
|
17
|
+
const hotel_model_const_temp_1 = require("./hotel_model_const_temp");
|
|
17
18
|
function run() {
|
|
18
19
|
const app = (0, express_1.default)();
|
|
19
20
|
const ggapp = new GGExpress_1.default(app, "hotel", ["./"]);
|
|
@@ -21,7 +22,7 @@ function run() {
|
|
|
21
22
|
requireParams: {
|
|
22
23
|
parameter: { files: "string[]" },
|
|
23
24
|
dataType: "arrayObject",
|
|
24
|
-
structure:
|
|
25
|
+
structure: hotel_model_const_temp_1.hotel_model_const_temp["booking"],
|
|
25
26
|
},
|
|
26
27
|
responseStructure: {
|
|
27
28
|
parameter: { numberOfPeople: "number", itemName: "string" },
|
|
@@ -32,7 +33,7 @@ function run() {
|
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
35
|
}, (req, res, next) => {
|
|
35
|
-
req.query.data.data.forEach((row) => row.
|
|
36
|
+
req.query.data.data.forEach((row) => row.checkInDate === "A");
|
|
36
37
|
console.log(req.query);
|
|
37
38
|
return res.json({
|
|
38
39
|
message: "",
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { removeDuplicates } from "./helperFunction"
|
|
|
7
7
|
|
|
8
8
|
type Unarray<T> = T extends (infer U)[] ? U : T
|
|
9
9
|
type AsConstArray<T extends readonly any[]> = [...T]
|
|
10
|
+
type InputEnum = readonly string[] | readonly number[]
|
|
10
11
|
type paramType =
|
|
11
12
|
| "number"
|
|
12
13
|
| "string"
|
|
@@ -15,6 +16,7 @@ type paramType =
|
|
|
15
16
|
// | AsConstArray<Array<number>>
|
|
16
17
|
| string[]
|
|
17
18
|
| number[]
|
|
19
|
+
| InputEnum
|
|
18
20
|
interface responseStructure {
|
|
19
21
|
parameter: { [key: string]: "number" | "string" }
|
|
20
22
|
dataType: "singleObject" | "arrayObject"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const hotel_model_const_temp = {
|
|
2
|
+
booking: {
|
|
3
|
+
id: "number",
|
|
4
|
+
bookingGroupID: "number",
|
|
5
|
+
checkInDate: "string",
|
|
6
|
+
checkOutDate: "string",
|
|
7
|
+
checkInTime: "string",
|
|
8
|
+
checkOutTime: "string",
|
|
9
|
+
roomRate: "number",
|
|
10
|
+
extraBedRate: "number",
|
|
11
|
+
roomNumber: "string",
|
|
12
|
+
editTime: "string",
|
|
13
|
+
createTime: "string",
|
|
14
|
+
shiftDate: "string",
|
|
15
|
+
shiftName: "string",
|
|
16
|
+
userName: "string",
|
|
17
|
+
bookingStatus: ["ACTIVE", "CLOSE", "CANCEL", "NO_SHOW"],
|
|
18
|
+
is_specificRoom: "number",
|
|
19
|
+
guestCount: "number",
|
|
20
|
+
reasonToCancel: "string",
|
|
21
|
+
note: "string",
|
|
22
|
+
},
|
|
23
|
+
} as const
|
package/src/run.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import GGExpress from "./GGExpress"
|
|
2
2
|
import express, { Express } from "express"
|
|
3
|
+
import { hotel_model_const_temp } from "./hotel_model_const_temp"
|
|
3
4
|
function run() {
|
|
4
5
|
const app = express()
|
|
5
6
|
const ggapp = new GGExpress<"hotel">(app, "hotel", ["./"])
|
|
@@ -9,7 +10,7 @@ function run() {
|
|
|
9
10
|
requireParams: {
|
|
10
11
|
parameter: { files: "string[]" },
|
|
11
12
|
dataType: "arrayObject",
|
|
12
|
-
structure:
|
|
13
|
+
structure: hotel_model_const_temp["booking"],
|
|
13
14
|
},
|
|
14
15
|
responseStructure: {
|
|
15
16
|
parameter: { numberOfPeople: "number", itemName: "string" },
|
|
@@ -21,7 +22,7 @@ function run() {
|
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
(req, res, next) => {
|
|
24
|
-
req.query.data.data.forEach((row) => row.
|
|
25
|
+
req.query.data.data.forEach((row) => row.checkInDate === "A")
|
|
25
26
|
console.log(req.query)
|
|
26
27
|
return res.json({
|
|
27
28
|
message: "",
|