@stacksjs/ts-cloud-types 0.1.3 → 0.1.7
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/README.md +13 -13
- package/dist/index.d.ts +1228 -0
- package/dist/index.js +386 -0
- package/package.json +11 -2
- package/src/index.ts +0 -2759
- package/tsconfig.json +0 -12
- package/tsconfig.tsbuildinfo +0 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
var QueuePresets = {
|
|
3
|
+
backgroundJobs: {
|
|
4
|
+
visibilityTimeout: 120,
|
|
5
|
+
messageRetentionPeriod: 604800,
|
|
6
|
+
deadLetterQueue: true,
|
|
7
|
+
maxReceiveCount: 3,
|
|
8
|
+
encrypted: true
|
|
9
|
+
},
|
|
10
|
+
fifo: {
|
|
11
|
+
fifo: true,
|
|
12
|
+
contentBasedDeduplication: true,
|
|
13
|
+
visibilityTimeout: 30,
|
|
14
|
+
encrypted: true
|
|
15
|
+
},
|
|
16
|
+
highThroughput: {
|
|
17
|
+
visibilityTimeout: 30,
|
|
18
|
+
receiveMessageWaitTime: 20,
|
|
19
|
+
encrypted: true
|
|
20
|
+
},
|
|
21
|
+
delayed: {
|
|
22
|
+
delaySeconds: 60,
|
|
23
|
+
visibilityTimeout: 60,
|
|
24
|
+
encrypted: true
|
|
25
|
+
},
|
|
26
|
+
longRunning: {
|
|
27
|
+
visibilityTimeout: 900,
|
|
28
|
+
messageRetentionPeriod: 1209600,
|
|
29
|
+
deadLetterQueue: true,
|
|
30
|
+
maxReceiveCount: 2,
|
|
31
|
+
encrypted: true
|
|
32
|
+
},
|
|
33
|
+
monitored: {
|
|
34
|
+
visibilityTimeout: 60,
|
|
35
|
+
messageRetentionPeriod: 604800,
|
|
36
|
+
deadLetterQueue: true,
|
|
37
|
+
maxReceiveCount: 3,
|
|
38
|
+
encrypted: true,
|
|
39
|
+
alarms: {
|
|
40
|
+
enabled: true,
|
|
41
|
+
queueDepthThreshold: 1000,
|
|
42
|
+
messageAgeThreshold: 3600,
|
|
43
|
+
dlqAlarm: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
lambdaOptimized: {
|
|
47
|
+
visibilityTimeout: 360,
|
|
48
|
+
receiveMessageWaitTime: 20,
|
|
49
|
+
deadLetterQueue: true,
|
|
50
|
+
maxReceiveCount: 3,
|
|
51
|
+
encrypted: true
|
|
52
|
+
},
|
|
53
|
+
fanOut: {
|
|
54
|
+
visibilityTimeout: 30,
|
|
55
|
+
receiveMessageWaitTime: 20,
|
|
56
|
+
encrypted: true
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var RealtimePresets = {
|
|
60
|
+
serverless: {
|
|
61
|
+
development: {
|
|
62
|
+
enabled: true,
|
|
63
|
+
mode: "serverless",
|
|
64
|
+
channels: {
|
|
65
|
+
public: true,
|
|
66
|
+
private: true,
|
|
67
|
+
presence: true
|
|
68
|
+
},
|
|
69
|
+
storage: {
|
|
70
|
+
type: "dynamodb",
|
|
71
|
+
dynamodb: { billingMode: "PAY_PER_REQUEST" }
|
|
72
|
+
},
|
|
73
|
+
scaling: {
|
|
74
|
+
maxConnections: 1000,
|
|
75
|
+
handlerMemory: 128
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
production: {
|
|
79
|
+
enabled: true,
|
|
80
|
+
mode: "serverless",
|
|
81
|
+
channels: {
|
|
82
|
+
public: true,
|
|
83
|
+
private: true,
|
|
84
|
+
presence: {
|
|
85
|
+
enabled: true,
|
|
86
|
+
maxMembers: 100,
|
|
87
|
+
heartbeatInterval: 30,
|
|
88
|
+
inactivityTimeout: 60
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
storage: {
|
|
92
|
+
type: "dynamodb",
|
|
93
|
+
dynamodb: {
|
|
94
|
+
billingMode: "PAY_PER_REQUEST",
|
|
95
|
+
pointInTimeRecovery: true,
|
|
96
|
+
connectionTTL: 86400
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
scaling: {
|
|
100
|
+
maxConnections: 50000,
|
|
101
|
+
messagesPerSecond: 5000,
|
|
102
|
+
handlerMemory: 256,
|
|
103
|
+
handlerTimeout: 30
|
|
104
|
+
},
|
|
105
|
+
monitoring: {
|
|
106
|
+
enabled: true,
|
|
107
|
+
connectionThreshold: 40000,
|
|
108
|
+
errorThreshold: 100,
|
|
109
|
+
latencyThreshold: 500
|
|
110
|
+
},
|
|
111
|
+
keepAlive: true,
|
|
112
|
+
keepAliveInterval: 30,
|
|
113
|
+
idleTimeout: 600
|
|
114
|
+
},
|
|
115
|
+
notifications: {
|
|
116
|
+
enabled: true,
|
|
117
|
+
mode: "serverless",
|
|
118
|
+
channels: {
|
|
119
|
+
public: false,
|
|
120
|
+
private: true,
|
|
121
|
+
presence: false
|
|
122
|
+
},
|
|
123
|
+
storage: {
|
|
124
|
+
type: "dynamodb",
|
|
125
|
+
dynamodb: { billingMode: "PAY_PER_REQUEST" }
|
|
126
|
+
},
|
|
127
|
+
scaling: {
|
|
128
|
+
maxConnections: 50000,
|
|
129
|
+
messagesPerSecond: 2000,
|
|
130
|
+
handlerMemory: 128
|
|
131
|
+
},
|
|
132
|
+
keepAlive: true,
|
|
133
|
+
keepAliveInterval: 60,
|
|
134
|
+
idleTimeout: 1800
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
server: {
|
|
138
|
+
development: {
|
|
139
|
+
enabled: true,
|
|
140
|
+
mode: "server",
|
|
141
|
+
channels: {
|
|
142
|
+
public: true,
|
|
143
|
+
private: true,
|
|
144
|
+
presence: true
|
|
145
|
+
},
|
|
146
|
+
server: {
|
|
147
|
+
host: "0.0.0.0",
|
|
148
|
+
port: 6001,
|
|
149
|
+
scheme: "ws",
|
|
150
|
+
driver: "bun",
|
|
151
|
+
idleTimeout: 120,
|
|
152
|
+
perMessageDeflate: false,
|
|
153
|
+
metrics: false
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
production: {
|
|
157
|
+
enabled: true,
|
|
158
|
+
mode: "server",
|
|
159
|
+
channels: {
|
|
160
|
+
public: true,
|
|
161
|
+
private: true,
|
|
162
|
+
presence: true
|
|
163
|
+
},
|
|
164
|
+
server: {
|
|
165
|
+
host: "0.0.0.0",
|
|
166
|
+
port: 6001,
|
|
167
|
+
scheme: "wss",
|
|
168
|
+
driver: "bun",
|
|
169
|
+
idleTimeout: 120,
|
|
170
|
+
maxPayloadLength: 16 * 1024 * 1024,
|
|
171
|
+
backpressureLimit: 1024 * 1024,
|
|
172
|
+
sendPings: true,
|
|
173
|
+
perMessageDeflate: true,
|
|
174
|
+
instances: 2,
|
|
175
|
+
redis: {
|
|
176
|
+
enabled: true,
|
|
177
|
+
keyPrefix: "broadcasting:"
|
|
178
|
+
},
|
|
179
|
+
rateLimit: {
|
|
180
|
+
enabled: true,
|
|
181
|
+
max: 100,
|
|
182
|
+
window: 60000,
|
|
183
|
+
perChannel: true,
|
|
184
|
+
perUser: true
|
|
185
|
+
},
|
|
186
|
+
loadManagement: {
|
|
187
|
+
enabled: true,
|
|
188
|
+
maxConnections: 1e4,
|
|
189
|
+
maxSubscriptionsPerConnection: 100,
|
|
190
|
+
shedLoadThreshold: 0.8
|
|
191
|
+
},
|
|
192
|
+
metrics: true,
|
|
193
|
+
autoScaling: {
|
|
194
|
+
min: 2,
|
|
195
|
+
max: 10,
|
|
196
|
+
targetCPU: 70
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
monitoring: {
|
|
200
|
+
enabled: true,
|
|
201
|
+
connectionThreshold: 8000,
|
|
202
|
+
errorThreshold: 100
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
highPerformance: {
|
|
206
|
+
enabled: true,
|
|
207
|
+
mode: "server",
|
|
208
|
+
channels: {
|
|
209
|
+
public: true,
|
|
210
|
+
private: true,
|
|
211
|
+
presence: true
|
|
212
|
+
},
|
|
213
|
+
server: {
|
|
214
|
+
host: "0.0.0.0",
|
|
215
|
+
port: 6001,
|
|
216
|
+
scheme: "wss",
|
|
217
|
+
driver: "bun",
|
|
218
|
+
idleTimeout: 60,
|
|
219
|
+
maxPayloadLength: 8 * 1024 * 1024,
|
|
220
|
+
backpressureLimit: 2 * 1024 * 1024,
|
|
221
|
+
closeOnBackpressureLimit: true,
|
|
222
|
+
sendPings: true,
|
|
223
|
+
perMessageDeflate: true,
|
|
224
|
+
instances: 4,
|
|
225
|
+
redis: {
|
|
226
|
+
enabled: true,
|
|
227
|
+
useElastiCache: true,
|
|
228
|
+
keyPrefix: "rt:"
|
|
229
|
+
},
|
|
230
|
+
rateLimit: {
|
|
231
|
+
enabled: true,
|
|
232
|
+
max: 200,
|
|
233
|
+
window: 60000,
|
|
234
|
+
perChannel: true
|
|
235
|
+
},
|
|
236
|
+
loadManagement: {
|
|
237
|
+
enabled: true,
|
|
238
|
+
maxConnections: 25000,
|
|
239
|
+
maxSubscriptionsPerConnection: 50,
|
|
240
|
+
shedLoadThreshold: 0.7
|
|
241
|
+
},
|
|
242
|
+
metrics: { enabled: true, path: "/metrics" },
|
|
243
|
+
autoScaling: {
|
|
244
|
+
min: 4,
|
|
245
|
+
max: 20,
|
|
246
|
+
targetCPU: 60,
|
|
247
|
+
targetConnections: 20000
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
monitoring: {
|
|
251
|
+
enabled: true,
|
|
252
|
+
connectionThreshold: 80000,
|
|
253
|
+
errorThreshold: 50,
|
|
254
|
+
latencyThreshold: 50
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
chat: {
|
|
258
|
+
enabled: true,
|
|
259
|
+
mode: "server",
|
|
260
|
+
channels: {
|
|
261
|
+
public: true,
|
|
262
|
+
private: true,
|
|
263
|
+
presence: {
|
|
264
|
+
enabled: true,
|
|
265
|
+
maxMembers: 200,
|
|
266
|
+
heartbeatInterval: 20,
|
|
267
|
+
inactivityTimeout: 60
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
server: {
|
|
271
|
+
host: "0.0.0.0",
|
|
272
|
+
port: 6001,
|
|
273
|
+
scheme: "wss",
|
|
274
|
+
driver: "bun",
|
|
275
|
+
idleTimeout: 300,
|
|
276
|
+
maxPayloadLength: 1024 * 1024,
|
|
277
|
+
sendPings: true,
|
|
278
|
+
perMessageDeflate: true,
|
|
279
|
+
instances: 2,
|
|
280
|
+
redis: {
|
|
281
|
+
enabled: true,
|
|
282
|
+
keyPrefix: "chat:"
|
|
283
|
+
},
|
|
284
|
+
rateLimit: {
|
|
285
|
+
enabled: true,
|
|
286
|
+
max: 60,
|
|
287
|
+
window: 60000,
|
|
288
|
+
perChannel: true
|
|
289
|
+
},
|
|
290
|
+
loadManagement: {
|
|
291
|
+
enabled: true,
|
|
292
|
+
maxConnections: 15000,
|
|
293
|
+
maxSubscriptionsPerConnection: 20
|
|
294
|
+
},
|
|
295
|
+
metrics: true
|
|
296
|
+
},
|
|
297
|
+
keepAlive: true,
|
|
298
|
+
keepAliveInterval: 25,
|
|
299
|
+
idleTimeout: 900
|
|
300
|
+
},
|
|
301
|
+
gaming: {
|
|
302
|
+
enabled: true,
|
|
303
|
+
mode: "server",
|
|
304
|
+
channels: {
|
|
305
|
+
public: true,
|
|
306
|
+
private: true,
|
|
307
|
+
presence: {
|
|
308
|
+
enabled: true,
|
|
309
|
+
maxMembers: 100,
|
|
310
|
+
heartbeatInterval: 10,
|
|
311
|
+
inactivityTimeout: 30
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
server: {
|
|
315
|
+
host: "0.0.0.0",
|
|
316
|
+
port: 6001,
|
|
317
|
+
scheme: "wss",
|
|
318
|
+
driver: "bun",
|
|
319
|
+
idleTimeout: 30,
|
|
320
|
+
maxPayloadLength: 64 * 1024,
|
|
321
|
+
backpressureLimit: 512 * 1024,
|
|
322
|
+
closeOnBackpressureLimit: true,
|
|
323
|
+
sendPings: true,
|
|
324
|
+
perMessageDeflate: false,
|
|
325
|
+
instances: 4,
|
|
326
|
+
redis: {
|
|
327
|
+
enabled: true,
|
|
328
|
+
useElastiCache: true
|
|
329
|
+
},
|
|
330
|
+
rateLimit: {
|
|
331
|
+
enabled: true,
|
|
332
|
+
max: 120,
|
|
333
|
+
window: 60000
|
|
334
|
+
},
|
|
335
|
+
loadManagement: {
|
|
336
|
+
enabled: true,
|
|
337
|
+
maxConnections: 5000,
|
|
338
|
+
maxSubscriptionsPerConnection: 10,
|
|
339
|
+
shedLoadThreshold: 0.6
|
|
340
|
+
},
|
|
341
|
+
metrics: true,
|
|
342
|
+
autoScaling: {
|
|
343
|
+
min: 4,
|
|
344
|
+
max: 16,
|
|
345
|
+
targetCPU: 50
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
keepAlive: true,
|
|
349
|
+
keepAliveInterval: 10,
|
|
350
|
+
idleTimeout: 60
|
|
351
|
+
},
|
|
352
|
+
single: {
|
|
353
|
+
enabled: true,
|
|
354
|
+
mode: "server",
|
|
355
|
+
channels: {
|
|
356
|
+
public: true,
|
|
357
|
+
private: true,
|
|
358
|
+
presence: true
|
|
359
|
+
},
|
|
360
|
+
server: {
|
|
361
|
+
host: "0.0.0.0",
|
|
362
|
+
port: 6001,
|
|
363
|
+
scheme: "wss",
|
|
364
|
+
driver: "bun",
|
|
365
|
+
idleTimeout: 120,
|
|
366
|
+
sendPings: true,
|
|
367
|
+
perMessageDeflate: true,
|
|
368
|
+
instances: 1,
|
|
369
|
+
rateLimit: {
|
|
370
|
+
enabled: true,
|
|
371
|
+
max: 100,
|
|
372
|
+
window: 60000
|
|
373
|
+
},
|
|
374
|
+
loadManagement: {
|
|
375
|
+
enabled: true,
|
|
376
|
+
maxConnections: 1e4
|
|
377
|
+
},
|
|
378
|
+
metrics: true
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
export {
|
|
384
|
+
RealtimePresets,
|
|
385
|
+
QueuePresets
|
|
386
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-cloud-types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared TypeScript types for ts-cloud",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/stacksjs/ts-cloud#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/stacksjs/ts-cloud.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/stacksjs/ts-cloud/issues"
|
|
15
|
+
},
|
|
8
16
|
"exports": {
|
|
9
17
|
".": {
|
|
10
18
|
"types": "./dist/index.d.ts",
|
|
@@ -18,7 +26,8 @@
|
|
|
18
26
|
"dist"
|
|
19
27
|
],
|
|
20
28
|
"scripts": {
|
|
21
|
-
"build": "bun build
|
|
29
|
+
"build": "bun --bun build.ts",
|
|
30
|
+
"prepublishOnly": "bun --bun run build",
|
|
22
31
|
"typecheck": "tsc --noEmit"
|
|
23
32
|
},
|
|
24
33
|
"devDependencies": {
|