@tsed/platform-test-sdk 8.0.0-alpha.5 → 8.0.0-alpha.7
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/esm/components/PlatformTestSdk.js.map +1 -1
- package/lib/esm/modules/feature/FeatureModule.js.map +1 -1
- package/lib/esm/modules/feature/controllers/FeatureController.js.map +1 -1
- package/lib/esm/tests/exports.js +1 -1
- package/lib/esm/tests/exports.js.map +1 -1
- package/lib/esm/tests/testAcceptMime.js +1 -0
- package/lib/esm/tests/testAcceptMime.js.map +1 -1
- package/lib/esm/tests/testAuth.js +1 -0
- package/lib/esm/tests/testAuth.js.map +1 -1
- package/lib/esm/tests/testBodyParams.js +2 -1
- package/lib/esm/tests/testBodyParams.js.map +1 -1
- package/lib/esm/tests/testCache.js +2 -1
- package/lib/esm/tests/testCache.js.map +1 -1
- package/lib/esm/tests/testChildrenControllers.js +1 -0
- package/lib/esm/tests/testChildrenControllers.js.map +1 -1
- package/lib/esm/tests/testCookies.js +1 -0
- package/lib/esm/tests/testCookies.js.map +1 -1
- package/lib/esm/tests/testCustom404.js +1 -0
- package/lib/esm/tests/testCustom404.js.map +1 -1
- package/lib/esm/tests/testDeepQueryParams.js +1 -0
- package/lib/esm/tests/testDeepQueryParams.js.map +1 -1
- package/lib/esm/tests/testErrors.js +7 -6
- package/lib/esm/tests/testErrors.js.map +1 -1
- package/lib/esm/tests/testHandlers.js +1 -0
- package/lib/esm/tests/testHandlers.js.map +1 -1
- package/lib/esm/tests/testHeaderParams.js +1 -0
- package/lib/esm/tests/testHeaderParams.js.map +1 -1
- package/lib/esm/tests/testHeaders.js +5 -4
- package/lib/esm/tests/testHeaders.js.map +1 -1
- package/lib/esm/tests/testInheritanceController.js +2 -1
- package/lib/esm/tests/testInheritanceController.js.map +1 -1
- package/lib/esm/tests/testLocals.js +1 -0
- package/lib/esm/tests/testLocals.js.map +1 -1
- package/lib/esm/tests/testLocation.js +2 -1
- package/lib/esm/tests/testLocation.js.map +1 -1
- package/lib/esm/tests/testMiddlewares.js +1 -0
- package/lib/esm/tests/testMiddlewares.js.map +1 -1
- package/lib/esm/tests/testModule.js +1 -0
- package/lib/esm/tests/testModule.js.map +1 -1
- package/lib/esm/tests/testMulter.js +1 -0
- package/lib/esm/tests/testMulter.js.map +1 -1
- package/lib/esm/tests/testPathParams.js +1 -0
- package/lib/esm/tests/testPathParams.js.map +1 -1
- package/lib/esm/tests/testQueryParams.js +1 -0
- package/lib/esm/tests/testQueryParams.js.map +1 -1
- package/lib/esm/tests/testRedirect.js +2 -1
- package/lib/esm/tests/testRedirect.js.map +1 -1
- package/lib/esm/tests/testResponse.js +3 -2
- package/lib/esm/tests/testResponse.js.map +1 -1
- package/lib/esm/tests/testResponseFilter.js +3 -2
- package/lib/esm/tests/testResponseFilter.js.map +1 -1
- package/lib/esm/tests/testRouting.js +1 -0
- package/lib/esm/tests/testRouting.js.map +1 -1
- package/lib/esm/tests/testScopeRequest.js +1 -0
- package/lib/esm/tests/testScopeRequest.js.map +1 -1
- package/lib/esm/tests/testSession.js +1 -0
- package/lib/esm/tests/testSession.js.map +1 -1
- package/lib/esm/tests/testStatics.js +1 -0
- package/lib/esm/tests/testStatics.js.map +1 -1
- package/lib/esm/tests/testStream.js +1 -0
- package/lib/esm/tests/testStream.js.map +1 -1
- package/lib/esm/tests/testView.js +2 -1
- package/lib/esm/tests/testView.js.map +1 -1
- package/package.json +19 -20
- package/lib/cjs/components/PlatformTestSdk.js +0 -30
- package/lib/cjs/components/PlatformTestSdk.js.map +0 -1
- package/lib/cjs/data/response.data.json +0 -3
- package/lib/cjs/data/swagger.json +0 -32
- package/lib/cjs/errors/CustomBadRequest.js +0 -17
- package/lib/cjs/errors/CustomBadRequest.js.map +0 -1
- package/lib/cjs/errors/CustomInternalError.js +0 -17
- package/lib/cjs/errors/CustomInternalError.js.map +0 -1
- package/lib/cjs/index.js +0 -44
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/PlatformTestingSdkOpts.js +0 -3
- package/lib/cjs/interfaces/PlatformTestingSdkOpts.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -8
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/modules/feature/FeatureModule.js +0 -17
- package/lib/cjs/modules/feature/FeatureModule.js.map +0 -1
- package/lib/cjs/modules/feature/controllers/FeatureController.js +0 -23
- package/lib/cjs/modules/feature/controllers/FeatureController.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/tests/exports.js +0 -68
- package/lib/cjs/tests/exports.js.map +0 -1
- package/lib/cjs/tests/testAcceptMime.js +0 -103
- package/lib/cjs/tests/testAcceptMime.js.map +0 -1
- package/lib/cjs/tests/testAuth.js +0 -343
- package/lib/cjs/tests/testAuth.js.map +0 -1
- package/lib/cjs/tests/testBodyParams.js +0 -539
- package/lib/cjs/tests/testBodyParams.js.map +0 -1
- package/lib/cjs/tests/testCache.js +0 -299
- package/lib/cjs/tests/testCache.js.map +0 -1
- package/lib/cjs/tests/testChildrenControllers.js +0 -64
- package/lib/cjs/tests/testChildrenControllers.js.map +0 -1
- package/lib/cjs/tests/testCookies.js +0 -45
- package/lib/cjs/tests/testCookies.js.map +0 -1
- package/lib/cjs/tests/testCustom404.js +0 -32
- package/lib/cjs/tests/testCustom404.js.map +0 -1
- package/lib/cjs/tests/testDeepQueryParams.js +0 -139
- package/lib/cjs/tests/testDeepQueryParams.js.map +0 -1
- package/lib/cjs/tests/testErrors.js +0 -253
- package/lib/cjs/tests/testErrors.js.map +0 -1
- package/lib/cjs/tests/testHandlers.js +0 -106
- package/lib/cjs/tests/testHandlers.js.map +0 -1
- package/lib/cjs/tests/testHeaderParams.js +0 -169
- package/lib/cjs/tests/testHeaderParams.js.map +0 -1
- package/lib/cjs/tests/testHeaders.js +0 -85
- package/lib/cjs/tests/testHeaders.js.map +0 -1
- package/lib/cjs/tests/testInheritanceController.js +0 -239
- package/lib/cjs/tests/testInheritanceController.js.map +0 -1
- package/lib/cjs/tests/testLocals.js +0 -63
- package/lib/cjs/tests/testLocals.js.map +0 -1
- package/lib/cjs/tests/testLocation.js +0 -42
- package/lib/cjs/tests/testLocation.js.map +0 -1
- package/lib/cjs/tests/testMiddlewares.js +0 -210
- package/lib/cjs/tests/testMiddlewares.js.map +0 -1
- package/lib/cjs/tests/testModule.js +0 -49
- package/lib/cjs/tests/testModule.js.map +0 -1
- package/lib/cjs/tests/testMulter.js +0 -169
- package/lib/cjs/tests/testMulter.js.map +0 -1
- package/lib/cjs/tests/testPathParams.js +0 -143
- package/lib/cjs/tests/testPathParams.js.map +0 -1
- package/lib/cjs/tests/testQueryParams.js +0 -241
- package/lib/cjs/tests/testQueryParams.js.map +0 -1
- package/lib/cjs/tests/testRedirect.js +0 -143
- package/lib/cjs/tests/testRedirect.js.map +0 -1
- package/lib/cjs/tests/testResponse.js +0 -569
- package/lib/cjs/tests/testResponse.js.map +0 -1
- package/lib/cjs/tests/testResponseFilter.js +0 -106
- package/lib/cjs/tests/testResponseFilter.js.map +0 -1
- package/lib/cjs/tests/testRouting.js +0 -77
- package/lib/cjs/tests/testRouting.js.map +0 -1
- package/lib/cjs/tests/testScopeRequest.js +0 -113
- package/lib/cjs/tests/testScopeRequest.js.map +0 -1
- package/lib/cjs/tests/testSession.js +0 -122
- package/lib/cjs/tests/testSession.js.map +0 -1
- package/lib/cjs/tests/testStatics.js +0 -58
- package/lib/cjs/tests/testStatics.js.map +0 -1
- package/lib/cjs/tests/testStream.js +0 -65
- package/lib/cjs/tests/testStream.js.map +0 -1
- package/lib/cjs/tests/testView.js +0 -83
- package/lib/cjs/tests/testView.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/components/PlatformTestSdk.d.ts +0 -9
- package/lib/types-esm/errors/CustomBadRequest.d.ts +0 -8
- package/lib/types-esm/errors/CustomInternalError.d.ts +0 -8
- package/lib/types-esm/index.d.ts +0 -40
- package/lib/types-esm/interfaces/PlatformTestingSdkOpts.d.ts +0 -8
- package/lib/types-esm/interfaces/index.d.ts +0 -4
- package/lib/types-esm/modules/feature/FeatureModule.d.ts +0 -2
- package/lib/types-esm/modules/feature/controllers/FeatureController.d.ts +0 -3
- package/lib/types-esm/tests/exports.d.ts +0 -2
- package/lib/types-esm/tests/testAcceptMime.d.ts +0 -2
- package/lib/types-esm/tests/testAuth.d.ts +0 -8
- package/lib/types-esm/tests/testBodyParams.d.ts +0 -3
- package/lib/types-esm/tests/testCache.d.ts +0 -2
- package/lib/types-esm/tests/testChildrenControllers.d.ts +0 -2
- package/lib/types-esm/tests/testCookies.d.ts +0 -11
- package/lib/types-esm/tests/testCustom404.d.ts +0 -2
- package/lib/types-esm/tests/testDeepQueryParams.d.ts +0 -3
- package/lib/types-esm/tests/testErrors.d.ts +0 -19
- package/lib/types-esm/tests/testHandlers.d.ts +0 -12
- package/lib/types-esm/tests/testHeaderParams.d.ts +0 -16
- package/lib/types-esm/tests/testHeaders.d.ts +0 -8
- package/lib/types-esm/tests/testInheritanceController.d.ts +0 -42
- package/lib/types-esm/tests/testLocals.d.ts +0 -2
- package/lib/types-esm/tests/testLocation.d.ts +0 -2
- package/lib/types-esm/tests/testMiddlewares.d.ts +0 -8
- package/lib/types-esm/tests/testModule.d.ts +0 -2
- package/lib/types-esm/tests/testMulter.d.ts +0 -21
- package/lib/types-esm/tests/testPathParams.d.ts +0 -2
- package/lib/types-esm/tests/testQueryParams.d.ts +0 -6
- package/lib/types-esm/tests/testRedirect.d.ts +0 -2
- package/lib/types-esm/tests/testResponse.d.ts +0 -16
- package/lib/types-esm/tests/testResponseFilter.d.ts +0 -2
- package/lib/types-esm/tests/testRouting.d.ts +0 -7
- package/lib/types-esm/tests/testScopeRequest.d.ts +0 -12
- package/lib/types-esm/tests/testSession.d.ts +0 -16
- package/lib/types-esm/tests/testStatics.d.ts +0 -2
- package/lib/types-esm/tests/testStream.d.ts +0 -2
- package/lib/types-esm/tests/testView.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-test-sdk",
|
|
3
3
|
"description": "Package to test platform adapter integration with Ts.ED",
|
|
4
|
-
"type": "
|
|
5
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "8.0.0-alpha.7",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
|
-
"main": "./lib/
|
|
7
|
+
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
9
9
|
"typings": "./lib/types/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./lib/types/index.d.ts",
|
|
13
13
|
"import": "./lib/esm/index.js",
|
|
14
|
-
"require": "./lib/cjs/index.js",
|
|
15
14
|
"default": "./lib/cjs/index.js"
|
|
16
15
|
}
|
|
17
16
|
},
|
|
@@ -28,27 +27,27 @@
|
|
|
28
27
|
"Adapter"
|
|
29
28
|
],
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@tsed/ajv": "8.0.0-alpha.
|
|
32
|
-
"@tsed/common": "8.0.0-alpha.
|
|
33
|
-
"@tsed/core": "8.0.0-alpha.
|
|
34
|
-
"@tsed/di": "8.0.0-alpha.
|
|
35
|
-
"@tsed/json-mapper": "8.0.0-alpha.
|
|
30
|
+
"@tsed/ajv": "8.0.0-alpha.7",
|
|
31
|
+
"@tsed/common": "8.0.0-alpha.7",
|
|
32
|
+
"@tsed/core": "8.0.0-alpha.7",
|
|
33
|
+
"@tsed/di": "8.0.0-alpha.7",
|
|
34
|
+
"@tsed/json-mapper": "8.0.0-alpha.7",
|
|
36
35
|
"@tsed/logger": "6.6.3",
|
|
37
|
-
"@tsed/platform-cache": "8.0.0-alpha.
|
|
38
|
-
"@tsed/platform-params": "8.0.0-alpha.
|
|
39
|
-
"@tsed/platform-router": "8.0.0-alpha.
|
|
40
|
-
"@tsed/platform-views": "8.0.0-alpha.
|
|
41
|
-
"@tsed/schema": "8.0.0-alpha.
|
|
42
|
-
"@tsed/swagger": "8.0.0-alpha.
|
|
43
|
-
"ajv": "^8.
|
|
36
|
+
"@tsed/platform-cache": "8.0.0-alpha.7",
|
|
37
|
+
"@tsed/platform-params": "8.0.0-alpha.7",
|
|
38
|
+
"@tsed/platform-router": "8.0.0-alpha.7",
|
|
39
|
+
"@tsed/platform-views": "8.0.0-alpha.7",
|
|
40
|
+
"@tsed/schema": "8.0.0-alpha.7",
|
|
41
|
+
"@tsed/swagger": "8.0.0-alpha.7",
|
|
42
|
+
"ajv": "^8.17.1",
|
|
44
43
|
"axios": "1.7.4",
|
|
45
44
|
"read-pkg-up": "7.0.1"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@tsed/barrels": "8.0.0-alpha.
|
|
49
|
-
"@tsed/typescript": "8.0.0-alpha.
|
|
50
|
-
"eslint": "
|
|
51
|
-
"typescript": "4.
|
|
47
|
+
"@tsed/barrels": "8.0.0-alpha.7",
|
|
48
|
+
"@tsed/typescript": "8.0.0-alpha.7",
|
|
49
|
+
"eslint": "9.11.1",
|
|
50
|
+
"typescript": "5.4.5"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {},
|
|
54
53
|
"repository": "https://github.com/tsedio/tsed",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformTestSdk = void 0;
|
|
4
|
-
const common_1 = require("@tsed/common");
|
|
5
|
-
const exports_js_1 = require("../tests/exports.js");
|
|
6
|
-
class PlatformTestSdk {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
this.options = options;
|
|
9
|
-
}
|
|
10
|
-
static create(options) {
|
|
11
|
-
return new PlatformTestSdk(options);
|
|
12
|
-
}
|
|
13
|
-
test(name, options = {}) {
|
|
14
|
-
exports_js_1.specsContainer.get(name)({
|
|
15
|
-
...this.options,
|
|
16
|
-
...options
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
bootstrap(options = {}) {
|
|
20
|
-
return common_1.PlatformTest.bootstrap(this.options.server, {
|
|
21
|
-
...this.options,
|
|
22
|
-
...options
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
reset() {
|
|
26
|
-
return common_1.PlatformTest.reset;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.PlatformTestSdk = PlatformTestSdk;
|
|
30
|
-
//# sourceMappingURL=PlatformTestSdk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformTestSdk.js","sourceRoot":"","sources":["../../../src/components/PlatformTestSdk.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;AAE1C,oDAAmD;AAEnD,MAAa,eAAe;IAC1B,YAA8B,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;IAAG,CAAC;IAEjE,MAAM,CAAC,MAAM,CAAC,OAA+B;QAC3C,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,UAAe,EAAE;QAClC,2BAAc,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;YACxB,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,UAAe,EAAE;QACzB,OAAO,qBAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACjD,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED,KAAK;QACH,OAAO,qBAAY,CAAC,KAAK,CAAC;IAC5B,CAAC;CACF;AAxBD,0CAwBC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.1",
|
|
3
|
-
"info": {
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"description": "Swagger description",
|
|
6
|
-
"title": "Swagger Title",
|
|
7
|
-
"termsOfService": "http://swagger.io/terms/",
|
|
8
|
-
"contact": {
|
|
9
|
-
"email": "apiteam@swagger.io"
|
|
10
|
-
},
|
|
11
|
-
"license": {
|
|
12
|
-
"name": "Apache 2.0",
|
|
13
|
-
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"components": {
|
|
17
|
-
"securitySchemes": {
|
|
18
|
-
"global_auth": {
|
|
19
|
-
"type": "oauth2",
|
|
20
|
-
"flows": {
|
|
21
|
-
"implicit": {
|
|
22
|
-
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
|
|
23
|
-
"scopes": {
|
|
24
|
-
"admin": "Admin access"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"paths": {}
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomBadRequest = void 0;
|
|
4
|
-
const exceptions_1 = require("@tsed/exceptions");
|
|
5
|
-
class CustomBadRequest extends exceptions_1.BadRequest {
|
|
6
|
-
constructor(message) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = "CUSTOM_BAD_REQUEST";
|
|
9
|
-
this.headers = {};
|
|
10
|
-
this.errors = ["test"];
|
|
11
|
-
this.headers = {
|
|
12
|
-
"X-HEADER-ERROR": "deny"
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.CustomBadRequest = CustomBadRequest;
|
|
17
|
-
//# sourceMappingURL=CustomBadRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomBadRequest.js","sourceRoot":"","sources":["../../../src/errors/CustomBadRequest.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAE5C,MAAa,gBAAiB,SAAQ,uBAAU;IAK9C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QALjB,SAAI,GAAG,oBAAoB,CAAC;QAE5B,YAAO,GAAG,EAAE,CAAC;QAIX,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG;YACb,gBAAgB,EAAE,MAAM;SACzB,CAAC;IACJ,CAAC;CACF;AAZD,4CAYC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomInternalError = void 0;
|
|
4
|
-
const exceptions_1 = require("@tsed/exceptions");
|
|
5
|
-
class CustomInternalError extends exceptions_1.InternalServerError {
|
|
6
|
-
constructor(message) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = "CUSTOM_INTERNAL_SERVER_ERROR";
|
|
9
|
-
this.headers = {};
|
|
10
|
-
this.errors = ["test"];
|
|
11
|
-
this.headers = {
|
|
12
|
-
"X-HEADER-ERROR": "deny"
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.CustomInternalError = CustomInternalError;
|
|
17
|
-
//# sourceMappingURL=CustomInternalError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomInternalError.js","sourceRoot":"","sources":["../../../src/errors/CustomInternalError.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAErD,MAAa,mBAAoB,SAAQ,gCAAmB;IAK1D,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QALjB,SAAI,GAAG,8BAA8B,CAAC;QAEtC,YAAO,GAAG,EAAE,CAAC;QAIX,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG;YACb,gBAAgB,EAAE,MAAM;SACzB,CAAC;IACJ,CAAC;CACF;AAZD,kDAYC"}
|
package/lib/cjs/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./components/PlatformTestSdk.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./errors/CustomBadRequest.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./errors/CustomInternalError.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./interfaces/index.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./interfaces/PlatformTestingSdkOpts.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./modules/feature/controllers/FeatureController.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./modules/feature/FeatureModule.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./tests/exports.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./tests/testAcceptMime.js"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./tests/testAuth.js"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./tests/testBodyParams.js"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./tests/testCache.js"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./tests/testChildrenControllers.js"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./tests/testCookies.js"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./tests/testCustom404.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./tests/testDeepQueryParams.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./tests/testErrors.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./tests/testHandlers.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./tests/testHeaderParams.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./tests/testHeaders.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./tests/testInheritanceController.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./tests/testLocals.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./tests/testLocation.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./tests/testMiddlewares.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./tests/testModule.js"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./tests/testMulter.js"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./tests/testPathParams.js"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./tests/testQueryParams.js"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./tests/testRedirect.js"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./tests/testResponse.js"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./tests/testResponseFilter.js"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./tests/testRouting.js"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./tests/testScopeRequest.js"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./tests/testSession.js"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./tests/testStatics.js"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./tests/testStream.js"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./tests/testView.js"), exports);
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,0EAAgD;AAChD,uEAA6C;AAC7C,0EAAgD;AAChD,gEAAsC;AACtC,iFAAuD;AACvD,6FAAmE;AACnE,6EAAmD;AACnD,6DAAmC;AACnC,oEAA0C;AAC1C,8DAAoC;AACpC,oEAA0C;AAC1C,+DAAqC;AACrC,6EAAmD;AACnD,iEAAuC;AACvC,mEAAyC;AACzC,yEAA+C;AAC/C,gEAAsC;AACtC,kEAAwC;AACxC,sEAA4C;AAC5C,iEAAuC;AACvC,+EAAqD;AACrD,gEAAsC;AACtC,kEAAwC;AACxC,qEAA2C;AAC3C,gEAAsC;AACtC,gEAAsC;AACtC,oEAA0C;AAC1C,qEAA2C;AAC3C,kEAAwC;AACxC,kEAAwC;AACxC,wEAA8C;AAC9C,iEAAuC;AACvC,sEAA4C;AAC5C,iEAAuC;AACvC,iEAAuC;AACvC,gEAAsC;AACtC,8DAAoC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformTestingSdkOpts.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformTestingSdkOpts.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./PlatformTestingSdkOpts.js"), exports);
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,sEAA4C"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeatureModule = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
const FeatureController_js_1 = require("./controllers/FeatureController.js");
|
|
7
|
-
let FeatureModule = class FeatureModule {
|
|
8
|
-
};
|
|
9
|
-
FeatureModule = tslib_1.__decorate([
|
|
10
|
-
(0, di_1.Module)({
|
|
11
|
-
mount: {
|
|
12
|
-
"/rest": [FeatureController_js_1.FeatureController]
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
], FeatureModule);
|
|
16
|
-
exports.FeatureModule = FeatureModule;
|
|
17
|
-
//# sourceMappingURL=FeatureModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureModule.js","sourceRoot":"","sources":["../../../../src/modules/feature/FeatureModule.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,6EAAqE;AAO9D,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,aAAa;IALzB,IAAA,WAAM,EAAC;QACN,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,wCAAiB,CAAC;SAC7B;KACF,CAAC;GACW,aAAa,CAAG;AAAhB,sCAAa"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FeatureController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@tsed/common");
|
|
6
|
-
const swagger_1 = require("@tsed/swagger");
|
|
7
|
-
let FeatureController = class FeatureController {
|
|
8
|
-
get() {
|
|
9
|
-
return "From feature";
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
tslib_1.__decorate([
|
|
13
|
-
(0, common_1.Get)("/"),
|
|
14
|
-
tslib_1.__metadata("design:type", Function),
|
|
15
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
16
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
17
|
-
], FeatureController.prototype, "get", null);
|
|
18
|
-
FeatureController = tslib_1.__decorate([
|
|
19
|
-
(0, swagger_1.Hidden)(),
|
|
20
|
-
(0, common_1.Controller)("/features")
|
|
21
|
-
], FeatureController);
|
|
22
|
-
exports.FeatureController = FeatureController;
|
|
23
|
-
//# sourceMappingURL=FeatureController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureController.js","sourceRoot":"","sources":["../../../../../src/modules/feature/controllers/FeatureController.ts"],"names":[],"mappings":";;;;AAAA,yCAA6C;AAC7C,2CAAqC;AAI9B,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE5B,GAAG;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJC;IAAC,IAAA,YAAG,EAAC,GAAG,CAAC;;;;4CAGR;AAJU,iBAAiB;IAF7B,IAAA,gBAAM,GAAE;IACR,IAAA,mBAAU,EAAC,WAAW,CAAC;GACX,iBAAiB,CAK7B;AALY,8CAAiB"}
|
package/lib/cjs/package.json
DELETED
package/lib/cjs/tests/exports.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.specsContainer = void 0;
|
|
4
|
-
const testAcceptMime_js_1 = require("./testAcceptMime.js");
|
|
5
|
-
const testAuth_js_1 = require("./testAuth.js");
|
|
6
|
-
const testBodyParams_js_1 = require("./testBodyParams.js");
|
|
7
|
-
const testChildrenControllers_js_1 = require("./testChildrenControllers.js");
|
|
8
|
-
const testCookies_js_1 = require("./testCookies.js");
|
|
9
|
-
const testCustom404_js_1 = require("./testCustom404.js");
|
|
10
|
-
const testDeepQueryParams_js_1 = require("./testDeepQueryParams.js");
|
|
11
|
-
const testErrors_js_1 = require("./testErrors.js");
|
|
12
|
-
const testHandlers_js_1 = require("./testHandlers.js");
|
|
13
|
-
const testHeaderParams_js_1 = require("./testHeaderParams.js");
|
|
14
|
-
const testHeaders_js_1 = require("./testHeaders.js");
|
|
15
|
-
const testInheritanceController_js_1 = require("./testInheritanceController.js");
|
|
16
|
-
const testLocals_js_1 = require("./testLocals.js");
|
|
17
|
-
const testLocation_js_1 = require("./testLocation.js");
|
|
18
|
-
const testMiddlewares_js_1 = require("./testMiddlewares.js");
|
|
19
|
-
const testModule_js_1 = require("./testModule.js");
|
|
20
|
-
const testMulter_js_1 = require("./testMulter.js");
|
|
21
|
-
const testPathParams_js_1 = require("./testPathParams.js");
|
|
22
|
-
const testQueryParams_js_1 = require("./testQueryParams.js");
|
|
23
|
-
const testRedirect_js_1 = require("./testRedirect.js");
|
|
24
|
-
const testResponse_js_1 = require("./testResponse.js");
|
|
25
|
-
const testResponseFilter_js_1 = require("./testResponseFilter.js");
|
|
26
|
-
const testRouting_js_1 = require("./testRouting.js");
|
|
27
|
-
const testScopeRequest_js_1 = require("./testScopeRequest.js");
|
|
28
|
-
const testSession_js_1 = require("./testSession.js");
|
|
29
|
-
const testStatics_js_1 = require("./testStatics.js");
|
|
30
|
-
const testStream_js_1 = require("./testStream.js");
|
|
31
|
-
const testView_js_1 = require("./testView.js");
|
|
32
|
-
const testCache_js_1 = require("./testCache.js");
|
|
33
|
-
exports.specsContainer = new Map();
|
|
34
|
-
// HANDLERS AND MIDDLEWARES
|
|
35
|
-
exports.specsContainer.set("handlers", testHandlers_js_1.testHandlers);
|
|
36
|
-
exports.specsContainer.set("auth", testAuth_js_1.testAuth);
|
|
37
|
-
exports.specsContainer.set("middlewares", testMiddlewares_js_1.testMiddlewares);
|
|
38
|
-
// RESPONSES
|
|
39
|
-
exports.specsContainer.set("headers", testHeaders_js_1.testHeaders);
|
|
40
|
-
exports.specsContainer.set("acceptMime", testAcceptMime_js_1.testAcceptMime);
|
|
41
|
-
exports.specsContainer.set("location", testLocation_js_1.testLocation);
|
|
42
|
-
exports.specsContainer.set("redirect", testRedirect_js_1.testRedirect);
|
|
43
|
-
exports.specsContainer.set("view", testView_js_1.testView);
|
|
44
|
-
exports.specsContainer.set("errors", testErrors_js_1.testErrors);
|
|
45
|
-
exports.specsContainer.set("response", testResponse_js_1.testResponse);
|
|
46
|
-
exports.specsContainer.set("stream", testStream_js_1.testStream);
|
|
47
|
-
exports.specsContainer.set("responseFilter", testResponseFilter_js_1.testResponseFilter);
|
|
48
|
-
exports.specsContainer.set("custom404", testCustom404_js_1.testCustom404);
|
|
49
|
-
exports.specsContainer.set("statics", testStatics_js_1.testStatics);
|
|
50
|
-
exports.specsContainer.set("cache", testCache_js_1.testCache);
|
|
51
|
-
// INPUTS
|
|
52
|
-
exports.specsContainer.set("cookies", testCookies_js_1.testCookies);
|
|
53
|
-
exports.specsContainer.set("session", testSession_js_1.testSession);
|
|
54
|
-
exports.specsContainer.set("headerParams", testHeaderParams_js_1.testHeaderParams);
|
|
55
|
-
exports.specsContainer.set("bodyParams", testBodyParams_js_1.testBodyParams);
|
|
56
|
-
exports.specsContainer.set("pathParams", testPathParams_js_1.testPathParams);
|
|
57
|
-
exports.specsContainer.set("queryParams", testQueryParams_js_1.testQueryParams);
|
|
58
|
-
exports.specsContainer.set("deepQueryParams", testDeepQueryParams_js_1.testDeepQueryParams);
|
|
59
|
-
exports.specsContainer.set("locals", testLocals_js_1.testLocals);
|
|
60
|
-
exports.specsContainer.set("multer", testMulter_js_1.testMulter);
|
|
61
|
-
// ROUTING
|
|
62
|
-
exports.specsContainer.set("scopeRequest", testScopeRequest_js_1.testScopeRequest);
|
|
63
|
-
exports.specsContainer.set("routing", testRouting_js_1.testRouting);
|
|
64
|
-
// CODE ORGANIZATION
|
|
65
|
-
exports.specsContainer.set("childrenControllers", testChildrenControllers_js_1.testChildrenControllers);
|
|
66
|
-
exports.specsContainer.set("inheritanceController", testInheritanceController_js_1.testInheritanceController);
|
|
67
|
-
exports.specsContainer.set("module", testModule_js_1.testModule);
|
|
68
|
-
//# sourceMappingURL=exports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/tests/exports.ts"],"names":[],"mappings":";;;AACA,2DAAmD;AACnD,+CAAuC;AACvC,2DAAmD;AACnD,6EAAqE;AACrE,qDAA6C;AAC7C,yDAAiD;AACjD,qEAA6D;AAC7D,mDAA2C;AAC3C,uDAA+C;AAC/C,+DAAuD;AACvD,qDAA6C;AAC7C,iFAAyE;AACzE,mDAA2C;AAC3C,uDAA+C;AAC/C,6DAAqD;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AAS,CAAC,CAAC;AAEvC,SAAS;AACT,sBAAc,CAAC,GAAG,CAAC,SAAS,EAAE,4BAAW,CAAC,CAAC;AAC3C,sBAAc,CAAC,GAAG,CAAC,SAAS,EAAE,4BAAW,CAAC,CAAC;AAC3C,sBAAc,CAAC,GAAG,CAAC,cAAc,EAAE,sCAAgB,CAAC,CAAC;AACrD,sBAAc,CAAC,GAAG,CAAC,YAAY,EAAE,kCAAc,CAAC,CAAC;AACjD,sBAAc,CAAC,GAAG,CAAC,YAAY,EAAE,kCAAc,CAAC,CAAC;AACjD,sBAAc,CAAC,GAAG,CAAC,aAAa,EAAE,oCAAe,CAAC,CAAC;AACnD,sBAAc,CAAC,GAAG,CAAC,iBAAiB,EAAE,4CAAmB,CAAC,CAAC;AAC3D,sBAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAU,CAAC,CAAC;AACzC,sBAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAU,CAAC,CAAC;AAEzC,UAAU;AACV,sBAAc,CAAC,GAAG,CAAC,cAAc,EAAE,sCAAgB,CAAC,CAAC;AACrD,sBAAc,CAAC,GAAG,CAAC,SAAS,EAAE,4BAAW,CAAC,CAAC;AAE3C,oBAAoB;AACpB,sBAAc,CAAC,GAAG,CAAC,qBAAqB,EAAE,oDAAuB,CAAC,CAAC;AACnE,sBAAc,CAAC,GAAG,CAAC,uBAAuB,EAAE,wDAAyB,CAAC,CAAC;AACvE,sBAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,0BAAU,CAAC,CAAC"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.testAcceptMime = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@tsed/common");
|
|
6
|
-
const schema_1 = require("@tsed/schema");
|
|
7
|
-
const supertest_1 = tslib_1.__importDefault(require("supertest"));
|
|
8
|
-
let TestAcceptMimeCtrl = class TestAcceptMimeCtrl {
|
|
9
|
-
scenario1(accept) {
|
|
10
|
-
return {
|
|
11
|
-
accept
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
ping() {
|
|
15
|
-
return "pong";
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, common_1.Post)("/scenario-1"),
|
|
20
|
-
(0, common_1.AcceptMime)("application/json"),
|
|
21
|
-
tslib_1.__param(0, (0, common_1.HeaderParams)("Accept")),
|
|
22
|
-
tslib_1.__metadata("design:type", Function),
|
|
23
|
-
tslib_1.__metadata("design:paramtypes", [String]),
|
|
24
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
25
|
-
], TestAcceptMimeCtrl.prototype, "scenario1", null);
|
|
26
|
-
tslib_1.__decorate([
|
|
27
|
-
(0, common_1.Get)("/scenario-2"),
|
|
28
|
-
(0, schema_1.ContentType)("text"),
|
|
29
|
-
(0, common_1.AcceptMime)("text"),
|
|
30
|
-
tslib_1.__metadata("design:type", Function),
|
|
31
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
32
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
33
|
-
], TestAcceptMimeCtrl.prototype, "ping", null);
|
|
34
|
-
TestAcceptMimeCtrl = tslib_1.__decorate([
|
|
35
|
-
(0, common_1.Controller)("/accept-mime")
|
|
36
|
-
], TestAcceptMimeCtrl);
|
|
37
|
-
function testAcceptMime(options) {
|
|
38
|
-
let request;
|
|
39
|
-
beforeAll(common_1.PlatformTest.bootstrap(options.server, {
|
|
40
|
-
...options,
|
|
41
|
-
mount: {
|
|
42
|
-
"/rest": [TestAcceptMimeCtrl]
|
|
43
|
-
}
|
|
44
|
-
}));
|
|
45
|
-
beforeAll(() => {
|
|
46
|
-
request = (0, supertest_1.default)(common_1.PlatformTest.callback());
|
|
47
|
-
});
|
|
48
|
-
afterAll(common_1.PlatformTest.reset);
|
|
49
|
-
describe("Scenario 1: POST /rest/accept-mime/scenario-1", () => {
|
|
50
|
-
it('should return a 200 response when Accept header match with @AcceptMime("application/json")', async () => {
|
|
51
|
-
const response = await request
|
|
52
|
-
.post("/rest/accept-mime/scenario-1")
|
|
53
|
-
.set({
|
|
54
|
-
Accept: "application/json"
|
|
55
|
-
})
|
|
56
|
-
.expect(200);
|
|
57
|
-
expect(response.body).toEqual({
|
|
58
|
-
accept: "application/json"
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
it('should return a 406 response when Accept header doesn\'t match with @AcceptMime("application/json")', async () => {
|
|
62
|
-
const response = await request
|
|
63
|
-
.post("/rest/accept-mime/scenario-1")
|
|
64
|
-
.set({
|
|
65
|
-
Accept: "application/xml"
|
|
66
|
-
})
|
|
67
|
-
.expect(406);
|
|
68
|
-
expect(response.body).toEqual({
|
|
69
|
-
name: "NOT_ACCEPTABLE",
|
|
70
|
-
message: "You must accept content-type application/json",
|
|
71
|
-
status: 406,
|
|
72
|
-
errors: []
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
describe("Scenario 2: GET /rest/accept-mime/scenario-2", () => {
|
|
77
|
-
it('should return a 200 response when Accept header match with @AcceptMime("text")', async () => {
|
|
78
|
-
const response = await request
|
|
79
|
-
.get("/rest/accept-mime/scenario-2")
|
|
80
|
-
.set({
|
|
81
|
-
Accept: "text/*, application/json"
|
|
82
|
-
})
|
|
83
|
-
.expect(200);
|
|
84
|
-
expect(response.text).toEqual("pong");
|
|
85
|
-
});
|
|
86
|
-
it('should return a 406 response when Accept header doesn\'t match with @AcceptMime("text")', async () => {
|
|
87
|
-
const response = await request
|
|
88
|
-
.get("/rest/accept-mime/scenario-2")
|
|
89
|
-
.set({
|
|
90
|
-
Accept: "application/xml"
|
|
91
|
-
})
|
|
92
|
-
.expect(406);
|
|
93
|
-
expect(response.body).toEqual({
|
|
94
|
-
name: "NOT_ACCEPTABLE",
|
|
95
|
-
message: "You must accept content-type text",
|
|
96
|
-
status: 406,
|
|
97
|
-
errors: []
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
exports.testAcceptMime = testAcceptMime;
|
|
103
|
-
//# sourceMappingURL=testAcceptMime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testAcceptMime.js","sourceRoot":"","sources":["../../../src/tests/testAcceptMime.ts"],"names":[],"mappings":";;;;AAAA,yCAA2F;AAC3F,yCAAyC;AACzC,kEAAkC;AAIlC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGtB,SAAS,CAAyB,MAAc;QAC9C,OAAO;YACL,MAAM;SACP,CAAC;IACJ,CAAC;IAKM,IAAI;QACT,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAdC;IAAC,IAAA,aAAI,EAAC,aAAa,CAAC;IACnB,IAAA,mBAAU,EAAC,kBAAkB,CAAC;IACpB,mBAAA,IAAA,qBAAY,EAAC,QAAQ,CAAC,CAAA;;;;mDAIhC;AAED;IAAC,IAAA,YAAG,EAAC,aAAa,CAAC;IAClB,IAAA,oBAAW,EAAC,MAAM,CAAC;IACnB,IAAA,mBAAU,EAAC,MAAM,CAAC;;;;8CAGlB;AAdG,kBAAkB;IADvB,IAAA,mBAAU,EAAC,cAAc,CAAC;GACrB,kBAAkB,CAevB;AAED,SAAgB,cAAc,CAAC,OAA+B;IAC5D,IAAI,OAAwB,CAAC;IAE7B,SAAS,CACP,qBAAY,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE;QACrC,GAAG,OAAO;QACV,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,kBAAkB,CAAC;SAC9B;KACF,CAAC,CACH,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,IAAA,mBAAS,EAAC,qBAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,qBAAY,CAAC,KAAK,CAAC,C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