@tsed/platform-test-sdk 7.79.3 → 7.80.0

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.
Files changed (102) hide show
  1. package/lib/cjs/tests/testHeaders.js +8 -24
  2. package/lib/cjs/tests/testHeaders.js.map +1 -1
  3. package/lib/cjs/tests/testInheritanceController.js +2 -1
  4. package/lib/cjs/tests/testInheritanceController.js.map +1 -1
  5. package/lib/cjs/tests/testMulter.js +5 -3
  6. package/lib/cjs/tests/testMulter.js.map +1 -1
  7. package/lib/cjs/tests/testRouting.js +4 -2
  8. package/lib/cjs/tests/testRouting.js.map +1 -1
  9. package/lib/cjs/tests/testStream.js +1 -1
  10. package/lib/esm/tests/testHeaders.js +8 -24
  11. package/lib/esm/tests/testHeaders.js.map +1 -1
  12. package/lib/esm/tests/testInheritanceController.js +2 -1
  13. package/lib/esm/tests/testInheritanceController.js.map +1 -1
  14. package/lib/esm/tests/testMulter.js +6 -4
  15. package/lib/esm/tests/testMulter.js.map +1 -1
  16. package/lib/esm/tests/testRouting.js +4 -2
  17. package/lib/esm/tests/testRouting.js.map +1 -1
  18. package/lib/esm/tests/testStream.js +1 -1
  19. package/lib/types-esm/components/PlatformTestSdk.d.ts +9 -0
  20. package/lib/types-esm/errors/CustomBadRequest.d.ts +8 -0
  21. package/lib/types-esm/errors/CustomInternalError.d.ts +8 -0
  22. package/lib/types-esm/interfaces/PlatformTestingSdkOpts.d.ts +8 -0
  23. package/lib/types-esm/modules/feature/FeatureModule.d.ts +2 -0
  24. package/lib/types-esm/modules/feature/controllers/FeatureController.d.ts +3 -0
  25. package/lib/types-esm/tests/exports.d.ts +2 -0
  26. package/lib/types-esm/tests/testAcceptMime.d.ts +2 -0
  27. package/lib/types-esm/tests/testAuth.d.ts +8 -0
  28. package/lib/types-esm/tests/testBodyParams.d.ts +3 -0
  29. package/lib/types-esm/tests/testCache.d.ts +2 -0
  30. package/lib/types-esm/tests/testChildrenControllers.d.ts +2 -0
  31. package/lib/types-esm/tests/testCookies.d.ts +11 -0
  32. package/lib/types-esm/tests/testCustom404.d.ts +2 -0
  33. package/lib/types-esm/tests/testDeepQueryParams.d.ts +3 -0
  34. package/lib/types-esm/tests/testErrors.d.ts +19 -0
  35. package/lib/types-esm/tests/testHandlers.d.ts +12 -0
  36. package/lib/types-esm/tests/testHeaderParams.d.ts +16 -0
  37. package/lib/types-esm/tests/testHeaders.d.ts +8 -0
  38. package/lib/types-esm/tests/testInheritanceController.d.ts +42 -0
  39. package/lib/types-esm/tests/testLocals.d.ts +2 -0
  40. package/lib/types-esm/tests/testLocation.d.ts +2 -0
  41. package/lib/types-esm/tests/testMiddlewares.d.ts +8 -0
  42. package/lib/types-esm/tests/testModule.d.ts +2 -0
  43. package/lib/types-esm/tests/testMulter.d.ts +21 -0
  44. package/lib/types-esm/tests/testPathParams.d.ts +2 -0
  45. package/lib/types-esm/tests/testQueryParams.d.ts +6 -0
  46. package/lib/types-esm/tests/testRedirect.d.ts +2 -0
  47. package/lib/types-esm/tests/testResponse.d.ts +16 -0
  48. package/lib/types-esm/tests/testResponseFilter.d.ts +2 -0
  49. package/lib/types-esm/tests/testRouting.d.ts +7 -0
  50. package/lib/types-esm/tests/testScopeRequest.d.ts +12 -0
  51. package/lib/types-esm/tests/testSession.d.ts +16 -0
  52. package/lib/types-esm/tests/testStatics.d.ts +2 -0
  53. package/lib/types-esm/tests/testStream.d.ts +2 -0
  54. package/lib/types-esm/tests/testView.d.ts +2 -0
  55. package/package.json +22 -20
  56. package/lib/cjs/package.json +0 -3
  57. package/lib/esm/package.json +0 -3
  58. package/lib/tsconfig.esm.tsbuildinfo +0 -1
  59. package/lib/tsconfig.tsbuildinfo +0 -1
  60. package/src/components/PlatformTestSdk.ts +0 -29
  61. package/src/data/file.txt +0 -1
  62. package/src/data/response.data.json +0 -3
  63. package/src/data/swagger.json +0 -32
  64. package/src/errors/CustomBadRequest.ts +0 -16
  65. package/src/errors/CustomInternalError.ts +0 -16
  66. package/src/interfaces/PlatformTestingSdkOpts.ts +0 -10
  67. package/src/modules/feature/FeatureModule.ts +0 -9
  68. package/src/modules/feature/controllers/FeatureController.ts +0 -11
  69. package/src/tests/exports.ts +0 -71
  70. package/src/tests/testAcceptMime.ts +0 -95
  71. package/src/tests/testAuth.ts +0 -339
  72. package/src/tests/testBodyParams.ts +0 -483
  73. package/src/tests/testCache.ts +0 -279
  74. package/src/tests/testChildrenControllers.ts +0 -55
  75. package/src/tests/testCookies.ts +0 -36
  76. package/src/tests/testCustom404.ts +0 -33
  77. package/src/tests/testDeepQueryParams.ts +0 -120
  78. package/src/tests/testErrors.ts +0 -226
  79. package/src/tests/testHandlers.ts +0 -90
  80. package/src/tests/testHeaderParams.ts +0 -152
  81. package/src/tests/testHeaders.ts +0 -91
  82. package/src/tests/testInheritanceController.ts +0 -200
  83. package/src/tests/testLocals.ts +0 -46
  84. package/src/tests/testLocation.ts +0 -37
  85. package/src/tests/testMiddlewares.ts +0 -159
  86. package/src/tests/testModule.ts +0 -46
  87. package/src/tests/testMulter.ts +0 -151
  88. package/src/tests/testPathParams.ts +0 -123
  89. package/src/tests/testQueryParams.ts +0 -233
  90. package/src/tests/testRedirect.ts +0 -124
  91. package/src/tests/testResponse.ts +0 -528
  92. package/src/tests/testResponseFilter.ts +0 -101
  93. package/src/tests/testRouting.ts +0 -65
  94. package/src/tests/testScopeRequest.ts +0 -111
  95. package/src/tests/testSession.ts +0 -103
  96. package/src/tests/testStatics.ts +0 -61
  97. package/src/tests/testStream.ts +0 -59
  98. package/src/tests/testView.ts +0 -68
  99. package/tsconfig.esm.json +0 -63
  100. package/tsconfig.json +0 -63
  101. /package/{src/index.ts → lib/types-esm/index.d.ts} +0 -0
  102. /package/{src/interfaces/index.ts → lib/types-esm/interfaces/index.d.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare class Resource {
3
+ id: string;
4
+ name: string;
5
+ }
6
+ export declare class BaseController<T extends {
7
+ id: string;
8
+ }> {
9
+ resources: T[];
10
+ get(id: string): Promise<any>;
11
+ list(): Promise<any[]>;
12
+ }
13
+ export declare class ResourcesCtrl extends BaseController<Resource> {
14
+ resources: {
15
+ id: string;
16
+ name: string;
17
+ }[];
18
+ get(id: string): Promise<any>;
19
+ post(resource: Resource): Resource;
20
+ }
21
+ declare abstract class AttachmentController {
22
+ getAll(parentID: string): string;
23
+ }
24
+ export declare class FindingsController extends AttachmentController {
25
+ get(): string;
26
+ }
27
+ export declare abstract class TestBaseController {
28
+ scenario3(search: string): {
29
+ search: string;
30
+ };
31
+ scenario5(q: string): {
32
+ data: string;
33
+ };
34
+ }
35
+ export declare class TestChildController extends TestBaseController {
36
+ scenario4(id: string): any;
37
+ scenario5(s: string): {
38
+ data: string;
39
+ };
40
+ }
41
+ export declare function testInheritanceController(options: PlatformTestingSdkOpts): void;
42
+ export {};
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testLocals(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testLocation(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,8 @@
1
+ import "@tsed/ajv";
2
+ import { MiddlewareMethods } from "@tsed/common";
3
+ import { Exception } from "@tsed/exceptions";
4
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
5
+ export declare class CatchErrorMiddleware implements MiddlewareMethods {
6
+ use(err: Exception): void;
7
+ }
8
+ export declare function testMiddlewares(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testModule(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,21 @@
1
+ import { PlatformMulterFile } from "@tsed/common";
2
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
+ export declare class Task {
4
+ id: string;
5
+ title: string;
6
+ }
7
+ export declare class Event {
8
+ id: string;
9
+ tasks: Task[];
10
+ }
11
+ export declare class TestMulterController {
12
+ uploadWithName(media: PlatformMulterFile): string;
13
+ uploadWithPayload(media: PlatformMulterFile, formId: string): {
14
+ file: string;
15
+ formId: string;
16
+ };
17
+ uploadWithOptions(media: PlatformMulterFile): {
18
+ file: string;
19
+ };
20
+ }
21
+ export declare function testMulter(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testPathParams(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,6 @@
1
+ import "@tsed/ajv";
2
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
3
+ export declare class RandomStringModel {
4
+ length: number;
5
+ }
6
+ export declare function testQueryParams(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testRedirect(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,16 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare enum EnumValue {
3
+ One = "one",
4
+ Two = "two"
5
+ }
6
+ export declare class NestedEnum {
7
+ value: EnumValue;
8
+ }
9
+ export declare class TestNestedEnum {
10
+ nested: NestedEnum;
11
+ }
12
+ export declare class ModelGroup {
13
+ id: string;
14
+ groups: string;
15
+ }
16
+ export declare function testResponse(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testResponseFilter(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,7 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare class TestRoutingController {
3
+ scenario1(): string;
4
+ scenario2(): string;
5
+ scenario3(): string;
6
+ }
7
+ export declare function testRouting(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,12 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare class ScopeRequestService {
3
+ user: string;
4
+ }
5
+ export declare class ScopeRequestCtrl {
6
+ scopeRequestService: ScopeRequestService;
7
+ userId: string | null;
8
+ constructor(scopeRequestService: ScopeRequestService);
9
+ $onDestroy(): void;
10
+ testPerRequest(userId: string): Promise<any>;
11
+ }
12
+ export declare function testScopeRequest(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,16 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare class UserCreation {
3
+ name: string;
4
+ email: string;
5
+ password: string;
6
+ }
7
+ export declare class User extends UserCreation {
8
+ password: string;
9
+ }
10
+ export declare class SessionCtrl {
11
+ platformName: string;
12
+ connect(session: any, user: UserCreation): Promise<UserCreation>;
13
+ userInfo(user: User): Promise<User>;
14
+ logout(req: any): any;
15
+ }
16
+ export declare function testSession(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testStatics(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testStream(options: PlatformTestingSdkOpts): void;
@@ -0,0 +1,2 @@
1
+ import { PlatformTestingSdkOpts } from "../interfaces/index.js";
2
+ export declare function testView(options: PlatformTestingSdkOpts): void;
package/package.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "@tsed/platform-test-sdk",
3
- "version": "7.79.3",
4
3
  "description": "Package to test platform adapter integration with Ts.ED",
4
+ "type": "commonjs",
5
+ "version": "7.80.0",
5
6
  "source": "./src/index.ts",
6
7
  "main": "./lib/cjs/index.js",
7
8
  "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
- "types": "./lib/types/index.d.ts",
11
- "import": "./lib/esm/index.js",
12
- "require": "./lib/cjs/index.js",
13
- "default": "./lib/esm/index.js"
11
+ ".": {
12
+ "types": "./lib/types/index.d.ts",
13
+ "import": "./lib/esm/index.js",
14
+ "default": "./lib/cjs/index.js"
15
+ }
14
16
  },
15
17
  "scripts": {
16
18
  "build": "yarn barrels && yarn build:ts",
17
19
  "barrels": "barrels",
18
- "build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json"
20
+ "build:ts": "tsc --build tsconfig.json"
19
21
  },
20
22
  "keywords": [
21
23
  "Ts.ED",
@@ -25,25 +27,25 @@
25
27
  "Adapter"
26
28
  ],
27
29
  "dependencies": {
28
- "@tsed/ajv": "7.79.3",
29
- "@tsed/common": "7.79.3",
30
- "@tsed/core": "7.79.3",
31
- "@tsed/di": "7.79.3",
32
- "@tsed/json-mapper": "7.79.3",
30
+ "@tsed/ajv": "7.80.0",
31
+ "@tsed/common": "7.80.0",
32
+ "@tsed/core": "7.80.0",
33
+ "@tsed/di": "7.80.0",
34
+ "@tsed/json-mapper": "7.80.0",
33
35
  "@tsed/logger": "6.6.3",
34
- "@tsed/platform-cache": "7.79.3",
35
- "@tsed/platform-params": "7.79.3",
36
- "@tsed/platform-router": "7.79.3",
37
- "@tsed/platform-views": "7.79.3",
38
- "@tsed/schema": "7.79.3",
39
- "@tsed/swagger": "7.79.3",
36
+ "@tsed/platform-cache": "7.80.0",
37
+ "@tsed/platform-params": "7.80.0",
38
+ "@tsed/platform-router": "7.80.0",
39
+ "@tsed/platform-views": "7.80.0",
40
+ "@tsed/schema": "7.80.0",
41
+ "@tsed/swagger": "7.80.0",
40
42
  "ajv": "^8.12.0",
41
- "axios": "1.6.8",
43
+ "axios": "1.7.4",
42
44
  "read-pkg-up": "7.0.1"
43
45
  },
44
46
  "devDependencies": {
45
- "@tsed/barrels": "7.79.3",
46
- "@tsed/typescript": "7.79.3",
47
+ "@tsed/barrels": "7.80.0",
48
+ "@tsed/typescript": "7.80.0",
47
49
  "eslint": "^8.57.0",
48
50
  "jest": "^29.7.0",
49
51
  "typescript": "4.9.5"
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }