@orpc/evlog 2.0.0-beta.23 → 2.0.0-beta.24

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/README.md CHANGED
@@ -44,6 +44,7 @@ You can read the documentation [here](https://orpc.dev).
44
44
 
45
45
  - [@orpc/publisher](https://www.npmjs.com/package/@orpc/publisher): Pub/Sub with memory, Redis, and Upstash adapters.
46
46
  - [@orpc/ratelimit](https://www.npmjs.com/package/@orpc/ratelimit): Rate limiting with memory, Redis, and Upstash adapters.
47
+ - [@orpc/hibernation](https://www.npmjs.com/package/@orpc/hibernation): Leverage Hibernation APIs like [Cloudflare's Hibernation WebSocket](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#durable-objects-hibernation-websocket-api).
47
48
  - [@orpc/json-schema](https://www.npmjs.com/package/@orpc/json-schema): Smart coercion for OpenAPI requests.
48
49
 
49
50
  **Framework & ecosystem integrations**
@@ -114,6 +115,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
114
115
  </tr>
115
116
  <tr>
116
117
  <td align="center"><a href="https://github.com/itigoore01?ref=orpc" target="_blank" rel="noopener" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&amp;v=4" width="139" alt="shota"/><br />shota</a></td>
118
+ <td align="center"><a href="https://github.com/ellis-driscoll?ref=orpc" target="_blank" rel="noopener" title="Ellis Driscoll"><img src="https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&amp;v=4" width="139" alt="Ellis Driscoll"/><br />Ellis Driscoll</a></td>
117
119
  </tr>
118
120
  </table>
119
121
 
@@ -139,8 +141,9 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
139
141
  <td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="noopener" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&amp;v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
140
142
  </tr>
141
143
  <tr>
144
+ <td align="center"><a href="https://github.com/guyariely?ref=orpc" target="_blank" rel="noopener" title="Guy Ariely"><img src="https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&amp;v=4" width="119" alt="Guy Ariely"/><br />Guy Ariely</a></td>
142
145
  <td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&amp;v=4" width="119" alt="Alex"/><br />Alex</a></td>
143
- <td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=29e91400dbd4a9c217048a8f59562c4f740498e6&amp;v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
146
+ <td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&amp;v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
144
147
  </tr>
145
148
  </table>
146
149
 
@@ -2,6 +2,12 @@ import { StandardRequest } from '@standardserver/core';
2
2
  import { RequestLogger } from 'evlog';
3
3
  import { FrameworkIntegrationSpec } from 'evlog/toolkit';
4
4
 
5
+ /**
6
+ * Creates an AsyncLocalStorage-backed logger store. Pass `storage` to
7
+ * `EvlogHandlerPlugin` and call `useLogger` inside procedures to access the request logger.
8
+ *
9
+ * @see {@link https://orpc.dev/docs/integrations/evlog#using-the-logger-in-your-code | Evlog Integration - Using the Logger in Your Code}
10
+ */
5
11
  declare function createLoggerStorage(): {
6
12
  storage: FrameworkIntegrationSpec<{
7
13
  request: StandardRequest;
@@ -2,6 +2,12 @@ import { StandardRequest } from '@standardserver/core';
2
2
  import { RequestLogger } from 'evlog';
3
3
  import { FrameworkIntegrationSpec } from 'evlog/toolkit';
4
4
 
5
+ /**
6
+ * Creates an AsyncLocalStorage-backed logger store. Pass `storage` to
7
+ * `EvlogHandlerPlugin` and call `useLogger` inside procedures to access the request logger.
8
+ *
9
+ * @see {@link https://orpc.dev/docs/integrations/evlog#using-the-logger-in-your-code | Evlog Integration - Using the Logger in Your Code}
10
+ */
5
11
  declare function createLoggerStorage(): {
6
12
  storage: FrameworkIntegrationSpec<{
7
13
  request: StandardRequest;
package/dist/index.d.mts CHANGED
@@ -5,9 +5,19 @@ import { StandardRequest } from '@standardserver/core';
5
5
  import { BaseEvlogOptions, FrameworkIntegrationSpec } from 'evlog/toolkit';
6
6
 
7
7
  declare const LOGGER_CONTEXT_SYMBOL: unique symbol;
8
+ /**
9
+ * Context shape that carries the Evlog request logger injected by `EvlogHandlerPlugin`.
10
+ *
11
+ * @see {@link https://orpc.dev/docs/integrations/evlog#without-asynclocalstorage | Evlog Integration - Without AsyncLocalStorage}
12
+ */
8
13
  interface LoggerContext {
9
14
  [LOGGER_CONTEXT_SYMBOL]?: undefined | RequestLogger;
10
15
  }
16
+ /**
17
+ * Retrieves the Evlog request logger from the oRPC context, if available.
18
+ *
19
+ * @see {@link https://orpc.dev/docs/integrations/evlog#without-asynclocalstorage | Evlog Integration - Without AsyncLocalStorage}
20
+ */
11
21
  declare function getLogger(context: LoggerContext): RequestLogger | undefined;
12
22
 
13
23
  interface EvlogHandlerPluginOptions<_T extends Context> extends BaseEvlogOptions {
@@ -24,6 +34,12 @@ interface EvlogHandlerPluginOptions<_T extends Context> extends BaseEvlogOptions
24
34
  */
25
35
  logAbort?: boolean;
26
36
  }
37
+ /**
38
+ * Instruments an oRPC handler with Evlog structured logging, request tracking,
39
+ * and error monitoring.
40
+ *
41
+ * @see {@link https://orpc.dev/docs/integrations/evlog | Evlog Integration}
42
+ */
27
43
  declare class EvlogHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
28
44
  name: string;
29
45
  /**
package/dist/index.d.ts CHANGED
@@ -5,9 +5,19 @@ import { StandardRequest } from '@standardserver/core';
5
5
  import { BaseEvlogOptions, FrameworkIntegrationSpec } from 'evlog/toolkit';
6
6
 
7
7
  declare const LOGGER_CONTEXT_SYMBOL: unique symbol;
8
+ /**
9
+ * Context shape that carries the Evlog request logger injected by `EvlogHandlerPlugin`.
10
+ *
11
+ * @see {@link https://orpc.dev/docs/integrations/evlog#without-asynclocalstorage | Evlog Integration - Without AsyncLocalStorage}
12
+ */
8
13
  interface LoggerContext {
9
14
  [LOGGER_CONTEXT_SYMBOL]?: undefined | RequestLogger;
10
15
  }
16
+ /**
17
+ * Retrieves the Evlog request logger from the oRPC context, if available.
18
+ *
19
+ * @see {@link https://orpc.dev/docs/integrations/evlog#without-asynclocalstorage | Evlog Integration - Without AsyncLocalStorage}
20
+ */
11
21
  declare function getLogger(context: LoggerContext): RequestLogger | undefined;
12
22
 
13
23
  interface EvlogHandlerPluginOptions<_T extends Context> extends BaseEvlogOptions {
@@ -24,6 +34,12 @@ interface EvlogHandlerPluginOptions<_T extends Context> extends BaseEvlogOptions
24
34
  */
25
35
  logAbort?: boolean;
26
36
  }
37
+ /**
38
+ * Instruments an oRPC handler with Evlog structured logging, request tracking,
39
+ * and error monitoring.
40
+ *
41
+ * @see {@link https://orpc.dev/docs/integrations/evlog | Evlog Integration}
42
+ */
27
43
  declare class EvlogHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
28
44
  name: string;
29
45
  /**
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ class EvlogHandlerPlugin {
16
16
  * - Logging interceptors should run after batch interceptors
17
17
  * so they log each individual request instead of the batch request.
18
18
  */
19
- before = ["~opentelemetry", "~batch"];
19
+ before = ["~opentelemetry", "~batch", "~hibernation"];
20
20
  logAbort;
21
21
  integration;
22
22
  evlogOptions;
@@ -60,8 +60,8 @@ class EvlogHandlerPlugin {
60
60
  response: {
61
61
  ...result.response,
62
62
  /**
63
- * @warning
64
- * Remember use `override` for AsyncIteratorObject to remain other special properties
63
+ * @remarks
64
+ * **Warning**: Remember use `override` for AsyncIteratorObject to remain other special properties
65
65
  */
66
66
  body: override(result.response.body, wrapAsyncIteratorPreservingEventMeta(result.response.body, {
67
67
  runWith,
@@ -82,8 +82,8 @@ class EvlogHandlerPlugin {
82
82
  response: {
83
83
  ...result.response,
84
84
  /**
85
- * @warning
86
- * Remember use `override` for ReadableStream to remain other special properties
85
+ * @remarks
86
+ * **Warning**: Remember use `override` for ReadableStream to remain other special properties
87
87
  */
88
88
  body: override(result.response.body, wrapReadableStream(result.response.body, {
89
89
  runWith,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/evlog",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.23",
4
+ "version": "2.0.0-beta.24",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.dev",
7
7
  "repository": {
@@ -34,10 +34,10 @@
34
34
  "evlog": ">=2.18.1"
35
35
  },
36
36
  "dependencies": {
37
- "@standardserver/core": "^0.6.0",
38
- "@orpc/client": "2.0.0-beta.23",
39
- "@orpc/shared": "2.0.0-beta.23",
40
- "@orpc/server": "2.0.0-beta.23"
37
+ "@standardserver/core": "^0.7.1",
38
+ "@orpc/client": "2.0.0-beta.24",
39
+ "@orpc/shared": "2.0.0-beta.24",
40
+ "@orpc/server": "2.0.0-beta.24"
41
41
  },
42
42
  "devDependencies": {
43
43
  "evlog": "^2.22.3"