@orpc/bun 2.0.0-beta.40 → 2.0.0-beta.41
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 +5 -5
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -10
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
82
82
|
|
|
83
83
|
<table>
|
|
84
84
|
<tr>
|
|
85
|
-
<td width="2000"><a href="https://screenshotone.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener" title="The screenshot API for developers"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="64" align="left" hspace="12" alt="ScreenshotOne.com"/><b>ScreenshotOne.com</b></a><br /><sub>The screenshot API for developers</sub></td>
|
|
85
|
+
<td width="2000"><a href="https://screenshotone.com/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="The screenshot API for developers"><img src="https://avatars.githubusercontent.com/u/97035603?v=4" width="64" align="left" hspace="12" alt="ScreenshotOne.com"/><b>ScreenshotOne.com</b></a><br /><sub>The screenshot API for developers</sub></td>
|
|
86
86
|
</tr>
|
|
87
87
|
<tr>
|
|
88
88
|
<td width="2000"><a href="https://yuzu.health/careers?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="We're hiring NYC based engineers"><img src="https://avatars.githubusercontent.com/u/102488956?v=4" width="64" align="left" hspace="12" alt="Yuzu"/><b>Yuzu</b></a><br /><sub>We're hiring NYC based engineers</sub></td>
|
|
@@ -124,19 +124,18 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
124
124
|
<td align="center"><a href="https://soymilk.party/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="あわわわとーにゅ"><img src="https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&v=4" width="139" alt="あわわわとーにゅ"/><br />あわわわとーにゅ</a></td>
|
|
125
125
|
<td align="center"><a href="https://github.com/nicognaW?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="nk"><img src="https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&v=4" width="139" alt="nk"/><br />nk</a></td>
|
|
126
126
|
<td align="center"><a href="https://supastarter.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="supastarter"><img src="https://avatars.githubusercontent.com/u/110960143?v=4" width="139" alt="supastarter"/><br />supastarter</a></td>
|
|
127
|
-
<td align="center"><a href="https://github.com/divmgl?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Dexter Miguel"><img src="https://avatars.githubusercontent.com/u/5452298?u=645993204be8696c085ecf0d228c3062efe2ed65&v=4" width="139" alt="Dexter Miguel"/><br />Dexter Miguel</a></td>
|
|
128
127
|
<td align="center"><a href="https://github.com/herrfugbaum?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="herrfugbaum"><img src="https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&v=4" width="139" alt="herrfugbaum"/><br />herrfugbaum</a></td>
|
|
128
|
+
<td align="center"><a href="https://laststance.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
|
|
129
129
|
</tr>
|
|
130
130
|
<tr>
|
|
131
|
-
<td align="center"><a href="https://laststance.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryota Murakami"><img src="https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&v=4" width="139" alt="Ryota Murakami"/><br />Ryota Murakami</a></td>
|
|
132
131
|
<td align="center"><a href="https://cra.mr/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="David Cramer"><img src="https://avatars.githubusercontent.com/u/23610?v=4" width="139" alt="David Cramer"/><br />David Cramer</a></td>
|
|
133
132
|
<td align="center"><a href="https://valerii15298.github.io/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
|
|
134
133
|
<td align="center"><a href="https://letstri.dev/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
|
|
135
134
|
<td align="center"><a href="https://blacklight.sh/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
|
|
136
135
|
<td align="center"><a href="https://github.com/christ12938?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
|
|
136
|
+
<td align="center"><a href="https://github.com/Ryanjso?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
137
137
|
</tr>
|
|
138
138
|
<tr>
|
|
139
|
-
<td align="center"><a href="https://github.com/Ryanjso?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
140
139
|
<td align="center"><a href="https://github.com/itigoore01?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&v=4" width="139" alt="shota"/><br />shota</a></td>
|
|
141
140
|
<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>
|
|
142
141
|
<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>
|
|
@@ -170,12 +169,13 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
170
169
|
<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="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
|
|
171
170
|
<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="119" alt="Guy Ariely"/><br />Guy Ariely</a></td>
|
|
172
171
|
<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="119" alt="PaulSenon"/><br />PaulSenon</a></td>
|
|
172
|
+
<td align="center"><a href="https://nakasyou.how/?ref=middleapi&utm_source=middleapi&utm_medium=sponsor" target="_blank" rel="noopener sponsored" title="Shotaro Nakamura"><img src="https://avatars.githubusercontent.com/u/79000684?u=f644df3f29f0e8677a90967115774564f1d9d6ab&v=4" width="119" alt="Shotaro Nakamura"/><br />Shotaro Nakamura</a></td>
|
|
173
173
|
<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="119" alt="Alex"/><br />Alex</a></td>
|
|
174
174
|
<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="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
|
|
175
175
|
</tr>
|
|
176
176
|
</table>
|
|
177
177
|
|
|
178
|
-
With thanks to [
|
|
178
|
+
With thanks to [38 past sponsors](https://orpc.dev/sponsors#past-sponsors) who helped get oRPC here.
|
|
179
179
|
|
|
180
180
|
## References
|
|
181
181
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseRedisLocker, BaseRedisLockerOptions } from '@orpc/experimental-lock/base-redis';
|
|
2
2
|
import { RedisClient } from 'bun';
|
|
3
|
-
import { BaseRedisPublisher, BaseRedisPublisherOptions,
|
|
3
|
+
import { BaseRedisPublisher, BaseRedisPublisherOptions, RedisStreamEntry } from '@orpc/publisher/base-redis';
|
|
4
4
|
import { Promisable } from '@orpc/shared';
|
|
5
5
|
import { BaseRedisRateLimiter, BaseRedisRateLimiterOptions } from '@orpc/ratelimit/base-redis';
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ declare class BunRedisPublisher<T extends Record<string, object>> extends BaseRe
|
|
|
39
39
|
constructor(redis: RedisClient, { subscriber, ...options }?: BunRedisPublisherOptions);
|
|
40
40
|
protected publishMessage(channel: string, message: string): Promise<void>;
|
|
41
41
|
protected subscribeChannel(channel: string, listener: (message: unknown) => void): Promise<() => Promise<void>>;
|
|
42
|
-
protected
|
|
42
|
+
protected evalScript(script: string, keys: string[], args: string[]): Promise<unknown>;
|
|
43
43
|
protected readStreamEntries(key: string, lastId: string): Promise<RedisStreamEntry[]>;
|
|
44
44
|
}
|
|
45
45
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseRedisLocker, BaseRedisLockerOptions } from '@orpc/experimental-lock/base-redis';
|
|
2
2
|
import { RedisClient } from 'bun';
|
|
3
|
-
import { BaseRedisPublisher, BaseRedisPublisherOptions,
|
|
3
|
+
import { BaseRedisPublisher, BaseRedisPublisherOptions, RedisStreamEntry } from '@orpc/publisher/base-redis';
|
|
4
4
|
import { Promisable } from '@orpc/shared';
|
|
5
5
|
import { BaseRedisRateLimiter, BaseRedisRateLimiterOptions } from '@orpc/ratelimit/base-redis';
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ declare class BunRedisPublisher<T extends Record<string, object>> extends BaseRe
|
|
|
39
39
|
constructor(redis: RedisClient, { subscriber, ...options }?: BunRedisPublisherOptions);
|
|
40
40
|
protected publishMessage(channel: string, message: string): Promise<void>;
|
|
41
41
|
protected subscribeChannel(channel: string, listener: (message: unknown) => void): Promise<() => Promise<void>>;
|
|
42
|
-
protected
|
|
42
|
+
protected evalScript(script: string, keys: string[], args: string[]): Promise<unknown>;
|
|
43
43
|
protected readStreamEntries(key: string, lastId: string): Promise<RedisStreamEntry[]>;
|
|
44
44
|
}
|
|
45
45
|
|
package/dist/index.mjs
CHANGED
|
@@ -34,16 +34,8 @@ class BunRedisPublisher extends BaseRedisPublisher {
|
|
|
34
34
|
await subscriber.unsubscribe(channel, listener);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
async
|
|
38
|
-
|
|
39
|
-
return await this.redis.send("XADD", [key, "*", "data", data]);
|
|
40
|
-
}
|
|
41
|
-
const [id] = await Promise.all([
|
|
42
|
-
this.redis.send("XADD", [key, "*", "data", data]),
|
|
43
|
-
this.redis.send("XTRIM", [key, "MINID", trim.exactness, trim.minId]),
|
|
44
|
-
this.redis.expire(key, trim.expireSeconds)
|
|
45
|
-
]);
|
|
46
|
-
return id;
|
|
37
|
+
async evalScript(script, keys, args) {
|
|
38
|
+
return await this.redis.send("EVAL", [script, String(keys.length), ...keys, ...args]);
|
|
47
39
|
}
|
|
48
40
|
async readStreamEntries(key, lastId) {
|
|
49
41
|
const results = await this.redis.send("XREAD", ["STREAMS", key, lastId]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/bun",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.41",
|
|
5
5
|
"description": "Bun integration for oRPC: Redis-backed pub/sub, rate limiting, and locking using Bun's built-in Redis client",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": [
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@orpc/client": "2.0.0-beta.
|
|
40
|
-
"@orpc/experimental-lock": "2.0.0-beta.
|
|
41
|
-
"@orpc/publisher": "2.0.0-beta.
|
|
42
|
-
"@orpc/ratelimit": "2.0.0-beta.
|
|
43
|
-
"@orpc/server": "2.0.0-beta.
|
|
44
|
-
"@orpc/shared": "2.0.0-beta.
|
|
45
|
-
"@standard-server/core": "~0.
|
|
39
|
+
"@orpc/client": "2.0.0-beta.41",
|
|
40
|
+
"@orpc/experimental-lock": "2.0.0-beta.41",
|
|
41
|
+
"@orpc/publisher": "2.0.0-beta.41",
|
|
42
|
+
"@orpc/ratelimit": "2.0.0-beta.41",
|
|
43
|
+
"@orpc/server": "2.0.0-beta.41",
|
|
44
|
+
"@orpc/shared": "2.0.0-beta.41",
|
|
45
|
+
"@standard-server/core": "~0.10.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/bun": "^1.3.14",
|