@atproto/xrpc-server 0.4.4 → 0.5.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 (75) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/auth.d.ts +1 -0
  3. package/dist/auth.d.ts.map +1 -0
  4. package/dist/auth.js +124 -0
  5. package/dist/auth.js.map +1 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +25 -53682
  9. package/dist/index.js.map +1 -7
  10. package/dist/logger.d.ts +1 -0
  11. package/dist/logger.d.ts.map +1 -0
  12. package/dist/logger.js +7 -0
  13. package/dist/logger.js.map +1 -0
  14. package/dist/rate-limiter.d.ts +1 -0
  15. package/dist/rate-limiter.d.ts.map +1 -0
  16. package/dist/rate-limiter.js +166 -0
  17. package/dist/rate-limiter.js.map +1 -0
  18. package/dist/server.d.ts +5 -4
  19. package/dist/server.d.ts.map +1 -0
  20. package/dist/server.js +472 -0
  21. package/dist/server.js.map +1 -0
  22. package/dist/stream/frames.d.ts +2 -1
  23. package/dist/stream/frames.d.ts.map +1 -0
  24. package/dist/stream/frames.js +141 -0
  25. package/dist/stream/frames.js.map +1 -0
  26. package/dist/stream/index.d.ts +1 -0
  27. package/dist/stream/index.d.ts.map +1 -0
  28. package/dist/stream/index.js +22 -0
  29. package/dist/stream/index.js.map +1 -0
  30. package/dist/stream/logger.d.ts +1 -0
  31. package/dist/stream/logger.d.ts.map +1 -0
  32. package/dist/stream/logger.js +7 -0
  33. package/dist/stream/logger.js.map +1 -0
  34. package/dist/stream/server.d.ts +2 -0
  35. package/dist/stream/server.d.ts.map +1 -0
  36. package/dist/stream/server.js +70 -0
  37. package/dist/stream/server.js.map +1 -0
  38. package/dist/stream/stream.d.ts +1 -0
  39. package/dist/stream/stream.d.ts.map +1 -0
  40. package/dist/stream/stream.js +44 -0
  41. package/dist/stream/stream.js.map +1 -0
  42. package/dist/stream/subscription.d.ts +2 -0
  43. package/dist/stream/subscription.d.ts.map +1 -0
  44. package/dist/stream/subscription.js +80 -0
  45. package/dist/stream/subscription.js.map +1 -0
  46. package/dist/stream/types.d.ts +1 -0
  47. package/dist/stream/types.d.ts.map +1 -0
  48. package/dist/stream/types.js +47 -0
  49. package/dist/stream/types.js.map +1 -0
  50. package/dist/stream/websocket-keepalive.d.ts +2 -0
  51. package/dist/stream/websocket-keepalive.d.ts.map +1 -0
  52. package/dist/stream/websocket-keepalive.js +160 -0
  53. package/dist/stream/websocket-keepalive.js.map +1 -0
  54. package/dist/types.d.ts +5 -1
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +163 -0
  57. package/dist/types.js.map +1 -0
  58. package/dist/util.d.ts +1 -0
  59. package/dist/util.d.ts.map +1 -0
  60. package/dist/util.js +263 -0
  61. package/dist/util.js.map +1 -0
  62. package/jest.config.js +4 -3
  63. package/package.json +10 -11
  64. package/src/server.ts +15 -12
  65. package/src/stream/frames.ts +1 -1
  66. package/src/stream/websocket-keepalive.ts +2 -1
  67. package/src/types.ts +8 -1
  68. package/src/util.ts +5 -2
  69. package/tests/bodies.test.ts +4 -4
  70. package/tests/errors.test.ts +1 -1
  71. package/tsconfig.build.json +6 -2
  72. package/tsconfig.json +3 -11
  73. package/tsconfig.tests.json +7 -0
  74. package/babel.config.js +0 -1
  75. package/build.js +0 -14
@@ -274,9 +274,9 @@ describe('Bodies', () => {
274
274
  const resBody = await res.json()
275
275
  const status = res.status
276
276
  expect(status).toBe(400)
277
- expect(resBody.error).toBe('InvalidRequest')
278
- expect(resBody.message).toBe(
279
- 'Request encoding (Content-Type) required but not provided',
280
- )
277
+ expect(resBody).toMatchObject({
278
+ error: 'InvalidRequest',
279
+ message: 'Request encoding (Content-Type) required but not provided',
280
+ })
281
281
  })
282
282
  })
@@ -75,7 +75,7 @@ const LEXICONS: LexiconDoc[] = [
75
75
  },
76
76
  ]
77
77
 
78
- const MISMATCHED_LEXICONS = [
78
+ const MISMATCHED_LEXICONS: LexiconDoc[] = [
79
79
  {
80
80
  lexicon: 1,
81
81
  id: 'io.example.query',
@@ -1,4 +1,8 @@
1
1
  {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["**/*.spec.ts", "**/*.test.ts"]
2
+ "extends": "../../tsconfig/node.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "outDir": "./dist"
6
+ },
7
+ "include": ["./src"]
4
8
  }
package/tsconfig.json CHANGED
@@ -1,15 +1,7 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist", // Your outDir,
6
- "emitDeclarationOnly": true
7
- },
8
- "include": ["./src", "__tests__/**/**.ts"],
2
+ "include": [],
9
3
  "references": [
10
- { "path": "../common/tsconfig.build.json" },
11
- { "path": "../crypto/tsconfig.build.json" },
12
- { "path": "../lexicon/tsconfig.build.json" },
13
- { "path": "../xrpc/tsconfig.build.json" }
4
+ { "path": "./tsconfig.build.json" },
5
+ { "path": "./tsconfig.tests.json" }
14
6
  ]
15
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig/tests.json",
3
+ "compilerOptions": {
4
+ "rootDir": "."
5
+ },
6
+ "include": ["./tests"]
7
+ }
package/babel.config.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('../../babel.config.js')
package/build.js DELETED
@@ -1,14 +0,0 @@
1
- const { nodeExternalsPlugin } = require('esbuild-node-externals')
2
-
3
- const buildShallow =
4
- process.argv.includes('--shallow') || process.env.ATP_BUILD_SHALLOW === 'true'
5
-
6
- require('esbuild').build({
7
- logLevel: 'info',
8
- entryPoints: ['src/index.ts'],
9
- bundle: true,
10
- sourcemap: true,
11
- outdir: 'dist',
12
- platform: 'node',
13
- plugins: buildShallow ? [nodeExternalsPlugin()] : [],
14
- })