omegon 0.8.3 → 0.9.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 (140) hide show
  1. package/extensions/cleave/dispatcher.ts +213 -20
  2. package/extensions/cleave/index.ts +24 -8
  3. package/extensions/cleave/rpc-child.ts +269 -0
  4. package/extensions/cleave/types.ts +52 -0
  5. package/extensions/openspec/spec.ts +3 -0
  6. package/node_modules/@types/node/README.md +3 -3
  7. package/node_modules/@types/node/assert/strict.d.ts +11 -5
  8. package/node_modules/@types/node/assert.d.ts +173 -50
  9. package/node_modules/@types/node/async_hooks.d.ts +8 -28
  10. package/node_modules/@types/node/buffer.buffer.d.ts +7 -1
  11. package/node_modules/@types/node/buffer.d.ts +168 -44
  12. package/node_modules/@types/node/child_process.d.ts +70 -27
  13. package/node_modules/@types/node/cluster.d.ts +332 -240
  14. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  15. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  16. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  17. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  18. package/node_modules/@types/node/console.d.ts +350 -49
  19. package/node_modules/@types/node/constants.d.ts +4 -3
  20. package/node_modules/@types/node/crypto.d.ts +1110 -630
  21. package/node_modules/@types/node/dgram.d.ts +51 -15
  22. package/node_modules/@types/node/diagnostics_channel.d.ts +6 -4
  23. package/node_modules/@types/node/dns/promises.d.ts +4 -4
  24. package/node_modules/@types/node/dns.d.ts +133 -132
  25. package/node_modules/@types/node/domain.d.ts +17 -13
  26. package/node_modules/@types/node/events.d.ts +663 -734
  27. package/node_modules/@types/node/fs/promises.d.ts +9 -43
  28. package/node_modules/@types/node/fs.d.ts +411 -628
  29. package/node_modules/@types/node/globals.d.ts +30 -8
  30. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  31. package/node_modules/@types/node/http.d.ts +265 -364
  32. package/node_modules/@types/node/http2.d.ts +715 -551
  33. package/node_modules/@types/node/https.d.ts +239 -65
  34. package/node_modules/@types/node/index.d.ts +6 -24
  35. package/node_modules/@types/node/inspector.d.ts +53 -69
  36. package/node_modules/@types/node/inspector.generated.d.ts +410 -759
  37. package/node_modules/@types/node/module.d.ts +186 -52
  38. package/node_modules/@types/node/net.d.ts +194 -70
  39. package/node_modules/@types/node/os.d.ts +11 -12
  40. package/node_modules/@types/node/package.json +3 -13
  41. package/node_modules/@types/node/path.d.ts +133 -120
  42. package/node_modules/@types/node/perf_hooks.d.ts +643 -318
  43. package/node_modules/@types/node/process.d.ts +132 -223
  44. package/node_modules/@types/node/punycode.d.ts +5 -5
  45. package/node_modules/@types/node/querystring.d.ts +4 -4
  46. package/node_modules/@types/node/readline/promises.d.ts +3 -3
  47. package/node_modules/@types/node/readline.d.ts +120 -68
  48. package/node_modules/@types/node/repl.d.ts +100 -87
  49. package/node_modules/@types/node/sea.d.ts +1 -10
  50. package/node_modules/@types/node/sqlite.d.ts +19 -363
  51. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  52. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  53. package/node_modules/@types/node/stream/web.d.ts +502 -176
  54. package/node_modules/@types/node/stream.d.ts +475 -581
  55. package/node_modules/@types/node/string_decoder.d.ts +4 -4
  56. package/node_modules/@types/node/test.d.ts +196 -308
  57. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  58. package/node_modules/@types/node/timers.d.ts +132 -4
  59. package/node_modules/@types/node/tls.d.ts +226 -110
  60. package/node_modules/@types/node/trace_events.d.ts +9 -9
  61. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -1
  62. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  63. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  64. package/node_modules/@types/node/tty.d.ts +16 -58
  65. package/node_modules/@types/node/url.d.ts +573 -130
  66. package/node_modules/@types/node/util.d.ts +1100 -181
  67. package/node_modules/@types/node/v8.d.ts +8 -76
  68. package/node_modules/@types/node/vm.d.ts +72 -280
  69. package/node_modules/@types/node/wasi.d.ts +4 -25
  70. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  71. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  72. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  73. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  74. package/node_modules/@types/node/worker_threads.d.ts +335 -268
  75. package/node_modules/@types/node/zlib.d.ts +74 -9
  76. package/node_modules/undici-types/agent.d.ts +12 -13
  77. package/node_modules/undici-types/api.d.ts +26 -26
  78. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  79. package/node_modules/undici-types/client.d.ts +19 -19
  80. package/node_modules/undici-types/connector.d.ts +2 -2
  81. package/node_modules/undici-types/cookies.d.ts +0 -2
  82. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  83. package/node_modules/undici-types/dispatcher.d.ts +103 -123
  84. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  85. package/node_modules/undici-types/errors.d.ts +54 -66
  86. package/node_modules/undici-types/eventsource.d.ts +4 -9
  87. package/node_modules/undici-types/fetch.d.ts +20 -22
  88. package/node_modules/undici-types/file.d.ts +39 -0
  89. package/node_modules/undici-types/filereader.d.ts +54 -0
  90. package/node_modules/undici-types/formdata.d.ts +7 -7
  91. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  92. package/node_modules/undici-types/global-origin.d.ts +5 -5
  93. package/node_modules/undici-types/handlers.d.ts +8 -8
  94. package/node_modules/undici-types/header.d.ts +1 -157
  95. package/node_modules/undici-types/index.d.ts +47 -64
  96. package/node_modules/undici-types/interceptors.d.ts +8 -64
  97. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  98. package/node_modules/undici-types/mock-client.d.ts +4 -6
  99. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  100. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  101. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  102. package/node_modules/undici-types/package.json +1 -1
  103. package/node_modules/undici-types/patch.d.ts +4 -0
  104. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  105. package/node_modules/undici-types/pool.d.ts +13 -15
  106. package/node_modules/undici-types/proxy-agent.d.ts +4 -5
  107. package/node_modules/undici-types/readable.d.ts +16 -19
  108. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  109. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  110. package/node_modules/undici-types/util.d.ts +3 -3
  111. package/node_modules/undici-types/webidl.d.ts +29 -142
  112. package/node_modules/undici-types/websocket.d.ts +10 -46
  113. package/package.json +2 -1
  114. package/skills/cleave/SKILL.md +62 -2
  115. package/node_modules/@types/node/inspector/promises.d.ts +0 -41
  116. package/node_modules/@types/node/path/posix.d.ts +0 -8
  117. package/node_modules/@types/node/path/win32.d.ts +0 -8
  118. package/node_modules/@types/node/quic.d.ts +0 -910
  119. package/node_modules/@types/node/test/reporters.d.ts +0 -96
  120. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  121. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  122. package/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  123. package/node_modules/@types/node/util/types.d.ts +0 -558
  124. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  125. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  126. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  127. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  128. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  129. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  130. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  131. package/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  132. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  133. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  134. package/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  135. package/node_modules/undici-types/client-stats.d.ts +0 -15
  136. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  137. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  138. package/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  139. package/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  140. package/node_modules/undici-types/utility.d.ts +0 -7
@@ -1,45 +0,0 @@
1
- export {};
2
-
3
- import * as perf_hooks from "node:perf_hooks";
4
-
5
- type _Performance = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.Performance;
6
- type _PerformanceEntry = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceEntry;
7
- type _PerformanceMark = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMark;
8
- type _PerformanceMeasure = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceMeasure;
9
- type _PerformanceObserver = typeof globalThis extends { onmessage: any } ? {} : perf_hooks.PerformanceObserver;
10
- type _PerformanceObserverEntryList = typeof globalThis extends { onmessage: any } ? {}
11
- : perf_hooks.PerformanceObserverEntryList;
12
- type _PerformanceResourceTiming = typeof globalThis extends { onmessage: any } ? {}
13
- : perf_hooks.PerformanceResourceTiming;
14
-
15
- declare global {
16
- interface Performance extends _Performance {}
17
- var Performance: typeof globalThis extends { onmessage: any; Performance: infer T } ? T
18
- : typeof perf_hooks.Performance;
19
-
20
- interface PerformanceEntry extends _PerformanceEntry {}
21
- var PerformanceEntry: typeof globalThis extends { onmessage: any; PerformanceEntry: infer T } ? T
22
- : typeof perf_hooks.PerformanceEntry;
23
-
24
- interface PerformanceMark extends _PerformanceMark {}
25
- var PerformanceMark: typeof globalThis extends { onmessage: any; PerformanceMark: infer T } ? T
26
- : typeof perf_hooks.PerformanceMark;
27
-
28
- interface PerformanceMeasure extends _PerformanceMeasure {}
29
- var PerformanceMeasure: typeof globalThis extends { onmessage: any; PerformanceMeasure: infer T } ? T
30
- : typeof perf_hooks.PerformanceMeasure;
31
-
32
- interface PerformanceObserver extends _PerformanceObserver {}
33
- var PerformanceObserver: typeof globalThis extends { onmessage: any; PerformanceObserver: infer T } ? T
34
- : typeof perf_hooks.PerformanceObserver;
35
-
36
- interface PerformanceObserverEntryList extends _PerformanceObserverEntryList {}
37
- var PerformanceObserverEntryList: typeof globalThis extends
38
- { onmessage: any; PerformanceObserverEntryList: infer T } ? T : typeof perf_hooks.PerformanceObserverEntryList;
39
-
40
- interface PerformanceResourceTiming extends _PerformanceResourceTiming {}
41
- var PerformanceResourceTiming: typeof globalThis extends { onmessage: any; PerformanceResourceTiming: infer T } ? T
42
- : typeof perf_hooks.PerformanceResourceTiming;
43
-
44
- var performance: typeof globalThis extends { onmessage: any; performance: infer T } ? T : perf_hooks.Performance;
45
- }
@@ -1,115 +0,0 @@
1
- export {};
2
-
3
- import * as webstreams from "stream/web";
4
-
5
- type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
6
- : webstreams.ByteLengthQueuingStrategy;
7
- type _CompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.CompressionStream;
8
- type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {} : webstreams.CountQueuingStrategy;
9
- type _DecompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.DecompressionStream;
10
- type _QueuingStrategy<T = any> = typeof globalThis extends { onmessage: any } ? {} : webstreams.QueuingStrategy<T>;
11
- type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
12
- : webstreams.ReadableByteStreamController;
13
- type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {} : webstreams.ReadableStream<R>;
14
- type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
15
- : webstreams.ReadableStreamBYOBReader;
16
- type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
17
- : webstreams.ReadableStreamBYOBRequest;
18
- type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
19
- : webstreams.ReadableStreamDefaultController<R>;
20
- type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
21
- : webstreams.ReadableStreamDefaultReader<R>;
22
- type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextDecoderStream;
23
- type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.TextEncoderStream;
24
- type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
25
- : webstreams.TransformStream<I, O>;
26
- type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
27
- : webstreams.TransformStreamDefaultController<O>;
28
- type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {} : webstreams.WritableStream<W>;
29
- type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
30
- : webstreams.WritableStreamDefaultController;
31
- type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
32
- : webstreams.WritableStreamDefaultWriter<W>;
33
-
34
- declare global {
35
- interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
36
- var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T } ? T
37
- : typeof webstreams.ByteLengthQueuingStrategy;
38
-
39
- interface CompressionStream extends _CompressionStream {}
40
- var CompressionStream: typeof globalThis extends {
41
- onmessage: any;
42
- CompressionStream: infer T;
43
- } ? T
44
- : typeof webstreams.CompressionStream;
45
-
46
- interface CountQueuingStrategy extends _CountQueuingStrategy {}
47
- var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
48
- : typeof webstreams.CountQueuingStrategy;
49
-
50
- interface DecompressionStream extends _DecompressionStream {}
51
- var DecompressionStream: typeof globalThis extends {
52
- onmessage: any;
53
- DecompressionStream: infer T;
54
- } ? T
55
- : typeof webstreams.DecompressionStream;
56
-
57
- interface QueuingStrategy<T = any> extends _QueuingStrategy<T> {}
58
-
59
- interface ReadableByteStreamController extends _ReadableByteStreamController {}
60
- var ReadableByteStreamController: typeof globalThis extends
61
- { onmessage: any; ReadableByteStreamController: infer T } ? T : typeof webstreams.ReadableByteStreamController;
62
-
63
- interface ReadableStream<R = any> extends _ReadableStream<R> {}
64
- var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
65
- : typeof webstreams.ReadableStream;
66
-
67
- interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
68
- var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T } ? T
69
- : typeof webstreams.ReadableStreamBYOBReader;
70
-
71
- interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
72
- var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T } ? T
73
- : typeof webstreams.ReadableStreamBYOBRequest;
74
-
75
- interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
76
- var ReadableStreamDefaultController: typeof globalThis extends
77
- { onmessage: any; ReadableStreamDefaultController: infer T } ? T
78
- : typeof webstreams.ReadableStreamDefaultController;
79
-
80
- interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
81
- var ReadableStreamDefaultReader: typeof globalThis extends { onmessage: any; ReadableStreamDefaultReader: infer T }
82
- ? T
83
- : typeof webstreams.ReadableStreamDefaultReader;
84
-
85
- interface TextDecoderStream extends _TextDecoderStream {}
86
- var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
87
- : typeof webstreams.TextDecoderStream;
88
-
89
- interface TextEncoderStream extends _TextEncoderStream {}
90
- var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
91
- : typeof webstreams.TextEncoderStream;
92
-
93
- interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
94
- var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
95
- : typeof webstreams.TransformStream;
96
-
97
- interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
98
- var TransformStreamDefaultController: typeof globalThis extends
99
- { onmessage: any; TransformStreamDefaultController: infer T } ? T
100
- : typeof webstreams.TransformStreamDefaultController;
101
-
102
- interface WritableStream<W = any> extends _WritableStream<W> {}
103
- var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
104
- : typeof webstreams.WritableStream;
105
-
106
- interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
107
- var WritableStreamDefaultController: typeof globalThis extends
108
- { onmessage: any; WritableStreamDefaultController: infer T } ? T
109
- : typeof webstreams.WritableStreamDefaultController;
110
-
111
- interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
112
- var WritableStreamDefaultWriter: typeof globalThis extends { onmessage: any; WritableStreamDefaultWriter: infer T }
113
- ? T
114
- : typeof webstreams.WritableStreamDefaultWriter;
115
- }
@@ -1,44 +0,0 @@
1
- export {};
2
-
3
- import * as promises from "node:timers/promises";
4
-
5
- // Note: The timer function definitions allow a single void-accepting argument
6
- // to be optional in arguments lists. This allows usage such as
7
- // `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
8
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
9
- type MakeVoidParameterOptional<TArgs extends any[]> = [void] extends TArgs ? Partial<TArgs> : TArgs;
10
-
11
- declare global {
12
- function setImmediate<TArgs extends any[]>(
13
- callback: (...args: TArgs) => void,
14
- ...args: MakeVoidParameterOptional<TArgs>
15
- ): NodeJS.Immediate;
16
- namespace setImmediate {
17
- import __promisify__ = promises.setImmediate;
18
- export { __promisify__ };
19
- }
20
-
21
- function setInterval<TArgs extends any[]>(
22
- callback: (...args: TArgs) => void,
23
- delay?: number,
24
- ...args: MakeVoidParameterOptional<TArgs>
25
- ): NodeJS.Timeout;
26
-
27
- function setTimeout<TArgs extends any[]>(
28
- callback: (...args: TArgs) => void,
29
- delay?: number,
30
- ...args: MakeVoidParameterOptional<TArgs>
31
- ): NodeJS.Timeout;
32
- namespace setTimeout {
33
- import __promisify__ = promises.setTimeout;
34
- export { __promisify__ };
35
- }
36
-
37
- function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
38
-
39
- function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
40
-
41
- function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
42
-
43
- function queueMicrotask(callback: () => void): void;
44
- }
@@ -1,24 +0,0 @@
1
- export {};
2
-
3
- import * as url from "node:url";
4
-
5
- declare global {
6
- interface URL extends url.URL {}
7
- var URL: typeof globalThis extends { onmessage: any; URL: infer T } ? T : typeof url.URL;
8
-
9
- interface URLPattern extends url.URLPattern {}
10
- var URLPattern: typeof globalThis extends {
11
- onmessage: any;
12
- scheduler: any; // Must be a var introduced at the same time as URLPattern.
13
- URLPattern: infer T;
14
- } ? T
15
- : typeof url.URLPattern;
16
-
17
- interface URLPatternInit extends url.URLPatternInit {}
18
-
19
- interface URLPatternResult extends url.URLPatternResult {}
20
-
21
- interface URLSearchParams extends url.URLSearchParams {}
22
- var URLSearchParams: typeof globalThis extends { onmessage: any; URLSearchParams: infer T } ? T
23
- : typeof url.URLSearchParams;
24
- }
@@ -1,173 +0,0 @@
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
-
44
- export interface CacheControlDirectives {
45
- 'max-stale'?: number;
46
- 'min-fresh'?: number;
47
- 'max-age'?: number;
48
- 's-maxage'?: number;
49
- 'stale-while-revalidate'?: number;
50
- 'stale-if-error'?: number;
51
- public?: true;
52
- private?: true | string[];
53
- 'no-store'?: true;
54
- 'no-cache'?: true | string[];
55
- 'must-revalidate'?: true;
56
- 'proxy-revalidate'?: true;
57
- immutable?: true;
58
- 'no-transform'?: true;
59
- 'must-understand'?: true;
60
- 'only-if-cached'?: true;
61
- }
62
-
63
- export interface CacheKey {
64
- origin: string
65
- method: string
66
- path: string
67
- headers?: Record<string, string | string[]>
68
- }
69
-
70
- export interface CacheValue {
71
- statusCode: number
72
- statusMessage: string
73
- headers: Record<string, string | string[]>
74
- vary?: Record<string, string | string[] | null>
75
- etag?: string
76
- cacheControlDirectives?: CacheControlDirectives
77
- cachedAt: number
78
- staleAt: number
79
- deleteAt: number
80
- }
81
-
82
- export interface DeleteByUri {
83
- origin: string
84
- method: string
85
- path: string
86
- }
87
-
88
- type GetResult = {
89
- statusCode: number
90
- statusMessage: string
91
- headers: Record<string, string | string[]>
92
- vary?: Record<string, string | string[] | null>
93
- etag?: string
94
- body?: Readable | Iterable<Buffer> | AsyncIterable<Buffer> | Buffer | Iterable<string> | AsyncIterable<string> | string
95
- cacheControlDirectives: CacheControlDirectives,
96
- cachedAt: number
97
- staleAt: number
98
- deleteAt: number
99
- }
100
-
101
- /**
102
- * Underlying storage provider for cached responses
103
- */
104
- export interface CacheStore {
105
- get(key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
106
-
107
- createWriteStream(key: CacheKey, val: CacheValue): Writable | undefined
108
-
109
- delete(key: CacheKey): void | Promise<void>
110
- }
111
-
112
- export interface MemoryCacheStoreOpts {
113
- /**
114
- * @default Infinity
115
- */
116
- maxCount?: number
117
-
118
- /**
119
- * @default Infinity
120
- */
121
- maxSize?: number
122
-
123
- /**
124
- * @default Infinity
125
- */
126
- maxEntrySize?: number
127
-
128
- errorCallback?: (err: Error) => void
129
- }
130
-
131
- export class MemoryCacheStore implements CacheStore {
132
- constructor (opts?: MemoryCacheStoreOpts)
133
-
134
- get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
135
-
136
- createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
137
-
138
- delete (key: CacheKey): void | Promise<void>
139
- }
140
-
141
- export interface SqliteCacheStoreOpts {
142
- /**
143
- * Location of the database
144
- * @default ':memory:'
145
- */
146
- location?: string
147
-
148
- /**
149
- * @default Infinity
150
- */
151
- maxCount?: number
152
-
153
- /**
154
- * @default Infinity
155
- */
156
- maxEntrySize?: number
157
- }
158
-
159
- export class SqliteCacheStore implements CacheStore {
160
- constructor (opts?: SqliteCacheStoreOpts)
161
-
162
- /**
163
- * Closes the connection to the database
164
- */
165
- close (): void
166
-
167
- get (key: CacheKey): GetResult | Promise<GetResult | undefined> | undefined
168
-
169
- createWriteStream (key: CacheKey, value: CacheValue): Writable | undefined
170
-
171
- delete (key: CacheKey): void | Promise<void>
172
- }
173
- }
@@ -1,15 +0,0 @@
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
- }
@@ -1,73 +0,0 @@
1
- import { URL } from 'node:url'
2
- import Dispatcher from './dispatcher'
3
- import buildConnector from './connector'
4
-
5
- type H2ClientOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
6
-
7
- /**
8
- * A basic H2C client, mapped on top a single TCP connection. Pipelining is disabled by default.
9
- */
10
- export class H2CClient extends Dispatcher {
11
- constructor (url: string | URL, options?: H2CClient.Options)
12
- /** Property to get and set the pipelining factor. */
13
- pipelining: number
14
- /** `true` after `client.close()` has been called. */
15
- closed: boolean
16
- /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
17
- destroyed: boolean
18
-
19
- // Override dispatcher APIs.
20
- override connect (
21
- options: H2ClientOptions
22
- ): Promise<Dispatcher.ConnectData>
23
- override connect (
24
- options: H2ClientOptions,
25
- callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
- ): void
27
- }
28
-
29
- export declare namespace H2CClient {
30
- export interface Options {
31
- /** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
32
- maxHeaderSize?: number;
33
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
34
- headersTimeout?: number;
35
- /** TODO */
36
- connectTimeout?: number;
37
- /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
38
- bodyTimeout?: number;
39
- /** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
40
- keepAliveTimeout?: number;
41
- /** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
42
- keepAliveMaxTimeout?: number;
43
- /** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
44
- keepAliveTimeoutThreshold?: number;
45
- /** TODO */
46
- socketPath?: string;
47
- /** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
48
- pipelining?: number;
49
- /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
50
- strictContentLength?: boolean;
51
- /** TODO */
52
- maxCachedSessions?: number;
53
- /** TODO */
54
- connect?: Omit<Partial<buildConnector.BuildOptions>, 'allowH2'> | buildConnector.connector;
55
- /** TODO */
56
- maxRequestsPerClient?: number;
57
- /** TODO */
58
- localAddress?: string;
59
- /** Max response body size in bytes, -1 is disabled */
60
- maxResponseSize?: number;
61
- /** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
62
- autoSelectFamily?: boolean;
63
- /** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
64
- autoSelectFamilyAttemptTimeout?: number;
65
- /**
66
- * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
67
- * @default 100
68
- */
69
- maxConcurrentStreams?: number
70
- }
71
- }
72
-
73
- export default H2CClient
@@ -1,111 +0,0 @@
1
- import Dispatcher from './dispatcher'
2
-
3
- declare namespace MockCallHistoryLog {
4
- /** request's configuration properties */
5
- export type MockCallHistoryLogProperties = 'protocol' | 'host' | 'port' | 'origin' | 'path' | 'hash' | 'fullUrl' | 'method' | 'searchParams' | 'body' | 'headers'
6
- }
7
-
8
- /** a log reflecting request configuration */
9
- declare class MockCallHistoryLog {
10
- constructor (requestInit: Dispatcher.DispatchOptions)
11
- /** protocol used. ie. 'https:' or 'http:' etc... */
12
- protocol: string
13
- /** request's host. */
14
- host: string
15
- /** request's port. */
16
- port: string
17
- /** request's origin. ie. https://localhost:3000. */
18
- origin: string
19
- /** path. never contains searchParams. */
20
- path: string
21
- /** request's hash. */
22
- hash: string
23
- /** the full url requested. */
24
- fullUrl: string
25
- /** request's method. */
26
- method: string
27
- /** search params. */
28
- searchParams: Record<string, string>
29
- /** request's body */
30
- body: string | null | undefined
31
- /** request's headers */
32
- headers: Record<string, string | string[]> | null | undefined
33
-
34
- /** returns an Map of property / value pair */
35
- toMap (): Map<MockCallHistoryLog.MockCallHistoryLogProperties, string | Record<string, string | string[]> | null | undefined>
36
-
37
- /** returns a string computed with all key value pair */
38
- toString (): string
39
- }
40
-
41
- declare namespace MockCallHistory {
42
- export type FilterCallsOperator = 'AND' | 'OR'
43
-
44
- /** modify the filtering behavior */
45
- export interface FilterCallsOptions {
46
- /** the operator to apply when filtering. 'OR' will adds any MockCallHistoryLog matching any criteria given. 'AND' will adds only MockCallHistoryLog matching every criteria given. (default 'OR') */
47
- operator?: FilterCallsOperator | Lowercase<FilterCallsOperator>
48
- }
49
- /** a function to be executed for filtering MockCallHistoryLog */
50
- export type FilterCallsFunctionCriteria = (log: MockCallHistoryLog) => boolean
51
-
52
- /** parameter to filter MockCallHistoryLog */
53
- export type FilterCallsParameter = string | RegExp | undefined | null
54
-
55
- /** an object to execute multiple filtering at once */
56
- export interface FilterCallsObjectCriteria extends Record<string, FilterCallsParameter> {
57
- /** filter by request protocol. ie https: */
58
- protocol?: FilterCallsParameter;
59
- /** filter by request host. */
60
- host?: FilterCallsParameter;
61
- /** filter by request port. */
62
- port?: FilterCallsParameter;
63
- /** filter by request origin. */
64
- origin?: FilterCallsParameter;
65
- /** filter by request path. */
66
- path?: FilterCallsParameter;
67
- /** filter by request hash. */
68
- hash?: FilterCallsParameter;
69
- /** filter by request fullUrl. */
70
- fullUrl?: FilterCallsParameter;
71
- /** filter by request method. */
72
- method?: FilterCallsParameter;
73
- }
74
- }
75
-
76
- /** a call history to track requests configuration */
77
- declare class MockCallHistory {
78
- constructor (name: string)
79
- /** returns an array of MockCallHistoryLog. */
80
- calls (): Array<MockCallHistoryLog>
81
- /** returns the first MockCallHistoryLog */
82
- firstCall (): MockCallHistoryLog | undefined
83
- /** returns the last MockCallHistoryLog. */
84
- lastCall (): MockCallHistoryLog | undefined
85
- /** returns the nth MockCallHistoryLog. */
86
- nthCall (position: number): MockCallHistoryLog | undefined
87
- /** return all MockCallHistoryLog matching any of criteria given. if an object is used with multiple properties, you can change the operator to apply during filtering on options */
88
- filterCalls (criteria: MockCallHistory.FilterCallsFunctionCriteria | MockCallHistory.FilterCallsObjectCriteria | RegExp, options?: MockCallHistory.FilterCallsOptions): Array<MockCallHistoryLog>
89
- /** return all MockCallHistoryLog matching the given protocol. if a string is given, it is matched with includes */
90
- filterCallsByProtocol (protocol: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
91
- /** return all MockCallHistoryLog matching the given host. if a string is given, it is matched with includes */
92
- filterCallsByHost (host: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
93
- /** return all MockCallHistoryLog matching the given port. if a string is given, it is matched with includes */
94
- filterCallsByPort (port: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
95
- /** return all MockCallHistoryLog matching the given origin. if a string is given, it is matched with includes */
96
- filterCallsByOrigin (origin: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
97
- /** return all MockCallHistoryLog matching the given path. if a string is given, it is matched with includes */
98
- filterCallsByPath (path: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
99
- /** return all MockCallHistoryLog matching the given hash. if a string is given, it is matched with includes */
100
- filterCallsByHash (hash: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
101
- /** return all MockCallHistoryLog matching the given fullUrl. if a string is given, it is matched with includes */
102
- filterCallsByFullUrl (fullUrl: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
103
- /** return all MockCallHistoryLog matching the given method. if a string is given, it is matched with includes */
104
- filterCallsByMethod (method: MockCallHistory.FilterCallsParameter): Array<MockCallHistoryLog>
105
- /** clear all MockCallHistoryLog on this MockCallHistory. */
106
- clear (): void
107
- /** use it with for..of loop or spread operator */
108
- [Symbol.iterator]: () => Generator<MockCallHistoryLog>
109
- }
110
-
111
- export { MockCallHistoryLog, MockCallHistory }
@@ -1,41 +0,0 @@
1
- import Client from './client'
2
- import TPoolStats from './pool-stats'
3
- import { URL } from 'node:url'
4
- import Dispatcher from './dispatcher'
5
-
6
- export default RoundRobinPool
7
-
8
- type RoundRobinPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
9
-
10
- declare class RoundRobinPool extends Dispatcher {
11
- constructor (url: string | URL, options?: RoundRobinPool.Options)
12
- /** `true` after `pool.close()` has been called. */
13
- closed: boolean
14
- /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
15
- destroyed: boolean
16
- /** Aggregate stats for a RoundRobinPool. */
17
- readonly stats: TPoolStats
18
-
19
- // Override dispatcher APIs.
20
- override connect (
21
- options: RoundRobinPoolConnectOptions
22
- ): Promise<Dispatcher.ConnectData>
23
- override connect (
24
- options: RoundRobinPoolConnectOptions,
25
- callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
- ): void
27
- }
28
-
29
- declare namespace RoundRobinPool {
30
- export type RoundRobinPoolStats = TPoolStats
31
- export interface Options extends Client.Options {
32
- /** Default: `(origin, opts) => new Client(origin, opts)`. */
33
- factory?(origin: URL, opts: object): Dispatcher;
34
- /** The max number of clients to create. `null` if no limit. Default `null`. */
35
- connections?: number | null;
36
- /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
37
- clientTtl?: number | null;
38
-
39
- interceptors?: { RoundRobinPool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
40
- }
41
- }