vovk 3.0.0-beta.73 → 3.0.0-beta.76
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/cjs/VovkApp.d.ts +1 -0
- package/cjs/VovkApp.js +2 -1
- package/cjs/createVovkApp.js +1 -0
- package/mjs/VovkApp.d.ts +1 -0
- package/mjs/VovkApp.js +2 -1
- package/mjs/createVovkApp.js +1 -0
- package/package.json +1 -1
package/cjs/VovkApp.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { NextRequest } from 'next/server';
|
|
|
2
2
|
import { HttpMethod, HttpStatus, type RouteHandler, type VovkController, type DecoratorOptions, type VovkRequest } from './types';
|
|
3
3
|
export declare class VovkApp {
|
|
4
4
|
#private;
|
|
5
|
+
segmentName: string;
|
|
5
6
|
private static getHeadersFromOptions;
|
|
6
7
|
routes: Record<HttpMethod, Map<VovkController, Record<string, RouteHandler>>>;
|
|
7
8
|
GET: (req: NextRequest, data: {
|
package/cjs/VovkApp.js
CHANGED
|
@@ -9,6 +9,7 @@ const reqQuery_1 = require("./req/reqQuery");
|
|
|
9
9
|
const reqMeta_1 = require("./req/reqMeta");
|
|
10
10
|
const reqForm_1 = require("./req/reqForm");
|
|
11
11
|
class VovkApp {
|
|
12
|
+
segmentName;
|
|
12
13
|
static getHeadersFromOptions(options) {
|
|
13
14
|
if (!options)
|
|
14
15
|
return {};
|
|
@@ -220,7 +221,7 @@ class VovkApp {
|
|
|
220
221
|
(0, reqMeta_1.reqMeta)(req, { xMetaHeader });
|
|
221
222
|
const { handler, methodParams } = this.#getHandler({ handlers, path, params });
|
|
222
223
|
if (!handler) {
|
|
223
|
-
console.log({ handlers, path, params });
|
|
224
|
+
console.log(this.segmentName, { handlers, path, params });
|
|
224
225
|
return this.#respondWithError({
|
|
225
226
|
req,
|
|
226
227
|
statusCode: types_1.HttpStatus.NOT_FOUND,
|
package/cjs/createVovkApp.js
CHANGED
|
@@ -101,6 +101,7 @@ function createVovkApp() {
|
|
|
101
101
|
};
|
|
102
102
|
const initSegment = (options) => {
|
|
103
103
|
options.segmentName = trimPath(options.segmentName ?? '');
|
|
104
|
+
vovkApp.segmentName = options.segmentName;
|
|
104
105
|
for (const [rpcModuleName, controller] of Object.entries(options.controllers ?? {})) {
|
|
105
106
|
controller._rpcModuleName = rpcModuleName;
|
|
106
107
|
controller._onError = options?.onError;
|
package/mjs/VovkApp.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { NextRequest } from 'next/server';
|
|
|
2
2
|
import { HttpMethod, HttpStatus, type RouteHandler, type VovkController, type DecoratorOptions, type VovkRequest } from './types';
|
|
3
3
|
export declare class VovkApp {
|
|
4
4
|
#private;
|
|
5
|
+
segmentName: string;
|
|
5
6
|
private static getHeadersFromOptions;
|
|
6
7
|
routes: Record<HttpMethod, Map<VovkController, Record<string, RouteHandler>>>;
|
|
7
8
|
GET: (req: NextRequest, data: {
|
package/mjs/VovkApp.js
CHANGED
|
@@ -9,6 +9,7 @@ const reqQuery_1 = require("./req/reqQuery");
|
|
|
9
9
|
const reqMeta_1 = require("./req/reqMeta");
|
|
10
10
|
const reqForm_1 = require("./req/reqForm");
|
|
11
11
|
class VovkApp {
|
|
12
|
+
segmentName;
|
|
12
13
|
static getHeadersFromOptions(options) {
|
|
13
14
|
if (!options)
|
|
14
15
|
return {};
|
|
@@ -220,7 +221,7 @@ class VovkApp {
|
|
|
220
221
|
(0, reqMeta_1.reqMeta)(req, { xMetaHeader });
|
|
221
222
|
const { handler, methodParams } = this.#getHandler({ handlers, path, params });
|
|
222
223
|
if (!handler) {
|
|
223
|
-
console.log({ handlers, path, params });
|
|
224
|
+
console.log(this.segmentName, { handlers, path, params });
|
|
224
225
|
return this.#respondWithError({
|
|
225
226
|
req,
|
|
226
227
|
statusCode: types_1.HttpStatus.NOT_FOUND,
|
package/mjs/createVovkApp.js
CHANGED
|
@@ -101,6 +101,7 @@ function createVovkApp() {
|
|
|
101
101
|
};
|
|
102
102
|
const initSegment = (options) => {
|
|
103
103
|
options.segmentName = trimPath(options.segmentName ?? '');
|
|
104
|
+
vovkApp.segmentName = options.segmentName;
|
|
104
105
|
for (const [rpcModuleName, controller] of Object.entries(options.controllers ?? {})) {
|
|
105
106
|
controller._rpcModuleName = rpcModuleName;
|
|
106
107
|
controller._onError = options?.onError;
|