@atproto/xrpc-server 0.10.21 → 0.11.0-next.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/auth.js +25 -65
  3. package/dist/auth.js.map +1 -1
  4. package/dist/errors.d.ts.map +1 -1
  5. package/dist/errors.js +59 -85
  6. package/dist/errors.js.map +1 -1
  7. package/dist/index.d.ts +8 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +7 -28
  10. package/dist/index.js.map +1 -1
  11. package/dist/logger.js +4 -7
  12. package/dist/logger.js.map +1 -1
  13. package/dist/rate-limiter.d.ts +1 -1
  14. package/dist/rate-limiter.d.ts.map +1 -1
  15. package/dist/rate-limiter.js +27 -91
  16. package/dist/rate-limiter.js.map +1 -1
  17. package/dist/server.d.ts +4 -4
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +94 -178
  20. package/dist/server.js.map +1 -1
  21. package/dist/stream/frames.d.ts +1 -1
  22. package/dist/stream/frames.d.ts.map +1 -1
  23. package/dist/stream/frames.js +20 -50
  24. package/dist/stream/frames.js.map +1 -1
  25. package/dist/stream/index.d.ts +5 -5
  26. package/dist/stream/index.d.ts.map +1 -1
  27. package/dist/stream/index.js +5 -21
  28. package/dist/stream/index.js.map +1 -1
  29. package/dist/stream/logger.js +3 -6
  30. package/dist/stream/logger.js.map +1 -1
  31. package/dist/stream/server.d.ts +3 -2
  32. package/dist/stream/server.d.ts.map +1 -1
  33. package/dist/stream/server.js +12 -22
  34. package/dist/stream/server.js.map +1 -1
  35. package/dist/stream/stream.d.ts +2 -2
  36. package/dist/stream/stream.d.ts.map +1 -1
  37. package/dist/stream/stream.js +12 -18
  38. package/dist/stream/stream.js.map +1 -1
  39. package/dist/stream/subscription.d.ts +1 -1
  40. package/dist/stream/subscription.d.ts.map +1 -1
  41. package/dist/stream/subscription.js +9 -18
  42. package/dist/stream/subscription.js.map +1 -1
  43. package/dist/stream/types.js +12 -15
  44. package/dist/stream/types.js.map +1 -1
  45. package/dist/types.d.ts +2 -2
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +22 -29
  48. package/dist/types.js.map +1 -1
  49. package/dist/util.d.ts +2 -2
  50. package/dist/util.d.ts.map +1 -1
  51. package/dist/util.js +75 -116
  52. package/dist/util.js.map +1 -1
  53. package/{jest.config.js → jest.config.cjs} +8 -2
  54. package/package.json +28 -22
  55. package/src/auth.ts +1 -1
  56. package/src/errors.ts +4 -1
  57. package/src/index.ts +8 -8
  58. package/src/rate-limiter.ts +2 -2
  59. package/src/server.ts +11 -6
  60. package/src/stream/frames.ts +2 -2
  61. package/src/stream/index.ts +5 -5
  62. package/src/stream/server.ts +4 -3
  63. package/src/stream/stream.ts +1 -1
  64. package/src/stream/subscription.ts +2 -2
  65. package/src/types.ts +2 -2
  66. package/src/util.ts +6 -3
  67. package/tests/_util.ts +1 -1
  68. package/tests/auth.test.ts +6 -3
  69. package/tests/bodies.test.ts +4 -3
  70. package/tests/errors.test.ts +2 -2
  71. package/tests/frames.test.ts +1 -1
  72. package/tests/ipld.test.ts +2 -2
  73. package/tests/parameters.test.ts +2 -2
  74. package/tests/parsing.test.ts +1 -1
  75. package/tests/procedures.test.ts +2 -2
  76. package/tests/queries.test.ts +2 -2
  77. package/tests/rate-limiter.test.ts +3 -3
  78. package/tests/responses.test.ts +2 -2
  79. package/tests/stream.test.ts +1 -1
  80. package/tests/subscriptions.test.ts +11 -5
  81. package/tsconfig.build.json +1 -1
  82. package/tsconfig.build.tsbuildinfo +1 -1
  83. package/tsconfig.tests.json +1 -1
@@ -2,13 +2,13 @@ import * as http from 'node:http'
2
2
  import { AddressInfo } from 'node:net'
3
3
  import { LexiconDoc } from '@atproto/lexicon'
4
4
  import { XrpcClient } from '@atproto/xrpc'
5
- import * as xrpcServer from '../src'
5
+ import * as xrpcServer from '../src/index.js'
6
6
  import {
7
7
  buildAddLexicons,
8
8
  buildMethodLexicons,
9
9
  closeServer,
10
10
  createServer,
11
- } from './_util'
11
+ } from './_util.js'
12
12
 
13
13
  const LEXICONS = [
14
14
  {
@@ -3,9 +3,9 @@ import { AddressInfo } from 'node:net'
3
3
  import { MINUTE } from '@atproto/common'
4
4
  import { LexiconDoc } from '@atproto/lexicon'
5
5
  import { XrpcClient } from '@atproto/xrpc'
6
- import * as xrpcServer from '../src'
7
- import { MemoryRateLimiter } from '../src'
8
- import { closeServer, createServer } from './_util'
6
+ import * as xrpcServer from '../src/index.js'
7
+ import { MemoryRateLimiter } from '../src/index.js'
8
+ import { closeServer, createServer } from './_util.js'
9
9
 
10
10
  const LEXICONS: LexiconDoc[] = [
11
11
  {
@@ -3,8 +3,8 @@ import { AddressInfo } from 'node:net'
3
3
  import { byteIterableToStream } from '@atproto/common'
4
4
  import { LexiconDoc } from '@atproto/lexicon'
5
5
  import { XrpcClient } from '@atproto/xrpc'
6
- import * as xrpcServer from '../src'
7
- import { closeServer, createServer } from './_util'
6
+ import * as xrpcServer from '../src/index.js'
7
+ import { closeServer, createServer } from './_util.js'
8
8
 
9
9
  const LEXICONS: LexiconDoc[] = [
10
10
  {
@@ -10,7 +10,7 @@ import {
10
10
  XrpcStreamServer,
11
11
  byFrame,
12
12
  byMessage,
13
- } from '../src'
13
+ } from '../src/index.js'
14
14
 
15
15
  describe('Stream', () => {
16
16
  const wait = (ms) => new Promise((res) => setTimeout(res, ms))
@@ -3,8 +3,14 @@ import { AddressInfo } from 'node:net'
3
3
  import { WebSocket, createWebSocketStream } from 'ws'
4
4
  import { wait } from '@atproto/common'
5
5
  import { LexiconDoc, Lexicons } from '@atproto/lexicon'
6
- import { ErrorFrame, Frame, MessageFrame, Subscription, byFrame } from '../src'
7
- import * as xrpcServer from '../src'
6
+ import {
7
+ ErrorFrame,
8
+ Frame,
9
+ MessageFrame,
10
+ Subscription,
11
+ byFrame,
12
+ } from '../src/index.js'
13
+ import * as xrpcServer from '../src/index.js'
8
14
  import {
9
15
  basicAuthHeaders,
10
16
  buildAddLexicons,
@@ -12,7 +18,7 @@ import {
12
18
  closeServer,
13
19
  createBasicAuth,
14
20
  createServer,
15
- } from './_util'
21
+ } from './_util.js'
16
22
 
17
23
  const LEXICONS = [
18
24
  {
@@ -278,8 +284,8 @@ for (const buildServer of [buildMethodLexicons, buildAddLexicons]) {
278
284
  it('does not websocket upgrade at bad endpoint', async () => {
279
285
  const ws = new WebSocket(`ws://localhost:${port}/xrpc/does.not.exist`)
280
286
  const drainStream = async () => {
281
- for await (const bytes of createWebSocketStream(ws)) {
282
- bytes // drain
287
+ for await (const _bytes of createWebSocketStream(ws)) {
288
+ // drain
283
289
  }
284
290
  }
285
291
  await expect(drainStream).rejects.toHaveProperty('code', 'ECONNRESET')
@@ -4,5 +4,5 @@
4
4
  "rootDir": "./src",
5
5
  "outDir": "./dist"
6
6
  },
7
- "include": ["./src"]
7
+ "include": ["./src", "../../tsconfig/cjs-default-exports.d.ts"]
8
8
  }
@@ -1 +1 @@
1
- {"root":["./src/auth.ts","./src/errors.ts","./src/index.ts","./src/logger.ts","./src/rate-limiter.ts","./src/server.ts","./src/types.ts","./src/util.ts","./src/stream/frames.ts","./src/stream/index.ts","./src/stream/logger.ts","./src/stream/server.ts","./src/stream/stream.ts","./src/stream/subscription.ts","./src/stream/types.ts"],"version":"5.8.2"}
1
+ {"root":["./src/auth.ts","./src/errors.ts","./src/index.ts","./src/logger.ts","./src/rate-limiter.ts","./src/server.ts","./src/types.ts","./src/util.ts","./src/stream/frames.ts","./src/stream/index.ts","./src/stream/logger.ts","./src/stream/server.ts","./src/stream/stream.ts","./src/stream/subscription.ts","./src/stream/types.ts","../../tsconfig/cjs-default-exports.d.ts"],"version":"6.0.3"}
@@ -3,5 +3,5 @@
3
3
  "compilerOptions": {
4
4
  "rootDir": "."
5
5
  },
6
- "include": ["./tests"]
6
+ "include": ["./tests", "../../tsconfig/cjs-default-exports.d.ts"]
7
7
  }