@tsed/common 6.71.1 → 7.0.0-alpha.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/lib/decorators/index.d.ts +0 -2
- package/lib/domain/index.d.ts +0 -1
- package/lib/index.js +0 -101
- package/lib/index.js.map +1 -1
- package/lib/index.modern.js +3 -101
- package/lib/index.modern.js.map +1 -1
- package/lib/middlewares/index.d.ts +0 -2
- package/lib/utils/index.d.ts +0 -1
- package/package.json +15 -15
- package/lib/decorators/params/endpointInfo.d.ts +0 -10
- package/lib/decorators/params/responseData.d.ts +0 -9
- package/lib/domain/PropertyMetadata.d.ts +0 -11
- package/lib/middlewares/AcceptMimesMiddleware.d.ts +0 -10
- package/lib/middlewares/GlobalAcceptMimesMiddleware.d.ts +0 -9
- package/lib/utils/loadInjector.d.ts +0 -6
package/lib/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DIConfiguration, ProviderType, ProviderScope, Injectable, InjectorService, Configuration, Inject, Constant, Scope, DIContext, Provider, Module, setLoggerLevel, GlobalProviders, registerProvider,
|
|
1
|
+
import { DIConfiguration, ProviderType, ProviderScope, Injectable, InjectorService, Configuration, Inject, Constant, Scope, DIContext, Provider, Module, setLoggerLevel, GlobalProviders, registerProvider, Container, createContainer, getConfiguration, registerController, DITest } from '@tsed/di';
|
|
2
2
|
export * from '@tsed/di';
|
|
3
3
|
import { Context, ParamTypes, ParamMetadata, PlatformParams, UseParam, mapParamsOptions } from '@tsed/platform-params';
|
|
4
4
|
export * from '@tsed/platform-params';
|
|
@@ -18,7 +18,7 @@ import { __decorate, __metadata, __param } from 'tslib';
|
|
|
18
18
|
import { Env, AnyToPromise, AnyToPromiseStatus, nameOf, Store, descriptorOf, classOf, prototypeOf, deepMerge, isFunction, Enumerable, DecoratorTypes, isStream, isBoolean, isNumber, isString, uniq, toMap, constructorOf, StoreMerge, Metadata, useDecorators, useMethodDecorators, isArrayOrArrayClass, isClass } from '@tsed/core';
|
|
19
19
|
import { PerfLogger } from '@tsed/perf';
|
|
20
20
|
import { Exception, NotAcceptable } from '@tsed/exceptions';
|
|
21
|
-
import { JsonEntityStore, getOperationsStores, JsonEntityComponent, OperationMethods,
|
|
21
|
+
import { JsonEntityStore, getOperationsStores, JsonEntityComponent, OperationMethods, Returns, Consumes, JsonEntityFn, Produces } from '@tsed/schema';
|
|
22
22
|
export { Location, Redirect } from '@tsed/schema';
|
|
23
23
|
import { serialize, deserialize } from '@tsed/json-mapper';
|
|
24
24
|
import { promisify } from 'util';
|
|
@@ -1468,22 +1468,6 @@ __decorate([__param(0, Context()), __metadata("design:type", Function), __metada
|
|
|
1468
1468
|
|
|
1469
1469
|
PlatformMulterMiddleware = PlatformMulterMiddleware_1 = __decorate([Middleware()], PlatformMulterMiddleware);
|
|
1470
1470
|
|
|
1471
|
-
/**
|
|
1472
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
1473
|
-
* @ignore
|
|
1474
|
-
*/
|
|
1475
|
-
|
|
1476
|
-
let GlobalAcceptMimesMiddleware = class GlobalAcceptMimesMiddleware {
|
|
1477
|
-
use(ctx) {
|
|
1478
|
-
return;
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
};
|
|
1482
|
-
|
|
1483
|
-
__decorate([__param(0, Context()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], GlobalAcceptMimesMiddleware.prototype, "use", null);
|
|
1484
|
-
|
|
1485
|
-
GlobalAcceptMimesMiddleware = __decorate([Middleware()], GlobalAcceptMimesMiddleware);
|
|
1486
|
-
|
|
1487
1471
|
/**
|
|
1488
1472
|
* @middleware
|
|
1489
1473
|
* @platform
|
|
@@ -1510,23 +1494,6 @@ __decorate([__param(0, Context()), __metadata("design:type", Function), __metada
|
|
|
1510
1494
|
|
|
1511
1495
|
PlatformAcceptMimesMiddleware = __decorate([Middleware()], PlatformAcceptMimesMiddleware);
|
|
1512
1496
|
|
|
1513
|
-
/**
|
|
1514
|
-
* @middleware
|
|
1515
|
-
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
1516
|
-
* @ignore
|
|
1517
|
-
*/
|
|
1518
|
-
|
|
1519
|
-
let AcceptMimesMiddleware = class AcceptMimesMiddleware {
|
|
1520
|
-
use(ctx) {
|
|
1521
|
-
return;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
__decorate([__param(0, Context()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], AcceptMimesMiddleware.prototype, "use", null);
|
|
1527
|
-
|
|
1528
|
-
AcceptMimesMiddleware = __decorate([Middleware()], AcceptMimesMiddleware);
|
|
1529
|
-
|
|
1530
1497
|
/**
|
|
1531
1498
|
* Create Ts.ED context handler
|
|
1532
1499
|
* @param fn
|
|
@@ -2422,22 +2389,6 @@ class ControllerProvider extends Provider {
|
|
|
2422
2389
|
|
|
2423
2390
|
}
|
|
2424
2391
|
|
|
2425
|
-
let PropertyMetadata = class PropertyMetadata extends JsonEntityStore {
|
|
2426
|
-
static get(target, propertyKey) {
|
|
2427
|
-
return JsonEntityStore.from(prototypeOf(target), propertyKey);
|
|
2428
|
-
}
|
|
2429
|
-
/**
|
|
2430
|
-
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
2431
|
-
*/
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
static getProperties(target, options = {}) {
|
|
2435
|
-
return getProperties(target, options);
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
};
|
|
2439
|
-
PropertyMetadata = __decorate([JsonEntityComponent(DecoratorTypes.PROP)], PropertyMetadata);
|
|
2440
|
-
|
|
2441
2392
|
function getControllerPath(basePath, provider) {
|
|
2442
2393
|
return (basePath === provider.path ? provider.path : (basePath || "") + provider.path).replace(/\/\//gi, "/");
|
|
2443
2394
|
}
|
|
@@ -2761,16 +2712,6 @@ async function listenHttpsServer(injector) {
|
|
|
2761
2712
|
}
|
|
2762
2713
|
}
|
|
2763
2714
|
|
|
2764
|
-
/**
|
|
2765
|
-
* @ignore
|
|
2766
|
-
* @deprecated User injector.load(container, module) instead
|
|
2767
|
-
*/
|
|
2768
|
-
|
|
2769
|
-
async function loadInjector(injector, container = createContainer()) {
|
|
2770
|
-
injector.bootstrap(container);
|
|
2771
|
-
return injector.load(container, PlatformModule);
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
2715
|
function printRoutes(routes) {
|
|
2775
2716
|
const mapColor = {
|
|
2776
2717
|
GET: "green",
|
|
@@ -3147,17 +3088,11 @@ class PlatformBuilder {
|
|
|
3147
3088
|
}
|
|
3148
3089
|
|
|
3149
3090
|
async loadRoutes() {
|
|
3150
|
-
var _this$settings$accept;
|
|
3151
|
-
|
|
3152
3091
|
// istanbul ignore next
|
|
3153
3092
|
if (this.settings.logger.level !== "off") {
|
|
3154
3093
|
this.app.use(PlatformLogMiddleware);
|
|
3155
3094
|
}
|
|
3156
3095
|
|
|
3157
|
-
if ((_this$settings$accept = this.settings.acceptMimes) != null && _this$settings$accept.length) {
|
|
3158
|
-
this.app.use(GlobalAcceptMimesMiddleware);
|
|
3159
|
-
}
|
|
3160
|
-
|
|
3161
3096
|
this.log("Load routes");
|
|
3162
3097
|
await this.callHook("$beforeRoutesInit");
|
|
3163
3098
|
await this.callHook("$$loadRoutes");
|
|
@@ -3587,22 +3522,6 @@ function Controller(options) {
|
|
|
3587
3522
|
};
|
|
3588
3523
|
}
|
|
3589
3524
|
|
|
3590
|
-
/**
|
|
3591
|
-
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
3592
|
-
*
|
|
3593
|
-
* @decorator
|
|
3594
|
-
* @operation
|
|
3595
|
-
* @input
|
|
3596
|
-
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
3597
|
-
*/
|
|
3598
|
-
|
|
3599
|
-
function ResponseData() {
|
|
3600
|
-
return UseParam({
|
|
3601
|
-
paramType: ParamTypes.$CTX,
|
|
3602
|
-
dataPath: "$ctx.data"
|
|
3603
|
-
});
|
|
3604
|
-
}
|
|
3605
|
-
|
|
3606
3525
|
function getParamType$1(target, propertyKey, parameterIndex) {
|
|
3607
3526
|
const type = Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
|
|
3608
3527
|
|
|
@@ -3729,23 +3648,6 @@ function Err() {
|
|
|
3729
3648
|
});
|
|
3730
3649
|
}
|
|
3731
3650
|
|
|
3732
|
-
/**
|
|
3733
|
-
* Get the current endpoint metadata.
|
|
3734
|
-
* @decorator
|
|
3735
|
-
* @operation
|
|
3736
|
-
* @input
|
|
3737
|
-
* @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
|
|
3738
|
-
*/
|
|
3739
|
-
|
|
3740
|
-
function EndpointInfo() {
|
|
3741
|
-
return UseParam({
|
|
3742
|
-
paramType: ParamTypes.$CTX,
|
|
3743
|
-
dataPath: "$ctx.endpoint",
|
|
3744
|
-
useConverter: false,
|
|
3745
|
-
useValidation: false
|
|
3746
|
-
});
|
|
3747
|
-
}
|
|
3748
|
-
|
|
3749
3651
|
const _excluded = ["use", "collection"];
|
|
3750
3652
|
|
|
3751
3653
|
/**
|
|
@@ -3964,5 +3866,5 @@ GlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider, {
|
|
|
3964
3866
|
|
|
3965
3867
|
});
|
|
3966
3868
|
|
|
3967
|
-
export { AcceptMime,
|
|
3869
|
+
export { AcceptMime, All, AnyToPromiseWithCtx, Controller, ControllerProvider, ConverterService, Delete, EndpointFn, EndpointMetadata, Err, Get, HandlerMetadata, HandlerType, Head, HttpServer, HttpsServer, MulterFileSize, MulterOptions, MultipartFile, Next, Options, PLATFORM_ROUTER_OPTIONS, Patch, Platform, PlatformAcceptMimesMiddleware, PlatformApplication, PlatformBuilder, PlatformConfiguration, PlatformContext, PlatformControllerBuilder, PlatformHandler, PlatformLogMiddleware, PlatformModule, PlatformMulterMiddleware, PlatformRequest, PlatformResponse, PlatformRouteDetails, PlatformRouter, PlatformTest, Post, Put, ROUTER_OPTIONS, Req, Request, Res, Response, bindEndpointMiddleware, createContext, createHttpServer, createHttpsServer, createInjector, createPlatformApplication, listenHttpServer, listenHttpsServer, listenServer, mapReturnedResponse, printRoutes, useCtxHandler };
|
|
3968
3870
|
//# sourceMappingURL=index.modern.js.map
|