@orpc/swr 2.0.0-beta.50 → 2.0.0-beta.51
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 +10 -8
- package/dist/index.d.ts +2 -2
- package/dist/router-utils.d.ts +2 -1
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -78,13 +78,14 @@ Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [
|
|
|
78
78
|
|
|
79
79
|
**Built-in features**
|
|
80
80
|
|
|
81
|
-
| Package
|
|
82
|
-
|
|
|
83
|
-
| [@orpc/publisher](https://www.npmjs.com/package/@orpc/publisher)
|
|
84
|
-
| [@orpc/ratelimit](https://www.npmjs.com/package/@orpc/ratelimit)
|
|
85
|
-
| [@orpc/experimental-lock](https://www.npmjs.com/package/@orpc/experimental-lock)
|
|
86
|
-
| [@orpc/
|
|
87
|
-
| [@orpc/
|
|
81
|
+
| Package | Purpose | Docs |
|
|
82
|
+
| ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
83
|
+
| [@orpc/publisher](https://www.npmjs.com/package/@orpc/publisher) | Pub/Sub with memory, Redis, and Upstash adapters. | [Publisher](https://orpc.dev/docs/helpers/publisher) |
|
|
84
|
+
| [@orpc/ratelimit](https://www.npmjs.com/package/@orpc/ratelimit) | Rate limiting with memory, Redis, and Upstash adapters. | [Rate Limit](https://orpc.dev/docs/helpers/ratelimit) |
|
|
85
|
+
| [@orpc/experimental-lock](https://www.npmjs.com/package/@orpc/experimental-lock) | Locking with memory, Redis, and Upstash adapters. | [Lock](https://orpc.dev/docs/helpers/lock) |
|
|
86
|
+
| [@orpc/experimental-openapi-inference](https://www.npmjs.com/package/@orpc/experimental-openapi-inference) | Generate OpenAPI specs from TypeScript types, no output schemas required. | [Type Inference](https://orpc.dev/docs/openapi/specification#type-inference) |
|
|
87
|
+
| [@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). | [Hibernation](https://orpc.dev/docs/integrations/hibernation) |
|
|
88
|
+
| [@orpc/json-schema](https://www.npmjs.com/package/@orpc/json-schema) | Smart coercion for OpenAPI requests. | [Smart Coercion](https://orpc.dev/docs/plugins/smart-coercion) |
|
|
88
89
|
|
|
89
90
|
**Framework & ecosystem integrations**
|
|
90
91
|
|
|
@@ -192,9 +193,10 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
192
193
|
<td align="center"><a href="https://kellychan.im/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&v=4" width="139" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
|
|
193
194
|
<td align="center"><a href="https://guyariely.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Guy Ariely"><img src="https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&v=4" width="139" alt="Guy Ariely"/><br />Guy Ariely</a></td>
|
|
194
195
|
<td align="center"><a href="https://paulsenon.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="PaulSenon"><img src="https://avatars.githubusercontent.com/u/19531087?u=6385741eb91d200b8c513ec6045482e301767ca6&v=4" width="139" alt="PaulSenon"/><br />PaulSenon</a></td>
|
|
195
|
-
<td align="center"><a href="https://
|
|
196
|
+
<td align="center"><a href="https://usagerail.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="UsageRail"><img src="https://avatars.githubusercontent.com/u/347653714?v=4" width="139" alt="UsageRail"/><br />UsageRail</a></td>
|
|
196
197
|
</tr>
|
|
197
198
|
<tr>
|
|
199
|
+
<td align="center"><a href="https://piscis.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&v=4" width="139" alt="Alex"/><br />Alex</a></td>
|
|
198
200
|
<td align="center"><a href="https://opensource.gubanov.eu/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&v=4" width="139" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
|
|
199
201
|
</tr>
|
|
200
202
|
</table>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OperationKey, OperationKeyOptions, OperationKeyPrefixOptions } from "./key.js";
|
|
2
2
|
import { ProcedureUtils, ProcedureUtilsOptions } from "./procedure-utils.js";
|
|
3
|
-
import { RouterUtils, RouterUtilsOptions, createRouterUtils } from "./router-utils.js";
|
|
3
|
+
import { RouterUtils, RouterUtilsInternal, RouterUtilsOptions, createRouterUtils } from "./router-utils.js";
|
|
4
4
|
import { SharedUtils } from "./shared-utils.js";
|
|
5
5
|
import { Fetcher, FetcherOptions, InferLiveSubscriberOutput, InferSubscriberOutput, KeyOptions, Matcher, MatcherOptions, MatcherStrategy, Mutator, MutatorOptions, OPERATION_CONTEXT_SYMBOL, OperationContext, OperationType, Subscriber, SubscriberOptions } from "./types.js";
|
|
6
6
|
import { Public } from "@orpc/shared";
|
|
7
|
-
export { Fetcher, FetcherOptions, InferLiveSubscriberOutput, InferSubscriberOutput, KeyOptions, Matcher, MatcherOptions, MatcherStrategy, Mutator, MutatorOptions, OPERATION_CONTEXT_SYMBOL, OperationContext, type OperationKey, type OperationKeyOptions, type OperationKeyPrefixOptions, OperationType, ProcedureUtils, type ProcedureUtilsOptions, type Public, RouterUtils, RouterUtilsOptions, type OperationContext as SWROperationContext, OPERATION_CONTEXT_SYMBOL as SWR_OPERATION_CONTEXT_SYMBOL, SharedUtils, Subscriber, SubscriberOptions, createRouterUtils, createRouterUtils as createSWRUtils };
|
|
7
|
+
export { Fetcher, FetcherOptions, InferLiveSubscriberOutput, InferSubscriberOutput, KeyOptions, Matcher, MatcherOptions, MatcherStrategy, Mutator, MutatorOptions, OPERATION_CONTEXT_SYMBOL, OperationContext, type OperationKey, type OperationKeyOptions, type OperationKeyPrefixOptions, OperationType, ProcedureUtils, type ProcedureUtilsOptions, type Public, RouterUtils, RouterUtilsInternal, RouterUtilsOptions, type OperationContext as SWROperationContext, OPERATION_CONTEXT_SYMBOL as SWR_OPERATION_CONTEXT_SYMBOL, SharedUtils, Subscriber, SubscriberOptions, createRouterUtils, createRouterUtils as createSWRUtils };
|
package/dist/router-utils.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { ProcedureUtils } from "./procedure-utils.js";
|
|
|
3
3
|
import { SharedUtils } from "./shared-utils.js";
|
|
4
4
|
import { Public } from "@orpc/shared";
|
|
5
5
|
import { AnyNestedClient, Client } from "@orpc/client";
|
|
6
|
-
export type RouterUtils<T extends AnyNestedClient> =
|
|
6
|
+
export type RouterUtils<T extends AnyNestedClient> = RouterUtilsInternal<T>;
|
|
7
|
+
export type RouterUtilsInternal<T> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Public<ProcedureUtils<UClientContext, UInput, UOutput, UError>> : { [K in keyof T]: RouterUtilsInternal<T[K] & {}>; } & Public<SharedUtils<unknown>>;
|
|
7
8
|
export interface RouterUtilsOptions extends OperationKeyPrefixOptions {
|
|
8
9
|
/**
|
|
9
10
|
* Base path for all keys.
|
package/dist/types.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type MatcherOptions<TStrategy extends MatcherStrategy, TInput> = ("partia
|
|
|
40
40
|
strategy?: TStrategy | undefined;
|
|
41
41
|
};
|
|
42
42
|
export type Matcher = (key?: unknown) => boolean;
|
|
43
|
-
export type FetcherOptions<TClientContext extends ClientContext> =
|
|
43
|
+
export type FetcherOptions<TClientContext extends ClientContext> = {} extends TClientContext ? {
|
|
44
44
|
context?: TClientContext | undefined;
|
|
45
45
|
} : {
|
|
46
46
|
context: TClientContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/swr",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.51",
|
|
4
4
|
"description": "SWR integration for oRPC: typesafe React data fetching hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-fetching",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@orpc/client": "2.0.0-beta.
|
|
41
|
-
"@orpc/shared": "2.0.0-beta.
|
|
40
|
+
"@orpc/client": "2.0.0-beta.51",
|
|
41
|
+
"@orpc/shared": "2.0.0-beta.51"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"swr": "^2.5.0",
|