@mstuercke/api-utils 5.1.1 → 5.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstuercke/api-utils",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -53,18 +53,18 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@aws-sdk/client-apigatewaymanagementapi": "^3.438.0",
56
- "@trpc/server": "next",
56
+ "@trpc/server": "^11.0.0-rc.364",
57
57
  "@types/aws-lambda": "^8.10.133"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@mstuercke/bun-utils": "6.0.0",
61
- "@trpc/server": "next",
61
+ "@trpc/server": "^11.0.0-rc.364",
62
62
  "@types/aws-lambda": "^8.10.133",
63
- "@types/bun": "^1.0.11",
63
+ "@types/bun": "^1.0.12",
64
64
  "@types/path-to-regexp": "^1.7.0",
65
65
  "@types/react": "^18.2.33",
66
66
  "aws-sdk-client-mock": "^4.0.0",
67
- "typescript": "^5.3.3",
67
+ "typescript": "^5.4.5",
68
68
  "zod": "^3.22.4"
69
69
  },
70
70
  "publishConfig": {
@@ -1,8 +1,7 @@
1
1
  import {PostToConnectionCommand} from '@aws-sdk/client-apigatewaymanagementapi';
2
2
  import {AnyTRPCRouter, callTRPCProcedure, inferRouterContext} from '@trpc/server';
3
- import type {APIGatewayResult} from '@trpc/server/adapters/aws-lambda';
4
3
  import type {Observable} from '@trpc/server/observable';
5
- import {APIGatewayProxyEvent} from 'aws-lambda';
4
+ import {APIGatewayProxyEvent, APIGatewayProxyResult} from 'aws-lambda';
6
5
  import {getApiGatewayManagementApiClient} from '../getApiGatewayManagementApiClient';
7
6
  import {getConnection} from '../getConnection';
8
7
  import {TrpcSubscriptionRequest} from './TrpcSubscriptionRequest';
@@ -14,11 +13,11 @@ export const awsLambdaTrpcSubscriptionRequestHandler = <Router extends AnyTRPCRo
14
13
  }) => {
15
14
  const {router, createContext} = opts;
16
15
 
17
- return async (event: APIGatewayProxyEvent): Promise<APIGatewayResult> => {
16
+ return async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
18
17
  const connection = getConnection(event);
19
18
 
20
19
  if (!event.body || event.body === '[]')
21
- return {statusCode: 200, body: ''};
20
+ return {statusCode: 200, body: '{}'};
22
21
 
23
22
  const request = (JSON.parse(event.body) as TrpcSubscriptionRequest);
24
23
 
@@ -100,7 +99,7 @@ export const awsLambdaTrpcSubscriptionRequestHandler = <Router extends AnyTRPCRo
100
99
 
101
100
  return {
102
101
  statusCode: 200,
103
- body: '',
102
+ body: '{}',
104
103
  };
105
104
  };
106
105
  };