@tsed/platform-serverless 8.33.0 → 8.35.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.
@@ -1,12 +1,12 @@
1
1
  import { Env } from "@tsed/core";
2
2
  import { configuration, constant, createContainer, destroyInjector, injector, setLoggerConfiguration } from "@tsed/di";
3
+ import { ServerlessResponseStream } from "../domain/ServerlessResponseStream.js";
4
+ import { getOperationsRoutes, s } from "@tsed/schema";
3
5
  import { $asyncEmit } from "@tsed/hooks";
4
6
  import { $log } from "@tsed/logger";
5
- import { getOperationsRoutes, JsonEntityStore } from "@tsed/schema";
7
+ import { PlatformServerlessHandler } from "./PlatformServerlessHandler.js";
6
8
  import { ServerlessContext } from "../domain/ServerlessContext.js";
7
- import { ServerlessResponseStream } from "../domain/ServerlessResponseStream.js";
8
9
  import { getRequestId } from "../utils/getRequestId.js";
9
- import { PlatformServerlessHandler } from "./PlatformServerlessHandler.js";
10
10
  /**
11
11
  * @platform
12
12
  */
@@ -14,15 +14,15 @@ export class PlatformServerless {
14
14
  constructor() {
15
15
  this.name = "PlatformServerless";
16
16
  }
17
+ get promise() {
18
+ return this._promise;
19
+ }
17
20
  get injector() {
18
21
  return injector();
19
22
  }
20
23
  get settings() {
21
24
  return configuration();
22
25
  }
23
- get promise() {
24
- return this._promise;
25
- }
26
26
  static bootstrap(settings = {}) {
27
27
  const platform = new PlatformServerless();
28
28
  platform.createInjector(settings);
@@ -94,7 +94,7 @@ export class PlatformServerless {
94
94
  return this._promise;
95
95
  }
96
96
  callback(token, propertyKey) {
97
- const entity = JsonEntityStore.fromMethod(token, propertyKey);
97
+ const entity = s.store.method(token, propertyKey);
98
98
  let handler;
99
99
  const wrappedHandler = async (event, responseStream, context) => {
100
100
  await this.init();
@@ -1,10 +1,10 @@
1
- import { pipeline } from "node:stream/promises";
2
1
  import { AnyToPromise, isSerializable, isStream } from "@tsed/core";
3
- import { inject, injectable, lazyInject, ProviderScope, runInContext } from "@tsed/di";
4
- import { $asyncEmit } from "@tsed/hooks";
5
- import { serialize } from "@tsed/json-mapper";
2
+ import { ProviderScope, inject, injectable, lazyInject, runInContext } from "@tsed/di";
6
3
  import { DeserializerPipe, PlatformParams, ValidationPipe } from "@tsed/platform-params";
4
+ import { $asyncEmit } from "@tsed/hooks";
7
5
  import { ServerlessResponseStream } from "../domain/ServerlessResponseStream.js";
6
+ import { pipeline } from "node:stream/promises";
7
+ import { serialize } from "@tsed/json-mapper";
8
8
  import { setResponseHeaders } from "../utils/setResponseHeaders.js";
9
9
  export class PlatformServerlessHandler {
10
10
  constructor() {
@@ -1,6 +1,6 @@
1
- import { getValue } from "@tsed/core";
2
- import { getStatusMessage } from "@tsed/schema";
3
1
  import encodeUrl from "encodeurl";
2
+ import { getStatusMessage } from "@tsed/schema";
3
+ import { getValue } from "@tsed/core";
4
4
  import mime from "mime";
5
5
  /**
6
6
  * @platform
@@ -1,9 +1,9 @@
1
- import { Type } from "@tsed/core";
2
- import { InjectorService } from "@tsed/di";
3
1
  import type { Handler } from "aws-lambda";
2
+ import { Type } from "@tsed/core";
4
3
  import type { Instance } from "find-my-way";
5
- import type { ServerlessEvent } from "../domain/ServerlessEvent.js";
4
+ import { InjectorService } from "@tsed/di";
6
5
  import { type RequestHandler } from "../domain/ServerlessResponseStream.js";
6
+ import type { ServerlessEvent } from "../domain/ServerlessEvent.js";
7
7
  export interface PlatformServerlessSettings extends Partial<TsED.Configuration> {
8
8
  lambda?: Type[];
9
9
  }
@@ -14,9 +14,9 @@ export declare class PlatformServerless {
14
14
  readonly name: string;
15
15
  private _router;
16
16
  private _promise;
17
+ get promise(): Promise<any>;
17
18
  get injector(): InjectorService;
18
19
  get settings(): TsED.Configuration & import("@tsed/di").DIConfiguration;
19
- get promise(): Promise<any>;
20
20
  static bootstrap(settings?: Partial<TsED.Configuration> & {
21
21
  lambda?: Type[];
22
22
  }): PlatformServerless;
@@ -1,6 +1,6 @@
1
+ import type { APIGatewayProxyEvent, Context } from "aws-lambda";
1
2
  import { DIContext, DIContextOptions } from "@tsed/di";
2
3
  import { JsonEntityStore } from "@tsed/schema";
3
- import type { APIGatewayProxyEvent, Context } from "aws-lambda";
4
4
  import { ServerlessRequest } from "./ServerlessRequest.js";
5
5
  import { ServerlessResponse } from "./ServerlessResponse.js";
6
6
  import type { ServerlessResponseStream } from "./ServerlessResponseStream.js";
@@ -1,2 +1,2 @@
1
- import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayTokenAuthorizerEvent, CloudWatchLogsEvent, DynamoDBStreamEvent, KinesisStreamEvent, S3Event, ScheduledEvent, SNSEvent, SQSEvent } from "aws-lambda";
1
+ import type { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayTokenAuthorizerEvent, CloudWatchLogsEvent, DynamoDBStreamEvent, KinesisStreamEvent, S3Event, SNSEvent, SQSEvent, ScheduledEvent } from "aws-lambda";
2
2
  export type ServerlessEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2 | S3Event | SQSEvent | SNSEvent | DynamoDBStreamEvent | KinesisStreamEvent | CloudWatchLogsEvent | ScheduledEvent | APIGatewayTokenAuthorizerEvent;
@@ -1,5 +1,5 @@
1
- import { Stream } from "node:stream";
2
1
  import type { APIGatewayProxyEventV2, Callback, Context, Handler } from "aws-lambda";
2
+ import { Stream } from "node:stream";
3
3
  export type ServerlessResponseMeta = {
4
4
  statusCode: number;
5
5
  headers: Record<string, string>;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tsed/platform-serverless",
3
+ "version": "8.35.0",
3
4
  "description": "Platform serverless module for Ts.ED Framework",
4
- "type": "module",
5
- "version": "8.33.0",
6
5
  "source": "./src/index.ts",
6
+ "type": "module",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
@@ -23,27 +23,26 @@
23
23
  "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
24
24
  },
25
25
  "dependencies": {
26
- "@tsed/core": "8.33.0",
27
- "@tsed/di": "8.33.0",
28
- "@tsed/exceptions": "8.33.0",
29
- "@tsed/hooks": "8.33.0",
30
- "@tsed/json-mapper": "8.33.0",
31
- "@tsed/platform-exceptions": "8.33.0",
32
- "@tsed/platform-params": "8.33.0",
33
- "@tsed/schema": "8.33.0",
26
+ "@tsed/core": "8.35.0",
27
+ "@tsed/di": "8.35.0",
28
+ "@tsed/exceptions": "8.35.0",
29
+ "@tsed/hooks": "8.35.0",
30
+ "@tsed/json-mapper": "8.35.0",
31
+ "@tsed/platform-exceptions": "8.35.0",
32
+ "@tsed/platform-params": "8.35.0",
33
+ "@tsed/schema": "8.35.0",
34
34
  "encodeurl": "^2.0.0",
35
35
  "mime": "^4.0.4",
36
36
  "tslib": ">=2.7.0",
37
37
  "uuid": "^14.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@tsed/barrels": "8.33.0",
41
- "@tsed/platform-serverless-testing": "8.33.0",
42
- "@tsed/typescript": "8.33.0",
40
+ "@tsed/barrels": "8.35.0",
41
+ "@tsed/platform-serverless-testing": "8.35.0",
42
+ "@tsed/typescript": "8.35.0",
43
43
  "@types/aws-lambda": "^8.10.145",
44
44
  "@types/encodeurl": "^1.0.2",
45
45
  "@types/mime": "^4.0.0",
46
- "eslint": "9.12.0",
47
46
  "find-my-way": "^9.1.0",
48
47
  "typescript": "6.0.2",
49
48
  "vitest": "4.1.4"