@openclaw/feishu 2026.6.8 → 2026.6.9-beta.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.
- package/dist/api.js +78 -23
- package/dist/{channel-DwygSth-.js → channel-C9mW5kaS.js} +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-CrqKcXaU.js → channel.runtime-BgUhHAja.js} +3 -3
- package/dist/{drive-8o3Omlnd.js → drive-9UfpmY27.js} +15 -2
- package/dist/{monitor-_1eNsUVp.js → monitor-BayUOr_U.js} +1 -1
- package/dist/{monitor.account-BhoLA1Y0.js → monitor.account-DzZWj0ob.js} +92 -48
- package/dist/{send-B3kteMF8.js → send-BozRcrbz.js} +32 -24
- package/dist/setup-api.js +1 -1
- package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
- package/node_modules/@protobufjs/aspromise/README.md +13 -0
- package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
- package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
- package/node_modules/@protobufjs/aspromise/package.json +21 -0
- package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
- package/node_modules/@protobufjs/base64/LICENSE +26 -0
- package/node_modules/@protobufjs/base64/README.md +19 -0
- package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
- package/node_modules/@protobufjs/base64/package.json +21 -0
- package/node_modules/@protobufjs/base64/tests/index.js +46 -0
- package/node_modules/@protobufjs/codegen/LICENSE +26 -0
- package/node_modules/@protobufjs/codegen/README.md +49 -0
- package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
- package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -113
- package/node_modules/@protobufjs/codegen/package.json +13 -0
- package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
- package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
- package/node_modules/@protobufjs/eventemitter/README.md +22 -0
- package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
- package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
- package/node_modules/@protobufjs/eventemitter/package.json +21 -0
- package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/LICENSE +26 -0
- package/node_modules/@protobufjs/fetch/README.md +13 -0
- package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
- package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
- package/node_modules/@protobufjs/fetch/package.json +27 -0
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/float/LICENSE +26 -0
- package/node_modules/@protobufjs/float/README.md +102 -0
- package/node_modules/@protobufjs/float/bench/index.js +87 -0
- package/node_modules/@protobufjs/float/bench/suite.js +46 -0
- package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
- package/node_modules/@protobufjs/float/package.json +26 -0
- package/node_modules/@protobufjs/float/tests/index.js +100 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/LICENSE +26 -0
- package/node_modules/@protobufjs/inquire/README.md +13 -0
- package/node_modules/{protobufjs/src/util/inquire.d.ts → @protobufjs/inquire/index.d.ts} +10 -10
- package/node_modules/{protobufjs/src/util/inquire.js → @protobufjs/inquire/index.js} +38 -38
- package/node_modules/@protobufjs/inquire/package.json +21 -0
- package/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/index.js +20 -0
- package/node_modules/@protobufjs/path/LICENSE +26 -0
- package/node_modules/@protobufjs/path/README.md +19 -0
- package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
- package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -72
- package/node_modules/@protobufjs/path/package.json +21 -0
- package/node_modules/@protobufjs/path/tests/index.js +60 -0
- package/node_modules/@protobufjs/pool/.npmignore +3 -0
- package/node_modules/@protobufjs/pool/LICENSE +26 -0
- package/node_modules/@protobufjs/pool/README.md +13 -0
- package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
- package/node_modules/@protobufjs/pool/package.json +21 -0
- package/node_modules/@protobufjs/pool/tests/index.js +33 -0
- package/node_modules/@protobufjs/utf8/LICENSE +26 -0
- package/node_modules/@protobufjs/utf8/README.md +20 -0
- package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
- package/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -130
- package/node_modules/@protobufjs/utf8/package.json +21 -0
- package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
- package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
- package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +59 -0
- package/node_modules/@types/node/assert.d.ts +950 -0
- package/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/node_modules/@types/node/buffer.d.ts +1765 -0
- package/node_modules/@types/node/child_process.d.ts +1366 -0
- package/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@types/node/crypto.d.ts +4058 -0
- package/node_modules/@types/node/dgram.d.ts +537 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
- package/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@types/node/fs/promises.d.ts +1468 -0
- package/node_modules/@types/node/fs.d.ts +4780 -0
- package/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@types/node/http.d.ts +2147 -0
- package/node_modules/@types/node/http2.d.ts +2485 -0
- package/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@types/node/index.d.ts +117 -0
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +264 -0
- package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@types/node/module.d.ts +755 -0
- package/node_modules/@types/node/net.d.ts +970 -0
- package/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@types/node/package.json +155 -0
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@types/node/perf_hooks.d.ts +612 -0
- package/node_modules/@types/node/process.d.ts +2204 -0
- package/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@types/node/quic.d.ts +897 -0
- package/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@types/node/readline.d.ts +507 -0
- package/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@types/node/sqlite.d.ts +1068 -0
- package/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@types/node/stream/iter.d.ts +301 -0
- package/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@types/node/stream/web.d.ts +300 -0
- package/node_modules/@types/node/stream.d.ts +1774 -0
- package/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +2279 -0
- package/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@types/node/tls.d.ts +1193 -0
- package/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +119 -0
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
- package/node_modules/@types/node/tty.d.ts +225 -0
- package/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@types/node/v8.d.ts +980 -0
- package/node_modules/@types/node/vm.d.ts +1136 -0
- package/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +671 -0
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +589 -0
- package/node_modules/protobufjs/README.md +556 -263
- package/node_modules/protobufjs/dist/light/protobuf.js +1569 -1919
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +906 -1132
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +1576 -1993
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
- package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
- package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
- package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
- package/node_modules/protobufjs/index.d.ts +720 -834
- package/node_modules/protobufjs/package.json +44 -20
- package/node_modules/protobufjs/src/converter.js +36 -60
- package/node_modules/protobufjs/src/decoder.js +53 -124
- package/node_modules/protobufjs/src/encoder.js +2 -10
- package/node_modules/protobufjs/src/enum.js +3 -8
- package/node_modules/protobufjs/src/field.js +11 -13
- package/node_modules/protobufjs/src/index-light.js +1 -1
- package/node_modules/protobufjs/src/mapfield.js +0 -1
- package/node_modules/protobufjs/src/message.js +11 -5
- package/node_modules/protobufjs/src/method.js +4 -5
- package/node_modules/protobufjs/src/namespace.js +3 -10
- package/node_modules/protobufjs/src/object.js +20 -20
- package/node_modules/protobufjs/src/oneof.js +0 -3
- package/node_modules/protobufjs/src/parse.js +16 -78
- package/node_modules/protobufjs/src/reader.js +31 -136
- package/node_modules/protobufjs/src/reader_buffer.js +3 -24
- package/node_modules/protobufjs/src/root.js +3 -7
- package/node_modules/protobufjs/src/roots.js +1 -1
- package/node_modules/protobufjs/src/service.js +6 -13
- package/node_modules/protobufjs/src/tokenize.js +1 -6
- package/node_modules/protobufjs/src/type.js +30 -44
- package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
- package/node_modules/protobufjs/src/util/minimal.js +12 -36
- package/node_modules/protobufjs/src/util.js +17 -6
- package/node_modules/protobufjs/src/verifier.js +6 -6
- package/node_modules/protobufjs/src/wrappers.js +1 -0
- package/node_modules/protobufjs/src/writer.js +16 -42
- package/node_modules/protobufjs/src/writer_buffer.js +1 -18
- package/node_modules/protobufjs/tsconfig.json +5 -3
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +32 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +123 -0
- package/node_modules/undici-types/connector.d.ts +36 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/undici-types/dispatcher.d.ts +279 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici-types/errors.d.ts +177 -0
- package/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/undici-types/fetch.d.ts +211 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +160 -0
- package/node_modules/undici-types/index.d.ts +91 -0
- package/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +41 -0
- package/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +347 -0
- package/node_modules/undici-types/websocket.d.ts +188 -0
- package/npm-shrinkwrap.json +95 -6
- package/package.json +4 -4
- package/skills/feishu-wiki/SKILL.md +10 -1
- package/node_modules/protobufjs/ext/README.md +0 -81
- package/node_modules/protobufjs/ext/descriptor.d.ts +0 -86
- package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -409
- package/node_modules/protobufjs/ext/descriptor.js +0 -1266
- package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
- package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -11
- package/node_modules/protobufjs/ext/textformat.js +0 -1235
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
- package/node_modules/protobufjs/src/typescript.js +0 -25
- /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
|
@@ -11,9 +11,9 @@ var roots = require("./roots");
|
|
|
11
11
|
var Type, // cyclic
|
|
12
12
|
Enum;
|
|
13
13
|
|
|
14
|
-
util.codegen
|
|
15
|
-
util.fetch
|
|
16
|
-
util.path
|
|
14
|
+
util.codegen = require("@protobufjs/codegen");
|
|
15
|
+
util.fetch = require("@protobufjs/fetch");
|
|
16
|
+
util.path = require("@protobufjs/path");
|
|
17
17
|
util.patterns = require("./util/patterns");
|
|
18
18
|
|
|
19
19
|
var reservedRe = util.patterns.reservedRe;
|
|
@@ -24,6 +24,20 @@ var reservedRe = util.patterns.reservedRe;
|
|
|
24
24
|
*/
|
|
25
25
|
util.fs = require("./util/fs");
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Checks a recursion depth.
|
|
29
|
+
* @param {number|undefined} depth Depth of recursion
|
|
30
|
+
* @returns {number} Depth of recursion
|
|
31
|
+
* @throws {Error} If depth exceeds util.recursionLimit
|
|
32
|
+
*/
|
|
33
|
+
util.checkDepth = function checkDepth(depth) {
|
|
34
|
+
if (depth === undefined)
|
|
35
|
+
depth = 0;
|
|
36
|
+
if (depth > util.recursionLimit)
|
|
37
|
+
throw Error("max depth exceeded");
|
|
38
|
+
return depth;
|
|
39
|
+
};
|
|
40
|
+
|
|
27
41
|
/**
|
|
28
42
|
* Converts an object's values to an array.
|
|
29
43
|
* @param {Object.<string,*>} object Object to convert
|
|
@@ -117,7 +131,6 @@ util.compareFieldsById = function compareFieldsById(a, b) {
|
|
|
117
131
|
* @returns {Type} Reflected type
|
|
118
132
|
* @template T extends Message<T>
|
|
119
133
|
* @property {Root} root Decorators root
|
|
120
|
-
* @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
|
|
121
134
|
*/
|
|
122
135
|
util.decorateType = function decorateType(ctor, typeName) {
|
|
123
136
|
|
|
@@ -149,7 +162,6 @@ var decorateEnumIndex = 0;
|
|
|
149
162
|
* Decorator helper for enums (TypeScript).
|
|
150
163
|
* @param {Object} object Enum object
|
|
151
164
|
* @returns {Enum} Reflected enum
|
|
152
|
-
* @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
|
|
153
165
|
*/
|
|
154
166
|
util.decorateEnum = function decorateEnum(object) {
|
|
155
167
|
|
|
@@ -210,7 +222,6 @@ util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
|
210
222
|
* @name util.decorateRoot
|
|
211
223
|
* @type {Root}
|
|
212
224
|
* @readonly
|
|
213
|
-
* @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
|
|
214
225
|
*/
|
|
215
226
|
Object.defineProperty(util, "decorateRoot", {
|
|
216
227
|
get: function() {
|
|
@@ -32,7 +32,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
32
32
|
} else {
|
|
33
33
|
gen
|
|
34
34
|
("{")
|
|
35
|
-
("var e=types[%i].verify(%s,
|
|
35
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
36
36
|
("if(e)")
|
|
37
37
|
("return%j+e", field.name + ".")
|
|
38
38
|
("}");
|
|
@@ -122,12 +122,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
122
122
|
function verifier(mtype) {
|
|
123
123
|
/* eslint-disable no-unexpected-multiline */
|
|
124
124
|
|
|
125
|
-
var gen = util.codegen(["m", "
|
|
125
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
126
126
|
("if(typeof m!==\"object\"||m===null)")
|
|
127
127
|
("return%j", "object expected")
|
|
128
|
-
("if(
|
|
129
|
-
("if(
|
|
130
|
-
("return%j", "
|
|
128
|
+
("if(n===undefined)n=0")
|
|
129
|
+
("if(n>util.recursionLimit)")
|
|
130
|
+
("return%j", "maximum nesting depth exceeded");
|
|
131
131
|
var oneofs = mtype.oneofsArray,
|
|
132
132
|
seenFirstField = {};
|
|
133
133
|
if (oneofs.length) gen
|
|
@@ -138,7 +138,7 @@ function verifier(mtype) {
|
|
|
138
138
|
ref = "m" + util.safeProp(field.name);
|
|
139
139
|
|
|
140
140
|
if (field.optional) gen
|
|
141
|
-
("if(%s!=null&&
|
|
141
|
+
("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name); // !== undefined && !== null
|
|
142
142
|
|
|
143
143
|
// map fields
|
|
144
144
|
if (field.map) { gen
|
|
@@ -75,6 +75,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
75
75
|
var googleApi = "type.googleapis.com/";
|
|
76
76
|
var prefix = "";
|
|
77
77
|
var name = "";
|
|
78
|
+
|
|
78
79
|
// decode value if requested and unmapped
|
|
79
80
|
if (options && options.json && message.type_url && message.value) {
|
|
80
81
|
// Only use fully qualified type name after the last '/'
|
|
@@ -173,11 +173,6 @@ function writeByte(val, buf, pos) {
|
|
|
173
173
|
buf[pos] = val & 255;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
function writeStringAscii(val, buf, pos) {
|
|
177
|
-
for (var i = 0; i < val.length;)
|
|
178
|
-
buf[pos++] = val.charCodeAt(i++);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
176
|
function writeVarint32(val, buf, pos) {
|
|
182
177
|
while (val > 127) {
|
|
183
178
|
buf[pos++] = val & 127 | 128;
|
|
@@ -230,7 +225,7 @@ Writer.prototype.uint32 = function write_uint32(value) {
|
|
|
230
225
|
* @returns {Writer} `this`
|
|
231
226
|
*/
|
|
232
227
|
Writer.prototype.int32 = function write_int32(value) {
|
|
233
|
-
return value < 0
|
|
228
|
+
return (value |= 0) < 0
|
|
234
229
|
? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec
|
|
235
230
|
: this.uint32(value);
|
|
236
231
|
};
|
|
@@ -245,16 +240,18 @@ Writer.prototype.sint32 = function write_sint32(value) {
|
|
|
245
240
|
};
|
|
246
241
|
|
|
247
242
|
function writeVarint64(val, buf, pos) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
243
|
+
var lo = val.lo,
|
|
244
|
+
hi = val.hi;
|
|
245
|
+
while (hi) {
|
|
246
|
+
buf[pos++] = lo & 127 | 128;
|
|
247
|
+
lo = (lo >>> 7 | hi << 25) >>> 0;
|
|
248
|
+
hi >>>= 7;
|
|
252
249
|
}
|
|
253
|
-
while (
|
|
254
|
-
buf[pos++] =
|
|
255
|
-
|
|
250
|
+
while (lo > 127) {
|
|
251
|
+
buf[pos++] = lo & 127 | 128;
|
|
252
|
+
lo = lo >>> 7;
|
|
256
253
|
}
|
|
257
|
-
buf[pos++] =
|
|
254
|
+
buf[pos++] = lo;
|
|
258
255
|
}
|
|
259
256
|
|
|
260
257
|
/**
|
|
@@ -388,16 +385,6 @@ Writer.prototype.bytes = function write_bytes(value) {
|
|
|
388
385
|
return this.uint32(len)._push(writeBytes, len, value);
|
|
389
386
|
};
|
|
390
387
|
|
|
391
|
-
/**
|
|
392
|
-
* Writes raw bytes without a tag or length prefix.
|
|
393
|
-
* @param {Uint8Array} value Raw bytes
|
|
394
|
-
* @returns {Writer} `this`
|
|
395
|
-
*/
|
|
396
|
-
Writer.prototype.raw = function write_raw(value) {
|
|
397
|
-
var len = value.length >>> 0;
|
|
398
|
-
return len ? this._push(writeBytes, len, value) : this;
|
|
399
|
-
};
|
|
400
|
-
|
|
401
388
|
/**
|
|
402
389
|
* Writes a string.
|
|
403
390
|
* @param {string} value Value to write
|
|
@@ -406,7 +393,7 @@ Writer.prototype.raw = function write_raw(value) {
|
|
|
406
393
|
Writer.prototype.string = function write_string(value) {
|
|
407
394
|
var len = utf8.length(value);
|
|
408
395
|
return len
|
|
409
|
-
? this.uint32(len)._push(
|
|
396
|
+
? this.uint32(len)._push(utf8.write, len, value)
|
|
410
397
|
: this._push(writeByte, 1, 0);
|
|
411
398
|
};
|
|
412
399
|
|
|
@@ -461,28 +448,15 @@ Writer.prototype.ldelim = function ldelim() {
|
|
|
461
448
|
* @returns {Uint8Array} Finished buffer
|
|
462
449
|
*/
|
|
463
450
|
Writer.prototype.finish = function finish() {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Finishes the write operation, writing into the provided buffer.
|
|
469
|
-
* The caller must ensure that `buf` has enough space starting at `offset`
|
|
470
|
-
* to hold {@link Writer#len} bytes.
|
|
471
|
-
* @param {T} buf Target buffer
|
|
472
|
-
* @param {number} [offset=0] Offset to start writing at
|
|
473
|
-
* @returns {T} The provided buffer
|
|
474
|
-
* @template T extends Uint8Array
|
|
475
|
-
*/
|
|
476
|
-
Writer.prototype.finishInto = function finishInto(buf, offset) {
|
|
477
|
-
if (offset === undefined)
|
|
478
|
-
offset = 0;
|
|
479
|
-
var head = this.head.next,
|
|
480
|
-
pos = offset;
|
|
451
|
+
var head = this.head.next, // skip noop
|
|
452
|
+
buf = this.constructor.alloc(this.len),
|
|
453
|
+
pos = 0;
|
|
481
454
|
while (head) {
|
|
482
455
|
head.fn(head.val, buf, pos);
|
|
483
456
|
pos += head.len;
|
|
484
457
|
head = head.next;
|
|
485
458
|
}
|
|
459
|
+
// this.head = this.tail = null;
|
|
486
460
|
return buf;
|
|
487
461
|
};
|
|
488
462
|
|
|
@@ -54,23 +54,6 @@ BufferWriter.prototype.bytes = function write_bytes_buffer(value) {
|
|
|
54
54
|
return this;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* Writes raw bytes without a tag or length prefix.
|
|
59
|
-
* @name BufferWriter#raw
|
|
60
|
-
* @function
|
|
61
|
-
* @param {Uint8Array} value Raw bytes
|
|
62
|
-
* @returns {BufferWriter} `this`
|
|
63
|
-
*/
|
|
64
|
-
BufferWriter.prototype.raw = function write_raw_buffer(value) {
|
|
65
|
-
var len = value.length >>> 0;
|
|
66
|
-
return len ? this._push(BufferWriter.writeBytesBuffer, len, value) : this;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
function writeStringBufferAscii(val, buf, pos) {
|
|
70
|
-
for (var i = 0; i < val.length;)
|
|
71
|
-
buf[pos++] = val.charCodeAt(i++);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
57
|
function writeStringBuffer(val, buf, pos) {
|
|
75
58
|
if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)
|
|
76
59
|
util.utf8.write(val, buf, pos);
|
|
@@ -87,7 +70,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
87
70
|
var len = util.Buffer.byteLength(value);
|
|
88
71
|
this.uint32(len);
|
|
89
72
|
if (len)
|
|
90
|
-
this._push(
|
|
73
|
+
this._push(writeStringBuffer, len, value);
|
|
91
74
|
return this;
|
|
92
75
|
};
|
|
93
76
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Matteo Collina and Undici contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# undici-types
|
|
2
|
+
|
|
3
|
+
This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version.
|
|
4
|
+
|
|
5
|
+
- [GitHub nodejs/undici](https://github.com/nodejs/undici)
|
|
6
|
+
- [Undici Documentation](https://undici.nodejs.org/#/)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { URL } from 'node:url'
|
|
2
|
+
import Pool from './pool'
|
|
3
|
+
import Dispatcher from './dispatcher'
|
|
4
|
+
import TClientStats from './client-stats'
|
|
5
|
+
import TPoolStats from './pool-stats'
|
|
6
|
+
|
|
7
|
+
export default Agent
|
|
8
|
+
|
|
9
|
+
declare class Agent extends Dispatcher {
|
|
10
|
+
constructor (opts?: Agent.Options)
|
|
11
|
+
/** `true` after `dispatcher.close()` has been called. */
|
|
12
|
+
closed: boolean
|
|
13
|
+
/** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
|
|
14
|
+
destroyed: boolean
|
|
15
|
+
/** Dispatches a request. */
|
|
16
|
+
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
|
17
|
+
/** Aggregate stats for a Agent by origin. */
|
|
18
|
+
readonly stats: Record<string, TClientStats | TPoolStats>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare namespace Agent {
|
|
22
|
+
export interface Options extends Pool.Options {
|
|
23
|
+
/** Default: `(origin, opts) => new Pool(origin, opts)`. */
|
|
24
|
+
factory?(origin: string | URL, opts: Object): Dispatcher;
|
|
25
|
+
|
|
26
|
+
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
|
|
27
|
+
maxOrigins?: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface DispatchOptions extends Dispatcher.DispatchOptions {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { URL, UrlObject } from 'node:url'
|
|
2
|
+
import { Duplex } from 'node:stream'
|
|
3
|
+
import Dispatcher from './dispatcher'
|
|
4
|
+
|
|
5
|
+
/** Performs an HTTP request. */
|
|
6
|
+
declare function request<TOpaque = null> (
|
|
7
|
+
url: string | URL | UrlObject,
|
|
8
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
9
|
+
): Promise<Dispatcher.ResponseData<TOpaque>>
|
|
10
|
+
|
|
11
|
+
/** A faster version of `request`. */
|
|
12
|
+
declare function stream<TOpaque = null> (
|
|
13
|
+
url: string | URL | UrlObject,
|
|
14
|
+
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path'>,
|
|
15
|
+
factory: Dispatcher.StreamFactory<TOpaque>
|
|
16
|
+
): Promise<Dispatcher.StreamData<TOpaque>>
|
|
17
|
+
|
|
18
|
+
/** For easy use with `stream.pipeline`. */
|
|
19
|
+
declare function pipeline<TOpaque = null> (
|
|
20
|
+
url: string | URL | UrlObject,
|
|
21
|
+
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions<TOpaque>, 'origin' | 'path'>,
|
|
22
|
+
handler: Dispatcher.PipelineHandler<TOpaque>
|
|
23
|
+
): Duplex
|
|
24
|
+
|
|
25
|
+
/** Starts two-way communications with the requested resource. */
|
|
26
|
+
declare function connect<TOpaque = null> (
|
|
27
|
+
url: string | URL | UrlObject,
|
|
28
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin' | 'path'>
|
|
29
|
+
): Promise<Dispatcher.ConnectData<TOpaque>>
|
|
30
|
+
|
|
31
|
+
/** Upgrade to a different protocol. */
|
|
32
|
+
declare function upgrade (
|
|
33
|
+
url: string | URL | UrlObject,
|
|
34
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
|
|
35
|
+
): Promise<Dispatcher.UpgradeData>
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
request,
|
|
39
|
+
stream,
|
|
40
|
+
pipeline,
|
|
41
|
+
connect,
|
|
42
|
+
upgrade
|
|
43
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Pool from './pool'
|
|
2
|
+
import Dispatcher from './dispatcher'
|
|
3
|
+
import { URL } from 'node:url'
|
|
4
|
+
|
|
5
|
+
export default BalancedPool
|
|
6
|
+
|
|
7
|
+
type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
|
8
|
+
|
|
9
|
+
declare class BalancedPool extends Dispatcher {
|
|
10
|
+
constructor (url: string | string[] | URL | URL[], options?: Pool.Options)
|
|
11
|
+
|
|
12
|
+
addUpstream (upstream: string | URL): BalancedPool
|
|
13
|
+
removeUpstream (upstream: string | URL): BalancedPool
|
|
14
|
+
getUpstream (upstream: string | URL): Pool | undefined
|
|
15
|
+
upstreams: Array<string>
|
|
16
|
+
|
|
17
|
+
/** `true` after `pool.close()` has been called. */
|
|
18
|
+
closed: boolean
|
|
19
|
+
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
|
|
20
|
+
destroyed: boolean
|
|
21
|
+
|
|
22
|
+
// Override dispatcher APIs.
|
|
23
|
+
override connect (
|
|
24
|
+
options: BalancedPoolConnectOptions
|
|
25
|
+
): Promise<Dispatcher.ConnectData>
|
|
26
|
+
override connect (
|
|
27
|
+
options: BalancedPoolConnectOptions,
|
|
28
|
+
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
|
|
29
|
+
): void
|
|
30
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { Readable, Writable } from 'node:stream'
|
|
2
|
+
|
|
3
|
+
export default CacheHandler
|
|
4
|
+
|
|
5
|
+
declare namespace CacheHandler {
|
|
6
|
+
export type CacheMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
|
|
7
|
+
|
|
8
|
+
export interface CacheHandlerOptions {
|
|
9
|
+
store: CacheStore
|
|
10
|
+
|
|
11
|
+
cacheByDefault?: number
|
|
12
|
+
|
|
13
|
+
type?: CacheOptions['type']
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CacheOptions {
|
|
17
|
+
store?: CacheStore
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The methods to cache
|
|
21
|
+
* Note we can only cache safe methods. Unsafe methods (i.e. PUT, POST)
|
|
22
|
+
* invalidate the cache for a origin.
|
|
23
|
+
* @see https://www.rfc-editor.org/rfc/rfc9111.html#name-invalidating-stored-respons
|
|
24
|
+
* @see https://www.rfc-editor.org/rfc/rfc9110#section-9.2.1
|
|
25
|
+
*/
|
|
26
|
+
methods?: CacheMethods[]
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* RFC9111 allows for caching responses that we aren't explicitly told to
|
|
30
|
+
* cache or to not cache.
|
|
31
|
+
* @see https://www.rfc-editor.org/rfc/rfc9111.html#section-3-5
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
cacheByDefault?: number
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* TODO docs
|
|
38
|
+
* @default 'shared'
|
|
39
|
+
*/
|
|
40
|
+
type?: 'shared' | 'private'
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Array of origins to cache. Only requests to these origins will be cached.
|
|
44
|
+
* Supports strings (case insensitive) and RegExp patterns.
|
|
45
|
+
* @default undefined (cache all origins)
|
|
46
|
+
*/
|
|
47
|
+
origins?: (string | RegExp)[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CacheControlDirectives {
|
|
51
|
+
'max-stale'?: number;
|
|
52
|
+
'min-fresh'?: number;
|
|
53
|
+
'max-age'?: number;
|
|
54
|
+
's-maxage'?: number;
|
|
55
|
+
'stale-while-revalidate'?: number;
|
|
56
|
+
'stale-if-error'?: number;
|
|
57
|
+
public?: true;
|
|
58
|
+
private?: true | string[];
|
|
59
|
+
'no-store'?: true;
|
|
60
|
+
'no-cache'?: true | string[];
|
|
61
|
+
'must-revalidate'?: true;
|
|
62
|
+
'proxy-revalidate'?: true;
|
|
63
|
+
immutable?: true;
|
|
64
|
+
'no-transform'?: true;
|
|
65
|
+
'must-understand'?: true;
|
|
66
|
+
'only-if-cached'?: true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CacheKey {
|
|
70
|
+
origin: string
|
|
71
|
+
method: string
|
|
72
|
+
path: string
|
|
73
|
+
headers?: Record<string, string | string[]>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface CacheValue {
|
|
77
|
+
statusCode: number
|
|
78
|
+
statusMessage: string
|
|
79
|
+
headers: Record<string, string | string[]>
|
|
80
|
+
vary?: Record<string, string | string[] | null>
|
|
81
|
+
etag?: string
|
|
82
|
+
cacheControlDirectives?: CacheControlDirectives
|
|
83
|
+
cachedAt: number
|
|
84
|
+
staleAt: number
|
|
85
|
+
deleteAt: number
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface DeleteByUri {
|
|
89
|
+
origin: string
|
|
90
|
+
method: string
|
|
91
|
+
path: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type GetResult = {
|
|
95
|
+
statusCode: number
|
|
96
|
+
statusMessage: string
|
|
97
|
+
headers: Record<string, string | string[]>
|
|
98
|
+
vary?: Record<string, string | string[] | null>
|
|
99
|
+
etag?: string
|
|
100
|
+
body?: Readable | Iterable<Buffer> | AsyncIterable<Buffer> | Buffer | Iterable<string> | AsyncIterable<string> | string
|
|
101
|
+
cacheControlDirectives: CacheControlDirectives,
|
|
102
|
+
cachedAt: number
|
|
103
|
+
staleAt: number
|
|
104
|
+
deleteAt: number
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Underlying storage provider for cached responses
|
|
109
|
+
*/
|
|
110
|
+
export interface CacheStore {
|
|
111
|
+
get(key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
|
|
112
|
+
|
|
113
|
+
createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined
|
|
114
|
+
|
|
115
|
+
delete(key: CacheKey): void | Promise<void>
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface MemoryCacheStoreOpts {
|
|
119
|
+
/**
|
|
120
|
+
* @default Infinity
|
|
121
|
+
*/
|
|
122
|
+
maxCount?: number
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @default Infinity
|
|
126
|
+
*/
|
|
127
|
+
maxSize?: number
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @default Infinity
|
|
131
|
+
*/
|
|
132
|
+
maxEntrySize?: number
|
|
133
|
+
|
|
134
|
+
errorCallback?: (err: Error) => void
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class MemoryCacheStore implements CacheStore {
|
|
138
|
+
constructor (opts?: MemoryCacheStoreOpts)
|
|
139
|
+
|
|
140
|
+
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
|
|
141
|
+
|
|
142
|
+
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
|
|
143
|
+
|
|
144
|
+
delete (key: CacheKey): void | Promise<void>
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface SqliteCacheStoreOpts {
|
|
148
|
+
/**
|
|
149
|
+
* Location of the database
|
|
150
|
+
* @default ':memory:'
|
|
151
|
+
*/
|
|
152
|
+
location?: string
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @default Infinity
|
|
156
|
+
*/
|
|
157
|
+
maxCount?: number
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @default Infinity
|
|
161
|
+
*/
|
|
162
|
+
maxEntrySize?: number
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export class SqliteCacheStore implements CacheStore {
|
|
166
|
+
constructor (opts?: SqliteCacheStoreOpts)
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Closes the connection to the database
|
|
170
|
+
*/
|
|
171
|
+
close (): void
|
|
172
|
+
|
|
173
|
+
get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
|
|
174
|
+
|
|
175
|
+
createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
|
|
176
|
+
|
|
177
|
+
delete (key: CacheKey): void | Promise<void>
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { RequestInfo, Response, Request } from './fetch'
|
|
2
|
+
|
|
3
|
+
export interface CacheStorage {
|
|
4
|
+
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>,
|
|
5
|
+
has (cacheName: string): Promise<boolean>,
|
|
6
|
+
open (cacheName: string): Promise<Cache>,
|
|
7
|
+
delete (cacheName: string): Promise<boolean>,
|
|
8
|
+
keys (): Promise<string[]>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const CacheStorage: {
|
|
12
|
+
prototype: CacheStorage
|
|
13
|
+
new(): CacheStorage
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Cache {
|
|
17
|
+
match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>,
|
|
18
|
+
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response[]>,
|
|
19
|
+
add (request: RequestInfo): Promise<undefined>,
|
|
20
|
+
addAll (requests: RequestInfo[]): Promise<undefined>,
|
|
21
|
+
put (request: RequestInfo, response: Response): Promise<undefined>,
|
|
22
|
+
delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
|
|
23
|
+
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request[]>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CacheQueryOptions {
|
|
27
|
+
ignoreSearch?: boolean,
|
|
28
|
+
ignoreMethod?: boolean,
|
|
29
|
+
ignoreVary?: boolean
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
33
|
+
cacheName?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare const caches: CacheStorage
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Client from './client'
|
|
2
|
+
|
|
3
|
+
export default ClientStats
|
|
4
|
+
|
|
5
|
+
declare class ClientStats {
|
|
6
|
+
constructor (pool: Client)
|
|
7
|
+
/** If socket has open connection. */
|
|
8
|
+
connected: boolean
|
|
9
|
+
/** Number of open socket connections in this client that do not have an active request. */
|
|
10
|
+
pending: number
|
|
11
|
+
/** Number of currently active requests of this client. */
|
|
12
|
+
running: number
|
|
13
|
+
/** Number of active, pending, or queued requests of this client. */
|
|
14
|
+
size: number
|
|
15
|
+
}
|