@ac-kit/net-socketmap 0.1.7 → 0.1.8
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
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @ac-kit/net-socketmap
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7f9f15d: Argument shapes follow one rule: required arguments are positional, `options`
|
|
8
|
+
is optional with every field optional, and a limit that has a sensible value
|
|
9
|
+
gets it as a default. Every `…Config` argument type is gone.
|
|
10
|
+
|
|
11
|
+
- `format-http`: new `HTTP_DEFAULT_MAX_FIELD_SECTION_SIZE` (16 KiB), the bound
|
|
12
|
+
every codec already applied by default.
|
|
13
|
+
- `net-http`: `new HttpServer(handler, options?)`; `HttpServerConfig` becomes
|
|
14
|
+
`HttpServerOptions`, with `maxHeadSize` defaulting to 16 KiB,
|
|
15
|
+
`idleTimeoutMs` to 5 s and `maxConnections` to 1 000.
|
|
16
|
+
- `net-http`: `new HttpAgent(connector, options?)`; `HttpAgentConfig` becomes
|
|
17
|
+
`HttpAgentOptions`, with `maxHeadSize` defaulting to 16 KiB,
|
|
18
|
+
`maxConnectionsPerOrigin` to 6 and `idleTimeoutMs` to 4 s.
|
|
19
|
+
`HttpAgentHttp2Config` becomes `HttpAgentHttp2Options`; its limits, and the
|
|
20
|
+
QPACK limits of `HttpAgentHttp3Options`, are optional and default to
|
|
21
|
+
`HTTP2_DEFAULT_LIMITS` and `HTTP3_DEFAULT_LIMITS`.
|
|
22
|
+
- `net-http`: new `HTTP2_DEFAULT_LIMITS` (100 concurrent streams, 65 535-byte
|
|
23
|
+
stream window, 1 MiB connection window, 200 control frames per second) and
|
|
24
|
+
`HTTP3_DEFAULT_LIMITS` (4 KiB QPACK table, 16 blocked streams).
|
|
25
|
+
- `net-http`: the per-connection classes take their connection (and, on the
|
|
26
|
+
server side, the handler) positionally, the rest as options:
|
|
27
|
+
`new Http1ClientConnection(connection, options?)`,
|
|
28
|
+
`new Http1ServerConnection(connection, handler, options?)`,
|
|
29
|
+
`new Http2ClientConnection(connection, options?)`,
|
|
30
|
+
`new Http2ServerConnection(connection, handler, options?)`,
|
|
31
|
+
`new Http3ClientConnection(connection, options?)`,
|
|
32
|
+
`new Http3ServerConnection(connection, handler, options?)`. Their `…Config`
|
|
33
|
+
types become `…Options`; `maxHeadSize` defaults to 16 KiB, `idleTimeoutMs`
|
|
34
|
+
to 5 s and `limits` to `HTTP2_DEFAULT_LIMITS` or `HTTP3_DEFAULT_LIMITS`.
|
|
35
|
+
- `net-websocket`: `new WebSocketPeer(transport, role, options?)`;
|
|
36
|
+
`WebSocketPeerConfig` becomes `WebSocketPeerOptions`, with `maxMessageSize`
|
|
37
|
+
defaulting to 1 MiB and `closeTimeoutMs` to 5 s.
|
|
38
|
+
- `net-websocket`: `acceptWebSocket(request, origins, onOpen, options?)` and
|
|
39
|
+
`connectWebSocket(requester, url, options?)`; `WebSocketAcceptInput` and
|
|
40
|
+
`WebSocketConnectInput` are removed, and `maxMessageSize` and
|
|
41
|
+
`closeTimeoutMs` move to their options, with the peer's defaults. `origins`
|
|
42
|
+
stays required.
|
|
43
|
+
- `net-core`: `Session`'s protected constructor takes
|
|
44
|
+
`(transport, codec, maxBufferSize, options?)`; `SessionOptions` holds only
|
|
45
|
+
`initialCapacity` and `registry`. `maxBufferSize` stays required, as for
|
|
46
|
+
`FrameLink`. `net-imap`, `net-pop3`, `net-smtp` and `net-socketmap` follow,
|
|
47
|
+
with no change to their own constructors.
|
|
48
|
+
- `net-http-node`: documentation only; `serveDirectory` keeps its signature.
|
|
49
|
+
- Updated dependencies [7f9f15d]
|
|
50
|
+
- Updated dependencies [7f9f15d]
|
|
51
|
+
- Updated dependencies [7f9f15d]
|
|
52
|
+
- @ac-kit/core@0.7.0
|
|
53
|
+
- @ac-kit/net-core@0.4.0
|
|
54
|
+
- @ac-kit/format-netstring@0.1.6
|
|
55
|
+
|
|
3
56
|
## 0.1.7
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
|
@@ -50,7 +50,6 @@ export declare class SocketmapClient extends Session<Uint8Array, Uint8Array | st
|
|
|
50
50
|
* @returns The status token and its accompanying value.
|
|
51
51
|
*/
|
|
52
52
|
lookup(table: string, key: string, options?: ExchangeOptions<Uint8Array>): Promise<SocketmapResult>;
|
|
53
|
-
private static buildOptions;
|
|
54
53
|
/** Applies the client-wide timeout when the call site did not set one. */
|
|
55
54
|
private withDefaults;
|
|
56
55
|
private static parseResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketmap-client.d.ts","sourceRoot":"","sources":["../../src/socketmap/socketmap-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"socketmap-client.d.ts","sourceRoot":"","sources":["../../src/socketmap/socketmap-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,KAAK,iBAAiB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnE,wCAAwC;AACxC,MAAM,MAAM,eAAe,GAAG;IAC7B,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,wDAAwD;AACxD,MAAM,WAAW,sBAAsB;IACtC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,qBAAa,eAAgB,SAAQ,OAAO,CAC3C,UAAU,EACV,UAAU,GAAG,MAAM,EACnB,qBAAqB,CACrB;IACA,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD;;;;;OAKG;IACH,YAAY,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,sBAAsB,EAS9D;IAED,UAAmB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAErD;IAED;;;;;;;OAOG;IACG,MAAM,CACX,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,eAAe,CAAC,CAQ1B;IAED,0EAA0E;IAC1E,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,MAAM,CAAC,aAAa;CAM5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { decodeText, encodeTextUtf8 } from "@ac-kit/core";
|
|
2
2
|
import { createNetstringCodec } from "@ac-kit/format-netstring";
|
|
3
|
-
import { Session
|
|
3
|
+
import { Session } from "@ac-kit/net-core";
|
|
4
4
|
/**
|
|
5
5
|
* Postfix socketmap client.
|
|
6
6
|
*
|
|
@@ -19,7 +19,9 @@ export class SocketmapClient extends Session {
|
|
|
19
19
|
* @param options Buffer, payload-length and timeout tuning.
|
|
20
20
|
*/
|
|
21
21
|
constructor(source, options) {
|
|
22
|
-
super(
|
|
22
|
+
super(source, createNetstringCodec({
|
|
23
|
+
maxPayloadLength: options?.maxPayloadLength ?? 100 * 1024,
|
|
24
|
+
}), options?.maxBufferSize ?? 1024 * 1024);
|
|
23
25
|
this.defaultTimeoutMs = options?.defaultTimeoutMs;
|
|
24
26
|
}
|
|
25
27
|
routeFrame(frame) {
|
|
@@ -38,15 +40,6 @@ export class SocketmapClient extends Session {
|
|
|
38
40
|
const frames = await this.request(request, () => "complete", this.withDefaults(options));
|
|
39
41
|
return SocketmapClient.parseResponse(decodeText(frames[0], "utf-8"));
|
|
40
42
|
}
|
|
41
|
-
static buildOptions(source, options) {
|
|
42
|
-
return {
|
|
43
|
-
transport: source,
|
|
44
|
-
codec: createNetstringCodec({
|
|
45
|
-
maxPayloadLength: options?.maxPayloadLength ?? 100 * 1024,
|
|
46
|
-
}),
|
|
47
|
-
maxBufferSize: options?.maxBufferSize ?? 1024 * 1024,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
43
|
/** Applies the client-wide timeout when the call site did not set one. */
|
|
51
44
|
withDefaults(options) {
|
|
52
45
|
if (this.defaultTimeoutMs === undefined ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketmap-client.js","sourceRoot":"","sources":["../../src/socketmap/socketmap-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,
|
|
1
|
+
{"version":3,"file":"socketmap-client.js","sourceRoot":"","sources":["../../src/socketmap/socketmap-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAA0B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA6BnE;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SAAQ,OAIpC;IACiB,gBAAgB,CAAqB;IAEtD;;;;;OAKG;IACH,YAAY,MAAiB,EAAE,OAAgC;QAC9D,KAAK,CACJ,MAAM,EACN,oBAAoB,CAAC;YACpB,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,IAAI,GAAG,GAAG,IAAI;SACzD,CAAC,EACF,OAAO,EAAE,aAAa,IAAI,IAAI,GAAG,IAAI,CACrC,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,OAAO,EAAE,gBAAgB,CAAC;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/net-socketmap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "A client for the socketmap protocol, Postfix's external table lookup protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"prepack": "yarn build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ac-kit/core": "^0.
|
|
48
|
-
"@ac-kit/format-netstring": "^0.1.
|
|
49
|
-
"@ac-kit/net-core": "^0.
|
|
47
|
+
"@ac-kit/core": "^0.7.0",
|
|
48
|
+
"@ac-kit/format-netstring": "^0.1.6",
|
|
49
|
+
"@ac-kit/net-core": "^0.4.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@ac-kit/net-transport-node": "0.
|
|
52
|
+
"@ac-kit/net-transport-node": "0.3.0",
|
|
53
53
|
"@ac-kit/tsconfig": "0.1.0",
|
|
54
54
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
55
55
|
"@ac-kit/vitest-config": "0.1.1",
|