tempo.ts 0.6.2 → 0.7.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/README.md +6 -2
  3. package/dist/ox/Transaction.js +1 -1
  4. package/dist/ox/Transaction.js.map +1 -1
  5. package/dist/server/Handler.d.ts +346 -0
  6. package/dist/server/Handler.d.ts.map +1 -0
  7. package/dist/server/Handler.js +441 -0
  8. package/dist/server/Handler.js.map +1 -0
  9. package/dist/server/Kv.d.ts +16 -0
  10. package/dist/server/Kv.d.ts.map +1 -0
  11. package/dist/server/Kv.js +25 -0
  12. package/dist/server/Kv.js.map +1 -0
  13. package/dist/server/index.d.ts +3 -0
  14. package/dist/server/index.d.ts.map +1 -0
  15. package/dist/server/index.js +3 -0
  16. package/dist/server/index.js.map +1 -0
  17. package/dist/server/internal/requestListener.d.ts +124 -0
  18. package/dist/server/internal/requestListener.d.ts.map +1 -0
  19. package/dist/server/internal/requestListener.js +174 -0
  20. package/dist/server/internal/requestListener.js.map +1 -0
  21. package/dist/viem/Actions/amm.d.ts +9 -41
  22. package/dist/viem/Actions/amm.d.ts.map +1 -1
  23. package/dist/viem/Actions/amm.js +15 -26
  24. package/dist/viem/Actions/amm.js.map +1 -1
  25. package/dist/viem/Actions/reward.d.ts +0 -1067
  26. package/dist/viem/Actions/reward.d.ts.map +1 -1
  27. package/dist/viem/Actions/reward.js +4 -212
  28. package/dist/viem/Actions/reward.js.map +1 -1
  29. package/dist/viem/Decorator.d.ts +0 -263
  30. package/dist/viem/Decorator.d.ts.map +1 -1
  31. package/dist/viem/Decorator.js +0 -10
  32. package/dist/viem/Decorator.js.map +1 -1
  33. package/dist/viem/Storage.d.ts +23 -0
  34. package/dist/viem/Storage.d.ts.map +1 -0
  35. package/dist/viem/Storage.js +47 -0
  36. package/dist/viem/Storage.js.map +1 -0
  37. package/dist/viem/Transport.d.ts +10 -1
  38. package/dist/viem/Transport.d.ts.map +1 -1
  39. package/dist/viem/Transport.js +22 -3
  40. package/dist/viem/Transport.js.map +1 -1
  41. package/dist/viem/internal/utils.d.ts +6 -0
  42. package/dist/viem/internal/utils.d.ts.map +1 -1
  43. package/dist/viem/internal/utils.js +24 -0
  44. package/dist/viem/internal/utils.js.map +1 -1
  45. package/dist/wagmi/Actions/reward.d.ts +0 -110
  46. package/dist/wagmi/Actions/reward.d.ts.map +1 -1
  47. package/dist/wagmi/Actions/reward.js +0 -121
  48. package/dist/wagmi/Actions/reward.js.map +1 -1
  49. package/dist/wagmi/Connector.d.ts +6 -17
  50. package/dist/wagmi/Connector.d.ts.map +1 -1
  51. package/dist/wagmi/Connector.js +17 -43
  52. package/dist/wagmi/Connector.js.map +1 -1
  53. package/dist/wagmi/Hooks/reward.d.ts +0 -88
  54. package/dist/wagmi/Hooks/reward.d.ts.map +1 -1
  55. package/dist/wagmi/Hooks/reward.js +0 -103
  56. package/dist/wagmi/Hooks/reward.js.map +1 -1
  57. package/dist/wagmi/KeyManager.d.ts +57 -0
  58. package/dist/wagmi/KeyManager.d.ts.map +1 -0
  59. package/dist/wagmi/KeyManager.js +101 -0
  60. package/dist/wagmi/KeyManager.js.map +1 -0
  61. package/dist/wagmi/index.d.ts +1 -0
  62. package/dist/wagmi/index.d.ts.map +1 -1
  63. package/dist/wagmi/index.js +1 -0
  64. package/dist/wagmi/index.js.map +1 -1
  65. package/package.json +8 -2
  66. package/src/ox/Transaction.ts +1 -1
  67. package/src/ox/e2e.test.ts +7 -0
  68. package/src/server/Handler.test.ts +566 -0
  69. package/src/server/Handler.ts +577 -0
  70. package/src/server/Kv.ts +40 -0
  71. package/src/server/index.ts +2 -0
  72. package/src/server/internal/requestListener.ts +285 -0
  73. package/src/viem/Actions/amm.test.ts +10 -284
  74. package/src/viem/Actions/amm.ts +32 -40
  75. package/src/viem/Actions/reward.test.ts +4 -212
  76. package/src/viem/Actions/reward.ts +4 -291
  77. package/src/viem/Decorator.ts +0 -294
  78. package/src/viem/Storage.ts +88 -0
  79. package/src/viem/Transport.ts +40 -2
  80. package/src/viem/e2e.test.ts +106 -3
  81. package/src/viem/internal/utils.ts +21 -0
  82. package/src/wagmi/Actions/amm.test.ts +7 -85
  83. package/src/wagmi/Actions/reward.test.ts +0 -99
  84. package/src/wagmi/Actions/reward.ts +0 -203
  85. package/src/wagmi/Connector.test.ts +4 -1
  86. package/src/wagmi/Connector.ts +24 -58
  87. package/src/wagmi/Hooks/amm.test.ts +8 -200
  88. package/src/wagmi/Hooks/reward.test.ts +1 -142
  89. package/src/wagmi/Hooks/reward.ts +0 -196
  90. package/src/wagmi/KeyManager.ts +159 -0
  91. package/src/wagmi/index.ts +1 -0
@@ -0,0 +1,441 @@
1
+ import { createRouter } from '@remix-run/fetch-router';
2
+ import { RpcRequest, RpcResponse } from 'ox';
3
+ import * as Base64 from 'ox/Base64';
4
+ import * as Hex from 'ox/Hex';
5
+ import { createClient } from 'viem';
6
+ import { signTransaction } from 'viem/actions';
7
+ import { formatTransaction } from '../viem/Formatters.js';
8
+ import * as Transaction from '../viem/Transaction.js';
9
+ import * as RequestListener from './internal/requestListener.js';
10
+ /**
11
+ * Instantiates a new request handler.
12
+ *
13
+ * @param options - constructor options
14
+ * @returns Handler instance
15
+ */
16
+ export function from() {
17
+ const router = createRouter();
18
+ return {
19
+ ...router,
20
+ listener: RequestListener.fromFetchHandler((request) => {
21
+ return router.fetch(request);
22
+ }),
23
+ };
24
+ }
25
+ /**
26
+ * Defines a Key Manager request handler.
27
+ *
28
+ * @example
29
+ * ### Cloudflare Worker
30
+ *
31
+ * ```ts
32
+ * import { env } from 'cloudflare:workers'
33
+ * import { Handler } from 'tempo.ts/server'
34
+ *
35
+ * export default {
36
+ * fetch(request) {
37
+ * return Handler.keyManager({
38
+ * kv: Kv.cloudflare(env.KEY_STORE),
39
+ * }).fetch(request)
40
+ * }
41
+ * }
42
+ * ```
43
+ *
44
+ * @example
45
+ * ### Next.js
46
+ *
47
+ * ```ts
48
+ * import { Handler } from 'tempo.ts/server'
49
+ *
50
+ * const handler = Handler.keyManager({
51
+ * kv: Kv.memory(),
52
+ * })
53
+ *
54
+ * export GET = handler.fetch
55
+ * export POST = handler.fetch
56
+ * ```
57
+ *
58
+ * @example
59
+ * ### Hono
60
+ *
61
+ * ```ts
62
+ * import { Handler } from 'tempo.ts/server'
63
+ *
64
+ * const handler = Handler.keyManager({
65
+ * kv: Kv.memory(),
66
+ * })
67
+ *
68
+ * const app = new Hono()
69
+ * app.all('*', handler)
70
+ *
71
+ * export default app
72
+ * ```
73
+ *
74
+ * @example
75
+ * ### Node.js
76
+ *
77
+ * ```ts
78
+ * import { Handler } from 'tempo.ts/server'
79
+ *
80
+ * const handler = Handler.keyManager({
81
+ * kv: Kv.memory(),
82
+ * })
83
+ *
84
+ * const server = createServer(handler.listener)
85
+ * server.listen(3000)
86
+ * ```
87
+ *
88
+ * @example
89
+ * ### Bun
90
+ *
91
+ * ```ts
92
+ * import { Handler } from 'tempo.ts/server'
93
+ *
94
+ * const handler = Handler.keyManager({
95
+ * kv: Kv.memory(),
96
+ * })
97
+ *
98
+ * Bun.serve(handler)
99
+ * ```
100
+ *
101
+ * @example
102
+ * ### Deno
103
+ *
104
+ * ```ts
105
+ * import { Handler } from 'tempo.ts/server'
106
+ *
107
+ * const handler = Handler.keyManager({
108
+ * kv: Kv.memory(),
109
+ * })
110
+ *
111
+ * Deno.serve(handler)
112
+ * ```
113
+ *
114
+ * @example
115
+ * ### Express
116
+ *
117
+ * ```ts
118
+ * import { Handler } from 'tempo.ts/server'
119
+ *
120
+ * const handler = Handler.keyManager({
121
+ * kv: Kv.memory(),
122
+ * })
123
+ *
124
+ * const app = express()
125
+ * app.use(handler.listener)
126
+ * app.listen(3000)
127
+ * ```
128
+ *
129
+ * @param options - Options.
130
+ * @returns Request handler.
131
+ */
132
+ export function keyManager(options) {
133
+ const { kv } = options;
134
+ const path = options.path ?? '';
135
+ const rp = (() => {
136
+ if (typeof options.rp === 'string')
137
+ return { id: options.rp, name: options.rp };
138
+ if (options.rp)
139
+ return {
140
+ id: options.rp.id,
141
+ name: options.rp.name ?? options.rp.id,
142
+ };
143
+ return undefined;
144
+ })();
145
+ const router = from();
146
+ // Get challenge for WebAuthn credential creation
147
+ router.get(`${path}/challenge`, async () => {
148
+ // Generate a random challenge
149
+ const challenge = Hex.random(32);
150
+ // Store challenge in KV with 5 minute expiration
151
+ await kv.set(`challenge:${challenge}`, '1');
152
+ return Response.json({
153
+ challenge,
154
+ ...(rp ? { rp } : {}),
155
+ });
156
+ });
157
+ // Get public key for a credential
158
+ router.get(`${path}/:id`, async ({ params }) => {
159
+ const { id } = params;
160
+ const publicKey = await kv.get(`credential:${id}`);
161
+ if (!publicKey)
162
+ return new Response('Credential not found', { status: 404 });
163
+ return Response.json({
164
+ publicKey,
165
+ });
166
+ });
167
+ // Set public key for a credential
168
+ router.post(`${path}/:id`, async ({ params, request }) => {
169
+ const { id } = params;
170
+ const { credential, publicKey } = (await request.json());
171
+ if (!credential)
172
+ return Response.json({ error: 'Missing `credential`' }, { status: 400 });
173
+ if (!publicKey)
174
+ return Response.json({ error: 'Missing `publicKey`' }, { status: 400 });
175
+ // Decode and verify clientDataJSON
176
+ const clientDataJSON = JSON.parse(Base64.toString(credential.response.clientDataJSON));
177
+ // Verify challenge
178
+ const challenge = Base64.toHex(clientDataJSON.challenge);
179
+ if (!(await kv.get(`challenge:${challenge}`)))
180
+ return Response.json({ error: 'Invalid or expired `challenge`' }, { status: 400 });
181
+ // Verify type
182
+ if (clientDataJSON.type !== 'webauthn.create')
183
+ return Response.json({ error: 'Invalid `clientDataJSON.type`' }, { status: 400 });
184
+ // Verify origin
185
+ if (rp?.id &&
186
+ !rp.id.includes('localhost') &&
187
+ clientDataJSON.origin !== new URL(`https://${rp.id}`).origin)
188
+ return Response.json({ error: 'Invalid `clientDataJSON.origin`' }, { status: 400 });
189
+ // Parse authenticatorData
190
+ const authenticatorData = Base64.toBytes(credential.response.authenticatorData);
191
+ // Parse flags (byte 32)
192
+ const flags = authenticatorData[32];
193
+ if (!flags)
194
+ return Response.json({ error: 'Invalid `authenticatorData`' }, { status: 400 });
195
+ // Check User Present (UP) flag (bit 0)
196
+ const userPresent = (flags & 0x01) !== 0;
197
+ if (!userPresent)
198
+ return Response.json({ error: 'User not present' }, { status: 400 });
199
+ // Consume the challenge (delete it so it can't be reused)
200
+ await kv.delete(`challenge:${challenge}`);
201
+ // Store the public key
202
+ await kv.set(`credential:${id}`, publicKey);
203
+ return new Response(null, { status: 204 });
204
+ });
205
+ return router;
206
+ }
207
+ /**
208
+ * Instantiates a fee payer service request handler that can be used to
209
+ * sponsor the fee for user transactions.
210
+ *
211
+ * @example
212
+ * ### Cloudflare Worker
213
+ *
214
+ * ```ts
215
+ * import { createClient, http } from 'viem'
216
+ * import { privateKeyToAccount } from 'viem/accounts'
217
+ * import { tempo } from 'tempo.ts/chains'
218
+ * import { Handler } from 'tempo.ts/server'
219
+ *
220
+ * const client = createClient({
221
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
222
+ * transport: http(),
223
+ * })
224
+ *
225
+ * export default {
226
+ * fetch(request) {
227
+ * return Handler.feePayer({
228
+ * account: privateKeyToAccount('0x...'),
229
+ * client,
230
+ * }).fetch(request)
231
+ * }
232
+ * }
233
+ * ```
234
+ *
235
+ * @example
236
+ * ### Next.js
237
+ *
238
+ * ```ts
239
+ * import { createClient, http } from 'viem'
240
+ * import { privateKeyToAccount } from 'viem/accounts'
241
+ * import { tempo } from 'tempo.ts/chains'
242
+ * import { Handler } from 'tempo.ts/server'
243
+ *
244
+ * const client = createClient({
245
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
246
+ * transport: http(),
247
+ * })
248
+ *
249
+ * const handler = Handler.feePayer({
250
+ * account: privateKeyToAccount('0x...'),
251
+ * client,
252
+ * })
253
+ *
254
+ * export GET = handler.fetch
255
+ * export POST = handler.fetch
256
+ * ```
257
+ *
258
+ * @example
259
+ * ### Hono
260
+ *
261
+ * ```ts
262
+ * import { createClient, http } from 'viem'
263
+ * import { privateKeyToAccount } from 'viem/accounts'
264
+ * import { tempo } from 'tempo.ts/chains'
265
+ * import { Handler } from 'tempo.ts/server'
266
+ *
267
+ * const client = createClient({
268
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
269
+ * transport: http(),
270
+ * })
271
+ *
272
+ * const handler = Handler.feePayer({
273
+ * account: privateKeyToAccount('0x...'),
274
+ * client,
275
+ * })
276
+ *
277
+ * const app = new Hono()
278
+ * app.all('*', handler)
279
+ *
280
+ * export default app
281
+ * ```
282
+ *
283
+ * @example
284
+ * ### Node.js
285
+ *
286
+ * ```ts
287
+ * import { createClient, http } from 'viem'
288
+ * import { privateKeyToAccount } from 'viem/accounts'
289
+ * import { tempo } from 'tempo.ts/chains'
290
+ * import { Handler } from 'tempo.ts/server'
291
+ *
292
+ * const client = createClient({
293
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
294
+ * transport: http(),
295
+ * })
296
+ *
297
+ * const handler = Handler.feePayer({
298
+ * account: privateKeyToAccount('0x...'),
299
+ * client,
300
+ * })
301
+ *
302
+ * const server = createServer(handler.listener)
303
+ * server.listen(3000)
304
+ * ```
305
+ *
306
+ * @example
307
+ * ### Bun
308
+ *
309
+ * ```ts
310
+ * import { createClient, http } from 'viem'
311
+ * import { privateKeyToAccount } from 'viem/accounts'
312
+ * import { tempo } from 'tempo.ts/chains'
313
+ * import { Handler } from 'tempo.ts/server'
314
+ *
315
+ * const client = createClient({
316
+ * account: privateKeyToAccount('0x...'),
317
+ * chain: tempo({
318
+ * feeToken: '0x20c0000000000000000000000000000000000001',
319
+ * }),
320
+ * transport: http(),
321
+ * })
322
+ *
323
+ * const handler = Handler.feePayer({
324
+ * account: privateKeyToAccount('0x...'),
325
+ * client,
326
+ * })
327
+ *
328
+ * Bun.serve(handler)
329
+ * ```
330
+ *
331
+ * @example
332
+ * ### Deno
333
+ *
334
+ * ```ts
335
+ * import { createClient, http } from 'viem'
336
+ * import { privateKeyToAccount } from 'viem/accounts'
337
+ * import { tempo } from 'tempo.ts/chains'
338
+ * import { Handler } from 'tempo.ts/server'
339
+ *
340
+ * const client = createClient({
341
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
342
+ * transport: http(),
343
+ * })
344
+ *
345
+ * const handler = Handler.feePayer({
346
+ * account: privateKeyToAccount('0x...'),
347
+ * client,
348
+ * })
349
+ *
350
+ * Deno.serve(handler)
351
+ * ```
352
+ *
353
+ * @example
354
+ * ### Express
355
+ *
356
+ * ```ts
357
+ * import { createClient, http } from 'viem'
358
+ * import { privateKeyToAccount } from 'viem/accounts'
359
+ * import { tempo } from 'tempo.ts/chains'
360
+ * import { Handler } from 'tempo.ts/server'
361
+ *
362
+ * const client = createClient({
363
+ * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
364
+ * transport: http(),
365
+ * })
366
+ *
367
+ * const handler = Handler.feePayer({
368
+ * account: privateKeyToAccount('0x...'),
369
+ * client,
370
+ * })
371
+ *
372
+ * const app = express()
373
+ * app.use(handler.listener)
374
+ * app.listen(3000)
375
+ * ```
376
+ *
377
+ * @param options - Options.
378
+ * @returns Request handler.
379
+ */
380
+ export function feePayer(options) {
381
+ const { account, onRequest, path = '/' } = options;
382
+ const client = (() => {
383
+ if ('client' in options)
384
+ return options.client;
385
+ if ('chain' in options && 'transport' in options)
386
+ return createClient({
387
+ chain: options.chain,
388
+ transport: options.transport,
389
+ });
390
+ throw new Error('No client or chain provided');
391
+ })();
392
+ const router = from();
393
+ router.post(path, async ({ request: req }) => {
394
+ const request = RpcRequest.from((await req.json()));
395
+ await onRequest?.(request);
396
+ if (request.method === 'eth_signTransaction') {
397
+ const transactionRequest = formatTransaction(request.params?.[0]);
398
+ const serializedTransaction = await signTransaction(client, {
399
+ ...transactionRequest,
400
+ account,
401
+ // @ts-expect-error
402
+ feePayer: account,
403
+ });
404
+ return Response.json(RpcResponse.from({ result: serializedTransaction }, { request }));
405
+ }
406
+ if (request.method === 'eth_signRawTransaction') {
407
+ const serialized = request.params?.[0];
408
+ const transaction = Transaction.deserialize(serialized);
409
+ const serializedTransaction = await signTransaction(client, {
410
+ ...transaction,
411
+ account,
412
+ // @ts-expect-error
413
+ feePayer: account,
414
+ });
415
+ return Response.json(RpcResponse.from({ result: serializedTransaction }, { request }));
416
+ }
417
+ if (request.method === 'eth_sendRawTransaction' ||
418
+ request.method === 'eth_sendRawTransactionSync') {
419
+ const serialized = request.params?.[0];
420
+ const transaction = Transaction.deserialize(serialized);
421
+ const serializedTransaction = await signTransaction(client, {
422
+ ...transaction,
423
+ account,
424
+ // @ts-expect-error
425
+ feePayer: account,
426
+ });
427
+ const result = await client.request({
428
+ method: request.method,
429
+ params: [serializedTransaction],
430
+ });
431
+ return Response.json(RpcResponse.from({ result }, { request }));
432
+ }
433
+ return Response.json(RpcResponse.from({
434
+ error: new RpcResponse.MethodNotSupportedError({
435
+ message: `Method not supported: ${request.method}`,
436
+ }),
437
+ }, { request }), { status: 400 });
438
+ });
439
+ return router;
440
+ }
441
+ //# sourceMappingURL=Handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Handler.js","sourceRoot":"","sources":["../../src/server/Handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAA2B,YAAY,EAAkB,MAAM,MAAM,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,eAAe,MAAM,+BAA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E,MAAM,EAAE,qBAAqB,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CACjE,CAAA;QACH,CAAC;QAED,IACE,OAAO,CAAC,MAAM,KAAK,wBAAwB;YAC3C,OAAO,CAAC,MAAM,KAAK,4BAA4B,EAC/C,CAAC;YACD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAoB,CAAA;YACzD,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;YAEvD,MAAM,qBAAqB,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE;gBAC1D,GAAG,WAAW;gBACd,OAAO;gBACP,mBAAmB;gBACnB,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAA;YAEF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;gBAClC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,CAAC,qBAAqB,CAAC;aAChC,CAAC,CAAA;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QACjE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAClB,WAAW,CAAC,IAAI,CACd;YACE,KAAK,EAAE,IAAI,WAAW,CAAC,uBAAuB,CAAC;gBAC7C,OAAO,EAAE,yBAAyB,OAAO,CAAC,MAAM,EAAE;aACnD,CAAC;SACH,EACD,EAAE,OAAO,EAAE,CACZ,EACD,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,16 @@
1
+ export type Kv = {
2
+ get: <value = unknown>(key: string) => Promise<value>;
3
+ set: (key: string, value: unknown) => Promise<void>;
4
+ delete: (key: string) => Promise<void>;
5
+ };
6
+ export declare function from<kv extends Kv>(kv: kv): kv;
7
+ export declare function cloudflare(kv: cloudflare.Parameters): Kv;
8
+ export declare namespace cloudflare {
9
+ type Parameters = {
10
+ get: <value = unknown>(key: string) => Promise<value>;
11
+ put: (key: string, value: any) => Promise<void>;
12
+ delete: (key: string) => Promise<void>;
13
+ };
14
+ }
15
+ export declare function memory(): Kv;
16
+ //# sourceMappingURL=Kv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Kv.d.ts","sourceRoot":"","sources":["../../src/server/Kv.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GAAG;IACf,GAAG,EAAE,CAAC,KAAK,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA;IACrD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACvC,CAAA;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAE9C;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,UAAU,GAAG,EAAE,CAMxD;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,KAAY,UAAU,GAAG;QACvB,GAAG,EAAE,CAAC,KAAK,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA;QACrD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;QAC/C,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KACvC,CAAA;CACF;AAED,wBAAgB,MAAM,IAAI,EAAE,CAa3B"}
@@ -0,0 +1,25 @@
1
+ export function from(kv) {
2
+ return kv;
3
+ }
4
+ export function cloudflare(kv) {
5
+ return from({
6
+ delete: kv.delete.bind(kv),
7
+ get: kv.get.bind(kv),
8
+ set: kv.put.bind(kv),
9
+ });
10
+ }
11
+ export function memory() {
12
+ const store = new Map();
13
+ return from({
14
+ async delete(key) {
15
+ Promise.resolve(store.delete(key));
16
+ },
17
+ async get(key) {
18
+ return store.get(key);
19
+ },
20
+ async set(key, value) {
21
+ store.set(key, value);
22
+ },
23
+ });
24
+ }
25
+ //# sourceMappingURL=Kv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Kv.js","sourceRoot":"","sources":["../../src/server/Kv.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,IAAI,CAAgB,EAAM;IACxC,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAyB;IAClD,OAAO,IAAI,CAAC;QACV,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;KACrB,CAAC,CAAA;AACJ,CAAC;AAUD,MAAM,UAAU,MAAM;IACpB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAA;IACxC,OAAO,IAAI,CAAC;QACV,KAAK,CAAC,MAAM,CAAC,GAAG;YACd,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QACpC,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,GAAG;YACX,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAQ,CAAA;QAC9B,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK;YAClB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACvB,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * as Handler from './Handler.js';
2
+ export * as Kv from './Kv.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * as Handler from './Handler.js';
2
+ export * as Kv from './Kv.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,124 @@
1
+ import type * as http from 'node:http';
2
+ import type * as http2 from 'node:http2';
3
+ export interface RequestListenerOptions {
4
+ /**
5
+ * Overrides the host portion of the incoming request URL. By default the request URL host is
6
+ * derived from the HTTP `Host` header.
7
+ *
8
+ * For example, if you have a `$HOST` environment variable that contains the hostname of your
9
+ * server, you can use it to set the host of all incoming request URLs like so:
10
+ *
11
+ * ```ts
12
+ * createRequestListener(handler, { host: process.env.HOST })
13
+ * ```
14
+ */
15
+ host?: string;
16
+ /**
17
+ * An error handler that determines the response when the request handler throws an error. By
18
+ * default a 500 Internal Server Error response will be sent.
19
+ */
20
+ onError?: ErrorHandler;
21
+ /**
22
+ * Overrides the protocol of the incoming request URL. By default the request URL protocol is
23
+ * derived from the connection protocol. So e.g. when serving over HTTPS (using
24
+ * `https.createServer()`), the request URL will begin with `https:`.
25
+ */
26
+ protocol?: string;
27
+ }
28
+ /**
29
+ * Wraps a fetch handler in a Node.js request listener that can be used with:
30
+ *
31
+ * - [`http.createServer()`](https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener)
32
+ * - [`https.createServer()`](https://nodejs.org/api/https.html#httpscreateserveroptions-requestlistener)
33
+ * - [`http2.createServer()`](https://nodejs.org/api/http2.html#http2createserveroptions-onrequesthandler)
34
+ * - [`http2.createSecureServer()`](https://nodejs.org/api/http2.html#http2createsecureserveroptions-onrequesthandler)
35
+ *
36
+ * Example:
37
+ *
38
+ * ```ts
39
+ * import * as http from 'node:http';
40
+ * import { createRequestListener } from '@mjackson/node-fetch-server';
41
+ *
42
+ * async function handler(request) {
43
+ * return new Response('Hello, world!');
44
+ * }
45
+ *
46
+ * let server = http.createServer(
47
+ * createRequestListener(handler)
48
+ * );
49
+ *
50
+ * server.listen(3000);
51
+ * ```
52
+ *
53
+ * @param handler The fetch handler to use for processing incoming requests.
54
+ * @param options Request listener options.
55
+ * @returns A Node.js request listener function.
56
+ */
57
+ export declare function fromFetchHandler(handler: FetchHandler, options?: RequestListenerOptions): http.RequestListener;
58
+ export type RequestOptions = Omit<RequestListenerOptions, 'onError'>;
59
+ /**
60
+ * Creates a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) object from
61
+ *
62
+ * - a [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage)/[`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) pair
63
+ * - a [`http2.Http2ServerRequest`](https://nodejs.org/api/http2.html#class-http2http2serverrequest)/[`http2.Http2ServerResponse`](https://nodejs.org/api/http2.html#class-http2http2serverresponse) pair
64
+ *
65
+ * @param req The incoming request object.
66
+ * @param res The server response object.
67
+ * @param options
68
+ * @returns A request object.
69
+ */
70
+ export declare function createRequest(req: http.IncomingMessage | http2.Http2ServerRequest, res: http.ServerResponse | http2.Http2ServerResponse, options?: RequestOptions): Request;
71
+ /**
72
+ * Creates a [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object from the headers in a Node.js
73
+ * [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage)/[`http2.Http2ServerRequest`](https://nodejs.org/api/http2.html#class-http2http2serverrequest).
74
+ *
75
+ * @param req The incoming request object.
76
+ * @returns A headers object.
77
+ */
78
+ export declare function createHeaders(req: http.IncomingMessage | http2.Http2ServerRequest): Headers;
79
+ /**
80
+ * Sends a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) to the client using a Node.js
81
+ * [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse)/[`http2.Http2ServerResponse`](https://nodejs.org/api/http2.html#class-http2http2serverresponse)
82
+ * object.
83
+ *
84
+ * @param res The server response object.
85
+ * @param response The response to send.
86
+ */
87
+ export declare function sendResponse(res: http.ServerResponse | http2.Http2ServerResponse, response: Response): Promise<void>;
88
+ export declare function readStream(stream: ReadableStream<Uint8Array>): AsyncIterable<Uint8Array>;
89
+ export interface ClientAddress {
90
+ /**
91
+ * The IP address of the client that sent the request.
92
+ *
93
+ * [Node.js Reference](https://nodejs.org/api/net.html#socketremoteaddress)
94
+ */
95
+ address: string;
96
+ /**
97
+ * The family of the client IP address.
98
+ *
99
+ * [Node.js Reference](https://nodejs.org/api/net.html#socketremotefamily)
100
+ */
101
+ family: 'IPv4' | 'IPv6';
102
+ /**
103
+ * The remote port of the client that sent the request.
104
+ *
105
+ * [Node.js Reference](https://nodejs.org/api/net.html#socketremoteport)
106
+ */
107
+ port: number;
108
+ }
109
+ /**
110
+ * A function that handles an error that occurred during request handling. May return a response to
111
+ * send to the client, or `undefined` to allow the server to send a default error response.
112
+ *
113
+ * [MDN `Response` Reference](https://developer.mozilla.org/en-US/docs/Web/API/Response)
114
+ */
115
+ export type ErrorHandler = (error: unknown) => undefined | Response | Promise<undefined | Response>;
116
+ /**
117
+ * A function that handles an incoming request and returns a response.
118
+ *
119
+ * [MDN `Request` Reference](https://developer.mozilla.org/en-US/docs/Web/API/Request)
120
+ *
121
+ * [MDN `Response` Reference](https://developer.mozilla.org/en-US/docs/Web/API/Response)
122
+ */
123
+ export type FetchHandler = (request: Request, client: ClientAddress) => Response | Promise<Response>;
124
+ //# sourceMappingURL=requestListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestListener.d.ts","sourceRoot":"","sources":["../../../src/server/internal/requestListener.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AACtC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,IAAI,CAAC,eAAe,CAyBtB;AAuBD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAA;AAEpE;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,kBAAkB,EACpD,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,mBAAmB,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAuCT;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,kBAAkB,GACnD,OAAO,CAUT;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,mBAAmB,EACpD,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,wBAAuB,UAAU,CAC/B,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,aAAa,CAAC,UAAU,C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