gg-express 1.0.156 → 1.0.157

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/main.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import GGExpressV2 from "./v2/GGExpressV2";
2
1
  import GGExpressV3 from "./v3/GGExpressV3";
3
- export { GGExpressV2, GGExpressV3 };
2
+ export { GGExpressV3 };
3
+ export default GGExpressV3;
package/dist/main.js CHANGED
@@ -3,9 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GGExpressV3 = exports.GGExpressV2 = void 0;
7
- // import GGExpress from "./GGExpress"
8
- const GGExpressV2_1 = __importDefault(require("./v2/GGExpressV2"));
9
- exports.GGExpressV2 = GGExpressV2_1.default;
6
+ exports.GGExpressV3 = void 0;
10
7
  const GGExpressV3_1 = __importDefault(require("./v3/GGExpressV3"));
11
8
  exports.GGExpressV3 = GGExpressV3_1.default;
9
+ exports.default = GGExpressV3_1.default;
@@ -91,7 +91,7 @@ class GGExpressV3 {
91
91
  generateAPIFiles() {
92
92
  return __awaiter(this, void 0, void 0, function* () {
93
93
  yield this.generateStaticRouteFile();
94
- console.log(`GGExpressV2.ts : ${this.appName} - generate staticRoute done.`);
94
+ console.log(`GGExpressV3.ts : ${this.appName} - generate staticRoute done.`);
95
95
  });
96
96
  }
97
97
  generateStaticRouteFile() {
package/dist/v3/test.js CHANGED
@@ -131,7 +131,7 @@ function run() {
131
131
  console.log(error);
132
132
  });
133
133
  // api
134
- // .get("/api/v2/hotel/users/id", {
134
+ // .get("/api/v3/hotel/users/id", {
135
135
  // data: {
136
136
  // name: "tin",
137
137
  // age: 31,
@@ -139,7 +139,7 @@ function run() {
139
139
  // })
140
140
  // .catch((error) => {})
141
141
  // api
142
- // .get("/api/v2/hotel/users/empty", {
142
+ // .get("/api/v3/hotel/users/empty", {
143
143
  // data: {},
144
144
  // })
145
145
  // .catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-express",
3
- "version": "1.0.156",
3
+ "version": "1.0.157",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {
package/src/main.ts CHANGED
@@ -1,4 +1,4 @@
1
- // import GGExpress from "./GGExpress"
2
- import GGExpressV2 from "./v2/GGExpressV2"
3
1
  import GGExpressV3 from "./v3/GGExpressV3"
4
- export { GGExpressV2, GGExpressV3 }
2
+
3
+ export { GGExpressV3 }
4
+ export default GGExpressV3
@@ -238,7 +238,7 @@ export default class GGExpressV3<
238
238
 
239
239
  public async generateAPIFiles() {
240
240
  await this.generateStaticRouteFile()
241
- console.log(`GGExpressV2.ts : ${this.appName} - generate staticRoute done.`)
241
+ console.log(`GGExpressV3.ts : ${this.appName} - generate staticRoute done.`)
242
242
  }
243
243
 
244
244
  private async generateStaticRouteFile() {
@@ -1,6 +1,5 @@
1
1
  import z from "zod"
2
2
  import { Method, RequestStructure } from "./GGExpressV3"
3
- import { ConstSchemaType, CustomType } from "../v2/typeResolver"
4
3
  import { createAuxiliaryTypeStore, zodToTs } from "zod-to-ts"
5
4
  import ts from "typescript"
6
5
 
package/src/v3/test.ts CHANGED
@@ -131,7 +131,7 @@ function run() {
131
131
  console.log(error)
132
132
  })
133
133
  // api
134
- // .get("/api/v2/hotel/users/id", {
134
+ // .get("/api/v3/hotel/users/id", {
135
135
  // data: {
136
136
  // name: "tin",
137
137
  // age: 31,
@@ -139,7 +139,7 @@ function run() {
139
139
  // })
140
140
  // .catch((error) => {})
141
141
  // api
142
- // .get("/api/v2/hotel/users/empty", {
142
+ // .get("/api/v3/hotel/users/empty", {
143
143
  // data: {},
144
144
  // })
145
145
  // .catch((error) => {
package/src/GGApi.ts DELETED
@@ -1,91 +0,0 @@
1
- import axios from "axios"
2
- import { staticRouteInterface } from "./staticRouteInterface"
3
-
4
- export class GGApi {
5
- constructor() {}
6
-
7
- get<T extends keyof staticRouteInterface["get"]>(
8
- url: T,
9
- requireParams: staticRouteInterface["get"][T]["requireParams"]
10
- ): Promise<staticRouteInterface["get"][T]["responseStructure"]> {
11
- return new Promise((resolve, reject) => {
12
- axios
13
- .get(url as string, { params: { data: requireParams } })
14
- .then((response) => {
15
- resolve(response.data)
16
- })
17
- .catch((error) => {
18
- reject(error)
19
- })
20
- })
21
- }
22
-
23
- post<T extends keyof staticRouteInterface["post"]>(
24
- url: T,
25
- requireParams: staticRouteInterface["post"][T]["requireParams"]
26
- ): Promise<staticRouteInterface["post"][T]["responseStructure"]> {
27
- return new Promise((resolve, reject) => {
28
- axios
29
- .post(url as string, { data: requireParams })
30
- .then((response) => {
31
- resolve(response.data)
32
- })
33
- .catch((error) => {
34
- reject(error)
35
- })
36
- })
37
- }
38
- put<T extends keyof staticRouteInterface["put"]>(
39
- url: T,
40
- requireParams: staticRouteInterface["put"][T]["requireParams"]
41
- ): Promise<staticRouteInterface["put"][T]["responseStructure"]> {
42
- return new Promise((resolve, reject) => {
43
- axios
44
- .put(url as string, { data: requireParams })
45
- .then((response) => {
46
- resolve(response.data)
47
- })
48
- .catch((error) => {
49
- reject(error)
50
- })
51
- })
52
- }
53
- delete<T extends keyof staticRouteInterface["delete"]>(
54
- url: T,
55
- requireParams: staticRouteInterface["delete"][T]["requireParams"]
56
- ): Promise<staticRouteInterface["delete"][T]["responseStructure"]> {
57
- return new Promise((resolve, reject) => {
58
- axios
59
- .delete(url as string, { data: { data: requireParams } })
60
- .then((response) => {
61
- resolve(response.data)
62
- })
63
- .catch((error) => {
64
- reject(error)
65
- })
66
- })
67
- }
68
- }
69
-
70
- async function run() {
71
- const api = new GGApi()
72
- // const data = await api.post("/api/item", {
73
- // parameter: { lotNumber: 1223 },
74
- // data: [],
75
- // })
76
-
77
- // const data2 = await api.get(
78
- // ("http://localhost:3002" + "/api/users/id") as any,
79
- // {
80
- // data: [{ id: 2 }, { id: 3 }, { id: 20 }],
81
- // }
82
- // )
83
- const data2 = await api.get("/api/gg/users/id", { data: [{ id: 2 }] })
84
- api.post("/api/gg/item", {
85
- data: { id: 1, name: "item-1", price: 2 },
86
- parameter: {
87
- lotNumber: 2,
88
- },
89
- })
90
- }
91
- run()