@mstuercke/api-utils 4.3.0 → 4.3.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.
@@ -1,4 +1,6 @@
1
- export * from './awsLambdaTrpcSubscriptionRequestHandler';
1
+ export * from './trpc/TrpcSubscriptionRequest';
2
+ export * from './trpc/TrpcSubscriptionResponse';
3
+ export * from './trpc/awsLambdaTrpcSubscriptionRequestHandler';
2
4
  export * from './buildWsApiRouteHandler';
3
5
  export * from './closeConnection';
4
6
  export * from './getConnection';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ws/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ws/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -1,4 +1,6 @@
1
- export * from './awsLambdaTrpcSubscriptionRequestHandler';
1
+ export * from './trpc/TrpcSubscriptionRequest';
2
+ export * from './trpc/TrpcSubscriptionResponse';
3
+ export * from './trpc/awsLambdaTrpcSubscriptionRequestHandler';
2
4
  export * from './buildWsApiRouteHandler';
3
5
  export * from './closeConnection';
4
6
  export * from './getConnection';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ws/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ws/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type TrpcSubscriptionRequest<Input = unknown> = {
2
+ id: number | string;
3
+ method: 'subscription';
4
+ params: {
5
+ path: string;
6
+ input?: Input;
7
+ };
8
+ } | {
9
+ id: number | string;
10
+ method: 'subscription.stop';
11
+ };
12
+ //# sourceMappingURL=TrpcSubscriptionRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrpcSubscriptionRequest.d.ts","sourceRoot":"","sources":["../../../../src/ws/server/trpc/TrpcSubscriptionRequest.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,CAAC,KAAK,GAAG,OAAO,IAAI;IACrD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,cAAc,CAAA;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,CAAA;CACxC,GAAG;IACF,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,mBAAmB,CAAA;CAC5B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TrpcSubscriptionRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrpcSubscriptionRequest.js","sourceRoot":"","sources":["../../../../src/ws/server/trpc/TrpcSubscriptionRequest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export type TrpcSubscriptionResponse<Data = unknown> = {
2
+ id: number | string;
3
+ result: ({
4
+ type: 'data';
5
+ data: Data;
6
+ } | {
7
+ type: 'started';
8
+ } | {
9
+ type: 'stopped';
10
+ });
11
+ };
12
+ //# sourceMappingURL=TrpcSubscriptionResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrpcSubscriptionResponse.d.ts","sourceRoot":"","sources":["../../../../src/ws/server/trpc/TrpcSubscriptionResponse.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,CAAC,IAAI,GAAG,OAAO,IAAI;IACrD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,CACF;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,GAC5B;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,GACnB;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CACpB,CAAA;CACN,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TrpcSubscriptionResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrpcSubscriptionResponse.js","sourceRoot":"","sources":["../../../../src/ws/server/trpc/TrpcSubscriptionResponse.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { AnyTRPCRouter } from '@trpc/server';
2
- import { APIGatewayResult } from '@trpc/server/adapters/aws-lambda';
2
+ import type { APIGatewayResult } from '@trpc/server/adapters/aws-lambda';
3
3
  import { APIGatewayProxyEvent } from 'aws-lambda';
4
4
  export declare const awsLambdaTrpcSubscriptionRequestHandler: <Router extends AnyTRPCRouter>(opts: {
5
5
  router: Router;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awsLambdaTrpcSubscriptionRequestHandler.d.ts","sourceRoot":"","sources":["../../../../src/ws/server/trpc/awsLambdaTrpcSubscriptionRequestHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAoB,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAC,oBAAoB,EAAC,MAAM,YAAY,CAAC;AAMhD,eAAO,MAAM,uCAAuC,uCAAwC;IAC1F,MAAM,EAAE,MAAM,CAAA;CACf,sCAG6C,QAAQ,gBAAgB,CAyFrE,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { PostToConnectionCommand } from '@aws-sdk/client-apigatewaymanagementapi';
2
+ import { callTRPCProcedure } from '@trpc/server';
3
+ import { getApiGatewayManagementApiClient } from '../getApiGatewayManagementApiClient';
4
+ import { getConnection } from '../getConnection';
5
+ export const awsLambdaTrpcSubscriptionRequestHandler = (opts) => {
6
+ const { router } = opts;
7
+ return async (event) => {
8
+ const connection = getConnection(event);
9
+ if (!event.body || event.body === '[]')
10
+ return { statusCode: 200, body: '' };
11
+ const request = JSON.parse(event.body);
12
+ const sendMessage = async (response) => {
13
+ await getApiGatewayManagementApiClient(connection.endpoint).send(new PostToConnectionCommand({
14
+ ConnectionId: connection.connectionId,
15
+ Data: JSON.stringify(response),
16
+ }));
17
+ };
18
+ const stopConnection = async () => {
19
+ await sendMessage({
20
+ id: request.id,
21
+ result: { type: 'stopped' },
22
+ });
23
+ };
24
+ try {
25
+ if (request.method === 'subscription.stop') {
26
+ await stopConnection();
27
+ }
28
+ if (request.method === 'subscription') {
29
+ await sendMessage({
30
+ id: request.id,
31
+ result: { type: 'started' },
32
+ });
33
+ const sub = (await callTRPCProcedure({
34
+ procedures: router._def.procedures,
35
+ path: request.params.path,
36
+ type: 'subscription',
37
+ ctx: {},
38
+ getRawInput: async () => request.params.input,
39
+ }));
40
+ const messageQueue = [];
41
+ sub.subscribe({
42
+ next: (data) => {
43
+ messageQueue.push({
44
+ id: request.id,
45
+ result: {
46
+ type: 'data',
47
+ data: data,
48
+ },
49
+ });
50
+ },
51
+ error: (err) => {
52
+ console.error(err);
53
+ messageQueue.push({
54
+ id: request.id,
55
+ result: { type: 'stopped' },
56
+ });
57
+ },
58
+ complete: () => {
59
+ messageQueue.push({
60
+ id: request.id,
61
+ result: { type: 'stopped' },
62
+ });
63
+ },
64
+ });
65
+ let stopped = false;
66
+ while (!stopped) {
67
+ const message = messageQueue.shift();
68
+ if (!message)
69
+ continue;
70
+ await sendMessage(message);
71
+ stopped = message.result.type === 'stopped';
72
+ }
73
+ }
74
+ }
75
+ catch (err) {
76
+ console.error(err);
77
+ await stopConnection();
78
+ }
79
+ return {
80
+ statusCode: 200,
81
+ body: '',
82
+ };
83
+ };
84
+ };
85
+ //# sourceMappingURL=awsLambdaTrpcSubscriptionRequestHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awsLambdaTrpcSubscriptionRequestHandler.js","sourceRoot":"","sources":["../../../../src/ws/server/trpc/awsLambdaTrpcSubscriptionRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAgB,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAI9D,OAAO,EAAC,gCAAgC,EAAC,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAI/C,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAA+B,IAErF,EAAE,EAAE;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC;IAEtB,OAAO,KAAK,EAAE,KAA2B,EAA6B,EAAE;QACtE,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;YACpC,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,CAAC;QAErC,MAAM,OAAO,GAAI,IAAI,CAAC,KAAK,CA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 "version": "4.3.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**/*.js",
@@ -61,12 +61,14 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@mstuercke/bun-utils": "5.0.4",
64
+ "@trpc/server": "next",
64
65
  "@types/aws-lambda": "^8.10.133",
65
66
  "@types/bun": "^1.0.5",
66
67
  "@types/path-to-regexp": "^1.7.0",
67
68
  "@types/react": "^18.2.33",
68
- "@trpc/server": "next",
69
- "typescript": "^5.3.3"
69
+ "aws-sdk-client-mock": "^4.0.0",
70
+ "typescript": "^5.3.3",
71
+ "zod": "^3.22.4"
70
72
  },
71
73
  "publishConfig": {
72
74
  "registry": "https://registry.npmjs.org/"
@@ -1 +0,0 @@
1
- {"version":3,"file":"awsLambdaTrpcSubscriptionRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/ws/server/awsLambdaTrpcSubscriptionRequestHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAoB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAC,oBAAoB,EAAC,MAAM,YAAY,CAAC;AAsBhD,eAAO,MAAM,uCAAuC,uCAAwC;IAC1F,MAAM,EAAE,MAAM,CAAA;CACf,sCAG6C,QAAQ,gBAAgB,CAwErE,CAAC"}
@@ -1,71 +0,0 @@
1
- import { PostToConnectionCommand } from '@aws-sdk/client-apigatewaymanagementapi';
2
- import { callTRPCProcedure } from '@trpc/server';
3
- import { getApiGatewayManagementApiClient } from './getApiGatewayManagementApiClient';
4
- import { getConnection } from './getConnection';
5
- export const awsLambdaTrpcSubscriptionRequestHandler = (opts) => {
6
- const { router } = opts;
7
- return async (event) => {
8
- try {
9
- const connection = getConnection(event);
10
- if (!event.body || event.body === '[]')
11
- return { statusCode: 200, body: '' };
12
- const request = JSON.parse(event.body);
13
- const sendMessage = async (response) => {
14
- await getApiGatewayManagementApiClient(connection.endpoint).send(new PostToConnectionCommand({
15
- ConnectionId: connection.connectionId,
16
- Data: JSON.stringify(response),
17
- }));
18
- };
19
- const stopConnection = async () => {
20
- await sendMessage({
21
- id: request.id,
22
- result: { type: 'stopped' },
23
- });
24
- };
25
- if (request.method === 'subscription.stop') {
26
- await stopConnection();
27
- }
28
- if (request.method === 'subscription') {
29
- await sendMessage({
30
- id: request.id,
31
- result: { type: 'started' },
32
- });
33
- const sub = (await callTRPCProcedure({
34
- procedures: router._def.procedures,
35
- path: request.params.path,
36
- type: 'subscription',
37
- ctx: {},
38
- getRawInput: async () => request.params.input,
39
- }));
40
- await new Promise((resolve) => {
41
- sub.subscribe({
42
- next: async (data) => await sendMessage({
43
- id: request.id,
44
- result: {
45
- type: 'data',
46
- data: data,
47
- },
48
- }),
49
- error: async (err) => {
50
- console.error(err);
51
- await stopConnection();
52
- resolve();
53
- },
54
- complete: async () => {
55
- await stopConnection();
56
- resolve();
57
- },
58
- });
59
- });
60
- }
61
- }
62
- catch (err) {
63
- console.error(err);
64
- }
65
- return {
66
- statusCode: 200,
67
- body: '',
68
- };
69
- };
70
- };
71
- //# sourceMappingURL=awsLambdaTrpcSubscriptionRequestHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"awsLambdaTrpcSubscriptionRequestHandler.js","sourceRoot":"","sources":["../../../src/ws/server/awsLambdaTrpcSubscriptionRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAgB,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAI9D,OAAO,EAAC,gCAAgC,EAAC,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAoB9C,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAA+B,IAErF,EAAE,EAAE;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC;IAEtB,OAAO,KAAK,EAAE,KAA2B,EAA6B,EAAE;QACt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