@orpc/experimental-ratelimit 0.0.0-next.91ac36a → 0.0.0-next.9a53484

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
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
2
+ <image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
3
3
  </div>
4
4
 
5
5
  <h1></h1>
@@ -45,7 +45,7 @@
45
45
 
46
46
  ## Documentation
47
47
 
48
- You can find the full documentation [here](https://orpc.unnoq.com).
48
+ You can find the full documentation [here](https://orpc.dev).
49
49
 
50
50
  ## Packages
51
51
 
@@ -0,0 +1,13 @@
1
+ import { a as Ratelimiter, R as RatelimiterLimitResult } from '../shared/experimental-ratelimit.C8zlaHwR.mjs';
2
+
3
+ declare class CloudflareRatelimiter implements Ratelimiter {
4
+ private readonly ratelimit;
5
+ constructor(ratelimit: {
6
+ limit: (options: {
7
+ key: string;
8
+ }) => Promise<RatelimiterLimitResult>;
9
+ });
10
+ limit(key: string): Promise<RatelimiterLimitResult>;
11
+ }
12
+
13
+ export { CloudflareRatelimiter };
@@ -0,0 +1,13 @@
1
+ import { a as Ratelimiter, R as RatelimiterLimitResult } from '../shared/experimental-ratelimit.C8zlaHwR.js';
2
+
3
+ declare class CloudflareRatelimiter implements Ratelimiter {
4
+ private readonly ratelimit;
5
+ constructor(ratelimit: {
6
+ limit: (options: {
7
+ key: string;
8
+ }) => Promise<RatelimiterLimitResult>;
9
+ });
10
+ limit(key: string): Promise<RatelimiterLimitResult>;
11
+ }
12
+
13
+ export { CloudflareRatelimiter };
@@ -0,0 +1,10 @@
1
+ class CloudflareRatelimiter {
2
+ constructor(ratelimit) {
3
+ this.ratelimit = ratelimit;
4
+ }
5
+ limit(key) {
6
+ return this.ratelimit.limit({ key });
7
+ }
8
+ }
9
+
10
+ export { CloudflareRatelimiter };
package/dist/index.d.mts CHANGED
@@ -16,7 +16,7 @@ interface RatelimitHandlerPluginContext {
16
16
  * Automatically adds HTTP rate-limiting headers (RateLimit-* and Retry-After) to responses
17
17
  * when used with middleware created by createRatelimitMiddleware.
18
18
  *
19
- * @see {@link https://orpc.unnoq.com/docs/helpers/ratelimit#handler-plugin Ratelimit handler plugin}
19
+ * @see {@link https://orpc.dev/docs/helpers/ratelimit#handler-plugin Ratelimit handler plugin}
20
20
  */
21
21
  declare class RatelimitHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
22
22
  init(options: StandardHandlerOptions<T>): void;
@@ -57,7 +57,7 @@ interface CreateRatelimitMiddlewareOptions<TInContext extends Context, TInput, T
57
57
  * Creates a middleware that enforces rate limits in oRPC procedures.
58
58
  * Supports per-request deduplication and integrates with the ratelimit handler plugin.
59
59
  *
60
- * @see {@link https://orpc.unnoq.com/docs/helpers/ratelimit#createratelimitmiddleware Ratelimit middleware}
60
+ * @see {@link https://orpc.dev/docs/helpers/ratelimit#createratelimitmiddleware Ratelimit middleware}
61
61
  */
62
62
  declare function createRatelimitMiddleware<TInContext extends Context, TInput = unknown, TMeta extends Meta = Record<never, never>>({ dedupe, ...options }: CreateRatelimitMiddlewareOptions<TInContext, TInput, TMeta>): Middleware<TInContext, Record<never, never>, TInput, any, any, TMeta>;
63
63
 
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ interface RatelimitHandlerPluginContext {
16
16
  * Automatically adds HTTP rate-limiting headers (RateLimit-* and Retry-After) to responses
17
17
  * when used with middleware created by createRatelimitMiddleware.
18
18
  *
19
- * @see {@link https://orpc.unnoq.com/docs/helpers/ratelimit#handler-plugin Ratelimit handler plugin}
19
+ * @see {@link https://orpc.dev/docs/helpers/ratelimit#handler-plugin Ratelimit handler plugin}
20
20
  */
21
21
  declare class RatelimitHandlerPlugin<T extends Context> implements StandardHandlerPlugin<T> {
22
22
  init(options: StandardHandlerOptions<T>): void;
@@ -57,7 +57,7 @@ interface CreateRatelimitMiddlewareOptions<TInContext extends Context, TInput, T
57
57
  * Creates a middleware that enforces rate limits in oRPC procedures.
58
58
  * Supports per-request deduplication and integrates with the ratelimit handler plugin.
59
59
  *
60
- * @see {@link https://orpc.unnoq.com/docs/helpers/ratelimit#createratelimitmiddleware Ratelimit middleware}
60
+ * @see {@link https://orpc.dev/docs/helpers/ratelimit#createratelimitmiddleware Ratelimit middleware}
61
61
  */
62
62
  declare function createRatelimitMiddleware<TInContext extends Context, TInput = unknown, TMeta extends Meta = Record<never, never>>({ dedupe, ...options }: CreateRatelimitMiddlewareOptions<TInContext, TInput, TMeta>): Middleware<TInContext, Record<never, never>, TInput, any, any, TMeta>;
63
63
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@orpc/experimental-ratelimit",
3
3
  "type": "module",
4
- "version": "0.0.0-next.91ac36a",
4
+ "version": "0.0.0-next.9a53484",
5
5
  "license": "MIT",
6
- "homepage": "https://orpc.unnoq.com",
6
+ "homepage": "https://orpc.dev",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/unnoq/orpc.git",
@@ -33,6 +33,11 @@
33
33
  "types": "./dist/adapters/upstash-ratelimit.d.mts",
34
34
  "import": "./dist/adapters/upstash-ratelimit.mjs",
35
35
  "default": "./dist/adapters/upstash-ratelimit.mjs"
36
+ },
37
+ "./cloudflare-ratelimit": {
38
+ "types": "./dist/adapters/cloudflare-ratelimit.d.mts",
39
+ "import": "./dist/adapters/cloudflare-ratelimit.mjs",
40
+ "default": "./dist/adapters/cloudflare-ratelimit.mjs"
36
41
  }
37
42
  },
38
43
  "files": [
@@ -47,10 +52,10 @@
47
52
  }
48
53
  },
49
54
  "dependencies": {
50
- "@orpc/server": "0.0.0-next.91ac36a",
51
- "@orpc/shared": "0.0.0-next.91ac36a",
52
- "@orpc/client": "0.0.0-next.91ac36a",
53
- "@orpc/standard-server": "0.0.0-next.91ac36a"
55
+ "@orpc/client": "0.0.0-next.9a53484",
56
+ "@orpc/server": "0.0.0-next.9a53484",
57
+ "@orpc/shared": "0.0.0-next.9a53484",
58
+ "@orpc/standard-server": "0.0.0-next.9a53484"
54
59
  },
55
60
  "devDependencies": {
56
61
  "@upstash/ratelimit": "^2.0.7",