@nattyjs/common 0.0.1-beta.64 → 0.0.1-beta.65
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/index.cjs +8 -4
- package/dist/index.d.ts +2 -3
- package/dist/index.mjs +8 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -74,6 +74,9 @@ const commonContainer = new class {
|
|
|
74
74
|
getMetadataValue(key, propName) {
|
|
75
75
|
return this.metadataConfig[propName].get(key);
|
|
76
76
|
}
|
|
77
|
+
deleteMetadataValue(key, propName) {
|
|
78
|
+
this.metadataConfig[propName].delete(key);
|
|
79
|
+
}
|
|
77
80
|
get globalConfig() {
|
|
78
81
|
return this.nattyConfig.global || {};
|
|
79
82
|
}
|
|
@@ -666,10 +669,11 @@ class AbstractRunner {
|
|
|
666
669
|
}
|
|
667
670
|
|
|
668
671
|
async function getPort() {
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
671
|
-
return
|
|
672
|
-
const
|
|
672
|
+
const configuredPort = commonContainer.nattyConfig?.port;
|
|
673
|
+
if (configuredPort)
|
|
674
|
+
return configuredPort;
|
|
675
|
+
const preferredPorts = [3200, ...Array(50).fill(3001).map((fillValue, index) => fillValue + index)];
|
|
676
|
+
const port = await getPortPlease.getPort({ ports: preferredPorts });
|
|
673
677
|
commonContainer.nattyConfig.port = port;
|
|
674
678
|
return port;
|
|
675
679
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -177,6 +177,7 @@ declare const commonContainer: {
|
|
|
177
177
|
}): void;
|
|
178
178
|
setMetadata(key: string, value: any, propName: string): void;
|
|
179
179
|
getMetadataValue(key: string, propName: string): any;
|
|
180
|
+
deleteMetadataValue(key: string, propName: string): void;
|
|
180
181
|
get globalConfig(): GlobalConfig;
|
|
181
182
|
registerType(type: TypesInfo): void;
|
|
182
183
|
types: TypesInfo;
|
|
@@ -331,8 +332,6 @@ declare abstract class AbstractConsoleLogger {
|
|
|
331
332
|
declare class ConsoleLogger extends AbstractConsoleLogger {
|
|
332
333
|
}
|
|
333
334
|
|
|
334
|
-
declare function typed(): <T extends {
|
|
335
|
-
new (...args: any[]): {};
|
|
336
|
-
}>(OriginalClass: T) => T;
|
|
335
|
+
declare function typed(): <T extends new (...args: any[]) => {}>(OriginalClass: T) => T;
|
|
337
336
|
|
|
338
337
|
export { ALLOW_METHODS, AbstractRunner, ActionFilter, AuthenticationFilter, AuthorizationFilter, BACK_SLASH_REGEX, BLANK, CONTROLLER, Claim, ClassType, ConsoleLogger, DEFAULT_ACTIONS, DEFAULT_CHILD_PATH, DELETE, DiTransformConfig, ENVIRONMENTS, ExceptionFilter, FrameworkType, GET, GlobalConfig, HTTP_METHOD_ROUTES, IActionExecutedContext, IActionExecutingContext, IAuthorizationContext, IExecutionContext, IGNORE_METHODS, List, MetaConfigProps, Middleware, NattyAppConfig, NattyCliConfig, NattyConfig, POST, PUT, RIGHT_SLASH, ROUTE_INSTANCES, ROUTE_METHODS, ROUTE_PATHS, TS_EXTENSION, UserIdentity, WebScheduleConfig, commonContainer, createPath, createTestServer, getPath, getPort, isConstructor, isEqual, isFunction, isObject, readEnv, readEnvKey, registerType, typeContainer, typed };
|
package/dist/index.mjs
CHANGED
|
@@ -57,6 +57,9 @@ const commonContainer = new class {
|
|
|
57
57
|
getMetadataValue(key, propName) {
|
|
58
58
|
return this.metadataConfig[propName].get(key);
|
|
59
59
|
}
|
|
60
|
+
deleteMetadataValue(key, propName) {
|
|
61
|
+
this.metadataConfig[propName].delete(key);
|
|
62
|
+
}
|
|
60
63
|
get globalConfig() {
|
|
61
64
|
return this.nattyConfig.global || {};
|
|
62
65
|
}
|
|
@@ -649,10 +652,11 @@ class AbstractRunner {
|
|
|
649
652
|
}
|
|
650
653
|
|
|
651
654
|
async function getPort() {
|
|
652
|
-
const
|
|
653
|
-
if (
|
|
654
|
-
return
|
|
655
|
-
const
|
|
655
|
+
const configuredPort = commonContainer.nattyConfig?.port;
|
|
656
|
+
if (configuredPort)
|
|
657
|
+
return configuredPort;
|
|
658
|
+
const preferredPorts = [3200, ...Array(50).fill(3001).map((fillValue, index) => fillValue + index)];
|
|
659
|
+
const port = await getPort$1({ ports: preferredPorts });
|
|
656
660
|
commonContainer.nattyConfig.port = port;
|
|
657
661
|
return port;
|
|
658
662
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattyjs/common",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.65",
|
|
4
4
|
"description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "ajayojha <ojhaajay@outlook.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "20.3.1",
|
|
24
|
-
"@nattyjs/types": "0.0.1-beta.
|
|
24
|
+
"@nattyjs/types": "0.0.1-beta.65",
|
|
25
25
|
"unbuild": "1.2.1"
|
|
26
26
|
}
|
|
27
27
|
}
|