dynamodb-reactive 0.3.0 → 0.4.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.
@@ -0,0 +1,78 @@
1
+ interface JsonPatch {
2
+ op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
3
+ path: string;
4
+ value?: unknown;
5
+ from?: string;
6
+ }
7
+ interface SnapshotResponse {
8
+ type: 'snapshot';
9
+ subscriptionId: string;
10
+ generation: number;
11
+ version: number;
12
+ data: unknown;
13
+ }
14
+ interface ErrorResponse {
15
+ type: 'error';
16
+ message: string;
17
+ }
18
+ interface PatchEvent {
19
+ type: 'patch';
20
+ subscriptionId: string;
21
+ generation: number;
22
+ fromVersion: number;
23
+ toVersion: number;
24
+ messageId: string;
25
+ patches: JsonPatch[];
26
+ }
27
+ interface ResyncEvent {
28
+ type: 'resync';
29
+ subscriptionId: string;
30
+ generation: number;
31
+ fromVersion: number;
32
+ toVersion: number;
33
+ messageId: string;
34
+ }
35
+ interface ConnectedEvent {
36
+ type: 'connected';
37
+ connectionId: string;
38
+ }
39
+ interface PongEvent {
40
+ type: 'pong';
41
+ }
42
+ type WebSocketEvent = ConnectedEvent | PongEvent | PatchEvent | ResyncEvent;
43
+ /** Frames the client sends on the WebSocket: `init` after opening, then periodic `ping`. */
44
+ type WebSocketClientMessage = {
45
+ type: 'init';
46
+ } | {
47
+ type: 'ping';
48
+ };
49
+ /**
50
+ * HTTP request bodies the client POSTs to `httpUrl`. A resync re-sends `subscribe`
51
+ * with the same subscription and a new registration; servers answer with a snapshot
52
+ * whose `version` must exceed the last one the client accepted.
53
+ */
54
+ interface SubscribeRequest {
55
+ type: 'subscribe';
56
+ connectionId: string;
57
+ subscriptionId: string;
58
+ generation: number;
59
+ registrationId: string;
60
+ path: string;
61
+ input: unknown;
62
+ }
63
+ interface UnsubscribeRequest {
64
+ type: 'unsubscribe';
65
+ connectionId: string;
66
+ subscriptionId: string;
67
+ generation: number;
68
+ registrationId: string;
69
+ }
70
+ interface CallRequest {
71
+ type: 'call';
72
+ connectionId: string;
73
+ path: string;
74
+ input: unknown;
75
+ }
76
+ type HttpRequest = SubscribeRequest | UnsubscribeRequest | CallRequest;
77
+
78
+ export type { CallRequest as C, ErrorResponse as E, HttpRequest as H, JsonPatch as J, PatchEvent as P, ResyncEvent as R, SnapshotResponse as S, UnsubscribeRequest as U, WebSocketClientMessage as W, ConnectedEvent as a, PongEvent as b, SubscribeRequest as c, WebSocketEvent as d };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamodb-reactive",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "A Serverless, Reactive tRPC replacement for AWS DynamoDB",
6
6
  "keywords": [
@@ -94,6 +94,26 @@
94
94
  "types": "./dist/cluster.d.cts",
95
95
  "default": "./dist/cluster.cjs"
96
96
  }
97
+ },
98
+ "./hub": {
99
+ "import": {
100
+ "types": "./dist/hub.d.ts",
101
+ "default": "./dist/hub.js"
102
+ },
103
+ "require": {
104
+ "types": "./dist/hub.d.cts",
105
+ "default": "./dist/hub.cjs"
106
+ }
107
+ },
108
+ "./cloudflare": {
109
+ "import": {
110
+ "types": "./dist/cloudflare.d.ts",
111
+ "default": "./dist/cloudflare.js"
112
+ },
113
+ "require": {
114
+ "types": "./dist/cloudflare.d.cts",
115
+ "default": "./dist/cloudflare.cjs"
116
+ }
97
117
  }
98
118
  },
99
119
  "files": [