@atproto-labs/xrpc-utils 0.0.23 → 0.1.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.
- package/CHANGELOG.md +28 -0
- package/LICENSE.txt +1 -1
- package/dist/accept.js +15 -21
- package/dist/accept.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atproto-labs/xrpc-utils
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`bb7491c`](https://github.com/bluesky-social/atproto/commit/bb7491c29e06181e1d2f8cf6eb454f9bb8ab961b) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
|
|
8
|
+
|
|
9
|
+
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`07ae5d4`](https://github.com/bluesky-social/atproto/commit/07ae5d4452df51e045e0239da7a04cf0bc154028) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
|
|
10
|
+
|
|
11
|
+
Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
|
|
12
|
+
|
|
13
|
+
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`042df15`](https://github.com/bluesky-social/atproto/commit/042df15087c0e62cd1e715fcbf58852fab875af9) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0. Emitted `.d.ts` files now use TypeScript 6's stricter `Uint8Array<ArrayBuffer>` typing in places where Web/Node APIs require buffer-backed (not shared-memory) byte arrays. Consumers compiling against these types on older TypeScript should see no runtime impact, but may need to widen or cast in spots that previously relied on `Uint8Array` defaulting to `<ArrayBufferLike>`.
|
|
14
|
+
|
|
15
|
+
Internal: tsconfig `moduleResolution: "node"` is silenced via `ignoreDeprecations: "6.0"` for now; the proper migration to `node16`/`bundler` resolution is deferred.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`bb7491c`](https://github.com/bluesky-social/atproto/commit/bb7491c29e06181e1d2f8cf6eb454f9bb8ab961b), [`07ae5d4`](https://github.com/bluesky-social/atproto/commit/07ae5d4452df51e045e0239da7a04cf0bc154028), [`042df15`](https://github.com/bluesky-social/atproto/commit/042df15087c0e62cd1e715fcbf58852fab875af9)]:
|
|
20
|
+
- @atproto/xrpc@0.8.0-next.0
|
|
21
|
+
- @atproto/xrpc-server@0.11.0-next.0
|
|
22
|
+
|
|
23
|
+
## 0.0.24
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7), [`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7)]:
|
|
28
|
+
- @atproto/xrpc-server@0.10.0
|
|
29
|
+
- @atproto/xrpc@0.7.6
|
|
30
|
+
|
|
3
31
|
## 0.0.23
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Dual MIT/Apache-2.0 License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2022-
|
|
3
|
+
Copyright (c) 2022-2026 Bluesky Social PBC, and Contributors
|
|
4
4
|
|
|
5
5
|
Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
|
|
6
6
|
|
package/dist/accept.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.buildProxiedContentEncoding = buildProxiedContentEncoding;
|
|
5
|
-
exports.negotiateContentEncoding = negotiateContentEncoding;
|
|
6
|
-
exports.formatAcceptHeader = formatAcceptHeader;
|
|
7
|
-
const xrpc_1 = require("@atproto/xrpc");
|
|
8
|
-
const xrpc_server_1 = require("@atproto/xrpc-server");
|
|
9
|
-
exports.ACCEPT_ENCODING_COMPRESSED = [
|
|
1
|
+
import { ResponseType } from '@atproto/xrpc';
|
|
2
|
+
import { InvalidRequestError, XRPCError as XRPCServerError, } from '@atproto/xrpc-server';
|
|
3
|
+
export const ACCEPT_ENCODING_COMPRESSED = [
|
|
10
4
|
['gzip', { q: 1.0 }],
|
|
11
5
|
['deflate', { q: 0.9 }],
|
|
12
6
|
['br', { q: 0.8 }],
|
|
13
7
|
['identity', { q: 0.1 }],
|
|
14
8
|
];
|
|
15
|
-
|
|
9
|
+
export const ACCEPT_ENCODING_UNCOMPRESSED = [
|
|
16
10
|
['identity', { q: 1.0 }],
|
|
17
11
|
['gzip', { q: 0.3 }],
|
|
18
12
|
['deflate', { q: 0.2 }],
|
|
@@ -21,12 +15,12 @@ exports.ACCEPT_ENCODING_UNCOMPRESSED = [
|
|
|
21
15
|
// accept-encoding defaults to "identity with lowest priority"
|
|
22
16
|
const ACCEPT_ENC_DEFAULT = ['identity', { q: 0.001 }];
|
|
23
17
|
const ACCEPT_FORBID_STAR = ['*', { q: 0 }];
|
|
24
|
-
function buildProxiedContentEncoding(acceptHeader, preferCompressed) {
|
|
18
|
+
export function buildProxiedContentEncoding(acceptHeader, preferCompressed) {
|
|
25
19
|
return negotiateContentEncoding(acceptHeader, preferCompressed
|
|
26
|
-
?
|
|
27
|
-
:
|
|
20
|
+
? ACCEPT_ENCODING_COMPRESSED
|
|
21
|
+
: ACCEPT_ENCODING_UNCOMPRESSED);
|
|
28
22
|
}
|
|
29
|
-
function negotiateContentEncoding(acceptHeader, preferences) {
|
|
23
|
+
export function negotiateContentEncoding(acceptHeader, preferences) {
|
|
30
24
|
const acceptMap = Object.fromEntries(parseAcceptEncoding(acceptHeader));
|
|
31
25
|
// Make sure the default (identity) is covered by the preferences
|
|
32
26
|
if (!preferences.some(coversIdentityAccept)) {
|
|
@@ -50,7 +44,7 @@ function negotiateContentEncoding(acceptHeader, preferences) {
|
|
|
50
44
|
}
|
|
51
45
|
// If no common encodings are acceptable, throw a 406 Not Acceptable error
|
|
52
46
|
if (!common.some(isAllowedAccept)) {
|
|
53
|
-
throw new
|
|
47
|
+
throw new XRPCServerError(ResponseType.NotAcceptable, 'this service does not support any of the requested encodings');
|
|
54
48
|
}
|
|
55
49
|
return formatAcceptHeader(common);
|
|
56
50
|
}
|
|
@@ -63,7 +57,7 @@ function isAllowedAccept([, flags]) {
|
|
|
63
57
|
/**
|
|
64
58
|
* @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Quality_values}
|
|
65
59
|
*/
|
|
66
|
-
function formatAcceptHeader(accept) {
|
|
60
|
+
export function formatAcceptHeader(accept) {
|
|
67
61
|
return accept.map(formatAcceptPart).join(',');
|
|
68
62
|
}
|
|
69
63
|
function formatAcceptPart([name, flags]) {
|
|
@@ -79,16 +73,16 @@ function parseAcceptEncoding(acceptEncodings) {
|
|
|
79
73
|
function parseAcceptEncodingDefinition(def) {
|
|
80
74
|
const { length, 0: encoding, 1: params } = def.trim().split(';', 3);
|
|
81
75
|
if (length > 2) {
|
|
82
|
-
throw new
|
|
76
|
+
throw new InvalidRequestError(`Invalid accept-encoding: "${def}"`);
|
|
83
77
|
}
|
|
84
78
|
if (!encoding || encoding.includes('=')) {
|
|
85
|
-
throw new
|
|
79
|
+
throw new InvalidRequestError(`Invalid accept-encoding: "${def}"`);
|
|
86
80
|
}
|
|
87
81
|
const flags = { q: 1 };
|
|
88
82
|
if (length === 2) {
|
|
89
83
|
const { length, 0: key, 1: value } = params.split('=', 3);
|
|
90
84
|
if (length !== 2) {
|
|
91
|
-
throw new
|
|
85
|
+
throw new InvalidRequestError(`Invalid accept-encoding: "${def}"`);
|
|
92
86
|
}
|
|
93
87
|
if (key === 'q' || key === 'Q') {
|
|
94
88
|
const q = parseFloat(value);
|
|
@@ -96,11 +90,11 @@ function parseAcceptEncodingDefinition(def) {
|
|
|
96
90
|
flags.q = q;
|
|
97
91
|
}
|
|
98
92
|
else {
|
|
99
|
-
throw new
|
|
93
|
+
throw new InvalidRequestError(`Invalid accept-encoding: "${def}"`);
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
96
|
else {
|
|
103
|
-
throw new
|
|
97
|
+
throw new InvalidRequestError(`Invalid accept-encoding: "${def}"`);
|
|
104
98
|
}
|
|
105
99
|
}
|
|
106
100
|
return [encoding.toLowerCase(), flags];
|
package/dist/accept.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../src/accept.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../src/accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EACL,mBAAmB,EACnB,SAAS,IAAI,eAAe,GAC7B,MAAM,sBAAsB,CAAA;AAK7B,MAAM,CAAC,MAAM,0BAA0B,GAAmC;IACxE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACpB,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;CACzB,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAmC;IAC1E,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACxB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,GAAG,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;QACH,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,mBAAmB,CAAC,6BAA6B,GAAG,GAAG,CAAC,CAAA;QACpE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAA;AACxC,CAAC","sourcesContent":["import { ResponseType } from '@atproto/xrpc'\nimport {\n InvalidRequestError,\n XRPCError as XRPCServerError,\n} from '@atproto/xrpc-server'\n\nexport type AcceptFlags = { q: number }\nexport type Accept = [name: string, flags: AcceptFlags]\n\nexport const ACCEPT_ENCODING_COMPRESSED: readonly [Accept, ...Accept[]] = [\n ['gzip', { q: 1.0 }],\n ['deflate', { q: 0.9 }],\n ['br', { q: 0.8 }],\n ['identity', { q: 0.1 }],\n]\n\nexport const ACCEPT_ENCODING_UNCOMPRESSED: readonly [Accept, ...Accept[]] = [\n ['identity', { q: 1.0 }],\n ['gzip', { q: 0.3 }],\n ['deflate', { q: 0.2 }],\n ['br', { q: 0.1 }],\n]\n\n// accept-encoding defaults to \"identity with lowest priority\"\nconst ACCEPT_ENC_DEFAULT = ['identity', { q: 0.001 }] as const satisfies Accept\nconst ACCEPT_FORBID_STAR = ['*', { q: 0 }] as const satisfies Accept\n\nexport function buildProxiedContentEncoding(\n acceptHeader: undefined | string | string[],\n preferCompressed: boolean,\n): string {\n return negotiateContentEncoding(\n acceptHeader,\n preferCompressed\n ? ACCEPT_ENCODING_COMPRESSED\n : ACCEPT_ENCODING_UNCOMPRESSED,\n )\n}\n\nexport function negotiateContentEncoding(\n acceptHeader: undefined | string | string[],\n preferences: readonly Accept[],\n): string {\n const acceptMap = Object.fromEntries<undefined | AcceptFlags>(\n parseAcceptEncoding(acceptHeader),\n )\n\n // Make sure the default (identity) is covered by the preferences\n if (!preferences.some(coversIdentityAccept)) {\n preferences = [...preferences, ACCEPT_ENC_DEFAULT]\n }\n\n const common = preferences.filter(([name]) => {\n const acceptQ = (acceptMap[name] ?? acceptMap['*'])?.q\n // Per HTTP/1.1, \"identity\" is always acceptable unless explicitly rejected\n if (name === 'identity') {\n return acceptQ == null || acceptQ > 0\n } else {\n return acceptQ != null && acceptQ > 0\n }\n })\n\n // Since \"identity\" was present in the preferences, a missing \"identity\" in\n // the common array means that the client explicitly rejected it. Let's reflect\n // this by adding it to the common array.\n if (!common.some(coversIdentityAccept)) {\n common.push(ACCEPT_FORBID_STAR)\n }\n\n // If no common encodings are acceptable, throw a 406 Not Acceptable error\n if (!common.some(isAllowedAccept)) {\n throw new XRPCServerError(\n ResponseType.NotAcceptable,\n 'this service does not support any of the requested encodings',\n )\n }\n\n return formatAcceptHeader(common as [Accept, ...Accept[]])\n}\n\nfunction coversIdentityAccept([name]: Accept): boolean {\n return name === 'identity' || name === '*'\n}\n\nfunction isAllowedAccept([, flags]: Accept): boolean {\n return flags.q > 0\n}\n\n/**\n * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Quality_values}\n */\nexport function formatAcceptHeader(\n accept: readonly [Accept, ...Accept[]],\n): string {\n return accept.map(formatAcceptPart).join(',')\n}\n\nfunction formatAcceptPart([name, flags]: Accept): string {\n return `${name};q=${flags.q}`\n}\n\nfunction parseAcceptEncoding(\n acceptEncodings: undefined | string | string[],\n): Accept[] {\n if (!acceptEncodings?.length) return []\n\n return Array.isArray(acceptEncodings)\n ? acceptEncodings.flatMap(parseAcceptEncoding)\n : acceptEncodings.split(',').map(parseAcceptEncodingDefinition)\n}\n\nfunction parseAcceptEncodingDefinition(def: string): Accept {\n const { length, 0: encoding, 1: params } = def.trim().split(';', 3)\n\n if (length > 2) {\n throw new InvalidRequestError(`Invalid accept-encoding: \"${def}\"`)\n }\n\n if (!encoding || encoding.includes('=')) {\n throw new InvalidRequestError(`Invalid accept-encoding: \"${def}\"`)\n }\n\n const flags = { q: 1 }\n if (length === 2) {\n const { length, 0: key, 1: value } = params.split('=', 3)\n if (length !== 2) {\n throw new InvalidRequestError(`Invalid accept-encoding: \"${def}\"`)\n }\n\n if (key === 'q' || key === 'Q') {\n const q = parseFloat(value)\n if (q === 0 || (Number.isFinite(q) && q <= 1 && q >= 0.001)) {\n flags.q = q\n } else {\n throw new InvalidRequestError(`Invalid accept-encoding: \"${def}\"`)\n }\n } else {\n throw new InvalidRequestError(`Invalid accept-encoding: \"${def}\"`)\n }\n }\n\n return [encoding.toLowerCase(), flags]\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./accept.js"), exports);
|
|
1
|
+
export * from './accept.js';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA","sourcesContent":["export * from './accept.js'\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto-labs/xrpc-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-next.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22"
|
|
6
|
+
},
|
|
4
7
|
"license": "MIT",
|
|
5
8
|
"description": "XRPC server utilities for Node.JS",
|
|
6
9
|
"keywords": [
|
|
@@ -18,9 +21,7 @@
|
|
|
18
21
|
"url": "https://github.com/bluesky-social/atproto",
|
|
19
22
|
"directory": "packages/internal/xrpc-utils"
|
|
20
23
|
},
|
|
21
|
-
"type": "
|
|
22
|
-
"main": "dist/index.js",
|
|
23
|
-
"types": "dist/index.d.ts",
|
|
24
|
+
"type": "module",
|
|
24
25
|
"exports": {
|
|
25
26
|
".": {
|
|
26
27
|
"types": "./dist/index.d.ts",
|
|
@@ -32,11 +33,11 @@
|
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@atproto/xrpc": "^0.
|
|
36
|
-
"@atproto/xrpc
|
|
36
|
+
"@atproto/xrpc-server": "^0.11.0-next.0",
|
|
37
|
+
"@atproto/xrpc": "^0.8.0-next.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"typescript": "^
|
|
40
|
+
"typescript": "^6.0.3"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "tsc --build tsconfig.build.json"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/accept.ts","./src/index.ts"],"version":"
|
|
1
|
+
{"root":["./src/accept.ts","./src/index.ts"],"version":"6.0.3"}
|