@orpc/shared 2.0.0-beta.33 → 2.0.0-beta.35
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 +15 -14
- package/dist/index.d.mts +69 -28
- package/dist/index.d.ts +69 -28
- package/dist/index.mjs +124 -116
- package/package.json +2 -11
package/README.md
CHANGED
|
@@ -55,20 +55,20 @@ You can read the documentation [here](https://orpc.dev).
|
|
|
55
55
|
|
|
56
56
|
**Framework & ecosystem integrations**
|
|
57
57
|
|
|
58
|
-
| Package | Purpose
|
|
59
|
-
| ------------------------------------------------------------------------------------ |
|
|
60
|
-
| [@orpc/next](https://www.npmjs.com/package/@orpc/next) | Integrate with [Next.js Server Functions](https://nextjs.org/docs/app/getting-started/mutating-data).
|
|
61
|
-
| [@orpc/ai-sdk](https://www.npmjs.com/package/@orpc/ai-sdk) | Turn contracts and procedures into [AI SDK](https://ai-sdk.dev/) tools.
|
|
62
|
-
| [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query) | Integrate with [TanStack Query](https://tanstack.com/query/latest).
|
|
63
|
-
| [@orpc/pinia-colada](https://www.npmjs.com/package/@orpc/pinia-colada) | Integrate with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
64
|
-
| [@orpc/swr](https://www.npmjs.com/package/@orpc/swr) | Integrate with [SWR](https://swr.vercel.app/).
|
|
65
|
-
| [@orpc/experimental-msw](https://www.npmjs.com/package/@orpc/experimental-msw) | Mock procedures with [Mock Service Worker](https://mswjs.io/).
|
|
66
|
-
| [@orpc/experimental-effect](https://www.npmjs.com/package/@orpc/experimental-effect) | Integrate with [Effect](https://effect.website/).
|
|
67
|
-
| [@orpc/nest](https://www.npmjs.com/package/@orpc/nest) | Implement your contract with [NestJS](https://nestjs.com/).
|
|
68
|
-
| [@orpc/node](https://www.npmjs.com/package/@orpc/node) | [Node.js](https://nodejs.org/) plugins for static file serving and large uploads.
|
|
69
|
-
| [@orpc/bun](https://www.npmjs.com/package/@orpc/bun) | Adapters for [Bun's Redis](https://bun.sh/).
|
|
70
|
-
| [@orpc/cloudflare](https://www.npmjs.com/package/@orpc/cloudflare) | Adapters for [Cloudflare
|
|
71
|
-
| [@orpc/trpc](https://www.npmjs.com/package/@orpc/trpc) | Reuse existing [tRPC](https://trpc.io/) routers within oRPC.
|
|
58
|
+
| Package | Purpose | Docs |
|
|
59
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
60
|
+
| [@orpc/next](https://www.npmjs.com/package/@orpc/next) | Integrate with [Next.js Server Functions](https://nextjs.org/docs/app/getting-started/mutating-data). | [Next.js](https://orpc.dev/docs/integrations/next) |
|
|
61
|
+
| [@orpc/ai-sdk](https://www.npmjs.com/package/@orpc/ai-sdk) | Turn contracts and procedures into [AI SDK](https://ai-sdk.dev/) tools. | [AI SDK](https://orpc.dev/docs/integrations/ai-sdk) |
|
|
62
|
+
| [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query) | Integrate with [TanStack Query](https://tanstack.com/query/latest). | [TanStack Query](https://orpc.dev/docs/integrations/tanstack-query) |
|
|
63
|
+
| [@orpc/pinia-colada](https://www.npmjs.com/package/@orpc/pinia-colada) | Integrate with [Pinia Colada](https://pinia-colada.esm.dev/). | [Pinia Colada](https://orpc.dev/docs/integrations/pinia-colada) |
|
|
64
|
+
| [@orpc/swr](https://www.npmjs.com/package/@orpc/swr) | Integrate with [SWR](https://swr.vercel.app/). | [SWR](https://orpc.dev/docs/integrations/swr) |
|
|
65
|
+
| [@orpc/experimental-msw](https://www.npmjs.com/package/@orpc/experimental-msw) | Mock procedures with [Mock Service Worker](https://mswjs.io/). | [MSW](https://orpc.dev/docs/integrations/msw) |
|
|
66
|
+
| [@orpc/experimental-effect](https://www.npmjs.com/package/@orpc/experimental-effect) | Integrate with [Effect](https://effect.website/). | [Effect](https://orpc.dev/docs/integrations/effect) |
|
|
67
|
+
| [@orpc/nest](https://www.npmjs.com/package/@orpc/nest) | Implement your contract with [NestJS](https://nestjs.com/). | [NestJS](https://orpc.dev/docs/integrations/nest) |
|
|
68
|
+
| [@orpc/node](https://www.npmjs.com/package/@orpc/node) | [Node.js](https://nodejs.org/) plugins for static file serving and large uploads. | [Static File](https://orpc.dev/docs/plugins/static-file), [Tmp File Upload](https://orpc.dev/docs/plugins/tmp-file-upload), [Batch Response Compression](https://orpc.dev/docs/plugins/batch-response-compression) |
|
|
69
|
+
| [@orpc/bun](https://www.npmjs.com/package/@orpc/bun) | Adapters for [Bun's Redis](https://bun.sh/). | [Publisher](https://orpc.dev/docs/helpers/publisher), [Rate Limit](https://orpc.dev/docs/helpers/ratelimit) |
|
|
70
|
+
| [@orpc/cloudflare](https://www.npmjs.com/package/@orpc/cloudflare) | Adapters for [Cloudflare Workers](https://developers.cloudflare.com/workers/). | [Publisher](https://orpc.dev/docs/helpers/publisher), [Rate Limit](https://orpc.dev/docs/helpers/ratelimit), [Traces](https://orpc.dev/docs/integrations/cloudflare-traces) |
|
|
71
|
+
| [@orpc/trpc](https://www.npmjs.com/package/@orpc/trpc) | Reuse existing [tRPC](https://trpc.io/) routers within oRPC. | [tRPC](https://orpc.dev/docs/integrations/trpc) |
|
|
72
72
|
|
|
73
73
|
**Observability**
|
|
74
74
|
|
|
@@ -127,6 +127,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
127
127
|
<td align="center"><a href="https://github.com/ellis-driscoll?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ellis Driscoll"><img src="https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&v=4" width="139" alt="Ellis Driscoll"/><br />Ellis Driscoll</a></td>
|
|
128
128
|
<td align="center"><a href="https://github.com/hoangbn?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Hoang Nguyen"><img src="https://avatars.githubusercontent.com/u/38968280?u=c90084c6de65c56facabab7ba13a72a49ddbc3e4&v=4" width="139" alt="Hoang Nguyen"/><br />Hoang Nguyen</a></td>
|
|
129
129
|
<td align="center"><a href="https://opencollective.com/guest-ac41de3b?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Orestis Ioannou"><img src="https://images.opencollective.com/guest-ac41de3b/avatar/460.png" width="139" alt="Orestis Ioannou"/><br />Orestis Ioannou</a></td>
|
|
130
|
+
<td align="center"><a href="https://automatio.ai/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Stefan Smiljkovic"><img src="https://avatars.githubusercontent.com/u/1984909?u=b7bf5bc40ed49df3c22f69d2da7b8d78709c49ed&v=4" width="139" alt="Stefan Smiljkovic"/><br />Stefan Smiljkovic</a></td>
|
|
130
131
|
</tr>
|
|
131
132
|
</table>
|
|
132
133
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Arrayable, Promisable } from 'type-fest';
|
|
2
2
|
export { Arrayable, IsEqual, PartialDeep, Promisable, Writable } from 'type-fest';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export { AbortError, AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@standardserver/shared';
|
|
3
|
+
import { AsyncIteratorClass } from '@standard-server/shared';
|
|
4
|
+
export { AbortError, AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@standard-server/shared';
|
|
6
5
|
|
|
7
6
|
type MaybeOptionalOptions<TOptions> = object extends TOptions ? [options?: TOptions] : [options: TOptions];
|
|
8
7
|
declare function resolveMaybeOptionalOptions<T>(rest: MaybeOptionalOptions<T>): T;
|
|
@@ -152,40 +151,78 @@ declare function onReadableStreamError<T, TOptions extends {
|
|
|
152
151
|
}, TRest extends any[]>(callback: NoInfer<(error: ThrowableError | (ReturnType<TOptions['next']> extends PromiseWithError<any, infer E> ? E : ThrowableError), options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => T | Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
153
152
|
declare function intercept<TOptions extends InterceptableOptions, TResult>(interceptors: undefined | Interceptor<TOptions, TResult>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => TResult>): TResult;
|
|
154
153
|
|
|
154
|
+
type TracingAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
155
|
+
interface TracingException {
|
|
156
|
+
name?: string;
|
|
157
|
+
message: string;
|
|
158
|
+
stack?: string;
|
|
159
|
+
code?: string | number;
|
|
160
|
+
}
|
|
161
|
+
type TracingHeaders = Record<string, string | string[] | undefined>;
|
|
162
|
+
type TracingExceptionLevel = 'error' | 'info';
|
|
163
|
+
interface TracingSpan {
|
|
164
|
+
setAttribute(key: string, value: TracingAttributeValue): void;
|
|
165
|
+
/**
|
|
166
|
+
* Renames the span. Backends that cannot rename spans ignore it.
|
|
167
|
+
*/
|
|
168
|
+
updateName(name: string): void;
|
|
169
|
+
/**
|
|
170
|
+
* Adds an event to the span. Backends without span events ignore it.
|
|
171
|
+
*/
|
|
172
|
+
addEvent(name: string): void;
|
|
173
|
+
/**
|
|
174
|
+
* Records an exception on the span. The `error` level also marks the span as failed.
|
|
175
|
+
*/
|
|
176
|
+
recordException(level: TracingExceptionLevel, exception: TracingException): void;
|
|
177
|
+
end(): void;
|
|
178
|
+
}
|
|
155
179
|
/**
|
|
156
|
-
*
|
|
180
|
+
* The tracing backend oRPC records spans with, see `@orpc/opentelemetry` and `@orpc/cloudflare`.
|
|
181
|
+
*
|
|
182
|
+
* A `parent` defaults to the active span of the backend when omitted.
|
|
157
183
|
*/
|
|
158
|
-
|
|
159
|
-
interface OpenTelemetryConfig {
|
|
160
|
-
tracer: Tracer;
|
|
161
|
-
trace: TraceAPI;
|
|
162
|
-
context: ContextAPI;
|
|
184
|
+
interface Tracer {
|
|
163
185
|
/**
|
|
164
|
-
*
|
|
186
|
+
* Starts a span without making it active. The caller must end it.
|
|
165
187
|
*/
|
|
166
|
-
|
|
188
|
+
startSpan(name: string, parent?: TracingSpan): TracingSpan;
|
|
189
|
+
/**
|
|
190
|
+
* Starts a span, makes it active while `fn` runs, and passes it to `fn`. The caller must end it.
|
|
191
|
+
*/
|
|
192
|
+
startActiveSpan<T>(name: string, parent: TracingSpan | undefined, fn: (span: TracingSpan) => Promise<T>): Promise<T>;
|
|
193
|
+
getActiveSpan(): TracingSpan | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Runs `fn` with `span` as the active span. Backends that cannot activate a span run `fn` directly.
|
|
196
|
+
*/
|
|
197
|
+
withActiveSpan<T>(span: TracingSpan, fn: () => Promisable<T>): Promisable<T>;
|
|
198
|
+
/**
|
|
199
|
+
* Writes the trace context of `span` into `headers`. Absent when the backend does not propagate context.
|
|
200
|
+
*/
|
|
201
|
+
inject?(span: TracingSpan, headers: TracingHeaders): void;
|
|
202
|
+
/**
|
|
203
|
+
* Reads the remote parent from `headers`. Absent when the backend does not propagate context.
|
|
204
|
+
*/
|
|
205
|
+
extract?(headers: TracingHeaders): TracingSpan | undefined;
|
|
167
206
|
}
|
|
168
|
-
declare function
|
|
169
|
-
declare function
|
|
170
|
-
interface StartSpanOptions
|
|
207
|
+
declare function setTracer(tracer: Tracer | undefined): void;
|
|
208
|
+
declare function getTracer(): Tracer | undefined;
|
|
209
|
+
interface StartSpanOptions {
|
|
171
210
|
/**
|
|
172
211
|
* The name of the span to create.
|
|
173
212
|
*/
|
|
174
213
|
name: string;
|
|
175
214
|
/**
|
|
176
|
-
*
|
|
215
|
+
* The span to use as parent. Defaults to the active span of the backend.
|
|
177
216
|
*/
|
|
178
|
-
|
|
217
|
+
parent?: TracingSpan | undefined;
|
|
179
218
|
}
|
|
180
|
-
declare function startSpan(options: StartSpanOptions | string):
|
|
181
|
-
declare function recordSpanError(span:
|
|
182
|
-
declare function setSpanAttributeIfDefined(span:
|
|
183
|
-
declare function
|
|
219
|
+
declare function startSpan(options: StartSpanOptions | string): TracingSpan | undefined;
|
|
220
|
+
declare function recordSpanError(span: TracingSpan | undefined, error: unknown): void;
|
|
221
|
+
declare function setSpanAttributeIfDefined(span: TracingSpan | undefined, key: string, value: TracingAttributeValue | undefined): void;
|
|
222
|
+
declare function toTracingException(error: unknown): TracingException;
|
|
184
223
|
declare function toSpanAttributeValue(data: unknown): string;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
declare function runWithSpan<T>(options: string | RunWithSpanOptions, fn: (span?: Span) => Promisable<T>): Promise<T>;
|
|
188
|
-
declare function runInSpanContext<T>(span: Span | undefined, fn: () => Promisable<T>): Promise<T>;
|
|
224
|
+
declare function runWithSpan<T>(options: string | StartSpanOptions, fn: (span?: TracingSpan) => Promisable<T>): Promise<T>;
|
|
225
|
+
declare function runInSpanContext<T>(span: TracingSpan | undefined, fn: () => Promisable<T>): Promisable<T>;
|
|
189
226
|
|
|
190
227
|
interface WrapAsyncIteratorOptions<TYield, TReturn, TMappedYield, TMappedReturn> {
|
|
191
228
|
/**
|
|
@@ -193,7 +230,7 @@ interface WrapAsyncIteratorOptions<TYield, TReturn, TMappedYield, TMappedReturn>
|
|
|
193
230
|
* Useful when you want execution to happen within a specific context,
|
|
194
231
|
* such as AsyncLocalStorage.
|
|
195
232
|
*/
|
|
196
|
-
runWith?: <T>(run: () => Promise<T>) =>
|
|
233
|
+
runWith?: <T>(run: () => Promise<T>) => Promisable<T>;
|
|
197
234
|
mapResult?: (result: IteratorResult<TYield, TReturn>) => Promisable<IteratorResult<TMappedYield, TMappedReturn>>;
|
|
198
235
|
mapError?: (error: ThrowableError) => Promisable<ThrowableError>;
|
|
199
236
|
onError?: (error: ThrowableError) => Promisable<void>;
|
|
@@ -272,6 +309,10 @@ declare function set(root: object, path: [PropertyKey, ...PropertyKey[]] | [...P
|
|
|
272
309
|
*/
|
|
273
310
|
declare function mergeTwoLevels(first: unknown, second: unknown): unknown;
|
|
274
311
|
declare function omit<T extends object, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
|
|
312
|
+
/**
|
|
313
|
+
* Deep clones arrays and plain objects, leaving every other value as is.
|
|
314
|
+
* Circular and shared references are preserved in the copy.
|
|
315
|
+
*/
|
|
275
316
|
declare function clone<T>(value: T): T;
|
|
276
317
|
declare function isPropertyKey(value: unknown): value is PropertyKey;
|
|
277
318
|
declare const NullProtoObj: ({
|
|
@@ -376,7 +417,7 @@ interface WrapReadableStreamOptions<T, TMapped> {
|
|
|
376
417
|
* Useful when you want execution to happen within a specific context,
|
|
377
418
|
* such as AsyncLocalStorage.
|
|
378
419
|
*/
|
|
379
|
-
runWith?: <T>(run: () => Promise<T>) =>
|
|
420
|
+
runWith?: <T>(run: () => Promise<T>) => Promisable<T>;
|
|
380
421
|
mapResult?: (result: ReadableStreamReadResult<T>) => Promisable<ReadableStreamReadResult<TMapped>>;
|
|
381
422
|
mapError?: (error: ThrowableError) => Promisable<ThrowableError>;
|
|
382
423
|
onError?: (error: ThrowableError) => Promisable<void>;
|
|
@@ -409,5 +450,5 @@ declare function asyncIteratorToUnproxiedDataStream<T>(iterator: AsyncIterator<T
|
|
|
409
450
|
|
|
410
451
|
declare function tryDecodeURIComponent(value: string): string;
|
|
411
452
|
|
|
412
|
-
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors,
|
|
413
|
-
export type { AnyFunction, AsyncIdQueueCloseOptions, ConsumeAsyncIteratorOptions, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OnFinishState,
|
|
453
|
+
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors, getOwn, getTracer, intercept, isAbortError, isAsyncGeneratorFunction, isCompressibleContentType, isDeepEqual, isNoTransformCacheControl, isPlainObject, isPropertyKey, loadBytes, matchesHttpPath, matchesHttpPathPrefix, mergeHttpPath, mergeTwoLevels, normalizeHttpPath, omit, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, once, override, parseAcceptEncodingQualities, pathToHttpPath, promiseWithResolvers, recordSpanError, replicateAsyncIterator, replicateReadableStream, resolveMaybeOptionalOptions, runInSpanContext, runWithSignal, runWithSpan, set, setSpanAttributeIfDefined, setTracer, sortPlugins, splitInHalf, startSpan, streamToAsyncIteratorObject, toSpanAttributeValue, toStringOrBytes, toTracingException, traceAsyncIterator, traceReadableStream, tryDecodeURIComponent, tryOrUndefined, value, varyByAcceptEncoding, wrapAsyncIterator, wrapReadableStream };
|
|
454
|
+
export type { AnyFunction, AsyncIdQueueCloseOptions, ConsumeAsyncIteratorOptions, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OnFinishState, OrderablePlugin, PromiseWithError, Public, ReadableStreamReadResult, Registry, Segment, StartSpanOptions, ThrowableError, Tracer, TracingAttributeValue, TracingException, TracingExceptionLevel, TracingHeaders, TracingSpan, Value, WrapAsyncIteratorOptions, WrapReadableStreamOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Arrayable, Promisable } from 'type-fest';
|
|
2
2
|
export { Arrayable, IsEqual, PartialDeep, Promisable, Writable } from 'type-fest';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export { AbortError, AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@standardserver/shared';
|
|
3
|
+
import { AsyncIteratorClass } from '@standard-server/shared';
|
|
4
|
+
export { AbortError, AsyncCleanupFn, AsyncIteratorClass, AsyncIteratorClassNextFn, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@standard-server/shared';
|
|
6
5
|
|
|
7
6
|
type MaybeOptionalOptions<TOptions> = object extends TOptions ? [options?: TOptions] : [options: TOptions];
|
|
8
7
|
declare function resolveMaybeOptionalOptions<T>(rest: MaybeOptionalOptions<T>): T;
|
|
@@ -152,40 +151,78 @@ declare function onReadableStreamError<T, TOptions extends {
|
|
|
152
151
|
}, TRest extends any[]>(callback: NoInfer<(error: ThrowableError | (ReturnType<TOptions['next']> extends PromiseWithError<any, infer E> ? E : ThrowableError), options: TOptions, ...rest: TRest) => Promisable<void>>): (options: TOptions, ...rest: TRest) => T | Promise<Awaited<ReturnType<TOptions['next']>>>;
|
|
153
152
|
declare function intercept<TOptions extends InterceptableOptions, TResult>(interceptors: undefined | Interceptor<TOptions, TResult>[], options: NoInfer<TOptions>, main: NoInfer<(options: TOptions) => TResult>): TResult;
|
|
154
153
|
|
|
154
|
+
type TracingAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
155
|
+
interface TracingException {
|
|
156
|
+
name?: string;
|
|
157
|
+
message: string;
|
|
158
|
+
stack?: string;
|
|
159
|
+
code?: string | number;
|
|
160
|
+
}
|
|
161
|
+
type TracingHeaders = Record<string, string | string[] | undefined>;
|
|
162
|
+
type TracingExceptionLevel = 'error' | 'info';
|
|
163
|
+
interface TracingSpan {
|
|
164
|
+
setAttribute(key: string, value: TracingAttributeValue): void;
|
|
165
|
+
/**
|
|
166
|
+
* Renames the span. Backends that cannot rename spans ignore it.
|
|
167
|
+
*/
|
|
168
|
+
updateName(name: string): void;
|
|
169
|
+
/**
|
|
170
|
+
* Adds an event to the span. Backends without span events ignore it.
|
|
171
|
+
*/
|
|
172
|
+
addEvent(name: string): void;
|
|
173
|
+
/**
|
|
174
|
+
* Records an exception on the span. The `error` level also marks the span as failed.
|
|
175
|
+
*/
|
|
176
|
+
recordException(level: TracingExceptionLevel, exception: TracingException): void;
|
|
177
|
+
end(): void;
|
|
178
|
+
}
|
|
155
179
|
/**
|
|
156
|
-
*
|
|
180
|
+
* The tracing backend oRPC records spans with, see `@orpc/opentelemetry` and `@orpc/cloudflare`.
|
|
181
|
+
*
|
|
182
|
+
* A `parent` defaults to the active span of the backend when omitted.
|
|
157
183
|
*/
|
|
158
|
-
|
|
159
|
-
interface OpenTelemetryConfig {
|
|
160
|
-
tracer: Tracer;
|
|
161
|
-
trace: TraceAPI;
|
|
162
|
-
context: ContextAPI;
|
|
184
|
+
interface Tracer {
|
|
163
185
|
/**
|
|
164
|
-
*
|
|
186
|
+
* Starts a span without making it active. The caller must end it.
|
|
165
187
|
*/
|
|
166
|
-
|
|
188
|
+
startSpan(name: string, parent?: TracingSpan): TracingSpan;
|
|
189
|
+
/**
|
|
190
|
+
* Starts a span, makes it active while `fn` runs, and passes it to `fn`. The caller must end it.
|
|
191
|
+
*/
|
|
192
|
+
startActiveSpan<T>(name: string, parent: TracingSpan | undefined, fn: (span: TracingSpan) => Promise<T>): Promise<T>;
|
|
193
|
+
getActiveSpan(): TracingSpan | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Runs `fn` with `span` as the active span. Backends that cannot activate a span run `fn` directly.
|
|
196
|
+
*/
|
|
197
|
+
withActiveSpan<T>(span: TracingSpan, fn: () => Promisable<T>): Promisable<T>;
|
|
198
|
+
/**
|
|
199
|
+
* Writes the trace context of `span` into `headers`. Absent when the backend does not propagate context.
|
|
200
|
+
*/
|
|
201
|
+
inject?(span: TracingSpan, headers: TracingHeaders): void;
|
|
202
|
+
/**
|
|
203
|
+
* Reads the remote parent from `headers`. Absent when the backend does not propagate context.
|
|
204
|
+
*/
|
|
205
|
+
extract?(headers: TracingHeaders): TracingSpan | undefined;
|
|
167
206
|
}
|
|
168
|
-
declare function
|
|
169
|
-
declare function
|
|
170
|
-
interface StartSpanOptions
|
|
207
|
+
declare function setTracer(tracer: Tracer | undefined): void;
|
|
208
|
+
declare function getTracer(): Tracer | undefined;
|
|
209
|
+
interface StartSpanOptions {
|
|
171
210
|
/**
|
|
172
211
|
* The name of the span to create.
|
|
173
212
|
*/
|
|
174
213
|
name: string;
|
|
175
214
|
/**
|
|
176
|
-
*
|
|
215
|
+
* The span to use as parent. Defaults to the active span of the backend.
|
|
177
216
|
*/
|
|
178
|
-
|
|
217
|
+
parent?: TracingSpan | undefined;
|
|
179
218
|
}
|
|
180
|
-
declare function startSpan(options: StartSpanOptions | string):
|
|
181
|
-
declare function recordSpanError(span:
|
|
182
|
-
declare function setSpanAttributeIfDefined(span:
|
|
183
|
-
declare function
|
|
219
|
+
declare function startSpan(options: StartSpanOptions | string): TracingSpan | undefined;
|
|
220
|
+
declare function recordSpanError(span: TracingSpan | undefined, error: unknown): void;
|
|
221
|
+
declare function setSpanAttributeIfDefined(span: TracingSpan | undefined, key: string, value: TracingAttributeValue | undefined): void;
|
|
222
|
+
declare function toTracingException(error: unknown): TracingException;
|
|
184
223
|
declare function toSpanAttributeValue(data: unknown): string;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
declare function runWithSpan<T>(options: string | RunWithSpanOptions, fn: (span?: Span) => Promisable<T>): Promise<T>;
|
|
188
|
-
declare function runInSpanContext<T>(span: Span | undefined, fn: () => Promisable<T>): Promise<T>;
|
|
224
|
+
declare function runWithSpan<T>(options: string | StartSpanOptions, fn: (span?: TracingSpan) => Promisable<T>): Promise<T>;
|
|
225
|
+
declare function runInSpanContext<T>(span: TracingSpan | undefined, fn: () => Promisable<T>): Promisable<T>;
|
|
189
226
|
|
|
190
227
|
interface WrapAsyncIteratorOptions<TYield, TReturn, TMappedYield, TMappedReturn> {
|
|
191
228
|
/**
|
|
@@ -193,7 +230,7 @@ interface WrapAsyncIteratorOptions<TYield, TReturn, TMappedYield, TMappedReturn>
|
|
|
193
230
|
* Useful when you want execution to happen within a specific context,
|
|
194
231
|
* such as AsyncLocalStorage.
|
|
195
232
|
*/
|
|
196
|
-
runWith?: <T>(run: () => Promise<T>) =>
|
|
233
|
+
runWith?: <T>(run: () => Promise<T>) => Promisable<T>;
|
|
197
234
|
mapResult?: (result: IteratorResult<TYield, TReturn>) => Promisable<IteratorResult<TMappedYield, TMappedReturn>>;
|
|
198
235
|
mapError?: (error: ThrowableError) => Promisable<ThrowableError>;
|
|
199
236
|
onError?: (error: ThrowableError) => Promisable<void>;
|
|
@@ -272,6 +309,10 @@ declare function set(root: object, path: [PropertyKey, ...PropertyKey[]] | [...P
|
|
|
272
309
|
*/
|
|
273
310
|
declare function mergeTwoLevels(first: unknown, second: unknown): unknown;
|
|
274
311
|
declare function omit<T extends object, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
|
|
312
|
+
/**
|
|
313
|
+
* Deep clones arrays and plain objects, leaving every other value as is.
|
|
314
|
+
* Circular and shared references are preserved in the copy.
|
|
315
|
+
*/
|
|
275
316
|
declare function clone<T>(value: T): T;
|
|
276
317
|
declare function isPropertyKey(value: unknown): value is PropertyKey;
|
|
277
318
|
declare const NullProtoObj: ({
|
|
@@ -376,7 +417,7 @@ interface WrapReadableStreamOptions<T, TMapped> {
|
|
|
376
417
|
* Useful when you want execution to happen within a specific context,
|
|
377
418
|
* such as AsyncLocalStorage.
|
|
378
419
|
*/
|
|
379
|
-
runWith?: <T>(run: () => Promise<T>) =>
|
|
420
|
+
runWith?: <T>(run: () => Promise<T>) => Promisable<T>;
|
|
380
421
|
mapResult?: (result: ReadableStreamReadResult<T>) => Promisable<ReadableStreamReadResult<TMapped>>;
|
|
381
422
|
mapError?: (error: ThrowableError) => Promisable<ThrowableError>;
|
|
382
423
|
onError?: (error: ThrowableError) => Promisable<void>;
|
|
@@ -409,5 +450,5 @@ declare function asyncIteratorToUnproxiedDataStream<T>(iterator: AsyncIterator<T
|
|
|
409
450
|
|
|
410
451
|
declare function tryDecodeURIComponent(value: string): string;
|
|
411
452
|
|
|
412
|
-
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors,
|
|
413
|
-
export type { AnyFunction, AsyncIdQueueCloseOptions, ConsumeAsyncIteratorOptions, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OnFinishState,
|
|
453
|
+
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors, getOwn, getTracer, intercept, isAbortError, isAsyncGeneratorFunction, isCompressibleContentType, isDeepEqual, isNoTransformCacheControl, isPlainObject, isPropertyKey, loadBytes, matchesHttpPath, matchesHttpPathPrefix, mergeHttpPath, mergeTwoLevels, normalizeHttpPath, omit, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, once, override, parseAcceptEncodingQualities, pathToHttpPath, promiseWithResolvers, recordSpanError, replicateAsyncIterator, replicateReadableStream, resolveMaybeOptionalOptions, runInSpanContext, runWithSignal, runWithSpan, set, setSpanAttributeIfDefined, setTracer, sortPlugins, splitInHalf, startSpan, streamToAsyncIteratorObject, toSpanAttributeValue, toStringOrBytes, toTracingException, traceAsyncIterator, traceReadableStream, tryDecodeURIComponent, tryOrUndefined, value, varyByAcceptEncoding, wrapAsyncIterator, wrapReadableStream };
|
|
454
|
+
export type { AnyFunction, AsyncIdQueueCloseOptions, ConsumeAsyncIteratorOptions, InterceptableOptions, Interceptor, InterceptorOptions, IntersectPick, MaybeOptionalOptions, OnFinishState, OrderablePlugin, PromiseWithError, Public, ReadableStreamReadResult, Registry, Segment, StartSpanOptions, ThrowableError, Tracer, TracingAttributeValue, TracingException, TracingExceptionLevel, TracingHeaders, TracingSpan, Value, WrapAsyncIteratorOptions, WrapReadableStreamOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbortError, AsyncIteratorClass, getOrBind, isTypescriptObject, isAsyncIteratorObject } from '@
|
|
2
|
-
export { AbortError, AsyncIteratorClass, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@
|
|
1
|
+
import { AbortError, AsyncIteratorClass, getOrBind, isTypescriptObject, isAsyncIteratorObject } from '@standard-server/shared';
|
|
2
|
+
export { AbortError, AsyncIteratorClass, SequentialIdGenerator, getOrBind, isAsyncIteratorObject, isTypescriptObject, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray } from '@standard-server/shared';
|
|
3
3
|
|
|
4
4
|
function resolveMaybeOptionalOptions(rest) {
|
|
5
5
|
return rest[0] ?? {};
|
|
@@ -228,106 +228,6 @@ function compareSequentialIds(a, b) {
|
|
|
228
228
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
const SPAN_ERROR_STATUS = 2;
|
|
232
|
-
const OPENTELEMETRY_CONFIG_SYMBOL = Symbol.for("ORPC_OPENTELEMETRY_CONFIG");
|
|
233
|
-
function setOpenTelemetryConfig(config) {
|
|
234
|
-
globalThis[OPENTELEMETRY_CONFIG_SYMBOL] = config;
|
|
235
|
-
}
|
|
236
|
-
function getOpenTelemetryConfig() {
|
|
237
|
-
return globalThis[OPENTELEMETRY_CONFIG_SYMBOL];
|
|
238
|
-
}
|
|
239
|
-
function startSpan(options) {
|
|
240
|
-
const tracer = getOpenTelemetryConfig()?.tracer;
|
|
241
|
-
if (!tracer) {
|
|
242
|
-
return void 0;
|
|
243
|
-
}
|
|
244
|
-
const { name, context, ...spanOptions } = typeof options === "string" ? { name: options } : options;
|
|
245
|
-
return tracer.startSpan(name, spanOptions, context);
|
|
246
|
-
}
|
|
247
|
-
function recordSpanError(span, error) {
|
|
248
|
-
if (!span) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
const exception = toOtelException(error);
|
|
252
|
-
span.recordException(exception);
|
|
253
|
-
if (!isAbortError(error)) {
|
|
254
|
-
span.setStatus({
|
|
255
|
-
code: SPAN_ERROR_STATUS,
|
|
256
|
-
message: exception.message
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function setSpanAttributeIfDefined(span, key, value) {
|
|
261
|
-
if (!span || value === void 0) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
span.setAttribute(key, value);
|
|
265
|
-
}
|
|
266
|
-
function toOtelException(error) {
|
|
267
|
-
if (error instanceof Error) {
|
|
268
|
-
const exception = {
|
|
269
|
-
message: error.message,
|
|
270
|
-
name: error.name,
|
|
271
|
-
stack: error.stack
|
|
272
|
-
};
|
|
273
|
-
if ("code" in error && (typeof error.code === "string" || typeof error.code === "number")) {
|
|
274
|
-
exception.code = error.code;
|
|
275
|
-
}
|
|
276
|
-
return exception;
|
|
277
|
-
}
|
|
278
|
-
return { message: String(error) };
|
|
279
|
-
}
|
|
280
|
-
function toSpanAttributeValue(data) {
|
|
281
|
-
if (data === void 0) {
|
|
282
|
-
return "undefined";
|
|
283
|
-
}
|
|
284
|
-
try {
|
|
285
|
-
return JSON.stringify(data, (_, value) => {
|
|
286
|
-
if (typeof value === "bigint") {
|
|
287
|
-
return value.toString();
|
|
288
|
-
}
|
|
289
|
-
if (value instanceof Map || value instanceof Set) {
|
|
290
|
-
return Array.from(value);
|
|
291
|
-
}
|
|
292
|
-
return value;
|
|
293
|
-
});
|
|
294
|
-
} catch {
|
|
295
|
-
return String(data);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
async function runWithSpan(options, fn) {
|
|
299
|
-
const tracer = getOpenTelemetryConfig()?.tracer;
|
|
300
|
-
if (!tracer) {
|
|
301
|
-
return fn();
|
|
302
|
-
}
|
|
303
|
-
if (typeof options === "string") {
|
|
304
|
-
options = { name: options };
|
|
305
|
-
}
|
|
306
|
-
const callback = async (span) => {
|
|
307
|
-
try {
|
|
308
|
-
return await fn(span);
|
|
309
|
-
} catch (e) {
|
|
310
|
-
recordSpanError(span, e);
|
|
311
|
-
throw e;
|
|
312
|
-
} finally {
|
|
313
|
-
span.end();
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
if (options.context) {
|
|
317
|
-
return tracer.startActiveSpan(options.name, options, options.context, callback);
|
|
318
|
-
} else {
|
|
319
|
-
return tracer.startActiveSpan(options.name, options, callback);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
async function runInSpanContext(span, fn) {
|
|
323
|
-
const otelConfig = getOpenTelemetryConfig();
|
|
324
|
-
if (!span || !otelConfig) {
|
|
325
|
-
return fn();
|
|
326
|
-
}
|
|
327
|
-
const ctx = otelConfig.trace.setSpan(otelConfig.context.active(), span);
|
|
328
|
-
return otelConfig.context.with(ctx, fn);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
231
|
class AsyncIdQueue {
|
|
332
232
|
openIds = /* @__PURE__ */ new Set();
|
|
333
233
|
queues = /* @__PURE__ */ new Map();
|
|
@@ -402,6 +302,93 @@ class AsyncIdQueue {
|
|
|
402
302
|
}
|
|
403
303
|
}
|
|
404
304
|
|
|
305
|
+
const TRACER_SYMBOL = Symbol.for("ORPC_TRACER");
|
|
306
|
+
function setTracer(tracer) {
|
|
307
|
+
globalThis[TRACER_SYMBOL] = tracer;
|
|
308
|
+
}
|
|
309
|
+
function getTracer() {
|
|
310
|
+
return globalThis[TRACER_SYMBOL];
|
|
311
|
+
}
|
|
312
|
+
function startSpan(options) {
|
|
313
|
+
const tracer = getTracer();
|
|
314
|
+
if (!tracer) {
|
|
315
|
+
return void 0;
|
|
316
|
+
}
|
|
317
|
+
if (typeof options === "string") {
|
|
318
|
+
return tracer.startSpan(options);
|
|
319
|
+
}
|
|
320
|
+
return tracer.startSpan(options.name, options.parent);
|
|
321
|
+
}
|
|
322
|
+
function recordSpanError(span, error) {
|
|
323
|
+
if (!span) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
span.recordException(isAbortError(error) ? "info" : "error", toTracingException(error));
|
|
327
|
+
}
|
|
328
|
+
function setSpanAttributeIfDefined(span, key, value) {
|
|
329
|
+
if (!span || value === void 0) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
span.setAttribute(key, value);
|
|
333
|
+
}
|
|
334
|
+
function toTracingException(error) {
|
|
335
|
+
if (error instanceof Error) {
|
|
336
|
+
const exception = {
|
|
337
|
+
message: error.message,
|
|
338
|
+
name: error.name,
|
|
339
|
+
stack: error.stack
|
|
340
|
+
};
|
|
341
|
+
if ("code" in error && (typeof error.code === "string" || typeof error.code === "number")) {
|
|
342
|
+
exception.code = error.code;
|
|
343
|
+
}
|
|
344
|
+
return exception;
|
|
345
|
+
}
|
|
346
|
+
return { message: String(error) };
|
|
347
|
+
}
|
|
348
|
+
function toSpanAttributeValue(data) {
|
|
349
|
+
if (data === void 0) {
|
|
350
|
+
return "undefined";
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
return JSON.stringify(data, (_, value) => {
|
|
354
|
+
if (typeof value === "bigint") {
|
|
355
|
+
return value.toString();
|
|
356
|
+
}
|
|
357
|
+
if (value instanceof Map || value instanceof Set) {
|
|
358
|
+
return Array.from(value);
|
|
359
|
+
}
|
|
360
|
+
return value;
|
|
361
|
+
});
|
|
362
|
+
} catch {
|
|
363
|
+
return String(data);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
async function runWithSpan(options, fn) {
|
|
367
|
+
const tracer = getTracer();
|
|
368
|
+
if (!tracer) {
|
|
369
|
+
return fn();
|
|
370
|
+
}
|
|
371
|
+
const name = typeof options === "string" ? options : options.name;
|
|
372
|
+
const parent = typeof options === "string" ? void 0 : options.parent;
|
|
373
|
+
return tracer.startActiveSpan(name, parent, async (span) => {
|
|
374
|
+
try {
|
|
375
|
+
return await fn(span);
|
|
376
|
+
} catch (e) {
|
|
377
|
+
recordSpanError(span, e);
|
|
378
|
+
throw e;
|
|
379
|
+
} finally {
|
|
380
|
+
span.end();
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function runInSpanContext(span, fn) {
|
|
385
|
+
const tracer = getTracer();
|
|
386
|
+
if (!span || !tracer) {
|
|
387
|
+
return fn();
|
|
388
|
+
}
|
|
389
|
+
return tracer.withActiveSpan(span, fn);
|
|
390
|
+
}
|
|
391
|
+
|
|
405
392
|
function wrapAsyncIterator(iterator, { runWith, mapResult, mapError, onError, onFinish }) {
|
|
406
393
|
runWith ??= (run) => run();
|
|
407
394
|
let isDone;
|
|
@@ -607,21 +594,25 @@ function set(root, path, value) {
|
|
|
607
594
|
const next = Object.hasOwn(current, key) ? current[key] : void 0;
|
|
608
595
|
if (!isTypescriptObject(next)) {
|
|
609
596
|
const child = {};
|
|
610
|
-
|
|
597
|
+
setOwn(current, key, child);
|
|
611
598
|
current = child;
|
|
612
599
|
} else {
|
|
613
600
|
current = next;
|
|
614
601
|
}
|
|
615
602
|
}
|
|
616
|
-
|
|
603
|
+
setOwn(current, path.at(-1), value);
|
|
617
604
|
}
|
|
618
|
-
function
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
605
|
+
function setOwn(object, key, value) {
|
|
606
|
+
if (key === "__proto__") {
|
|
607
|
+
Object.defineProperty(object, key, {
|
|
608
|
+
value,
|
|
609
|
+
writable: true,
|
|
610
|
+
enumerable: true,
|
|
611
|
+
configurable: true
|
|
612
|
+
});
|
|
613
|
+
} else {
|
|
614
|
+
object[key] = value;
|
|
615
|
+
}
|
|
625
616
|
}
|
|
626
617
|
function mergeTwoLevels(first, second) {
|
|
627
618
|
if (!isPlainObject(first) || !isPlainObject(second)) {
|
|
@@ -635,7 +626,7 @@ function mergeTwoLevels(first, second) {
|
|
|
635
626
|
const firstValue = first[key];
|
|
636
627
|
const secondValue = second[key];
|
|
637
628
|
if (isPlainObject(firstValue) && isPlainObject(secondValue)) {
|
|
638
|
-
|
|
629
|
+
setOwn(result, key, { ...firstValue, ...secondValue });
|
|
639
630
|
}
|
|
640
631
|
}
|
|
641
632
|
return result;
|
|
@@ -648,16 +639,33 @@ function omit(obj, keys) {
|
|
|
648
639
|
return result;
|
|
649
640
|
}
|
|
650
641
|
function clone(value) {
|
|
642
|
+
return cloneWithVisited(value, /* @__PURE__ */ new WeakMap());
|
|
643
|
+
}
|
|
644
|
+
function cloneWithVisited(value, visited) {
|
|
651
645
|
if (Array.isArray(value)) {
|
|
652
|
-
|
|
646
|
+
const existing = visited.get(value);
|
|
647
|
+
if (existing) {
|
|
648
|
+
return existing;
|
|
649
|
+
}
|
|
650
|
+
const result = [];
|
|
651
|
+
visited.set(value, result);
|
|
652
|
+
for (const item of value) {
|
|
653
|
+
result.push(cloneWithVisited(item, visited));
|
|
654
|
+
}
|
|
655
|
+
return result;
|
|
653
656
|
}
|
|
654
657
|
if (isPlainObject(value)) {
|
|
658
|
+
const existing = visited.get(value);
|
|
659
|
+
if (existing) {
|
|
660
|
+
return existing;
|
|
661
|
+
}
|
|
655
662
|
const result = {};
|
|
663
|
+
visited.set(value, result);
|
|
656
664
|
for (const key in value) {
|
|
657
|
-
|
|
665
|
+
setOwn(result, key, cloneWithVisited(value[key], visited));
|
|
658
666
|
}
|
|
659
667
|
for (const sym of Object.getOwnPropertySymbols(value)) {
|
|
660
|
-
|
|
668
|
+
setOwn(result, sym, cloneWithVisited(value[sym], visited));
|
|
661
669
|
}
|
|
662
670
|
return result;
|
|
663
671
|
}
|
|
@@ -1071,4 +1079,4 @@ async function runWithSignal(signal, fn) {
|
|
|
1071
1079
|
}
|
|
1072
1080
|
}
|
|
1073
1081
|
|
|
1074
|
-
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors,
|
|
1082
|
+
export { AsyncIdQueue, NullProtoObj, ORPC_NAME, allAbortSignal, anyAbortSignal, asyncIteratorToStream, asyncIteratorToUnproxiedDataStream, bindMethods, clone, compareSequentialIds, consumeAsyncIterator, defer, findDeepMatches, get, getConstructor, getConstructors, getOwn, getTracer, intercept, isAbortError, isAsyncGeneratorFunction, isCompressibleContentType, isDeepEqual, isNoTransformCacheControl, isPlainObject, isPropertyKey, loadBytes, matchesHttpPath, matchesHttpPathPrefix, mergeHttpPath, mergeTwoLevels, normalizeHttpPath, omit, onAsyncIteratorObjectError, onError, onFinish, onReadableStreamError, onStart, onSuccess, once, override, parseAcceptEncodingQualities, pathToHttpPath, promiseWithResolvers, recordSpanError, replicateAsyncIterator, replicateReadableStream, resolveMaybeOptionalOptions, runInSpanContext, runWithSignal, runWithSpan, set, setSpanAttributeIfDefined, setTracer, sortPlugins, splitInHalf, startSpan, streamToAsyncIteratorObject, toSpanAttributeValue, toStringOrBytes, toTracingException, traceAsyncIterator, traceReadableStream, tryDecodeURIComponent, tryOrUndefined, value, varyByAcceptEncoding, wrapAsyncIterator, wrapReadableStream };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.35",
|
|
5
5
|
"description": "Internal utilities shared across oRPC packages",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": [
|
|
@@ -29,21 +29,12 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
|
-
"peerDependencies": {
|
|
33
|
-
"@opentelemetry/api": ">=1.9.0"
|
|
34
|
-
},
|
|
35
|
-
"peerDependenciesMeta": {
|
|
36
|
-
"@opentelemetry/api": {
|
|
37
|
-
"optional": true
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
32
|
"dependencies": {
|
|
41
|
-
"@
|
|
33
|
+
"@standard-server/shared": "~0.9.0",
|
|
42
34
|
"radash": "^12.1.1",
|
|
43
35
|
"type-fest": "^5.3.1"
|
|
44
36
|
},
|
|
45
37
|
"devDependencies": {
|
|
46
|
-
"@opentelemetry/api": "^1.9.1",
|
|
47
38
|
"arktype": "^2.2.1",
|
|
48
39
|
"valibot": "^1.4.1",
|
|
49
40
|
"zod": "^4.5.4"
|