phecda-server 8.2.0 → 8.3.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/dist/{chunk-MPKVT4SQ.js → chunk-R73A7HS3.js} +35 -34
- package/dist/{chunk-2P2UICBC.mjs → chunk-US2DTB3Z.mjs} +35 -34
- package/dist/{core-D1YYphEn.d.mts → core-mOKtuP0F.d.mts} +1 -1
- package/dist/{core-BTSHIAyB.d.ts → core-qL97H3d_.d.ts} +1 -1
- package/dist/helper.d.mts +1 -1
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +2 -2
- package/dist/helper.mjs +1 -1
- package/dist/http/elysia/index.d.mts +3 -3
- package/dist/http/elysia/index.d.ts +3 -3
- package/dist/http/elysia/index.js +17 -17
- package/dist/http/elysia/index.mjs +1 -1
- package/dist/http/express/index.d.mts +3 -3
- package/dist/http/express/index.d.ts +3 -3
- package/dist/http/express/index.js +16 -16
- package/dist/http/express/index.mjs +1 -1
- package/dist/http/fastify/index.d.mts +3 -3
- package/dist/http/fastify/index.d.ts +3 -3
- package/dist/http/fastify/index.js +16 -16
- package/dist/http/fastify/index.mjs +1 -1
- package/dist/http/h3/index.d.mts +3 -3
- package/dist/http/h3/index.d.ts +3 -3
- package/dist/http/h3/index.js +17 -17
- package/dist/http/h3/index.mjs +1 -1
- package/dist/http/hono/index.d.mts +3 -3
- package/dist/http/hono/index.d.ts +3 -3
- package/dist/http/hono/index.js +14 -14
- package/dist/http/hono/index.mjs +1 -1
- package/dist/http/hyper-express/index.d.mts +3 -3
- package/dist/http/hyper-express/index.d.ts +3 -3
- package/dist/http/hyper-express/index.js +15 -15
- package/dist/http/hyper-express/index.mjs +1 -1
- package/dist/http/koa/index.d.mts +3 -3
- package/dist/http/koa/index.d.ts +3 -3
- package/dist/http/koa/index.js +16 -16
- package/dist/http/koa/index.mjs +1 -1
- package/dist/index.d.mts +29 -28
- package/dist/index.d.ts +29 -28
- package/dist/index.js +20 -20
- package/dist/index.mjs +1 -1
- package/dist/{meta-DNF6Fl27.d.mts → meta-EGS-4cNY.d.mts} +1 -1
- package/dist/{meta-DNF6Fl27.d.ts → meta-EGS-4cNY.d.ts} +1 -1
- package/dist/rpc/bullmq/index.d.mts +3 -3
- package/dist/rpc/bullmq/index.d.ts +3 -3
- package/dist/rpc/bullmq/index.js +6 -6
- package/dist/rpc/bullmq/index.mjs +1 -1
- package/dist/rpc/electron/index.d.mts +3 -3
- package/dist/rpc/electron/index.d.ts +3 -3
- package/dist/rpc/electron/index.js +5 -5
- package/dist/rpc/electron/index.mjs +1 -1
- package/dist/rpc/kafka/index.d.mts +3 -3
- package/dist/rpc/kafka/index.d.ts +3 -3
- package/dist/rpc/kafka/index.js +6 -6
- package/dist/rpc/kafka/index.mjs +1 -1
- package/dist/rpc/nats/index.d.mts +3 -3
- package/dist/rpc/nats/index.d.ts +3 -3
- package/dist/rpc/nats/index.js +6 -6
- package/dist/rpc/nats/index.mjs +1 -1
- package/dist/rpc/rabbitmq/index.d.mts +3 -3
- package/dist/rpc/rabbitmq/index.d.ts +3 -3
- package/dist/rpc/rabbitmq/index.js +6 -6
- package/dist/rpc/rabbitmq/index.mjs +1 -1
- package/dist/rpc/redis/index.d.mts +3 -3
- package/dist/rpc/redis/index.d.ts +3 -3
- package/dist/rpc/redis/index.js +6 -6
- package/dist/rpc/redis/index.mjs +1 -1
- package/dist/rpc/ws/index.d.mts +3 -3
- package/dist/rpc/ws/index.d.ts +3 -3
- package/dist/rpc/ws/index.js +5 -5
- package/dist/rpc/ws/index.mjs +1 -1
- package/dist/test.d.mts +2 -2
- package/dist/test.d.ts +2 -2
- package/dist/{types-DtiHAXQB.d.mts → types-BkU6kQWV.d.mts} +1 -1
- package/dist/{types-BOZ8yE2L.d.mts → types-CoOCYe_X.d.mts} +1 -1
- package/dist/{types-Cosv4nol.d.ts → types-DGUpAXle.d.ts} +1 -1
- package/dist/{types-YJ55P7A_.d.ts → types-NkRE3d35.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -27,8 +27,9 @@ var Exception = class extends Error {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
constructor(message, metadata, status = 0, description = "Exception") {
|
|
32
|
+
super(message), this.message = message, this.metadata = metadata, this.status = status, this.description = description;
|
|
32
33
|
}
|
|
33
34
|
get data() {
|
|
34
35
|
return {
|
|
@@ -45,8 +46,8 @@ var UndefinedException = class extends Exception {
|
|
|
45
46
|
static {
|
|
46
47
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "UndefinedException");
|
|
47
48
|
}
|
|
48
|
-
constructor(message) {
|
|
49
|
-
super(message, 500, "Undefined error");
|
|
49
|
+
constructor(message, metadata) {
|
|
50
|
+
super(message, metadata, 500, "Undefined error");
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
|
|
@@ -55,8 +56,8 @@ var ValidateException = class extends Exception {
|
|
|
55
56
|
static {
|
|
56
57
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "ValidateException");
|
|
57
58
|
}
|
|
58
|
-
constructor(message) {
|
|
59
|
-
super(message, 400, "Validate exception");
|
|
59
|
+
constructor(message, metadata) {
|
|
60
|
+
super(message, metadata, 400, "Validate exception");
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -65,8 +66,8 @@ var ForbiddenException = class extends Exception {
|
|
|
65
66
|
static {
|
|
66
67
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "ForbiddenException");
|
|
67
68
|
}
|
|
68
|
-
constructor(message) {
|
|
69
|
-
super(message, 403, "Forbidden resource");
|
|
69
|
+
constructor(message, metadata) {
|
|
70
|
+
super(message, metadata, 403, "Forbidden resource");
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
|
|
@@ -75,8 +76,8 @@ var BadRequestException = class extends Exception {
|
|
|
75
76
|
static {
|
|
76
77
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "BadRequestException");
|
|
77
78
|
}
|
|
78
|
-
constructor(message) {
|
|
79
|
-
super(message, 400, "Bad Request");
|
|
79
|
+
constructor(message, metadata) {
|
|
80
|
+
super(message, metadata, 400, "Bad Request");
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
|
|
@@ -85,8 +86,8 @@ var NotFoundException = class extends Exception {
|
|
|
85
86
|
static {
|
|
86
87
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "NotFoundException");
|
|
87
88
|
}
|
|
88
|
-
constructor(message) {
|
|
89
|
-
super(message, 404, "Not Found");
|
|
89
|
+
constructor(message, metadata) {
|
|
90
|
+
super(message, metadata, 404, "Not Found");
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
|
|
@@ -95,8 +96,8 @@ var ConflictException = class extends Exception {
|
|
|
95
96
|
static {
|
|
96
97
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "ConflictException");
|
|
97
98
|
}
|
|
98
|
-
constructor(message) {
|
|
99
|
-
super(message, 409, "Conflict");
|
|
99
|
+
constructor(message, metadata) {
|
|
100
|
+
super(message, metadata, 409, "Conflict");
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
|
|
@@ -105,8 +106,8 @@ var BadGatewayException = class extends Exception {
|
|
|
105
106
|
static {
|
|
106
107
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "BadGatewayException");
|
|
107
108
|
}
|
|
108
|
-
constructor(message) {
|
|
109
|
-
super(message, 502, "Bad Gatrway");
|
|
109
|
+
constructor(message, metadata) {
|
|
110
|
+
super(message, metadata, 502, "Bad Gatrway");
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
|
|
@@ -115,8 +116,8 @@ var InvalidInputException = class extends Exception {
|
|
|
115
116
|
static {
|
|
116
117
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "InvalidInputException");
|
|
117
118
|
}
|
|
118
|
-
constructor(message) {
|
|
119
|
-
super(message, 502, "Invalid Input");
|
|
119
|
+
constructor(message, metadata) {
|
|
120
|
+
super(message, metadata, 502, "Invalid Input");
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
123
|
|
|
@@ -125,8 +126,8 @@ var UnsupportedMediaTypeException = class extends Exception {
|
|
|
125
126
|
static {
|
|
126
127
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "UnsupportedMediaTypeException");
|
|
127
128
|
}
|
|
128
|
-
constructor(message) {
|
|
129
|
-
super(message, 415, "Unsupported Media Type");
|
|
129
|
+
constructor(message, metadata) {
|
|
130
|
+
super(message, metadata, 415, "Unsupported Media Type");
|
|
130
131
|
}
|
|
131
132
|
};
|
|
132
133
|
|
|
@@ -135,8 +136,8 @@ var PayloadLargeException = class extends Exception {
|
|
|
135
136
|
static {
|
|
136
137
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "PayloadLargeException");
|
|
137
138
|
}
|
|
138
|
-
constructor(message) {
|
|
139
|
-
super(message, 413, "Payload Too Large");
|
|
139
|
+
constructor(message, metadata) {
|
|
140
|
+
super(message, metadata, 413, "Payload Too Large");
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
|
|
@@ -145,8 +146,8 @@ var TimeoutException = class extends Exception {
|
|
|
145
146
|
static {
|
|
146
147
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "TimeoutException");
|
|
147
148
|
}
|
|
148
|
-
constructor(message) {
|
|
149
|
-
super(message, 408, "Request Timeout");
|
|
149
|
+
constructor(message, metadata) {
|
|
150
|
+
super(message, metadata, 408, "Request Timeout");
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
|
|
@@ -155,8 +156,8 @@ var UnauthorizedException = class extends Exception {
|
|
|
155
156
|
static {
|
|
156
157
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "UnauthorizedException");
|
|
157
158
|
}
|
|
158
|
-
constructor(message) {
|
|
159
|
-
super(message, 401, "Unauthorized");
|
|
159
|
+
constructor(message, metadata) {
|
|
160
|
+
super(message, metadata, 401, "Unauthorized");
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
|
|
@@ -165,8 +166,8 @@ var ServiceUnavailableException = class extends Exception {
|
|
|
165
166
|
static {
|
|
166
167
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "ServiceUnavailableException");
|
|
167
168
|
}
|
|
168
|
-
constructor(message) {
|
|
169
|
-
super(message, 503, "Service Unavailable");
|
|
169
|
+
constructor(message, metadata) {
|
|
170
|
+
super(message, metadata, 503, "Service Unavailable");
|
|
170
171
|
}
|
|
171
172
|
};
|
|
172
173
|
|
|
@@ -175,8 +176,8 @@ var FrameworkException = class extends Exception {
|
|
|
175
176
|
static {
|
|
176
177
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "FrameworkException");
|
|
177
178
|
}
|
|
178
|
-
constructor(message) {
|
|
179
|
-
super(`[phecda-server] ${message}`, 500, "Framework Error");
|
|
179
|
+
constructor(message, metadata) {
|
|
180
|
+
super(`[phecda-server] ${message}`, metadata, 500, "Framework Error");
|
|
180
181
|
}
|
|
181
182
|
};
|
|
182
183
|
|
|
@@ -185,8 +186,8 @@ var TimerException = class extends Exception {
|
|
|
185
186
|
static {
|
|
186
187
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "TimerException");
|
|
187
188
|
}
|
|
188
|
-
constructor(message) {
|
|
189
|
-
super(message, 0, "Timer Error");
|
|
189
|
+
constructor(message, metadata) {
|
|
190
|
+
super(message, metadata, 0, "Timer Error");
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
193
|
|
|
@@ -195,8 +196,8 @@ var WorkerException = class extends Exception {
|
|
|
195
196
|
static {
|
|
196
197
|
_chunkOUQM7GZHjs.__name.call(void 0, this, "WorkerException");
|
|
197
198
|
}
|
|
198
|
-
constructor(message) {
|
|
199
|
-
super(message, 0, "Worker Error");
|
|
199
|
+
constructor(message, metadata) {
|
|
200
|
+
super(message, metadata, 0, "Worker Error");
|
|
200
201
|
}
|
|
201
202
|
};
|
|
202
203
|
|
|
@@ -25,10 +25,11 @@ var Exception = class extends Error {
|
|
|
25
25
|
__name(this, "Exception");
|
|
26
26
|
}
|
|
27
27
|
message;
|
|
28
|
+
metadata;
|
|
28
29
|
status;
|
|
29
30
|
description;
|
|
30
|
-
constructor(message, status = 0, description = "Exception") {
|
|
31
|
-
super(message), this.message = message, this.status = status, this.description = description;
|
|
31
|
+
constructor(message, metadata, status = 0, description = "Exception") {
|
|
32
|
+
super(message), this.message = message, this.metadata = metadata, this.status = status, this.description = description;
|
|
32
33
|
}
|
|
33
34
|
get data() {
|
|
34
35
|
return {
|
|
@@ -45,8 +46,8 @@ var UndefinedException = class extends Exception {
|
|
|
45
46
|
static {
|
|
46
47
|
__name(this, "UndefinedException");
|
|
47
48
|
}
|
|
48
|
-
constructor(message) {
|
|
49
|
-
super(message, 500, "Undefined error");
|
|
49
|
+
constructor(message, metadata) {
|
|
50
|
+
super(message, metadata, 500, "Undefined error");
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
53
|
|
|
@@ -55,8 +56,8 @@ var ValidateException = class extends Exception {
|
|
|
55
56
|
static {
|
|
56
57
|
__name(this, "ValidateException");
|
|
57
58
|
}
|
|
58
|
-
constructor(message) {
|
|
59
|
-
super(message, 400, "Validate exception");
|
|
59
|
+
constructor(message, metadata) {
|
|
60
|
+
super(message, metadata, 400, "Validate exception");
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -65,8 +66,8 @@ var ForbiddenException = class extends Exception {
|
|
|
65
66
|
static {
|
|
66
67
|
__name(this, "ForbiddenException");
|
|
67
68
|
}
|
|
68
|
-
constructor(message) {
|
|
69
|
-
super(message, 403, "Forbidden resource");
|
|
69
|
+
constructor(message, metadata) {
|
|
70
|
+
super(message, metadata, 403, "Forbidden resource");
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
|
|
@@ -75,8 +76,8 @@ var BadRequestException = class extends Exception {
|
|
|
75
76
|
static {
|
|
76
77
|
__name(this, "BadRequestException");
|
|
77
78
|
}
|
|
78
|
-
constructor(message) {
|
|
79
|
-
super(message, 400, "Bad Request");
|
|
79
|
+
constructor(message, metadata) {
|
|
80
|
+
super(message, metadata, 400, "Bad Request");
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
|
|
@@ -85,8 +86,8 @@ var NotFoundException = class extends Exception {
|
|
|
85
86
|
static {
|
|
86
87
|
__name(this, "NotFoundException");
|
|
87
88
|
}
|
|
88
|
-
constructor(message) {
|
|
89
|
-
super(message, 404, "Not Found");
|
|
89
|
+
constructor(message, metadata) {
|
|
90
|
+
super(message, metadata, 404, "Not Found");
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
|
|
@@ -95,8 +96,8 @@ var ConflictException = class extends Exception {
|
|
|
95
96
|
static {
|
|
96
97
|
__name(this, "ConflictException");
|
|
97
98
|
}
|
|
98
|
-
constructor(message) {
|
|
99
|
-
super(message, 409, "Conflict");
|
|
99
|
+
constructor(message, metadata) {
|
|
100
|
+
super(message, metadata, 409, "Conflict");
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
103
|
|
|
@@ -105,8 +106,8 @@ var BadGatewayException = class extends Exception {
|
|
|
105
106
|
static {
|
|
106
107
|
__name(this, "BadGatewayException");
|
|
107
108
|
}
|
|
108
|
-
constructor(message) {
|
|
109
|
-
super(message, 502, "Bad Gatrway");
|
|
109
|
+
constructor(message, metadata) {
|
|
110
|
+
super(message, metadata, 502, "Bad Gatrway");
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
|
|
@@ -115,8 +116,8 @@ var InvalidInputException = class extends Exception {
|
|
|
115
116
|
static {
|
|
116
117
|
__name(this, "InvalidInputException");
|
|
117
118
|
}
|
|
118
|
-
constructor(message) {
|
|
119
|
-
super(message, 502, "Invalid Input");
|
|
119
|
+
constructor(message, metadata) {
|
|
120
|
+
super(message, metadata, 502, "Invalid Input");
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
123
|
|
|
@@ -125,8 +126,8 @@ var UnsupportedMediaTypeException = class extends Exception {
|
|
|
125
126
|
static {
|
|
126
127
|
__name(this, "UnsupportedMediaTypeException");
|
|
127
128
|
}
|
|
128
|
-
constructor(message) {
|
|
129
|
-
super(message, 415, "Unsupported Media Type");
|
|
129
|
+
constructor(message, metadata) {
|
|
130
|
+
super(message, metadata, 415, "Unsupported Media Type");
|
|
130
131
|
}
|
|
131
132
|
};
|
|
132
133
|
|
|
@@ -135,8 +136,8 @@ var PayloadLargeException = class extends Exception {
|
|
|
135
136
|
static {
|
|
136
137
|
__name(this, "PayloadLargeException");
|
|
137
138
|
}
|
|
138
|
-
constructor(message) {
|
|
139
|
-
super(message, 413, "Payload Too Large");
|
|
139
|
+
constructor(message, metadata) {
|
|
140
|
+
super(message, metadata, 413, "Payload Too Large");
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
|
|
@@ -145,8 +146,8 @@ var TimeoutException = class extends Exception {
|
|
|
145
146
|
static {
|
|
146
147
|
__name(this, "TimeoutException");
|
|
147
148
|
}
|
|
148
|
-
constructor(message) {
|
|
149
|
-
super(message, 408, "Request Timeout");
|
|
149
|
+
constructor(message, metadata) {
|
|
150
|
+
super(message, metadata, 408, "Request Timeout");
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
|
|
@@ -155,8 +156,8 @@ var UnauthorizedException = class extends Exception {
|
|
|
155
156
|
static {
|
|
156
157
|
__name(this, "UnauthorizedException");
|
|
157
158
|
}
|
|
158
|
-
constructor(message) {
|
|
159
|
-
super(message, 401, "Unauthorized");
|
|
159
|
+
constructor(message, metadata) {
|
|
160
|
+
super(message, metadata, 401, "Unauthorized");
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
|
|
@@ -165,8 +166,8 @@ var ServiceUnavailableException = class extends Exception {
|
|
|
165
166
|
static {
|
|
166
167
|
__name(this, "ServiceUnavailableException");
|
|
167
168
|
}
|
|
168
|
-
constructor(message) {
|
|
169
|
-
super(message, 503, "Service Unavailable");
|
|
169
|
+
constructor(message, metadata) {
|
|
170
|
+
super(message, metadata, 503, "Service Unavailable");
|
|
170
171
|
}
|
|
171
172
|
};
|
|
172
173
|
|
|
@@ -175,8 +176,8 @@ var FrameworkException = class extends Exception {
|
|
|
175
176
|
static {
|
|
176
177
|
__name(this, "FrameworkException");
|
|
177
178
|
}
|
|
178
|
-
constructor(message) {
|
|
179
|
-
super(`[phecda-server] ${message}`, 500, "Framework Error");
|
|
179
|
+
constructor(message, metadata) {
|
|
180
|
+
super(`[phecda-server] ${message}`, metadata, 500, "Framework Error");
|
|
180
181
|
}
|
|
181
182
|
};
|
|
182
183
|
|
|
@@ -185,8 +186,8 @@ var TimerException = class extends Exception {
|
|
|
185
186
|
static {
|
|
186
187
|
__name(this, "TimerException");
|
|
187
188
|
}
|
|
188
|
-
constructor(message) {
|
|
189
|
-
super(message, 0, "Timer Error");
|
|
189
|
+
constructor(message, metadata) {
|
|
190
|
+
super(message, metadata, 0, "Timer Error");
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
193
|
|
|
@@ -195,8 +196,8 @@ var WorkerException = class extends Exception {
|
|
|
195
196
|
static {
|
|
196
197
|
__name(this, "WorkerException");
|
|
197
198
|
}
|
|
198
|
-
constructor(message) {
|
|
199
|
-
super(message, 0, "Worker Error");
|
|
199
|
+
constructor(message, metadata) {
|
|
200
|
+
super(message, metadata, 0, "Worker Error");
|
|
200
201
|
}
|
|
201
202
|
};
|
|
202
203
|
|
package/dist/helper.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Meta, a as ControllerMeta } from './meta-
|
|
1
|
+
import { M as Meta, a as ControllerMeta } from './meta-EGS-4cNY.mjs';
|
|
2
2
|
import { Construct } from 'phecda-core';
|
|
3
3
|
|
|
4
4
|
declare function HMR(cb: (oldModels: Construct[], newModels: Construct[]) => any): void;
|
package/dist/helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Meta, a as ControllerMeta } from './meta-
|
|
1
|
+
import { M as Meta, a as ControllerMeta } from './meta-EGS-4cNY.js';
|
|
2
2
|
import { Construct } from 'phecda-core';
|
|
3
3
|
|
|
4
4
|
declare function HMR(cb: (oldModels: Construct[], newModels: Construct[]) => any): void;
|
package/dist/helper.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkR73A7HS3js = require('./chunk-R73A7HS3.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -21,4 +21,4 @@ var _chunkOUQM7GZHjs = require('./chunk-OUQM7GZH.js');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.HMR = _chunkOUQM7GZHjs.HMR; exports.RELAUNCH = _chunkOUQM7GZHjs.RELAUNCH; exports.RELOAD = _chunkOUQM7GZHjs.RELOAD; exports.createControllerMetaMap =
|
|
24
|
+
exports.HMR = _chunkOUQM7GZHjs.HMR; exports.RELAUNCH = _chunkOUQM7GZHjs.RELAUNCH; exports.RELOAD = _chunkOUQM7GZHjs.RELOAD; exports.createControllerMetaMap = _chunkR73A7HS3js.createControllerMetaMap; exports.detectAopDep = _chunkR73A7HS3js.detectAopDep; exports.joinUrl = _chunkR73A7HS3js.joinUrl; exports.mergeObject = _chunkR73A7HS3js.mergeObject; exports.resolveDep = _chunkR73A7HS3js.resolveDep; exports.shallowClone = _chunkR73A7HS3js.shallowClone;
|
package/dist/helper.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Elysia as Elysia$1, Context } from 'elysia';
|
|
2
2
|
import { AnyLocalHook } from 'elysia/dist/types';
|
|
3
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
4
|
-
import { F as Factory } from '../../core-
|
|
3
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-BkU6kQWV.mjs';
|
|
4
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
5
5
|
import 'node:http';
|
|
6
|
-
import '../../meta-
|
|
6
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
7
7
|
import 'phecda-core';
|
|
8
8
|
|
|
9
9
|
interface ElysiaCtx extends HttpCtx {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Elysia as Elysia$1, Context } from 'elysia';
|
|
2
2
|
import { AnyLocalHook } from 'elysia/dist/types';
|
|
3
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
4
|
-
import { F as Factory } from '../../core-
|
|
3
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-DGUpAXle.js';
|
|
4
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
5
5
|
import 'node:http';
|
|
6
|
-
import '../../meta-
|
|
6
|
+
import '../../meta-EGS-4cNY.js';
|
|
7
7
|
import 'phecda-core';
|
|
8
8
|
|
|
9
9
|
interface ElysiaCtx extends HttpCtx {
|
|
@@ -7,7 +7,7 @@ var _chunkC424F7TVjs = require('../../chunk-C424F7TV.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkR73A7HS3js = require('../../chunk-R73A7HS3.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkOUQM7GZHjs = require('../../chunk-OUQM7GZH.js');
|
|
@@ -19,14 +19,14 @@ var debug = _debug2.default.call(void 0, "phecda-server/elysia");
|
|
|
19
19
|
function bind(app, data, opts = {}) {
|
|
20
20
|
const { globalGuards, parallelRoute = "/__PHECDA_SERVER__", globalAddons = [], parallelAddons = [], globalFilter, globalPipe, dynamic = false } = opts;
|
|
21
21
|
const { moduleMap, meta } = data;
|
|
22
|
-
const metaMap =
|
|
22
|
+
const metaMap = _chunkR73A7HS3js.createControllerMetaMap.call(void 0, meta, (meta2) => {
|
|
23
23
|
const { controller, http, method, tag } = meta2.data;
|
|
24
24
|
if (controller === "http" && _optionalChain([http, 'optionalAccess', _ => _.method])) {
|
|
25
25
|
debug(`register method "${method}" in module "${tag}"`);
|
|
26
26
|
return true;
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
_chunkR73A7HS3js.detectAopDep.call(void 0, meta, {
|
|
30
30
|
addons: [
|
|
31
31
|
...globalAddons,
|
|
32
32
|
...parallelAddons
|
|
@@ -35,29 +35,29 @@ function bind(app, data, opts = {}) {
|
|
|
35
35
|
});
|
|
36
36
|
registerRoute();
|
|
37
37
|
function registerRoute() {
|
|
38
|
-
|
|
38
|
+
_chunkR73A7HS3js.Context.applyAddons(globalAddons, app, "elysia");
|
|
39
39
|
if (parallelRoute) {
|
|
40
40
|
const parallelRouter = new (0, _elysia.Elysia)();
|
|
41
|
-
|
|
41
|
+
_chunkR73A7HS3js.Context.applyAddons(parallelAddons, app, "elysia");
|
|
42
42
|
parallelRouter.post(parallelRoute, async (c) => {
|
|
43
43
|
const { body } = c;
|
|
44
44
|
async function errorHandler(e) {
|
|
45
|
-
const error = await
|
|
45
|
+
const error = await _chunkR73A7HS3js.Context.filterRecord.default(e);
|
|
46
46
|
c.set.status = error.status;
|
|
47
47
|
return error;
|
|
48
48
|
}
|
|
49
49
|
_chunkOUQM7GZHjs.__name.call(void 0, errorHandler, "errorHandler");
|
|
50
|
-
if (!Array.isArray(body)) return errorHandler(new (0,
|
|
50
|
+
if (!Array.isArray(body)) return errorHandler(new (0, _chunkR73A7HS3js.BadRequestException)("data format should be an array"));
|
|
51
51
|
try {
|
|
52
52
|
return Promise.all(body.map((item, i) => {
|
|
53
53
|
return new Promise(async (resolve) => {
|
|
54
54
|
if (!item) return resolve(null);
|
|
55
55
|
const { tag, method } = item;
|
|
56
56
|
debug(`(parallel)invoke method "${method}" in module "${tag}"`);
|
|
57
|
-
if (!metaMap.has(tag)) return resolve(await
|
|
57
|
+
if (!metaMap.has(tag)) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`module "${tag}" doesn't exist`)));
|
|
58
58
|
const meta2 = metaMap.get(tag)[method];
|
|
59
|
-
if (!meta2) return resolve(await
|
|
60
|
-
const aop =
|
|
59
|
+
if (!meta2) return resolve(await _chunkR73A7HS3js.Context.filterRecord.default(new (0, _chunkR73A7HS3js.BadRequestException)(`"${method}" in "${tag}" doesn't exist`)));
|
|
60
|
+
const aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
61
61
|
globalGuards,
|
|
62
62
|
globalFilter,
|
|
63
63
|
globalPipe
|
|
@@ -88,7 +88,7 @@ function bind(app, data, opts = {}) {
|
|
|
88
88
|
throw new Error("elysia can't support getResponse");
|
|
89
89
|
}, "getResponse")
|
|
90
90
|
};
|
|
91
|
-
const context = new (0,
|
|
91
|
+
const context = new (0, _chunkR73A7HS3js.Context)(contextData);
|
|
92
92
|
context.run(aop, resolve, resolve);
|
|
93
93
|
});
|
|
94
94
|
})).then((ret) => {
|
|
@@ -110,14 +110,14 @@ function bind(app, data, opts = {}) {
|
|
|
110
110
|
if (!_optionalChain([http, 'optionalAccess', _2 => _2.method])) continue;
|
|
111
111
|
let aop;
|
|
112
112
|
if (!dynamic) {
|
|
113
|
-
aop =
|
|
113
|
+
aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
114
114
|
globalFilter,
|
|
115
115
|
globalGuards,
|
|
116
116
|
globalPipe
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
subApp[http.method](
|
|
119
|
+
_chunkR73A7HS3js.Context.applyAddons(addons, subApp, "elysia");
|
|
120
|
+
subApp[http.method](_chunkR73A7HS3js.joinUrl.call(void 0, http.prefix, http.route), async (c) => {
|
|
121
121
|
debug(`invoke method "${method}" in module "${tag}"`);
|
|
122
122
|
const contextData = {
|
|
123
123
|
type: "elysia",
|
|
@@ -149,16 +149,16 @@ function bind(app, data, opts = {}) {
|
|
|
149
149
|
}, "getResponse")
|
|
150
150
|
};
|
|
151
151
|
if (dynamic) {
|
|
152
|
-
aop =
|
|
152
|
+
aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
153
153
|
globalFilter,
|
|
154
154
|
globalGuards,
|
|
155
155
|
globalPipe
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
const context = new (0,
|
|
158
|
+
const context = new (0, _chunkR73A7HS3js.Context)(contextData);
|
|
159
159
|
if (http.headers) c.set.headers = http.headers;
|
|
160
160
|
if (dynamic) {
|
|
161
|
-
aop =
|
|
161
|
+
aop = _chunkR73A7HS3js.Context.getAop(meta2, {
|
|
162
162
|
globalFilter,
|
|
163
163
|
globalGuards,
|
|
164
164
|
globalPipe
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Request, Response, Router, RequestHandler } from 'express';
|
|
2
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
3
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-BkU6kQWV.mjs';
|
|
3
|
+
import { F as Factory } from '../../core-mOKtuP0F.mjs';
|
|
4
4
|
import 'node:http';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.mjs';
|
|
6
6
|
import 'phecda-core';
|
|
7
7
|
|
|
8
8
|
interface ExpressCtx extends HttpCtx {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Request, Response, Router, RequestHandler } from 'express';
|
|
2
|
-
import { H as HttpCtx, a as HttpOptions } from '../../types-
|
|
3
|
-
import { F as Factory } from '../../core-
|
|
2
|
+
import { H as HttpCtx, a as HttpOptions } from '../../types-DGUpAXle.js';
|
|
3
|
+
import { F as Factory } from '../../core-qL97H3d_.js';
|
|
4
4
|
import 'node:http';
|
|
5
|
-
import '../../meta-
|
|
5
|
+
import '../../meta-EGS-4cNY.js';
|
|
6
6
|
import 'phecda-core';
|
|
7
7
|
|
|
8
8
|
interface ExpressCtx extends HttpCtx {
|